<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Admin Archives - ClickedyClick</title>
	<atom:link href="https://gergely.imreh.net/blog/category/comp/admin/feed/" rel="self" type="application/rss+xml" />
	<link>https://gergely.imreh.net/blog/category/comp/admin/</link>
	<description>Life in real, complex and digital.</description>
	<lastBuildDate>Sat, 07 Feb 2026 08:38:21 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>How to Think Differently When Internet Searches Are Metered</title>
		<link>https://gergely.imreh.net/blog/2026/02/how-to-think-differently-when-internet-searches-are-metered/</link>
					<comments>https://gergely.imreh.net/blog/2026/02/how-to-think-differently-when-internet-searches-are-metered/#respond</comments>
		
		<dc:creator><![CDATA[Gergely Imreh]]></dc:creator>
		<pubDate>Sat, 07 Feb 2026 08:38:17 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Thinking]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[internet search]]></category>
		<category><![CDATA[Kagi]]></category>
		<guid isPermaLink="false">https://gergely.imreh.net/blog/?p=3003</guid>

					<description><![CDATA[<p>A few months ago I&#8217;ve tried to up to Kagi, a subscription-based search engine, that I heard a lot of good stuff of. Since I was in a country where their payment system didn&#8217;t work yet, I couldn&#8217;t actually complete the signup. They&#8217;ve generously given a Starter plan me for free while their system was [&#8230;]</p>
<p>The post <a href="https://gergely.imreh.net/blog/2026/02/how-to-think-differently-when-internet-searches-are-metered/">How to Think Differently When Internet Searches Are Metered</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">A few months ago I&#8217;ve tried to up to <a href="https://kagi.com">Kagi</a>, a subscription-based search engine, that I heard a lot of good stuff of. Since I was in a country where their payment system didn&#8217;t work yet, I couldn&#8217;t actually complete the signup. They&#8217;ve generously given a Starter plan me for free while their system was being sorted out (nice, thank you!), however that plan comes with a &#8220;300 search per month&#8221; limit &#8212; which I&#8217;ve quickly seen to really matter.</p>



<p class="wp-block-paragraph">It was around a time when I had a new laptop, and been trying to get things right installing <a href="https://archlinux.org/">ArchLinux</a>, where both the processes and the hardware changed a lot since I&#8217;ve last had done it in&#8230; 2011-ish. So that involved many queries to the Internet. So much so, that my 300 searches were <em>done</em> on the 3rd day or so.</p>



<p class="wp-block-paragraph">So 3 days into a month I already used up my quota, and couldn&#8217;t just upgrade to unlimited (yet), since it was a gift from the Kagi. So what could I do different in the future for a better experience?</p>



<span id="more-3003"></span>



<h1 class="wp-block-heading">Habit Changes</h1>



<p class="wp-block-paragraph">What does that better experience really mean? Doing a retrospective of how was I searching, it seemed to me a really mindless, throwaway process:</p>



<ul class="wp-block-list">
<li>plopping in keywords, scrolling quickly around, not really clicking on any link necessarily, but changing the word and re-running the search (total shotgun approach)</li>



<li>running the same query again and again across days</li>



<li>relying on the search engine to get slowly changing or unchanging information</li>
</ul>



<p class="wp-block-paragraph">&#8230; and more. I feel like these are the habits from other search engines, where I didn&#8217;t find things, when most pages are &#8220;sponsored&#8221;, when I didn&#8217;t put in effort to check the queries I run just sent them off, and could do because it was &#8220;all you can eat&#8221;, and that made me not really pay attention to the &#8220;taste &amp; flavour&#8221; of the results&#8230;</p>



<h2 class="wp-block-heading">Bookmark more &amp; better</h2>



<p class="wp-block-paragraph">One of the most obvious idea I had was that since I go to the same pages all the time, why not <em>save</em> those links in bookmarks?</p>



<p class="wp-block-paragraph">I used to bookmark a lot, and organise those bookmarks, etc&#8230; Then I gave it all up, because &#8230; I could just search things? And because organisation wasn&#8217;t that simple either. Which folder does this link go to? Is it under Programming > Languages > Python? Or under Professional Development? Or under Useful Libraries?&#8230;</p>



<p class="wp-block-paragraph">The same perfectionist &#8220;it doesn&#8217;t just need to be bookmarked, it has to be filed away correctly too!&#8221; was really not doing me any good service&#8230; It took a little while to work through this, and just settle on putting every bookmark in a flat hierarchy, and use tagging to help me find them (rather than folders). Difference being, that a single link can have multiple tags, but can exist in only one folder. I do believe that&#8217;s the only scalable way, ever since I was trying to do the other way around (and failing)<sup data-fn="f8dd80ed-9269-4d69-810d-90eb92b9ea2d" class="fn"><a href="#f8dd80ed-9269-4d69-810d-90eb92b9ea2d" id="f8dd80ed-9269-4d69-810d-90eb92b9ea2d-link">1</a></sup>.</p>



<p class="wp-block-paragraph">So bookmark:</p>



<ul class="wp-block-list">
<li>the (book) library catalogues that I borrow books from</li>



<li>the forums and docs pages of projects I&#8217;m using<sup data-fn="481de0c2-87dc-4fe1-bc86-ae6461319aab" class="fn"><a href="#481de0c2-87dc-4fe1-bc86-ae6461319aab" id="481de0c2-87dc-4fe1-bc86-ae6461319aab-link">2</a></sup> </li>



<li>the useful tools available online, from <a href="https://www.timeanddate.com/">timezone wrangling</a> to <a href="https://www.xe.com/">currency conversion</a>&#8230;</li>



<li>blogs, publications, web comics that I frequent&#8230;</li>
</ul>



<p class="wp-block-paragraph">and so on&#8230; Now whenever I visit a page, I do stop for a moment and think: could I imagine myself wanting to come back here in the future? If yes, let&#8217;s bookmark.</p>



<p class="wp-block-paragraph">It&#8217;s not all perfect, but it&#8217;s more about the tools than the process: Firefox on Android doesn&#8217;t seem to handle the same &#8220;search in bookmarks&#8221; shortcuts, or make it more difficult to do. Oh, well, eventually&#8230;</p>



<h2 class="wp-block-heading">Add custom search engines</h2>



<p class="wp-block-paragraph">Sometimes I the page I want to go to is within a large collection, such as a wiki, or a forum. I know it&#8217;s there, but unsure where exactly. Bookmarks take me to the page, but then I have to use the search as a second step. This can be made a lot more ergonomic in pretty much every current browser by adding custom search engines<sup data-fn="32fe7398-0359-4ead-8261-d3f4239af710" class="fn"><a href="#32fe7398-0359-4ead-8261-d3f4239af710" id="32fe7398-0359-4ead-8261-d3f4239af710-link">3</a></sup>.</p>



<p class="wp-block-paragraph">Adding Wikipedia&#8217;s search? It might already be there. Adding ArchLinux Wiki? It takes 15 seconds to do, and I have a shortcut to so much Linux system admin knowledge that is riddiculous. Whatever site has a search, can be added just as simple.</p>



<p class="wp-block-paragraph">Here the kicker is to remember that shortcut (and the fact that I&#8217;ve added that shortcut), but after that, it&#8217;s off to the races.</p>



<h2 class="wp-block-heading">Change how I search</h2>



<p class="wp-block-paragraph">While I was auditing what sort of searches I like to do, one type that stood out was when I was asking for something like &#8220;what&#8217;s the website of this-or-that company or project or organisation?&#8221; More often than not, these are companies, projects, and organisations that are notable enough to be in Wikipedia. Here&#8217;s the new process: search Wikipedia or the company/project/organisation and use the link from their page.</p>



<p class="wp-block-paragraph">This also feel more to the point than search for &#8220;&lt;companyname> website&#8221; which is just &#8220;close enough&#8221; in meaning, and will still get me many results, even if the answers should be a single value.</p>



<p class="wp-block-paragraph">This is caveated by that for programming / open source projects, the better search is probably GitHub / GitLab / CodeBerg, where they are likely hosted (in decreasing probability, currently), and switch to search engine search when that fails.</p>



<p class="wp-block-paragraph">This is aling the lines that if I already know an authoritive source for the information, I should probably go there directly?</p>



<h2 class="wp-block-heading">Misc</h2>



<p class="wp-block-paragraph">Bookmarks &amp; custom searches brought down my search count already. One that is more of a housekeeping change is that my browser was reopening pages from my previous session whenever I started it. If I had any Kagi search results open, that just used up another in the quota, and there often there were more than one open&#8230; Setting my browser to start afresh on each time I open it helped with that &#8212; and also helped with me not being distracted every time I open my browser by whatever I was doing last time, as opposed to what I wanted to do <em>now</em>.</p>



<h1 class="wp-block-heading">What did I Learn?</h1>



<p class="wp-block-paragraph">Now that I&#8217;m on a proper paid plan, I will up it to the Professional plan, where searches are not metered. It doesn&#8217;t feel like just a lazy release valve<sup data-fn="ab17392b-0fc4-4261-b010-409482095f2b" class="fn"><a href="#ab17392b-0fc4-4261-b010-409482095f2b" id="ab17392b-0fc4-4261-b010-409482095f2b-link">4</a></sup>, rather because I don&#8217;t believe this sorts of limit to my access information is productive. &#8220;Limited&#8221; limitations, when there&#8217;s a purpose, can indeed be &#8220;cretive limitations&#8221;. </p>



<p class="wp-block-paragraph">If I believe that Kagi does a good job, then there&#8217;s no point sticking to the quota; if I don&#8217;t, then why am I using it in the first place, instead of any of the alternatives?</p>



<p class="wp-block-paragraph">And if I want to use the power of creative limitations, I can always do my own quest with rules like no search, it&#8217;s within my power.</p>



<p class="wp-block-paragraph">I do feel that the changes to my thinking due to this experience &#8212; being more deliberate of what am I looking for and thoughful about where might I find them; choosing and rewarding sources I find useful and reliable; using the little gray cells more &#8212; I want to keep and even cultivate. These changes also brought back a more old-school internet vibes (old as in when I bought printed magazines that came with collected links of what you can find on the  World Wide Web, something more tangible and purposeful). I guess I&#8217;m getting old as well. :)</p>


<ol class="wp-block-footnotes"><li id="f8dd80ed-9269-4d69-810d-90eb92b9ea2d">Tagging also got a big push from and also due to a push from the book <a href="https://app.thestorygraph.com/books/22c416f5-4a94-4c7a-add3-5161c9d3a4d7">Everything is Miscellanious</a>. It&#8217;s also why e.g. Gmail was awesome to have tags while other clients were still just doing folders. Fastmail goes even further, lets you choose <a href="https://www.fastmail.help/hc/en-us/articles/360058753554-Setting-up-and-using-labels#what">labels</a> (tags) or folders, which is pretty awesome of them. <a href="#f8dd80ed-9269-4d69-810d-90eb92b9ea2d-link" aria-label="Jump to footnote reference 1"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/21a9.png" alt="↩" class="wp-smiley" style="height: 1em; max-height: 1em;" />︎</a></li><li id="481de0c2-87dc-4fe1-bc86-ae6461319aab">Almost every good project has a good forum/docs, or maybe a good forum/docs contributes to the project being good? Here&#8217;s looking at you <a href="https://wiki.archlinux.org/title/Main_page">ArchWiki</a>, <a href="https://help.obsidian.md/">Obsidian Help</a>,&#8230;  <a href="#481de0c2-87dc-4fe1-bc86-ae6461319aab-link" aria-label="Jump to footnote reference 2"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/21a9.png" alt="↩" class="wp-smiley" style="height: 1em; max-height: 1em;" />︎</a></li><li id="32fe7398-0359-4ead-8261-d3f4239af710">For example <a href="https://support.mozilla.org/en-US/kb/add-or-remove-search-engine-firefox">in Firefox</a>. <a href="#32fe7398-0359-4ead-8261-d3f4239af710-link" aria-label="Jump to footnote reference 3"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/21a9.png" alt="↩" class="wp-smiley" style="height: 1em; max-height: 1em;" />︎</a></li><li id="ab17392b-0fc4-4261-b010-409482095f2b">As in &#8220;if I&#8217;m unlimited, I don&#8217;t have to care about all the effort I&#8217;ve described so far, I can go back to my old habits&#8221;. <a href="#ab17392b-0fc4-4261-b010-409482095f2b-link" aria-label="Jump to footnote reference 4"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/21a9.png" alt="↩" class="wp-smiley" style="height: 1em; max-height: 1em;" />︎</a></li></ol><p>The post <a href="https://gergely.imreh.net/blog/2026/02/how-to-think-differently-when-internet-searches-are-metered/">How to Think Differently When Internet Searches Are Metered</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gergely.imreh.net/blog/2026/02/how-to-think-differently-when-internet-searches-are-metered/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ZFS on a Raspberry Pi</title>
		<link>https://gergely.imreh.net/blog/2024/02/zfs-on-a-raspberry-pi/</link>
					<comments>https://gergely.imreh.net/blog/2024/02/zfs-on-a-raspberry-pi/#comments</comments>
		
		<dc:creator><![CDATA[Gergely Imreh]]></dc:creator>
		<pubDate>Wed, 28 Feb 2024 11:48:50 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[ZFS]]></category>
		<guid isPermaLink="false">https://gergely.imreh.net/blog/?p=2862</guid>

					<description><![CDATA[<p>Using ZFS to make the most an assorted bunch of SD cards and USB sticks for storage, and hitting Linux kernel licensing issues along the way.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2024/02/zfs-on-a-raspberry-pi/">ZFS on a Raspberry Pi</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I have a little home server, just like mike many other geeks / nerds / programmers / technical people&#8230; It can be both <em>useful</em>, a learning experience, as well as <em>a real chore</em>; most of the time the balance is shifting between these two ends. Today I&#8217;m taking notes here on one aspect of that home server that is widely swing between those two use cases.</p>



<p class="wp-block-paragraph">When I say I have a home server, that might be too generous description of the status quo: I have a pretty banged up <a href="https://www.raspberrypi.com/products/raspberry-pi-3-model-b/">Raspberry Pi 3B</a>. It&#8217;s running <a href="https://archlinuxarm.org/">ArchLinux ARM</a>, the 64-bit, AAarch64 version, looking a bit more retro on the hardware front while pushing for more modernity on the software side &#8211; a mix that I find fun.</p>



<p class="wp-block-paragraph">There are a handful of services running on the device &#8212; not <em>that</em> many, mostly limited by it&#8217;s <em>*gulp*</em> 1GB memory; plenty of things I&#8217;d love to run, doesn&#8217;t well co-locate in such a tiny compartment. Besides the memory, it&#8217;s also limited by storage: the Raspberry Pi runs off an SD card, and those are both fragile, and limited in size. If one wants to run a home file server, say using a handful of other SD cards lying around, to expand the available storage, that will be awkward very soon. To make that task less awkward (or replace one kind of awkward with a more interesting one), I&#8217;ve set out to set up a ZFS storage pool, using <a href="https://openzfs.readthedocs.io/en/latest/introduction.html">OpenZFS</a>. </p>



<h2 class="wp-block-heading">The idea</h2>



<p class="wp-block-paragraph">Why ZFS? In big part, to be able to credibly answer that question. </p>



<p class="wp-block-paragraph">But with a single, more concrete reason: being able to build a more solid and expandable storage unit. ZFS cancombine different storage units</p>



<ul class="wp-block-list">
<li>in a way that combats data errors, e.g. mirroring: this addresses SD cards fragility</li>



<li>in a way that data can expand across all of them in a single file system: this addresses the SD cards size limitations</li>
</ul>



<p class="wp-block-paragraph">This sounds great in theory and after a bit of trial-and-error, I&#8217;ve made the following setup, relying on dynamic kernel modules for support for flexibility, and a hodgepodge of drives at hand for the storage</p>



<p class="wp-block-paragraph">The file system supports needs is provided by the <a href="https://aur.archlinux.org/packages/zfs-dkms">zfs-dkms package</a> dynamic kernel module (<a href="https://wiki.archlinux.org/title/Dynamic_Kernel_Module_Support">DKMS</a>), which means the kernel module required for being able to manage that file system is recompiled for each new Linux kernel version as it is updated. This is handy in theory, as I can use the main kernel packages provided by the ArchLinux ARM team.</p>



<p class="wp-block-paragraph">For storage, I&#8217;ve started off with two SD cards in mirror mode (going for data integrity first). Later I&#8217;ve found &#8212; and invested in &#8212; some large capacity USB sticks that bumped the storage size quite a bit. With these, the currentl ZFS pool looks like this:</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="365" src="https://gergely.imreh.net/blog/wp-content/uploads/2024/02/pooling-that-external-storage-1024x365.png" alt="Terminal screenshot of the 'zpool status' command." class="wp-image-2863" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2024/02/pooling-that-external-storage-1024x365.png 1024w, https://gergely.imreh.net/blog/wp-content/uploads/2024/02/pooling-that-external-storage-500x178.png 500w, https://gergely.imreh.net/blog/wp-content/uploads/2024/02/pooling-that-external-storage-768x274.png 768w, https://gergely.imreh.net/blog/wp-content/uploads/2024/02/pooling-that-external-storage-1200x428.png 1200w, https://gergely.imreh.net/blog/wp-content/uploads/2024/02/pooling-that-external-storage.png 1454w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">It already saved me &#8212; or rather my data &#8212; once where an SD card was acting up, though that&#8217;s par for the course. One very large benefit is that the main system card is being used less, so hopefully will last longer.</p>



<h2 class="wp-block-heading">The complications</h2>



<p class="wp-block-paragraph">Of course, it&#8217;s never this easy&#8230; With non-mainline kernel modules and with DKMS, every update is a bit of a gamble, that can suddenly not pay off. That&#8217;s exactly what happened last year, when suddenly the module didn&#8217;t compile anymore on a new kernel version, and thus all that storage was sitting dump and inaccessible. After <a href="https://github.com/openzfs/zfs/issues/14555">digging into</a> the issue, it down to:</p>



<ol class="wp-block-list">
<li>the OpenZFS project being under <a href="https://opensource.org/license/cddl-1-0">Common Development and Distribution License</a> (CDDL)</li>



<li>the Linux kernel <a href="https://github.com/torvalds/linux/commit/aaeca98456431a8d9382ecf48ac4843e252c07b3">deliberately breaking non-GPL licensed code</a> by starting to withold certain floating point capabilities, because &#8220;this is not expected to be disruptive to existing users&#8221;.</li>
</ol>



<p class="wp-block-paragraph">This wasn&#8217;t great, as user being between pretty much a rock &amp; a hard place, even if this is a hobby and not strictly speaking a production use case on my side. </p>



<p class="wp-block-paragraph">Nonetheless, it worked by <a href="https://wiki.archlinux.org/title/Downgrading_packages">downgrading</a> to a working version and <a href="https://wiki.archlinux.org/title/Pacman#Skip_package_from_being_upgraded">skipping updates</a> to the kernel packages.</p>



<p class="wp-block-paragraph">Then based on a <a href="https://github.com/openzfs/zfs/issues/14555#issuecomment-1475119774">suggestion</a>, patching the zfs-dkms package (rewriting the license entry in the META file) to make it look like it&#8217;s a GPL-licensed module &#8212; which is fair game for one doing on their own machine. This is hacky, or let&#8217;s call it pragmatic.</p>



<pre class="wp-block-code"><code class="">--- META.prev   2024-02-28 08:42:21.526641154 +0800
+++ META        2024-02-28 08:42:36.435569959 +0800
@@ -4,7 +4,7 @@
 Version:       2.2.3
 Release:       1
 Release-Tags:  relext
-License:       CDDL
+License:       GPL
 Author:        OpenZFS
 Linux-Maximum: 6.7
 Linux-Minimum: 3.10</code></pre>



<p class="wp-block-paragraph">Now, with the current 2.2.3 version, it seems like there&#8217;s an official f<a href="https://github.com/openzfs/zfs/pull/15711">ix-slash-workaround</a> for being able to get the module to compile, even if it&#8217;s not a full fix. From the linked merge request message I&#8217;m not fully convinced that this is not a fragile status quo, but it&#8217;s at least front of mind &#8211; good going for wider ARM hardware usage that brings out people&#8217;s willingness to fix things! </p>



<h2 class="wp-block-heading">Future development</h2>



<p class="wp-block-paragraph">Some while back, while working at <a href="https://www.balena.io/">an IoT software deploument &amp; management company</a>, I had a lot of interesting hardware at hand, naturally, to build things with (or wrestle with&#8230;). Nowadays I have things I best describe as <em>spare parts</em>, and thus loads of thingss are more fragile than they need to be, as well as gosh-it-takes-a-long-time to compile things on a Raspberry Pi 3 &#8211; making every kernel update some half-an-hour longer!</p>



<p class="wp-block-paragraph">Likely the best move would be to upgrade to a (much more powerful) <a href="https://www.raspberrypi.com/products/raspberry-pi-5/">Raspberry Pi 5</a> and use an <a href="https://learn.pimoroni.com/article/getting-started-with-nvme-base">external NVMe drive</a>, where I&#8217;d have much less need for ZFS, at least for the original reasons. It would likely be still useful for other aspects (such as <a href="https://wiki.archlinux.org/title/ZFS#Automatic_snapshots">snapshotting</a>, or sending/receiving the drive data, compression, deduplication, etc&#8230;), changing the learning path away from multi-device support to the file system features.</p>



<p class="wp-block-paragraph">If I wanted to use more storage in the existing system, I could also get rid of the mirrored SD cards and just just 4 large USB sticks (maybe in a <a href="https://openzfs.github.io/openzfs-docs/Basic%20Concepts/RAIDZ.html">RAIDZ</a> setup), a poor-man&#8217;s NAS, I guess. Though there I&#8217;d worry a bit about using the sticks with the same sizes for this to work (unlike pooling, which has no same-size requirements), given the differences in the supposedly same sized products from different companies (likely locking me into a having the same brand and model across the board).</p>



<p class="wp-block-paragraph">I also feel like I&#8217;m not using ZFS to its full potential. If I know enough just to be dangerous&#8230; maybe that&#8217;s the generalists natural habitat?</p>
<p>The post <a href="https://gergely.imreh.net/blog/2024/02/zfs-on-a-raspberry-pi/">ZFS on a Raspberry Pi</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gergely.imreh.net/blog/2024/02/zfs-on-a-raspberry-pi/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Mixing GitLab personal and work accounts: Enterprise Users</title>
		<link>https://gergely.imreh.net/blog/2023/07/mixing-gitlab-personal-and-work-accounts-enterprise-users/</link>
					<comments>https://gergely.imreh.net/blog/2023/07/mixing-gitlab-personal-and-work-accounts-enterprise-users/#respond</comments>
		
		<dc:creator><![CDATA[Gergely Imreh]]></dc:creator>
		<pubDate>Fri, 14 Jul 2023 15:30:23 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[GitLab]]></category>
		<guid isPermaLink="false">https://gergely.imreh.net/blog/?p=2785</guid>

					<description><![CDATA[<p>GitLab Enterprise Users seem to have until August 1st to split their personal accounts from work or will be taken over by their orgs.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2023/07/mixing-gitlab-personal-and-work-accounts-enterprise-users/">Mixing GitLab personal and work accounts: Enterprise Users</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>TL;DR</strong>: if you are about to become a GitLab enterprise user, time to split your work from passion.</p>



<p class="wp-block-paragraph">I&#8217;m often asked by other team members just starting on their version control journey, when using the likes of GitHub and GitLab, whether to have <strong>separate accounts for work and personal projects, or have a single one for both</strong>?</p>



<p class="wp-block-paragraph">So far my advice has been pretty much along the lines of: &#8220;<strong>use a single one</strong>&#8220;, for many reasons, like every service seems to handle email aliases, git+ssh is pain enough with a single account not even multiple, and people generally seem to build their professional and open source contributions under a single persona anyways.</p>



<p class="wp-block-paragraph">This advice no longer stands, at least for GitLab. I received this email recently, and how their use of Enterprise Users (and SSO Login + domain verification) makes it <em>absolutely necessary</em> to separate work and personal accounts:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="830" height="1024" src="https://gergely.imreh.net/blog/wp-content/uploads/2023/07/Screenshot-2023-07-14-at-22.32.54-830x1024.png" alt="" class="wp-image-2787" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2023/07/Screenshot-2023-07-14-at-22.32.54-830x1024.png 830w, https://gergely.imreh.net/blog/wp-content/uploads/2023/07/Screenshot-2023-07-14-at-22.32.54-405x500.png 405w, https://gergely.imreh.net/blog/wp-content/uploads/2023/07/Screenshot-2023-07-14-at-22.32.54-768x948.png 768w, https://gergely.imreh.net/blog/wp-content/uploads/2023/07/Screenshot-2023-07-14-at-22.32.54-1245x1536.png 1245w, https://gergely.imreh.net/blog/wp-content/uploads/2023/07/Screenshot-2023-07-14-at-22.32.54-1200x1481.png 1200w, https://gergely.imreh.net/blog/wp-content/uploads/2023/07/Screenshot-2023-07-14-at-22.32.54.png 1274w" sizes="(max-width: 830px) 100vw, 830px" /></figure>



<p class="wp-block-paragraph">I&#8217;ve been looking for a blogpost or other announcement, but couldn&#8217;t find one, hence the reposting of it here. I definitely gonna scramble a bit to create some new accounts (and keep my preferred username for the personal one). </p>



<span id="more-2785"></span>



<p class="wp-block-paragraph">Enterprise Users and the extra bit affecting them sorta make sense for &#8220;Enterprises&#8221;, such that:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">This means when requested by an <code>Owner</code> in the <strong>top-level of a paid group</strong>, information can be shared about, and actions can be made on behalf of an enterprise user.</p>
<cite><a href="https://about.gitlab.com/handbook/support/workflows/gitlab-com_overview.html#enterprise-users">GitLab Docs on Enterprise Users</a></cite></blockquote>



<p class="wp-block-paragraph">Enterprises need different things, that&#8217;s for sure.</p>



<p class="wp-block-paragraph">On the other hand, on GitHub I mostly read to the point of Personal accounts</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Most people will use one personal account for all their work on GitHub.com, including both open source projects and paid employment.</p>
<cite><a href="https://docs.github.com/en/get-started/learning-about-github/types-of-github-accounts#personal-accounts">GitHub Docs on Personal Users</a></cite></blockquote>



<p class="wp-block-paragraph">So for one moment thought that &#8220;yeah, they do it better&#8221;&#8230; except reading on to <a href="https://docs.github.com/en/enterprise-cloud@latest/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/about-enterprise-managed-users">Enterprise Managed Users</a> it&#8217;s pretty much like GitLab &#8212; with one difference: they seem to indicate that the given enterprise with <em>create</em> new accounts for the those EMUs, rather than <em>take over</em> their accounts. That might make all the difference, how much of a fuff it is.</p>



<p class="wp-block-paragraph">Either way, this is just a shout-out, and then I scurry off getting some account splitting sorted. The main benefit is really to separate work from non-work, which occasionally does need a bit of forcing function, even if force feels bad for a short time. Just like having separate work and personal laptops, I consider that right thing while a lot of people do find it annoying. Let&#8217;s keep learning the &#8220;proper&#8221;-ish ways of doing this stuff.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2023/07/mixing-gitlab-personal-and-work-accounts-enterprise-users/">Mixing GitLab personal and work accounts: Enterprise Users</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gergely.imreh.net/blog/2023/07/mixing-gitlab-personal-and-work-accounts-enterprise-users/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>When WordPress caching is  not what it seems</title>
		<link>https://gergely.imreh.net/blog/2023/02/when-wordpress-caching-is-not-what-it-seems/</link>
					<comments>https://gergely.imreh.net/blog/2023/02/when-wordpress-caching-is-not-what-it-seems/#respond</comments>
		
		<dc:creator><![CDATA[Gergely Imreh]]></dc:creator>
		<pubDate>Sun, 12 Feb 2023 04:20:21 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[ActivityPub]]></category>
		<category><![CDATA[Mastodon]]></category>
		<category><![CDATA[W3TC]]></category>
		<category><![CDATA[wordpress plugin]]></category>
		<guid isPermaLink="false">https://gergely.imreh.net/blog/?p=2762</guid>

					<description><![CDATA[<p>Using WordPress blog as a Fediverse node comes with issues when site caching breaks my assumptions.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2023/02/when-wordpress-caching-is-not-what-it-seems/">When WordPress caching is  not what it seems</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">When parts of a system are strongly interconnected, one can discover latent issues while debugging something completely different. This is what happened with this blog&#8217;s caching and integrating with the Fediverse.</p>



<h2 class="wp-block-heading">Fediverse adventures</h2>



<p class="wp-block-paragraph">I was part of The Great Twitter Exodus of 2022, and like many I&#8217;ve landed on <a href="https://joinmastodon.org/">Mastodon</a> (hey, hello, <a href="https://fosstodon.org/@imrehg">https://fosstodon.org/@imrehg</a>). Mastodon and the whole <a href="https://en.wikipedia.org/wiki/Fediverse">Fediverse</a> and its build around the <a href="https://w3c.github.io/activitypub/">ActivityPub</a> protocol is technically very interesting and brings back a bit of retro-joy to me (which needs some reflections on why and how is retro joyful, but another time). This current blog is running <a href="https://wordpress.org/">WordPress</a>, and soon found that there&#8217;s <a href="https://wordpress.org/plugins/activitypub/">a plugin to turn a WordPress blog into a my own ActivityPub node</a>. That seemed some excellent way to connect up tools and make a more inter-connected Internet (besides nerding out, if I&#8217;m fully honest).</p>



<span id="more-2762"></span>



<h3 class="wp-block-heading">ActivityPub plugin</h3>



<p class="wp-block-paragraph">It was super easy to set up, and seemed to have worked well: take my <a href="https://gergely.imreh.net/blog/author/gergely/">author URL</a>, put it your Mastodon instance&#8217;s search, and voila, there&#8217;s a compatible profile which one can follow and interact with (to an extent, but still):</p>



<figure class="wp-block-image size-full"><img decoding="async" src="https://gergely.imreh.net/blog/wp-content/uploads/2023/02/activitypub_profile_mastodon.png" alt="Screenshot of the profle of this author page when searched on a Mastodon web instance, showing profile picture, about text, some links, post counts an Fediverse followers count." class="wp-image-2764"/><figcaption class="wp-element-caption">How does my author profile look when searched on a Mastodon instance, this time on <a href="https://fosstodon.org/">Fosstodon</a>. One can use either the author URL or the shortened address shown under the profile picture to find a person.</figcaption></figure>



<p class="wp-block-paragraph">It all seemed to have worked, but coming back after a while, but <a href="https://wordpress.org/documentation/article/site-health-screen/">Site Health</a> popped up a critical issue. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f640.png" alt="🙀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>



<figure class="wp-block-image size-full"><img decoding="async" width="823" height="261" src="https://gergely.imreh.net/blog/wp-content/uploads/2023/02/activitypub-critical-site-health.png" alt="Critical problem showin in the WordPress Site Health page, ighlighting that the author endpoint returns something unexpected." class="wp-image-2765" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2023/02/activitypub-critical-site-health.png 823w, https://gergely.imreh.net/blog/wp-content/uploads/2023/02/activitypub-critical-site-health-500x159.png 500w, https://gergely.imreh.net/blog/wp-content/uploads/2023/02/activitypub-critical-site-health-768x244.png 768w" sizes="(max-width: 823px) 100vw, 823px" /><figcaption class="wp-element-caption">Critical problem showin in the WordPress Site Health page.</figcaption></figure>



<p class="wp-block-paragraph">Digging in into what the endpoint actually returned when setting what response format the client want to accept:</p>



<pre class="wp-block-code"><code class="">curl --silent -H "Accept: application/activity+json" https://gergely.imreh.net/blog/author/gergely/</code></pre>



<p class="wp-block-paragraph">I can see that it indeed doesn&#8217;t look like a <a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON">JSON</a> file, instead the cached web content:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="882" height="589" src="https://gergely.imreh.net/blog/wp-content/uploads/2023/02/activitypub-bad-cache.png" alt="Terminal view of of the response to request to the JSON author page, showing cached HTML instead." class="wp-image-2767" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2023/02/activitypub-bad-cache.png 882w, https://gergely.imreh.net/blog/wp-content/uploads/2023/02/activitypub-bad-cache-500x334.png 500w, https://gergely.imreh.net/blog/wp-content/uploads/2023/02/activitypub-bad-cache-768x513.png 768w" sizes="auto, (max-width: 882px) 100vw, 882px" /><figcaption class="wp-element-caption">Terminal view of of the response to request to the JSON author page, showing cached HTML instead.</figcaption></figure>



<p class="wp-block-paragraph">Hot on your trail, <a href="https://wordpress.org/plugins/w3-total-cache/">W3 Total Cache</a> (W3TC)! I use this plugin to make this site (hopefully) more performant, but it&#8217;s not looking great in this instance. Fortunately I got some interesting pointers by <a href="https://fosstodon.org/@imrehg/109843852024278070">asking none other the Fediverse</a> about this issue, and got some helpful pointers.</p>



<h3 class="wp-block-heading">W3 Total Cache</h3>



<p class="wp-block-paragraph">The way I understood how the W3TC plugin and my configuration worked was the following:</p>



<ol class="wp-block-list">
<li>The plugin does some internal caching (opcode, objects,&#8230;) using  PHP, and something I don&#8217;t worry about much.</li>



<li>The main performance benefit is coming from generating page caches on disk that can be loaded quicker then regenerating the page.</li>



<li>Routing to those cached files is mostly through my <a href="https://nginx.org/en/">nginx</a> web server&#8217;s configuration: the caching plugin creates an nginx configuration file with the relevant logic and redirects, so on the &#8220;happy path&#8221;  when the target page is cached, the request doesn&#8217;t even touch WordPress&#8217; backend at all.</li>
</ol>



<h4 class="wp-block-heading">Disabling Caching for an Endpoint</h4>



<p class="wp-block-paragraph">Based on the above (especially point 2), my train of thought started at &#8220;Can I tell W3TC not to cache that author endpoint if a specific header is received?&#8221; Looking at the <a href="https://github.com/BoldGrid/w3-total-cache/wiki/FAQ%3A-Developers#how-can-i-prevent-caching-directly-in-my-templates-etc">W3TC FAQs</a>, there&#8217;s indeed a way to signal that, by disabling e.g. page caching when the plugin (ActivityPub in this case), by setting this inside the code path of the relevant page:</p>



<pre class="wp-block-code"><code class="">define('DONOTCACHEPAGE', true);</code></pre>



<p class="wp-block-paragraph">Looking at <a href="https://github.com/pfefferle/wordpress-activitypub">the source code of the ActivityPub plugin</a>, I could find <a href="https://github.com/pfefferle/wordpress-activitypub/blob/971c6ae5d52a9158678105b021637b414e08286f/includes/class-activitypub.php#L46">where in the data flow</a> one would set this, before the author template is returned. I tried it out and seemed to have worked. I&#8217;ve even opened a <a href="https://github.com/pfefferle/wordpress-activitypub/issues/275">GitHub issue</a> so that hopefully a fix can be developed for everyone!</p>



<p class="wp-block-paragraph">Looking further in the code (to do that fix), though, it&#8217;s not only the &#8220;author&#8221; page, but silently also all the posts and the front page has the same issue (of getting cached HTML when asking for JSON). <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f640.png" alt="🙀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> If one disables caching on author + blogposts + frontpage, what else of note is left cached? Nothing really. And the plugin owner <a href="https://github.com/pfefferle/wordpress-activitypub/issues/275#issuecomment-1426763972">agrees</a>.</p>



<h4 class="wp-block-heading">Route Request Based on Headers</h4>



<p class="wp-block-paragraph">Let&#8217;s try instead routing the request based on headers: if a compatible &#8220;Accept&#8221; header is received, bypass the cache, and use what he endpoint returns. Here comes the issue about the 3rd point above: the nginx configuration and its use.</p>



<p class="wp-block-paragraph">Ideally I would be able to add to the config a tests for this header, a check, roughly along the lines of this in nginx config::</p>



<pre class="wp-block-code"><code class="">if ( $http_accept = 'application/activity+json' ) {
 # switch vars not to cache
}</code></pre>



<p class="wp-block-paragraph">Following the <a href="https://github.com/BoldGrid/w3-total-cache/wiki/FAQ%3A-Installation%3A-Nginx-Web-Server">installation steps</a>, when Page Caching is enabled in W3TC <a href="https://github.com/BoldGrid/w3-total-cache/blob/c0680d6f7ce7cee56a27eac6f9625ffd86f91510/PgCache_Environment.php#L771-L777">generates</a> an extra <code>nginx.conf</code> file that governs what happens. There are a lot of various checks (e.g. do not cache on <code>POST</code> requests, do not rewrite paths if the predicted cache file location is empty&#8230;.) I&#8217;ve been following the generated file, and tried to adjust the caching behaviour. To debug, I turned to <a href="https://nginx.org/en/docs/http/ngx_http_headers_module.html">adding various headers</a> to the response, as it was easier than messing with the nginx logging rules. For example adding this just before the last rewrite rule kicks in would show the variable&#8217;s value that would decide if a rewrite happens:</p>



<pre class="wp-block-code"><code class="">add_header X-gergely-debug "rewrite-$w3tr_rewrite";</code></pre>



<p class="wp-block-paragraph">Looking at this, in every situation I was getting &#8220;no rewrite to do&#8221; outcomes, and it wasn&#8217;t in the end too much a surprise, as the logic in that file seems to be flawed: generating on disk file locations from the request incorrectly and thus never finding anything (and/or some of my misconfiguration? But there are definitely things which look plain wrong).</p>



<p class="wp-block-paragraph">But while the nginx rules shrugged, in the same time my web requests were returning the files from disk! If I rewrote the generated files, I got the modified version back. Then, frustrated, even emptied out <code>nginx.conf</code> to try to &#8220;break&#8221; caching &#8211; and it continued to work! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f643.png" alt="🙃" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p class="wp-block-paragraph">So I guess the actual behaviour was different from the above 3. point, and rather:</p>



<ul class="wp-block-list">
<li>W3TC generates <strong>nginx rules</strong> and hope that they work and take load off the WordPress backend</li>



<li>If that doesn&#8217;t fly, <strong>generate the caches internally</strong> in the plugin (of course, have to be able to do that on first requests/preloading anyways)</li>



<li>The plugin still checks internally (in code) <strong>whether the cached file exists</strong> where it expects one on the disk and loads that, bypassing this above point!</li>
</ul>



<p class="wp-block-paragraph">I haven&#8217;t verified this yet by looking at <a href="https://github.com/BoldGrid/w3-total-cache/">the code</a>, but this explains all the  behaviour I&#8217;ve seen while trying things (serving files that I&#8217;ve manually changed and working while having an empty nginx rewrite).</p>



<p class="wp-block-paragraph">So after all, these checks for the Accept header would need to be both in the nginx config (less important for me as it was already broken), and also in the code of W3TC (which feels currently less tractable).</p>



<h3 class="wp-block-heading">Current and Future Fixes</h3>



<p class="wp-block-paragraph">What I&#8217;ve ended up with is the simple and dumb way for now: <strong>disable Page Caching altogether</strong>.</p>



<p class="wp-block-paragraph">For my site and level of traffic that should definitely not be a serious issue, though <a href="https://gtmetrix.com/reports/gergely.imreh.net/OSRtS8nP/">I did check with a site speed test</a> just in case, and I don&#8217;t see much difference for my otherwise semi-broken setup.</p>



<p class="wp-block-paragraph">Still, it&#8217;s definitely a step forward not assuming &amp; hoping things are working (ie. nginx-based chaching) when they are not.</p>



<p class="wp-block-paragraph">What would be good for the future, though, is a pattern where cache plugins only <strong>cache what they can and if not pass it on to the rest of the processing</strong> (ie. check if the client &#8220;Accept&#8221; header is empty or defaults to <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation/List_of_default_Accept_values">some browser-y value</a>). I bet this is a naive view, and there are more complications. There likely should be more complications if WordPress is more of a &#8220;platform&#8221;, given then it will have to support a lot more different use cases and behaviours.</p>



<h2 class="wp-block-heading">Future Rabbitholes </h2>



<p class="wp-block-paragraph">I&#8217;m definitely not alone in this quest, there are others who hit various ActivityPub + caching issues (e.g. <a href="https://jasontucker.blog/14308/whats-with-activitypub-wordpress-cloudflare-not-working">using CloudFlare CDN</a>). With More Mastodon usage there might be some more satisfying solutions than &#8220;disable most caching&#8221;.</p>



<p class="wp-block-paragraph">I&#8217;ve definite learned more about WordPress Plugin internals by looking at the <a href="https://github.com/pfefferle/wordpress-activitypub">ActivityPub plugin&#8217;s repo</a>. I&#8217;m sure I could pick up some stuff for the <a href="https://gergely.imreh.net/blog/2022/07/100-days-to-offload-wordpress-plugin/">100 Days to Offload plugin</a> in the future.</p>



<p class="wp-block-paragraph">During debugging I was also looking at my web server logs which I haven&#8217;t done for years, but I know would be a &#8220;proper&#8221; sysadmin thing to do. There were a lot of interesting queries that I want to follow up on (bots, sites, tools scaraping the blog and interacting with various bits). It&#8217;s the <em>Inter</em>net, after all, so let&#8217;s look at the connections made!</p>
<p>The post <a href="https://gergely.imreh.net/blog/2023/02/when-wordpress-caching-is-not-what-it-seems/">When WordPress caching is  not what it seems</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gergely.imreh.net/blog/2023/02/when-wordpress-caching-is-not-what-it-seems/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Folding@Home on AWS to kick the arse of coronavirus</title>
		<link>https://gergely.imreh.net/blog/2020/03/foldinghome-on-aws/</link>
					<comments>https://gergely.imreh.net/blog/2020/03/foldinghome-on-aws/#comments</comments>
		
		<dc:creator><![CDATA[Gergely Imreh]]></dc:creator>
		<pubDate>Fri, 13 Mar 2020 22:13:53 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[covid-19]]></category>
		<guid isPermaLink="false">https://gergely.imreh.net/blog/?p=2550</guid>

					<description><![CDATA[<p>Learning how to spin up a F@H client on AWS as easy and cheap as possible.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2020/03/foldinghome-on-aws/">Folding@Home on AWS to kick the arse of coronavirus</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><a href="https://foldingathome.org/">Folding@Home</a> popped up on my radar due to a <a href="https://foldingathome.org/2020/03/10/covid19-update/">recent announcement</a> that their computational research platform is adding a bunch of projects to study (and ultimately help fight) the <a href="https://en.wikipedia.org/wiki/Coronavirus_disease_2019">COVID-19</a> virus. Previously I haven&#8217;t had any good machine at hand to be able to help in such efforts (my 9 years old Lenovo X201 is still cozy to work with, but doesn&#8217;t pack a computing punch). At <a href="https://faculty.ai/">work,</a> however I get to to be around GPU machines much more, and gave me ideas how to contribute a bit more.</p>



<p class="wp-block-paragraph">Poking around the available GPU instance types on AWS, seen that there are some pretty affordable ones in the <a href="https://aws.amazon.com/ec2/instance-types/g4/">G4 series</a>, going down to as low as roughly $0.60/hour to use some decent &amp; recent CPU and an <a href="https://www.nvidia.com/en-us/data-center/tesla-t4/">NVIDIA Tesla T4 GPU</a>. This drops even further if I use <a href="https://aws.amazon.com/ec2/spot/">spot instances</a>, and looking around in the different regions, I&#8217;ve seen available capacity at $0.16-0.20/hour, which feels really in the bargain category. Thus I thought spinning up a Folding@Home server in the cloud on spot instances, to help out and hopefully learning a thing or two, at the price of roughly 2 cups of gourmet London coffee (or taking the tube to work) per day.</p>



<span id="more-2550"></span>



<p class="wp-block-paragraph">Looking at the instance types, there are a few others than the mentioned g4dn.xlarge to choose from, but going to stick with that for the time being:</p>



<ul class="wp-block-list"><li>larger g4dn instances don&#8217;t really worth it, since the GPU will do the heavy lifting, and it&#8217;s the same size until going up to 12xlarge that comes with 4 GPUs, but that&#8217;s more than 4x as expensive, so would be rather wasted. </li><li>Compute optimised <a href="https://aws.amazon.com/ec2/instance-types/p3/">p3</a> instances also don&#8217;t seem to particularly worth it, as the difference between its <a href="https://www.nvidia.com/en-us/data-center/v100/">NVIDIA V100</a> and the T4 is much smaller multiplier than the price difference (based on a quick search for benchmarks: performance is roughly x2, while price of the smallest machine, that&#8217;s 2xlarge is x5-6).</li></ul>



<h3 class="wp-block-heading">Software setup</h3>



<p class="wp-block-paragraph">I&#8217;ve spun up an instance simply enough, and with a bit of trial &amp; error got the setup sorted.</p>



<p class="wp-block-paragraph">Using an Ubunutu system, the required <code>fahclient</code> installed just fine as per the <a href="https://foldingathome.org/support/faq/installation-guides/linux/manual-installation-advanced/">documentation</a>, but the GPU side needed some extra poking, things were unblocked by the NVIDIA drivers and OpenGL packages (thanks to the F@H forums), in my case: </p>



<pre class="wp-block-code"><code>sudo apt install -qy nvidia-headless-435 ocl-icd-opencl-dev</code></pre>



<p class="wp-block-paragraph">The next was adding a good Folding@Home config, again a bit of trial and error. The docs say lots of the pieces can be left to self-configure (the folding slots in particular), but I&#8217;ve found that explicitly setting it works better overall. Thus my <code>/etc/fahclient/config.xml</code> file looks something like this:</p>



<pre class="wp-block-code"><code>&lt;config>
  &lt;!-- Client Control -->
  &lt;fold-anon v='true'/>

  &lt;!-- Folding Slot Configuration -->
  &lt;gpu v='true'/>

  &lt;!-- Slot Control -->
  &lt;power v='full'/>

  &lt;!-- User Information -->
  &lt;passkey v='111111111111111111111'/>
  &lt;team v='xxxxx'/>
  &lt;user v='YYYYYYYYYYYY'/>

  &lt;!-- Folding Slots -->
  &lt;slot id='0' type='CPU'/>
  &lt;slot id='1' type='GPU'/>

  &lt;allow>127.0.0.1 A.B.C.D&lt;/allow>
  &lt;web-allow>127.0.0.1 A.B.C.D&lt;/web-allow>

  &lt;!-- Remote Command Server -->
  &lt;password v='zzzzzzzzz'/>
&lt;/config></code></pre>



<p class="wp-block-paragraph">Here I omitted my user name and passkey (naturally), so fill others can fill in their own. I&#8217;ve also joined the <a href="https://wiki.archlinux.org/index.php/Folding@home#Configuration">ArchLinux team</a> (number 45032 ;), but to each of their own. The last part in <code>allow/web-allow</code> section is that I&#8217;ve added my VPN&#8217;s IP address, so I can connect to the server remotely, without opening it up to the rest of the world. That part (A.B.C.D) can be removed, and could, for example, use SSH port forwarding to connect to the server (forwarding the required port 7396).  Finally, the password section allows the remote FAHControl graphical interface to connect to the folding service remotely (without port forwarding).</p>



<p class="wp-block-paragraph">This setup then got to fold. To ensure that things were running on the GPU fine, I&#8217;ve also built <a href="https://github.com/Syllo/nvtop">nvtop</a> on the machine and checked that the unit is maxed out</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="894" height="688" src="https://gergely.imreh.net/blog/wp-content/uploads/2020/03/nvtop_foldingathome.png" alt="" class="wp-image-2557" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2020/03/nvtop_foldingathome.png 894w, https://gergely.imreh.net/blog/wp-content/uploads/2020/03/nvtop_foldingathome-500x385.png 500w, https://gergely.imreh.net/blog/wp-content/uploads/2020/03/nvtop_foldingathome-768x591.png 768w" sizes="auto, (max-width: 894px) 100vw, 894px" /><figcaption>nvtop when folding happily</figcaption></figure>



<h3 class="wp-block-heading">Launch Template</h3>



<p class="wp-block-paragraph">So far it&#8217;s fine, but let&#8217;s make things more automatic. Spot instances can be killed, or I might want to spin up some extra instances, and would rather have as little manual work to do as possible. What I converged on then is having a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html">Launch Template</a> which sets up all the things needed and I could start a new folder with a couple of clicks. In there I&#8217;ve set:</p>



<ul class="wp-block-list"><li>the instance type, g4dn.xlarge</li><li>an Ubuntu 18.04 system</li><li>the security group, that allows all traffic to my VPN (otherwise port 22 for ssh would be enough with the mentioned ssh tunneling above)</li><li>that these are spot requests</li><li>my default AWS keypair for ssh access</li><li>some tags for housekeeping (definitely optional)</li><li>user data that does the whole setup on on system start</li></ul>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://gergely.imreh.net/blog/wp-content/uploads/2020/03/launch_template_folding.png" alt="" class="wp-image-2559" width="580" height="282" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2020/03/launch_template_folding.png 939w, https://gergely.imreh.net/blog/wp-content/uploads/2020/03/launch_template_folding-500x243.png 500w, https://gergely.imreh.net/blog/wp-content/uploads/2020/03/launch_template_folding-768x374.png 768w" sizes="auto, (max-width: 580px) 100vw, 580px" /><figcaption>Launch templating, took 5 versions to converge</figcaption></figure>



<p class="wp-block-paragraph">Of the parts above, I guess naturally the user data took the most to figure out, because of some peculiarities of the setup.</p>



<p class="wp-block-paragraph">First, FAHClient keeps wanting to interactively set things up when it is installed, so had to get around that. If I pre-create the correct <code>config.xml</code> file before the install, fortunately only a single question remains (whether it should start the service on automatically) and that one thing is taken care buy a bit of <a href="https://linux.die.net/man/1/expect">expect</a> scripting.</p>



<pre class="wp-block-code"><code>#!/bin/bash

export DEBIAN_FRONTEND=noninteractive
sudo apt update
sudo apt install -qy nvidia-headless-435 ocl-icd-opencl-dev expect

wget https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v7.6/fahclient_7.6.9_amd64.deb
sudo mkdir /etc/fahclient/ || true
sudo chmod 777 /etc/fahclient
cat  &lt;&lt;EOF > "/etc/fahclient/config.xml"
&lt;config>
  &lt;!-- Client Control -->
  &lt;fold-anon v='true'/>

  &lt;!-- Folding Slot Configuration -->
  &lt;gpu v='true'/>

  &lt;!-- Slot Control -->
  &lt;power v='full'/>

  &lt;!-- User Information -->
  &lt;passkey v='9c6306b5e237ab269c6306b5e237ab26'/>
  &lt;team v='45032'/>
  &lt;user v='Gergely_Imreh'/>

  &lt;!-- Folding Slots -->
  &lt;slot id='0' type='CPU'/>
  &lt;slot id='1' type='GPU'/>

  &lt;allow>127.0.0.1 62.212.77.217&lt;/allow>
  &lt;web-allow>127.0.0.1 62.212.77.217&lt;/web-allow>
  &lt;password v='guardian'/>
&lt;/config>
EOF

# This new FAHClient version might not get GPUs.txt properly, load it
curl https://apps.foldingathome.org/GPUs.txt  --create-dirs -o /var/lib/fahclient/GPUs.txt
sudo chmod -R 755 /var/lib/fahclient

cat &lt;&lt;EOF > "/home/ubuntu/install.sh"
#!/usr/bin/expect
spawn dpkg -i --force-confdef --force-depends fahclient_7.6.9_amd64.deb
expect "Should FAHClient be automatically started?"
send "\r"
# done
expect eof
EOF

chmod +x /home/ubuntu/install.sh

sudo /home/ubuntu/install.sh</code></pre>



<p class="wp-block-paragraph">With this script passed to the instance as user data now it all falls into place, and can spin up new folding any time.</p>



<p class="wp-block-paragraph">Then there are two ways to connect to the server and monitor it remotely:</p>



<ul class="wp-block-list"><li>the web client, on port 7396, with an interface like at the top of this post, or</li><li>using FAHClient desktop client, that can monitor and control multiple folding instances, and I feel has better control over &amp; more information about what&#8217;s being done. This is by default on port 36330 and to work remotely, have to have a &#8220;password&#8221; set in the configuration.</li></ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="716" height="596" src="https://gergely.imreh.net/blog/wp-content/uploads/2020/03/remote_settings_fahcontrol.png" alt="" class="wp-image-2563" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2020/03/remote_settings_fahcontrol.png 716w, https://gergely.imreh.net/blog/wp-content/uploads/2020/03/remote_settings_fahcontrol-500x416.png 500w" sizes="auto, (max-width: 716px) 100vw, 716px" /></figure>



<p class="wp-block-paragraph">Using these settings, the remote workload (both the CPU and GPU pops up, and possible to monitor &amp; control:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="616" src="https://gergely.imreh.net/blog/wp-content/uploads/2020/03/remote_fahcontrol_foldingathome-1024x616.png" alt="" class="wp-image-2564" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2020/03/remote_fahcontrol_foldingathome-1024x616.png 1024w, https://gergely.imreh.net/blog/wp-content/uploads/2020/03/remote_fahcontrol_foldingathome-500x301.png 500w, https://gergely.imreh.net/blog/wp-content/uploads/2020/03/remote_fahcontrol_foldingathome-768x462.png 768w, https://gergely.imreh.net/blog/wp-content/uploads/2020/03/remote_fahcontrol_foldingathome-1200x722.png 1200w, https://gergely.imreh.net/blog/wp-content/uploads/2020/03/remote_fahcontrol_foldingathome.png 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">And this should be done for now&#8230;</p>



<h3 class="wp-block-heading">Notes &amp; Future</h3>



<p class="wp-block-paragraph">Thus far I&#8217;ve learned:</p>



<ul class="wp-block-list"><li>A bit about <strong>spot instances</strong>. There are a lot more options which I haven&#8217;t touched and might be useful in general, such as targets &amp; instance pools, using the time-limited spot instances, etc, but those are more in general, not in this particular case)</li><li>A lot about <strong>launch templates</strong>. They seem handy, though one request would be being able to edit the description of them, or when starting from a previous version, that description is pre-filled (which is currently not, unlike all the other settings). </li><li>Some apt/dpkg coercion tricks for <strong>non-interactive setup</strong>, though there seems to be a more to know. How nice it is on ArchLinux that non-interactive mode is basically a single <code>-y</code> flag away in pacman.</li><li>How to use <strong>user data</strong>, though that&#8217;s definitely just scratching the surface. What would be much better is to learn <a href="https://cloudinit.readthedocs.io/en/latest/">cloud-init</a> instead, which seems much more like the proper way to supply files to install and scripts to run on these virtual machines.</li></ul>



<p class="wp-block-paragraph">I&#8217;ve also experienced that Folding@Home might be struggling a bit with the current load, earlier today the work servers (but now they seem to be okay), but also the <a href="https://stats.foldingathome.org/donors">statistics servers</a>, so I&#8217;m guessing the whole infrastructure is under load. I wonder how are they set up, and where their bottlenecks are&#8230;</p>



<p class="wp-block-paragraph">But now this is done, the ball is in the court of the research, keep them computational biochemistry research coming. In the meantime keep safe, everyone. Wash hands, not touch faces, and take good care of people around you.</p>



<p class="wp-block-paragraph"><strong>Edit 2020/03/14</strong>: Looking at their <a href="https://apps.foldingathome.org/serverstats">server stats</a> and connecting up the dots with their <a href="https://apps.foldingathome.org/psummary">project stats</a>, they might have run out of relevant work items for the time being. That&#8217;s kinda both good (likely large response to their shout out) and a bummer (resources just idling).</p>



<p class="wp-block-paragraph"><strong>Edit 2020/04/19</strong>: Updated the template user data script to install the the newer 7.6.9 version of FAHClient (instead of 7.4.4), which also needs manually loading the <code>GPUs.txt</code> file, because it doesn&#8217;t seem to do that by itself&#8230;</p>
<p>The post <a href="https://gergely.imreh.net/blog/2020/03/foldinghome-on-aws/">Folding@Home on AWS to kick the arse of coronavirus</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gergely.imreh.net/blog/2020/03/foldinghome-on-aws/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
		<item>
		<title>Continuous integration testing of Arch User Repository packages</title>
		<link>https://gergely.imreh.net/blog/2018/04/circleci-aur/</link>
					<comments>https://gergely.imreh.net/blog/2018/04/circleci-aur/#comments</comments>
		
		<dc:creator><![CDATA[Gergely Imreh]]></dc:creator>
		<pubDate>Thu, 12 Apr 2018 11:56:40 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[CircleCI]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[YAML]]></category>
		<guid isPermaLink="false">https://gergely.imreh.net/blog/?p=2425</guid>

					<description><![CDATA[<p>Using git submodules and CircleCI workflows to build and test the AUR packages I maintain.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2018/04/circleci-aur/">Continuous integration testing of Arch User Repository packages</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I maintain <a href="https://aur.archlinux.org/packages/?K=imrehg&amp;SeB=m">a couple of ArchLinux user-contributed packages</a> on the <a href="https://wiki.archlinux.org/index.php/Arch_User_Repository">Arch User Repository (AUR)</a>, and over time I&#8217;ve built out a bit of infrastructure around that to make that maintenance easier (and hopefully the results better). The core of it is automated building of packages in Continuous Integration, which catches a number of issues which otherwise would be more difficult.</p>
<p>This write-up will go through the entire packaging process to make it easily reproducible.<span id="more-2425"></span></p>
<h2>Contributing a package</h2>
<p>AUR is a great resource for Arch Linux users, and  it is pretty easy to <a href="https://wiki.archlinux.org/index.php/Arch_User_Repository#Sharing_and_maintaining_packages">create and contribute new packages</a>.</p>
<p>Packages are created by cloning an empty <a href="https://git-scm.com/">git</a> repository with the desired package name. I do it in a slightly different setup compared to the wiki that&#8217;s linked just above, as:</p>
<pre class="lang:sh decode:true" title="Clone an empty repo to create a new AUR package">git clone ssh+git://aur@aur.archlinux.org/&lt;PACKAGENAME&gt;.git</pre>
<p>Add your PKGBUILD and any other required files, run mksrcinfo, and git commit, and push&#8230; If everything went well, your package is now visible in the <a href="https://aur.archlinux.org/packages/?O=0&amp;K=">AUR search</a>.</p>
<p>Next time that repository is cloned, it will contain the code, and changes (i.e. package updates) can be pushed just as well too.</p>
<h2>Keeping track of packages</h2>
<p>As more packages are contributed, it is increasingly hard to keep track of them as separate repositories. One way to improve on this, is creating a &#8220;meta&#8221; repository (or repo), where all the contributed packages are linked as <a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules">git submodules</a>.</p>
<p>This organization is achieved by creating your meta-repo, and add your package as a submodule:</p>
<pre class="lang:sh decode:true " title="Adding AUR package as a submodule to a git repo">git submodule add ssh+git://aur@aur.archlinux.org/&lt;PACKAGENAME&gt;.git</pre>
<p>Then you&#8217;d make package updates in that submodule, and the meta repo would contain all your packages as a collection.</p>
<p>My packages&#8217; meta repo that show this arrangement is on Github at <a href="https://github.com/imrehg/aur">imrehg/aur</a>.</p>
<h2>Continuous integration testing</h2>
<p>What we can do with this setup now, is to automatically check out, build, analyze, and test (including installation) of the all the packages.  I&#8217;ve set that up as <a href="https://circleci.com/">CircleCI</a> build jobs for each of the packages: each of them built and installed in a clean Arch Linux environment.</p>
<p>The clean Arch Linux environment is provided by a <a href="https://www.docker.com/">Docker</a> image, that I&#8217;ve created for this purpose, <a href="https://github.com/imrehg/archlinux-makepkg-docker">archlinux-makepkg-docker</a>. That image builds on an upstream Arch Linux image, and sets a few things up:</p>
<ul>
<li>updates the image with the latest base build system</li>
<li>creates a &#8220;builder&#8221; user that can run sudo</li>
<li>installs two packages from scratch that are sometimes needed for working with AUR packages: &#8220;package-query&#8221; and &#8220;yaourt&#8221;</li>
<li>installs &#8220;<a href="https://wiki.archlinux.org/index.php/Namcap">namcap</a>&#8221; to analyze the package</li>
</ul>
<p>Each AUR package is set up with its own CircleCI build job as part of a <a href="https://circleci.com/docs/2.0/workflows/">workflow</a>.</p>
<p>Since most of the work for each package is pretty much the same, we can simplify things with templates, such as this:</p>
<pre class="lang:yaml decode:true" title="A CircleCI config to build my-package"># Common sections
defaults: &amp;defaults
  working_directory: ~/aur
  docker:
    - image: imrehg/archlinux-makepkg

updatepackage: &amp;updatepackage
  name: Update packages
  command: sudo pacman -Syu --noconfirm

gitupdate: &amp;gitupdate
  name: Git repo updates
  command: |
    sed -i "s#ssh+git://aur@aur.archlinux.org#https://aur.archlinux.org#" .gitmodules
    git submodule update --init
pkgbuildtest: &amp;pkgbuildtest
  name: Testing PKGBUILD
  command: |
    cd ~/aur/${CIRCLE_JOB}
    namcap PKGBUILD
buildtest: &amp;buildtest
  name: Building package
  command: |
    cd ~/aur/${CIRCLE_JOB}
    makepkg -sci --noconfirm

# Main
version: 2
jobs:
  my-package:
    &lt;&lt;: *defaults
    steps:
      - run:
          &lt;&lt;: *updatepackage
      - checkout
      - run:
          &lt;&lt;: *gitupdate
      - run:
          &lt;&lt;: *pkgbuildtest
      - run:
          &lt;&lt;: *buildtest

workflows:
  version: 2
  build:
    jobs:
      - my-package
</pre>
<p>The sample CircleCI &#8220;config.yml&#8221; here is set up to build an AUR package called &#8220;my-package&#8221;:</p>
<ul>
<li>it pulls the Arch Linux Docker image mentioned earlier</li>
<li>updates any outdated OS package</li>
<li>checks out meta repo that we are working from</li>
<li>updates the submodule configuration to be able to pull the required submodule without authentication. the &#8220;ssh+git://&#8221; setup requires the maintainer&#8217;s SSH credentials, while switching to &#8220;https://&#8221; the CI environment is allowed to check the package&#8217;s code out (and won&#8217;t be able to push back upstream, which is safer)</li>
<li>runs &#8220;namcap&#8221; on the PKGBUILD to catch any obvious issues</li>
<li>builds and installs the package (including dependencies)</li>
</ul>
<p>As &#8220;my-package&#8221; is set up above, it does not have any line specific in to that package in the build steps. The specifics are set up using CircleCI variables (CIRCLE_JOB) and <a href="http://yaml.org/spec/1.2/spec.html">YAML</a> <a href="http://yaml.org/type/merge.html">Merge Key Language-Independent Types</a> (the &#8220;foo: &amp;foo&#8221; and &#8220;&lt;&lt; : *foo&#8221; section). Thus if there&#8217;s &#8220;another-package&#8221;, it&#8217;s easy to clone the &#8220;my-package&#8221; section as it is, naming that &#8220;another-package&#8221;, and adding a new build job to the end of the file called &#8220;another-package&#8221;. With this &#8220;templating&#8221; when the build steps need to be modified, they can be updated in the header, and all the packages will pick that up.</p>
<p>Workflows are also useful, as  jobs can be made dependent on each other, if they are related, such as my &#8220;gnushogi&#8221; and &#8220;xshogi&#8221; packages, or likely any AUR package that requires other AUR packages that need to be built.</p>
<pre class="lang:yaml decode:true" title="Workflow with dependency">...
workflows:
  version: 2
  build:
    jobs:
      &lt;other jobs&gt;
      - gnushogi
      - xshogi:
          requires:
            - gnushogi
</pre>
<p>This would result in a dependency in the jobs as:</p>
<p><figure id="attachment_2443" aria-describedby="caption-attachment-2443" style="width: 724px" class="wp-caption aligncenter"><a href="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/circleci_aur_jobs.png"><img loading="lazy" decoding="async" class="size-full wp-image-2443" src="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/circleci_aur_jobs.png" alt="" width="724" height="973" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/circleci_aur_jobs.png 724w, https://gergely.imreh.net/blog/wp-content/uploads/2018/04/circleci_aur_jobs-372x500.png 372w" sizes="auto, (max-width: 724px) 100vw, 724px" /></a><figcaption id="caption-attachment-2443" class="wp-caption-text">Jobs in the CircleCI workflow</figcaption></figure></p>
<p>The workflows also allow for jobs to give files to each other. E.g. as above &#8220;xshogi&#8221; depends on &#8220;gnushogi&#8221; to be installed, I could build all the required dependencies again in &#8220;xshogi&#8221;, but it was already built, I could just pass on the created package from the earlier job to the next, using <a href="https://circleci.com/blog/deep-diving-into-circleci-workspaces/">CircleCI workspaces</a>.</p>
<pre class="lang:yaml decode:true" title="Sample file passing between jobs with workspaces">  gnushogi:
    &lt;&lt;: *defaults
    steps:
      - run:
          &lt;&lt;: *updatepackage
      - checkout
      - run:
          &lt;&lt;: *gitupdate
      - run:
          &lt;&lt;: *pkgbuildtest
      - run:
          &lt;&lt;: *buildtest
      - persist_to_workspace:
          root: gnushogi
          paths: gnushogi-*.pkg.tar.xz

  xshogi:
    &lt;&lt;: *defaults
    steps:
    &lt;&lt;: *defaults
    steps:
      - run:
          &lt;&lt;: *updatepackage
      - checkout
      - run:
          &lt;&lt;: *gitupdate
      - run:
          &lt;&lt;: *pkgbuildtest
      - attach_workspace:
          at: /tmp/workspace
      - run:
          name: Installing gnushogi
          command: sudo pacman -U --noconfirm /tmp/workspace/gnushogi*.pkg.*
      - run:
          &lt;&lt;: *buildtest
</pre>
<p>The meta repo is now ready to go with such &#8220;.circleci/config.yml&#8221;, and on each push, it will build all the packages defined in the job list. You can check how the results look for my AUR packages in CircleCI&#8217;s <a href="https://circleci.com/gh/imrehg/aur">build job view</a> (one entry by build job, ie. package-per-push) or <a href="https://circleci.com/gh/imrehg/workflows/aur">workflow view</a> (one entry per push, aggregating all jobs).</p>
<p><figure id="attachment_2453" aria-describedby="caption-attachment-2453" style="width: 1020px" class="wp-caption aligncenter"><a href="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/circleci_aur_workflow_small.png"><img loading="lazy" decoding="async" class="size-full wp-image-2453" src="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/circleci_aur_workflow_small.png" alt="" width="1020" height="845" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/circleci_aur_workflow_small.png 1020w, https://gergely.imreh.net/blog/wp-content/uploads/2018/04/circleci_aur_workflow_small-500x414.png 500w, https://gergely.imreh.net/blog/wp-content/uploads/2018/04/circleci_aur_workflow_small-768x636.png 768w" sizes="auto, (max-width: 1020px) 100vw, 1020px" /></a><figcaption id="caption-attachment-2453" class="wp-caption-text">Last build workflows</figcaption></figure></p>
<p>One of the advantages of this setup, is that if a build fails on any of the package (e.g. a source file is no longer available) it&#8217;s easy to see, and I can catch a number of out-of-date packages sooner than someone reports it on AUR.</p>
<h2>Keeping the build image up to data</h2>
<p>The  Arch Linux Docker image is <a href="https://docs.docker.com/docker-hub/builds/">automatically built</a> on Docker Hub (and can be found at <a href="https://hub.docker.com/r/imrehg/archlinux-makepkg/">imrehg/archlinux-makepkg</a>. It is kept fresh by an <a href="https://ifttt.com/">If This Than That</a> applet, which triggers the build every morning.</p>
<p><figure id="attachment_2441" aria-describedby="caption-attachment-2441" style="width: 691px" class="wp-caption aligncenter"><a href="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/aur_build_image_ifttt.png"><img loading="lazy" decoding="async" class="wp-image-2441 size-full" src="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/aur_build_image_ifttt.png" alt="" width="691" height="549" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/aur_build_image_ifttt.png 691w, https://gergely.imreh.net/blog/wp-content/uploads/2018/04/aur_build_image_ifttt-500x397.png 500w" sizes="auto, (max-width: 691px) 100vw, 691px" /></a><figcaption id="caption-attachment-2441" class="wp-caption-text">IFTTT Applet to trigger Docker Hub automated builds</figcaption></figure></p>
<p>That applet just uses the <a href="https://ifttt.com/date_and_time">Date &amp; Time</a> and <a href="https://ifttt.com/maker_webhooks">Webhooks</a> recipes. The webhook points to the Trigger URL provided by the &#8220;Build Settings / Build Triggers&#8221; section on Docker Hub for the image, and it&#8217;s a POST request with payload of:</p>
<pre class="lang:js decode:true" title="Docker Hub build trigger payload">{"docker_tag": "latest"}</pre>
<p><figure id="attachment_2442" aria-describedby="caption-attachment-2442" style="width: 525px" class="wp-caption aligncenter"><a href="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/docker_hub_triggers.png"><img loading="lazy" decoding="async" class="wp-image-2442 size-large" src="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/docker_hub_triggers-1024x563.png" alt="" width="525" height="289" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2018/04/docker_hub_triggers-1024x563.png 1024w, https://gergely.imreh.net/blog/wp-content/uploads/2018/04/docker_hub_triggers-500x275.png 500w, https://gergely.imreh.net/blog/wp-content/uploads/2018/04/docker_hub_triggers-768x422.png 768w, https://gergely.imreh.net/blog/wp-content/uploads/2018/04/docker_hub_triggers.png 1909w" sizes="auto, (max-width: 525px) 100vw, 525px" /></a><figcaption id="caption-attachment-2442" class="wp-caption-text">Docker HUB Build Settings / Build Triggers settings</figcaption></figure></p>
<p>Keeping the image fresh like this shortens the build time when running the jobs on CircleCI (fewer packages need to be updated), which especially important as free users have limited CPU time available each month.</p>
<p>Not many packages which use other AUR packages, which likely need more setup here.</p>
<h2>Update workflow</h2>
<p>As an aside, the process to update any given package with this setup as follows:</p>
<ul>
<li>Update the &#8220;PKGBUILD&#8221; for the package, quite often it&#8217;s just the version number</li>
<li>Update the checksums easily with &#8220;updpkgsums&#8221; (part of &#8220;pacman&#8221; so it should be always available)</li>
<li>Build the package</li>
<li>If everything goes well, update the required &#8220;.SRCINFO&#8221; with &#8220;mksrcinfo&#8221; (part of &#8220;pkgbuild-introspection&#8221;)</li>
<li>git add, commit (signed if you can:), and push to AUR</li>
<li>Clean up the package directory (&#8220;git clean -d -f &amp;&amp; rm -rf src&#8221;)</li>
<li>Going back up in the folder hierarchy to the meta repo git add and commit the changes to the submodules</li>
<li>Push to github, and enjoy the build!</li>
</ul>
<h2>Future</h2>
<p>Many things can be improved on this setup (one day), here are some ideas</p>
<p>It should be possible to <strong>publish the build artifacts</strong> to somewhere (say S3) and set it up as a custom Arch Linux package repository, thus can be reused without everyone needing to build from scratch every time.</p>
<p>If that publishing would happen, I&#8217;m guessing it would be good to also <strong>sign the built packages</strong>, which might be a bit trickier to set up safely, but would make package distribution nicer and more robust.</p>
<p>In my list of packages there are not that many that depend on other AUR packages. Other <strong>packages with more AUR dependencies</strong> might need even more custom setup than shown above, besides the templated sections, to make them speedy and logical.</p>
<p>In the package testing steps, probably should <strong>run &#8220;namcap&#8221; on the finished package</strong> too, to catch other issues (e.g. dependencies required but not included).</p>
<hr />
<p>What&#8217;s your experience with maintaining AUR packages, or with CircleCI? Have any feedback on how to make this above even more useful?</p>
<p>The post <a href="https://gergely.imreh.net/blog/2018/04/circleci-aur/">Continuous integration testing of Arch User Repository packages</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gergely.imreh.net/blog/2018/04/circleci-aur/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>Personal phone server, or Can you hear me now?</title>
		<link>https://gergely.imreh.net/blog/2014/03/can-you-hear-me-now/</link>
					<comments>https://gergely.imreh.net/blog/2014/03/can-you-hear-me-now/#comments</comments>
		
		<dc:creator><![CDATA[Gergely Imreh]]></dc:creator>
		<pubDate>Tue, 18 Mar 2014 09:41:02 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Maker]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[hackerspace]]></category>
		<category><![CDATA[iax]]></category>
		<category><![CDATA[sip]]></category>
		<category><![CDATA[voip]]></category>
		<guid isPermaLink="false">https://gergely.imreh.net/blog/?p=1712</guid>

					<description><![CDATA[<p>Experience setting up my own Voice-over-IP phone network, with the aim to have one good way to communicate from desktop &#038; smartphone, over wifi &#038; 3G.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2014/03/can-you-hear-me-now/">Personal phone server, or Can you hear me now?</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Ever since someone donated an IP phone to the <a title="Taipei Hackerspace" href="http://tpehack.no-ip.biz">Taipei Hackerspace</a>, I&#8217;m trying to find time to set up an internal phone network between the hackerspace members. It should be fun to make our own infrastructure. Recently did some research, and started with it. Since if I get into something then I dive deep for a while, this was an intense week. This post is to summarize where I have got in this time</p>
<h2>Asterisk &amp; FreePBX</h2>
<p>A bit of searching turned up <a title="Asterisk homepage" href="http://www.asterisk.org/">Asterisk</a>, a PBX (&#8220;private branch exchange&#8221; aka telephone network) software. It looked interesting because it came with <a title="A brief history of Asterisk" href="https://wiki.asterisk.org/wiki/display/AST/A+Brief+History+of+the+Asterisk+Project">a story</a>: a guy building something awesome because he doesn&#8217;t know that it was supposed to be difficult. It&#8217;s also open source from the start, with a successful <a title="Digium" href="http://www.digium.com/">company</a> build on top of the project.</p>
<p>Also found, that there&#8217;s a graphical control panel called <a title="FreePBX home" href="http://www.freepbx.org/">FreePBX</a> that makes using the all-command-line-and-config-files Asterisk easier to use. Both projects had a seemingly very detailed wiki, long track record, and strong following that made it worth checking them out.</p>
<h3>The Server</h3>
<p>Judging from the <a title="Installing FreePBX on Ubuntu 12.04 Server (Precise Pangolin)" href="http://wiki.freepbx.org/pages/viewpage.action?pageId=1409028">original install instructions</a> on the FreePBX wiki, it looked like installing Asterisk &amp; FreePBX is a complex (or rather many-step) process. Didn&#8217;t want to litter my own computer with broken installation artefacts, so enter <a title="VirtualBox home" href="https://www.virtualbox.org/">VirtualBox</a>. Using a virtual machine makes it easy to wipe and restart.</p>
<p>There&#8217;s a dedicated, preinstalled FreePBX distro based on CentOS, but had enough of CentOS for a while. Instead I just took Ubuntu 12.04.3 as a base, and FreePBX 2.11 and Asterisk 11 from the wiki. The install instructions were clear enough, though occasionally there were small differences needing a fix. Nothing major, but had to play around. After 5-6 reinstalls with increasing experience I got the basic functionality working, calls placed between and such, but the performance and sound quality wasn&#8217;t really that good. After thinking what could I improve, decided to take the next step: get out of the virtual machine, and up the version numbers (I&#8217;m <a title="ArchLinux About page" href="https://www.archlinux.org/about/">Arch Linux</a> user with a reason, living on the bleeding edge).</p>
<p>Enter <a title="DigitalOcean" href="https://www.digitalocean.com/">DigitalOcean</a>, a hosting provider that I used for other projects before (cheap, fast with SSD, good service). Set up a machine (aka &#8220;droplet&#8221;) in their Singaporean center (since that&#8217;s probably the closest one to Taiwan). I chose the 1Gb memory instance, because from experience with VirtualBox Asterisk+FreePBX maxed out at around that with a few test accounts.</p>
<p>Upping the version numbers I went with FreePBX 12.0 (from git) and Asterisk 12.1.1 (from download), both are testing versions. Asterisk had an extra dependency of libjansson-dev compared to version 11, didn&#8217;t check if any of the earlier dependencies are not required anymore.</p>
<p><figure id="attachment_1717" aria-describedby="caption-attachment-1717" style="width: 500px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-1717" src="https://gergely.imreh.net/blog/wp-content/uploads/2014/03/Asterisk.jpg" alt="The information control panel of FreePBX." width="500" height="380" /><figcaption id="caption-attachment-1717" class="wp-caption-text">FreePBX interface for Asterisk</figcaption></figure></p>
<p>Got the whole system working (after a few droplet wipes), and played with the installation with a bit more confidence. From initial experience, Asterisk is a bit like the Linux Kernel. It&#8217;s modular, complex, focus on reliability, and the &#8220;<a title="Menuselect on the Asterisk wiki" href="https://wiki.asterisk.org/wiki/display/AST/Using+Menuselect+to+Select+Asterisk+Options">make menuselect</a>&#8221; is a familiar environment after years of &#8220;<a title="Menuconfig on Wikipedia" href="http://en.wikipedia.org/wiki/Menuconfig">make menuconfig</a>&#8221; compiling my own kernel. On the other hand, FreePBX is a bit like WordPress. It has its own auto-updater (just like updating plugins in WordPress), loads and loads of menus, focuses on configuration and tries not to let any faulty module take down the system (found quite a few buggy behaviour, so that&#8217;s a good idea). The Kernel and WordPress are two familiar environments, so felt home here too somehow.</p>
<p>Asterisk has a bunch of vocabulary that I&#8217;m so far barely familiar with, and lots of functionality that I haven&#8217;t had a chance to test yet. FreePBX has a lot of functionality too, and still it&#8217;s a bit difficult for me to tell where does an Asterisk function (module, resource?) end and one FreePBX function (plugin?) start. The fact is that I got to feel excited about programmable phone routing (with Lua), fax-to-pdf, hotel style wake-up calls, voicemail recording, call tracing, speaking time, simple conference talks, intercom functionality, regardless from whether it&#8217;s a module or a plugin&#8230;</p>
<p><span style="line-height: 1.5em;">Some additional server notes: voicemail requires email out for notification, I set that up with <a title="Mandrill homepage" href="https://mandrill.com/">Mandrill</a> and <a title="Can I configure Postfix to send through Mandrill?" href="http://help.mandrill.com/entries/23060367-Can-I-configure-Postfix-to-send-through-Mandrill-">postfix</a>. For such testing it might not be important, but good to secure the server at least a bit with <a title="fail2ban wiki" href="http://www.fail2ban.org/wiki/index.php/Main_Page">fail2ban</a> and <a title="ufw on the community wiki" href="https://help.ubuntu.com/community/UFW">ufw</a> (Uncomplicated Firewall), and probably other things I don&#8217;t do well yet. Just sayin&#8217;.</span></p>
<h3>Accounts / Extensions</h3>
<p>Accounts on  the server are the extensions on which someone (or something), a numerical value. The vocabulary and concepts are also new to me, so it took a while to understand how things supposed to interoperate. Asterisk has a bunch of different kinds of extensions, of which I have tried two main ones: SIP and IAX.</p>
<h4>SIP</h4>
<p>SIP stands for <a title="Session Initiation Protocol on Wikipedia" href="http://en.wikipedia.org/wiki/Session_Initiation_Protocol">Session Initiation Protocol</a>. As far as I see it is basically a messaging protocol, to set up a connection between two parties, and also provide some other services, for example presence information (Online, Away, Busy&#8230;.), messaging, and what not. The actual data of the call (voice or video) is trhough RTP (<a title="Real-time Transport Protocol on Wikipedia" href="http://en.wikipedia.org/wiki/Real-time_Transport_Protocol">Real-time Transport Protocol</a>).</p>
<p>The voice data in the transmission is compressed with one of the many codecs available:</p>
<ul>
<li>ulaw and alaw (<a title="G.711 on Wikipedia" href="http://en.wikipedia.org/wiki/G.711">G.711</a>) are a pair of the standard codecs, okay quality, one of the basic one to have in any client</li>
<li><a title="Speex on Wikipedia" href="http://en.wikipedia.org/wiki/Speex">speex</a> is a variable bitrate codec, haven&#8217;t used that much</li>
<li>gsm is lower bitrate, but lower quality too (think of crappy cell phone reception voice)</li>
<li><a title="G.722 on Wikipedia" href="http://en.wikipedia.org/wiki/G.722">G.722</a> is a hi-def (HD) voice codec, really good! I think beats Skype, and on par with a good Google Hangout quality,</li>
<li><a title="G.729 on Wikipedia" href="http://en.wikipedia.org/wiki/G.729">G.729</a> is a non-free codec, shows up here and there, but haven&#8217;t had a chance to try it, this is the other HD codec that I&#8217;ve seen recommended</li>
</ul>
<p>In testing, this was some of the learning curve, how to set up clients, and also the server that they can communicate with each other. Who choses the codec (caller, callee, server)? How to prioritize the codecs in different clients? What does it look like (or sounds like) when there&#8217;s a problem in this area? How to debug and fix?</p>
<p>Asterisk 12 has two different SIP channels or components: their classic library (chan_sip), and a rewritten one (<a title="PJSIP homepage" href="http://www.pjsip.org/">chan_pjsip</a>). The latter one is a standalone library that can be used for other purposes as well. SIP usually works on UDP, while PJSIP can do UDP/TCP/WebSockets too, and feels stable and fast. Definitely would use that if I have to choose between these two. Still, it is in test phase (both in Asterisk and FreePBX), so not without headaches.</p>
<p>There are bunch of different clients that I tried:</p>
<p>On Linux:</p>
<ul>
<li><a title="Ekiga homepage" href="http://ekiga.org/">Ekiga</a> is nice, simple, can sign into multiple accounts in multiple networks. Presence information, well integrated into the desktop with notifications and such. Does not seem to be able to handle non-standard SIP ports (which will be an issue further down)</li>
<li><a title="Linphone homepage" href="http://www.linphone.org/">Linphone</a> is really multiplatform (Linux, Win, OSX, smartphones&#8230;), but it was crashing on me quite a bit, doesn&#8217;t integrate into the desktop (no notification just sound on call), and can be confusing with the lot of settings (the control panel looks a mess). Can handle non-standard ports too.</li>
<li><a title="SFLPhone homepgae" href="http://sflphone.org/">SFLPhone</a> is good, works pretty well, simple, and can do IAX communication besides SIP.</li>
</ul>
<p>On Android:</p>
<ul>
<li><a title="Android SIP configuration" href="http://www.voipvoip.com/android/sip.html">Android</a> actually has full SIP handling capabilities built in for a while now (under &#8220;internet phone&#8221;). That would be awesome, if there were more information how to set up and use, but in theory a SIP account can be fully integrated into the system.</li>
<li><a title="CSIPSimple on the Play Store" href="https://play.google.com/store/apps/details?id=com.csipsimple">CSIPSimple</a> really impressed me, probably the best working client I found. Integrates with the system (calls are handled as &#8216;calls&#8217; with all the icons, history, and so on), good sound quality (can use the G.722 codec) and so on.</li>
<li>SipDroid, VIMPhone, LinPhone&#8230;. these other clients, don&#8217;t even remember them, all of them fell short somehow</li>
<li><a title="Zoiper home" href="http://www.zoiper.com/">Zoiper</a> stands out as well, not just because it&#8217;s multiplatform, but because it&#8217;s pretty much the only one I found that can do both SIP and IAX. The Android system integration is not as close as CSIPSimple, but quite okay.</li>
</ul>
<p>One of (the many) good thing about SIP that it is well known and pretty well supported. If there&#8217;s a &#8220;softphone&#8221; (phone in software), it&#8217;s quite likely to have SIP communication capabilities.</p>
<p>The bad thing about SIP though that it is well known and pretty well resented by the phone service providers. Many of those providers block SIP messages on their network, or sabotage the connection in some other way. On my own cell phone / 3G provider&#8217;s network, I couldn&#8217;t connect to Asterisk. In the forums some suggested that changing the port number that Asterisk listens on for SIP connections can solve things &#8211; and indeed after moving away from 5060/5061 to somewhere else, I could connect. The celebration was short lived, though because even though the calls now can reach the destination, RTP communication (the part that actually transports voice) was still broken. I don&#8217;t want to use VPN all the time (though might need to soon), and want to keep moving parts and settings to the minimum if I want others in the Hackerspace to join this network as well, thus SIP looks like a no-go because of the phone companies (darn).</p>
<h4>IAX</h4>
<p>Looking around, I found another type of channel, using the IAX (Inter-Asterisk eXchange) protocol. The bad thing about it that it is much less supported, but in turn it is not blocked by the phone companies either (since they don&#8217;t know about it).</p>
<p>Using SFLPhone and Zoiper I could successfully talk over 3G! Still it is not all good, the devil is in the details.</p>
<p><figure id="attachment_1713" aria-describedby="caption-attachment-1713" style="width: 281px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-1713" src="https://gergely.imreh.net/blog/wp-content/uploads/2014/03/zoiper.jpg" alt="Phone interface showing incoming call from IAX test user" width="281" height="500" /><figcaption id="caption-attachment-1713" class="wp-caption-text">Zoiper incoming call on Android</figcaption></figure></p>
<ul>
<li>It&#8217;s good that no need for custom ports</li>
<li>It&#8217;s bad that the IAX channel seems to be more unstable on Asterisk (or maybe I messed up my install after a while?): some extensions have trouble logging on for a while until the server is restarted; the wakeup-calls plugin misbehaved with IAX extension.</li>
<li>The less support also means less choice in clients. The ones I found cannot do G.722 so no HD voice anymore</li>
<li>Has a security setting (requirecalltoken) that not all clients support, not sure if there are any implications.</li>
</ul>
<p>It&#8217;s also good, that Asterisk can route incoming SIP calls onto IAX extensions (i.e. the caller doesn&#8217;t have to care what technology the callee is using). On the note of routing, I could set things up such that outside calls can be routed into the system. E.g. every hackerspace could have their own Asterisk server and interoperate to call members at other spaces &#8211; sounds like a lot of work and might not worth it, but it also sounds awesome.</p>
<p><span style="font-size: 1.5em; line-height: 1.5em;">Summary &amp; Future</span></p>
<p>I had a lot of fun playing with Asterisk. On the surface phone networks are familiar to everyone, but going deeper both makes things more confusing and opens my eyes how many possibilities there are for making something useful.<span style="line-height: 1.5em;"> </span></p>
<p>There are a lot of things that I thought about, but haven&#8217;t tried yet:</p>
<ul>
<li>Programmable dialplans (&#8220;what happens when a call is received&#8221;), <a title="Lua Dialpans" href="https://wiki.asterisk.org/wiki/display/AST/Lua+Dialplan+Configuration">via Lua</a>. Lua is an <a title="Language of the Month: Lua, part 2" href="https://gergely.imreh.net/blog/2011/07/language-of-the-month-lua-part-2/">awesome language</a> and probably a lot more large piece of software has it embedded (since that&#8217;s one of its strength)</li>
<li>Could script a lot more too via the <a title="AGI technical introduction" href="http://www.rdegges.com/a-technical-introduction-to-the-asterisk-gateway-interface-agi/">Asterisk Gateway Interface</a> (AGI).</li>
<li>There are a bunch of other protocols and acronyms in Asterisk, for example <a title="SRTP on Wikipedia" href="http://en.wikipedia.org/wiki/Secure_Real-time_Transport_Protocol">Secure Real-Time Protocol</a> (SRTP) and <a title="ZRTP on Wikipedia" href="http://en.wikipedia.org/wiki/ZRTP">ZRTP</a>, that could worth figuring out for a deeper understanding and security</li>
<li>There&#8217;s an <a title="Asterisk on Rasberry Pi" href="http://www.raspberry-asterisk.org/">Asterisk on Raspberry Pi</a> project that looks interesting (if nothing else then how do they lower the memory usage below the RPi&#8217;s &lt;512MB?). Since Asterisk can be used with multiple servers in a network, the RPi can provide one kind of service (e.g. <a title="GSM Dongle setup for Asterisk on Rasberry Pi" href="http://www.raspberry-asterisk.org/documentation/gsm-voip-gateway-with-chan_dongle/">GSM gateway</a>) while other servers with more resources do other stuff</li>
<li>Using physical phones in the network, for example traditional phone network to come into the server, and IP Phone to ring out.  Maybe setting up fax endpoint (and sending it out as PDF or printing it). Basically anything that is working on the threshold between physical and digital.</li>
<li>Should check out how the likes of <a title="Line" href="http://line.me/">Line</a>, <a title="Voxer home" href="https://voxer.com/">Voxer</a>, and <a title="Viber homepage" href="http://www.viber.com/">Viber</a> are doing VoIP on Android, do they have any interoperability?</li>
<li>How about <a title="Twillio" href="http://www.twilio.com/">Twillio</a>, can their system be a similar PBX on a much larger scale?</li>
</ul>
<p>The funny thing is that looks like the original IP phone that started this whole adventure does not work with Asterisk. Never mind, it will be good for another project.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2014/03/can-you-hear-me-now/">Personal phone server, or Can you hear me now?</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gergely.imreh.net/blog/2014/03/can-you-hear-me-now/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Switched to SPDY and now Google&#8217;s confused</title>
		<link>https://gergely.imreh.net/blog/2013/05/switched-to-spdy-and-now-googles-confused/</link>
					<comments>https://gergely.imreh.net/blog/2013/05/switched-to-spdy-and-now-googles-confused/#comments</comments>
		
		<dc:creator><![CDATA[Gergely Imreh]]></dc:creator>
		<pubDate>Sun, 26 May 2013 13:44:48 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[spdy]]></category>
		<category><![CDATA[webmaster]]></category>
		<guid isPermaLink="false">https://gergely.imreh.net/blog/?p=1393</guid>

					<description><![CDATA[<p>Recently switched my blog over to https/spdy, and google tells me that now I don't show up in search results, while other evidence shows that I do. What's going on?</p>
<p>The post <a href="https://gergely.imreh.net/blog/2013/05/switched-to-spdy-and-now-googles-confused/">Switched to SPDY and now Google&#8217;s confused</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Out of interest, I recently switched this site to <a title="SPDY on wikipedia" href="http://en.wikipedia.org/wiki/SPDY">SPDY</a>, party because I like to try out new things, and partly because I would want to make things be better and faster. So far it&#8217;s a mixed experience, with some puzzling changes, that I cannot make heads or tails of.</p>
<p>The first step for the switch was bringing everything onto HTTPS, which I have done with a <a title="StartSSL Free" href="http://www.startssl.com/?app=1">free SSL certificate</a> from StartSSL. Redirected everything from the HTTP to the secure connection, with the <a title="HTTP 301 Moved Permanently on Wikipedia" href="http://en.wikipedia.org/wiki/HTTP_301">301 http code</a> so I thought Google will be able to follow it well and replace the addresses in their index. Then enabled the <a title="SPDY module" href="http://nginx.org/en/docs/http/ngx_http_spdy_module.html">SPDY module</a> in Nginx, and <a title="SPDYcheck results of this site" href="http://spdycheck.org/#gergely.imreh.net">checking the result</a> looked like I was in business.</p>
<p>Some time has passed, and a scary graph started to manifest itself in Google Analytics:</p>
<p><figure id="attachment_1394" aria-describedby="caption-attachment-1394" style="width: 400px" class="wp-caption aligncenter"><a href="https://gergely.imreh.net/blog/wp-content/uploads/2013/05/impressions.png"><img loading="lazy" decoding="async" class="size-medium wp-image-1394" alt="Google Analytics impression count, the site has changed around May 8." src="https://gergely.imreh.net/blog/wp-content/uploads/2013/05/impressions-400x73.png" width="400" height="73" /></a><figcaption id="caption-attachment-1394" class="wp-caption-text">Google Analytics impression count, the site has changed around May 8.</figcaption></figure></p>
<p>Right after I have made the changes, my impression count on Google dropped like a brick, now being exactly 0. That&#8217;s not really the change I wanted to see. Digging more into it, though, it looks like I still have a constant stream of visitors from Google Search:</p>
<p><figure id="attachment_1397" aria-describedby="caption-attachment-1397" style="width: 400px" class="wp-caption aligncenter"><a href="https://gergely.imreh.net/blog/wp-content/uploads/2013/05/fromsearch.png"><img loading="lazy" decoding="async" class="size-medium wp-image-1397" alt="Visitor numbers from Google Search, same time interval as the impression count." src="https://gergely.imreh.net/blog/wp-content/uploads/2013/05/fromsearch-400x73.png" width="400" height="73" /></a><figcaption id="caption-attachment-1397" class="wp-caption-text">Visitor numbers from Google Search, same time interval as the impression count.</figcaption></figure></p>
<p>How can I have zero impressions, but still a half a dozen visitors from Search? The results in the Webmaster Tools mirror things: dropping impression count, no crawl errors, same or even better indexed count, and relatively good stats:</p>
<p><figure id="attachment_1398" aria-describedby="caption-attachment-1398" style="width: 273px" class="wp-caption aligncenter"><a href="https://gergely.imreh.net/blog/wp-content/uploads/2013/05/stats.png"><img loading="lazy" decoding="async" class="size-medium wp-image-1398" alt="Google Crawler stats, with a big spike when switched over HTTPS/SPDY when needed to reindex everything" src="https://gergely.imreh.net/blog/wp-content/uploads/2013/05/stats-273x400.png" width="273" height="400" /></a><figcaption id="caption-attachment-1398" class="wp-caption-text">Google Crawler stats, with a big spike when switched over HTTPS/SPDY when needed to reindex everything</figcaption></figure></p>
<p>The crawl seemed to have gotten a bit slower (the bottom plot of the three), but more consistent.</p>
<p>I wonder what could be the change, does the impression count depend on the method of access (http/https)? Or did I made some braking changes? If so, then why&#8217;s the conflicting information?</p>
<p>Being a scientist, my main concern is not actually the raw value of any visitor count, but understanding the reactions to my actions, and consistency of the &#8220;experimental results&#8221;.  I wonder what kind of technique I could use to debug all this?</p>
<p><strong>Update 2013/May/28: </strong></p>
<p>Following some recommendations from the comments, it looks like that the https:// version of my URL has to added to the Webmaster Tools separately. Now there&#8217;s a http://gergely.imreh.net and a https://gergely.imreh.net section as well. In the latter section, I can see that there are some impressions reported. Some weird things still exist: the sum of impressions from both is less than how many visitors I reportedly get from Google Search; the crawl stats is shared between the two sections (ie. the https version reports a lot of crawl stats even from the time there wasn&#8217;t https enabled), while most other data is separate for the two sections (e.g. impression, search queries, sitemaps). Still probably this is on the right path.</p>
<p><figure id="attachment_1406" aria-describedby="caption-attachment-1406" style="width: 400px" class="wp-caption aligncenter"><a href="https://gergely.imreh.net/blog/wp-content/uploads/2013/05/wmt_update.png"><img loading="lazy" decoding="async" class="size-medium wp-image-1406" alt="The impression count after adding a https version of my site's records to the Webmaster  Tools" src="https://gergely.imreh.net/blog/wp-content/uploads/2013/05/wmt_update-400x52.png" width="400" height="52" /></a><figcaption id="caption-attachment-1406" class="wp-caption-text">The impression count after adding a https version of my site&#8217;s records to the Webmaster Tools</figcaption></figure></p>
<p>After the Webmaster Tools changes, I have just switched the Google Analytics association from one WMT property to the other. Hopefully this will freak me out less, though it will likely take some days to see the changes in the result.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2013/05/switched-to-spdy-and-now-googles-confused/">Switched to SPDY and now Google&#8217;s confused</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gergely.imreh.net/blog/2013/05/switched-to-spdy-and-now-googles-confused/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Fighting forum spam</title>
		<link>https://gergely.imreh.net/blog/2013/01/fighting-forum-spam/</link>
					<comments>https://gergely.imreh.net/blog/2013/01/fighting-forum-spam/#respond</comments>
		
		<dc:creator><![CDATA[Gergely Imreh]]></dc:creator>
		<pubDate>Sun, 27 Jan 2013 02:16:33 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Cloudflare]]></category>
		<category><![CDATA[FluxBB]]></category>
		<category><![CDATA[ignite]]></category>
		<guid isPermaLink="false">http://gergely.imreh.net/blog/?p=1308</guid>

					<description><![CDATA[<p>Lessons learned from fighting spam on the Ignite Taipei forums, mostly by using Cloudflare to let them do the fighting.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2013/01/fighting-forum-spam/">Fighting forum spam</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>As one of the managers of <a title="Ignite Taipei homepage" href="http://ignitetaipei.tw">Ignite Taipei</a>, I&#8217;m trying to come up with new ways to let the community communicate, new ways to share information, advice and all. A while ago <a title="Post about the forum on the Ignite blog" href="http://ignitetaipei.tw/post/31923453405/new-forum-for-the-community">I have set up a forum</a> at <a href="http://bbs.ignitetaipei.tw/">http://bbs.ignitetaipei.tw/</a> and I thought that will be an interesting experiment. Well, so far it is useless for communication, but turned out to be a very interesting experience from the sysadmin point of view.</p>
<p>I used <a title="FluxBB homepage" href="http://fluxbb.org/">FluxBB</a>, because it looked simple enough, seemed to be quite fast (for low traffic volume at least), and well configurable. Except that within a very short time I run into a spam problem, so many fake users registered, and lots of algorithmically generated garbage text with a bit of advertisement here and there.</p>
<p>First I looked into FluxBB&#8217;s own solutions, and looks like it might not have been a great choice, because many of the spam-fighting plugins are out of date, or not supported anymore, or just a real pain to set up. The immediate practical step I could take was updating my security questions, roll my own version of &#8220;written with words, how much is 5 + 4?&#8221;, the regular low-tech captcha on FluxBB. Looks like the original answers are already in the database everywhere, so had to write my own set, which seemed to work for a while, cutting down on red-flagged registrations. But it&#8217;s not ideal, since I want to make this a dual-language forum (Ignite Taipei has both English &amp; Chinese as official language).</p>
<p>Instead I turned on email confirmation. When someone registers, the password is sent to their email and have to use that to sign in. It was okay for a tiny bit, then crazy registration boom happened. I think I might be the only one real member of the board (I said that it is a failure so far for communication:) and there are 500 other spam members. Looking at their email addresses, it seems all of them have Hotmail. That kinda suggests a giant failure at Hotmail to restrict automatic registration, which is probably a problem overall. I cannot just throw out Hotmail addresses either, because it&#8217;s a popular mail provider here in Taiwan too (my first email was Hotmail too, but that was a looooong time ago, before it was Microsoft property).</p>
<p>So captcha don&#8217;t work, email don&#8217;t work. What to do instead? At the time I was playing around with <a title="Cloudflare homepage" href="https://www.cloudflare.com">Cloudflare</a>, to act as an easy to use <a title="Content Delivery Network" href="http://en.wikipedia.org/wiki/Content_delivery_network">CDN</a>. I tried it before for our Ignite Taipei blog, which is hosted on Tumblr, and that doesn&#8217;t play well with Cloudflare unfortunately. Couldn&#8217;t use it for this blog before because of my DNS provider, but now I switched, so started playing with it again.</p>
<p><figure id="attachment_1309" aria-describedby="caption-attachment-1309" style="width: 500px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-1309" alt="The dashboard of the Cloudflare interface" src="http://gergely.imreh.net/blog/wp-content/uploads/2013/01/Cloudflare500.jpg" width="500" height="357" /><figcaption id="caption-attachment-1309" class="wp-caption-text">Cloudflare stats snapshot (parts of it)</figcaption></figure></p>
<p>Instead of enabling Cloudlfare for the entire ignitetaipei.tw domain, just turned it on for the forum, since it&#8217;s hosted elsewhere. And that totally did it. Spam stopped that very moment, and haven&#8217;t returned since. I think what happens is that Cloudflare knows globally a lot of web/forum/email span hosts, and can challenge them or generally ignore them. Can even see where those spammers are coming from.</p>
<p><figure id="attachment_1310" aria-describedby="caption-attachment-1310" style="width: 500px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-1310" alt="List of captured threats on the Cloudflare threats console" src="http://gergely.imreh.net/blog/wp-content/uploads/2013/01/CloudflareThreats500o.jpg" width="500" height="163" /><figcaption id="caption-attachment-1310" class="wp-caption-text">Cloudflare Threats Console</figcaption></figure></p>
<p>One weird (but actually not that surprising) thing is that the most active web crawler on the site (Cloudflare gives that info as well) was <a title="Baidu on Wikipedia" href="http://en.wikipedia.org/wiki/Baidu">Baidu</a> by far, so I guess more people knew about the site in China than elsewhere. Why&#8217;s that? Some forums that share vulnerable sites, or something like that? I barely had any Chinese content at that time, so it cannot be that. And since I turned on the threat control part, Baidu seem to have dropped quite a bit (submitted the site to Google so now that&#8217;s the busiest crawler).</p>
<p>All in all, Cloudflare is an interesting experiment. I can really mess up my DNS with it, and could blocked my own site for several hours, but in general it worth it. Just have to be careful. For example when testing, use their own name servers to check the information, and maybe instead if &#8220;automatic&#8221; time-to-live, set some very short time first. I usually use Google&#8217;s 8.8.8.8, and they pick up the first wrong setting really quickly, then it takes hours to pick up the correction I made just minutes after the first one.</p>
<p>After a bit of playing around, at least I have no spam anymore (keep fingers crossed). Now just have to get people to use the forums. :)</p>
<p>The post <a href="https://gergely.imreh.net/blog/2013/01/fighting-forum-spam/">Fighting forum spam</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gergely.imreh.net/blog/2013/01/fighting-forum-spam/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Laboratory 2.0 &#8211; a monitoring system</title>
		<link>https://gergely.imreh.net/blog/2012/10/laboratory-2-0-a-monitoring-system/</link>
					<comments>https://gergely.imreh.net/blog/2012/10/laboratory-2-0-a-monitoring-system/#comments</comments>
		
		<dc:creator><![CDATA[Gergely Imreh]]></dc:creator>
		<pubDate>Sun, 28 Oct 2012 14:03:15 +0000</pubDate>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Lab]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">http://gergely.imreh.net/blog/?p=1150</guid>

					<description><![CDATA[<p>Being lazy physicist programmer, I grab on every opportunity to automate things in our lab. Recently I had my first large scale chance to try out the technologies I was playing with in my spare time, and amaze my coworkers. And of course create something useful.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2012/10/laboratory-2-0-a-monitoring-system/">Laboratory 2.0 &#8211; a monitoring system</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Looks like that one of my specialty as a physicist, and contribution to the labs where I have worked so far, is bringing different kinds of programming techniques, and technologies to the table. I&#8217;m not saying I&#8217;m any better than many of the professors, post-docs, and students I&#8217;ve met so far (there are plenty of ingenious ones), it&#8217;s more like I experiment with different tools, have tried more of the cutting edge or recent technologies, did some web programming and could whip up something quick &#8211; that might not work very well at first, but does broaden the horizon for the rest of the people.</p>
<p>Also, I&#8217;m a lazy person, so want to automate as much as possible. That was on my mind recently when we have been preparing to do a vacuum-system <a title="Bake-out explanation on Wikipedia" href="http://en.wikipedia.org/wiki/Bake-out" target="_blank">bake-out</a>. It&#8217;s essentially a procedure to have a delicate experimental system, mostly made up of steel, glass, and stuff like that, closed up from the atmosphere, all the air pumped out, then heated up to high temperature (~150-300°C). One has to be careful, because things can break, there are temperature limitations for some materials, also on how quickly that temperature can change, requiring careful monitoring of the status of the system. And the whole thing takes something like two weeks or more. Perfect setting for automation.</p>
<h2>Set up the electronics</h2>
<p>The pressure measurements are done by some expensive other equipment so didn&#8217;t have to bother with that one yet, so set to work first on the temperature monitoring. Before it was a bunch of <a title="Thermocouple on Wikipedia" href="http://en.wikipedia.org/wiki/Thermocouple" target="_blank">thermocouples</a> and <a title="Multimeter on Wikipedia" href="http://en.wikipedia.org/wiki/Multimeter" target="_blank">multimeters</a>, requiring manual intervention and lots of labour. Instead, got some inspiration from <a title="Thermocouple Amplifier MAX31855 breakout board (MAX6675 upgrade) - v1.0" href="http://www.adafruit.com/products/269" target="_blank">Adafruit&#8217;s Thermocouple Breakout Board</a>, using the <a title="MAX31855 Cold-Junction Compensated Thermocouple-to-Digital Converter" href="http://www.maximintegrated.com/datasheet/index.mvp/id/7273" target="_blank">MAX31855</a> chip, and also from the <a title="Ocean Controls K Thermocouple Multiplexer Shield" href="http://www.oceancontrols.com.au/KTA-259.html" target="_blank">Thermocouple Multiplexer Shield</a>. It can handle only one channel, but can use some other chip together with it to switch between the different thermocouples, and so we can read it out one-by-one. The Adafruit board could only handle 1 channel, and the multiplexer shield was using an older chip for the measurement that I could not buy anymore. In the end, found a good analog multiplexer that one that is sold in the computer market here in Taipei, the <a title="CD4067B CMOS Single 16-Channel Analog Multiplexer/Demultiplexer" href="http://www.ti.com/product/cd4067b" target="_blank">CD4067B</a>, and it works pretty well.</p>
<p><figure id="attachment_1167" aria-describedby="caption-attachment-1167" style="width: 550px" class="wp-caption aligncenter"><a href="http://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack2.jpg"><img loading="lazy" decoding="async" class="size-large wp-image-1167" title="Breadboard setup for temperature monitoring" src="http://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack2-1024x768.jpg" alt="Breadboard setup for temperature monitoring Arduino" width="550" height="412" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack2-1024x768.jpg 1024w, https://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack2-500x375.jpg 500w, https://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack2-768x576.jpg 768w, https://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack2.jpg 2048w" sizes="auto, (max-width: 550px) 100vw, 550px" /></a><figcaption id="caption-attachment-1167" class="wp-caption-text">Breadboard setup for temperature monitoring with Arduino</figcaption></figure></p>
<p>Of course, setting it all up was quite a bit of fun times, as there were way too many gotchas along the way.</p>
<ul>
<li>MAX31855 is a <a title="Surface Mount Technology on Wikipedia" href="http://en.wikipedia.org/wiki/Surface-mount_technology" target="_blank">surface-mount</a> component, and haven&#8217;t worked with it before. Not too bad, and can be much neater, just takes some plactice</li>
<li>MAX31855 is a 3.3V circuit, so the CMOS voltage levels used by my <a title="Arduino Mega ADK on Arduino Wiki" href="http://www.arduino.cc/en/Main/ArduinoBoardADK" target="_blank">Arduino Mega ADK</a> had to be level shifted</li>
<li>Unlike the older chip, MAX31855 really needs differential input, and it&#8217;s much more sensitive to the environment. This required different kind of analog multiplexer than that board had</li>
<li>The Arduino Mega is a new model for me, and had some strange behaviour in terms of the serial communication</li>
<li>Surprisingly there are not too many options for 3.3V voltage regulators over here, just the LM1117, which is different from what others are using elsewhere</li>
<li>Lots of noise and stability issues until figured out what should be how. For example under no circumstance should touch the thermocouple to conducting surfaces, and avoid ground loops</li>
<li>While MAX31855 says it&#8217;s &#8220;cold-point compensated&#8221;, meaning that it accounts for the chip-s local temperature when measuring the thermocouple, it doesn&#8217;t appear completely compensated, meaning that we can have unexpected measurement change because the chip is heating up for example by being in a closed box.</li>
<li>Figuring out the right amount of time to wait between switching channels (375ms seems to be good enough, 500ms is totally fine)</li>
</ul>
<div>In the end, though, we did have a nice 16 channel thermocouple multiplexer, sending off the measurements onto an LCD screen and to the computer over an USB cable.</div>
<p><figure id="attachment_1166" aria-describedby="caption-attachment-1166" style="width: 550px" class="wp-caption aligncenter"><a href="http://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack.jpg"><img loading="lazy" decoding="async" class="size-large wp-image-1166" title="Temperature monitoring board" src="http://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack-1024x768.jpg" alt="Temperature monitoring board soldered" width="550" height="412" srcset="https://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack-1024x768.jpg 1024w, https://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack-500x375.jpg 500w, https://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack-768x576.jpg 768w, https://gergely.imreh.net/blog/wp-content/uploads/2012/10/temphack.jpg 2048w" sizes="auto, (max-width: 550px) 100vw, 550px" /></a><figcaption id="caption-attachment-1166" class="wp-caption-text">Temperature monitoring board in it&#8217;s lab setting with 16 thermocouple channels</figcaption></figure></p>
<p>This is then saved in a database, and can be accessed from elsewhere.</p>
<h2>Visualize!</h2>
<p>The thing that my co-workers were most amazed by wasn&#8217;t the electronics. Sure, they haven&#8217;t worked with Arduinos, but did do similar stuff. Instead they liked the monitoring interface much more, this is the one on the picture right here (can click to enlarge)</p>
<p><figure id="attachment_1151" aria-describedby="caption-attachment-1151" style="width: 550px" class="wp-caption aligncenter"><a href="http://gergely.imreh.net/blog/wp-content/uploads/2012/10/BOMon.png" target="_blank"><img loading="lazy" decoding="async" class="size-large wp-image-1151  " title="Bakeout Monitor" src="http://gergely.imreh.net/blog/wp-content/uploads/2012/10/BOMon-1024x586.png" alt="Bakeout Monitor  interface showing the vacuum system, temperatures, pressures and long term graphs" width="550" height="314" /></a><figcaption id="caption-attachment-1151" class="wp-caption-text">Bakeout Monitor interface (click image for full view)</figcaption></figure></p>
<p>It&#8217;s the schematic layout of our equipment, with the temperatures positioned where the actual sensors are. Also, the change of the measured values in time are also displayed with live scrolling.</p>
<p>I&#8217;m not saying it&#8217;s great. Thinking about it, the major insight that made it good for the rest of the people is that I realized how much more people understand visual data: the placement of the values to the corresponding locations on the schematics. That&#8217;s the only thing.</p>
<p>So inside it&#8217;s a <a title="MongoDB" href="http://www.mongodb.org/" target="_blank">MongoDB</a> database (learned from previous mistakes, using a replica-set at least), with <a title="Python homepage" href="http://www.python.org/" target="_blank">Python</a> scripts talking to the sensors and saving the data, <a title="NodeJS home page" href="http://nodejs.org/" target="_blank">NodeJS</a> /<a title="Smoothie Charts homepage" href="http://smoothiecharts.org/" target="_blank"> Smoothie Charts</a> for visualization (and plain old CSS positioning of <a title="&lt;input&gt; tag explanation" href="http://www.w3schools.com/tags/tag_input.asp">&lt;input&gt; tags</a> for the reading display), <a title="NGINX homepage" href="http://nginx.org/" target="_blank">nginx</a>&#8216;s upstream module for running two monitoring servers just in case. It&#8217;s mostly in the <a title="Bakeout code on Github" href="https://github.com/imrehg/bakeout" target="_blank">Github repo of the monitoring code</a>, as well as the <a title="Arduino temperature monitoring" href="https://github.com/imrehg/sketchbook/tree/master/Thermocouple5" target="_blank">Arduino sketch for talking to the electronics</a>.</p>
<p>It was actually quite fun to write it all, and the gradual improvements, trying the new tech, trying not to lose to much data, amazed how well it works. Especially had a good time learning about the database, scaling, fault tolerance, performance&#8230;</p>
<p>Of course there could be room for a lot more improvements.</p>
<ul>
<li>My failover-restart bash scripts are awful, though they do seem to work more or less and counteract the USB unreliablilities</li>
<li>There were some changes to Smoothie Charts that I could improve on: logarithmic plotting, some display enhancements, wonder if it can be more optimized for performance</li>
<li>More efficient data loading. 12h data is about 30Mb in JSON format, that I send compressed, apparently it gets down to ~5% in size, but it still takes quite a bit of time to process on the frontend</li>
<li>The layout now can be changed from config files if the sensors change, so co-workers can do that without programming knowledge. I wonder if that can be simplified even more</li>
</ul>
<p>Of course, I&#8217;m a person who generally overengineers stuff, so maybe it&#8217;s good to stop somewhere. And the somewhere might be when I got to the point to use my Kindle for monitoring (craps out on 1h data already, but some real time things are good enough).</p>
<p><figure id="attachment_1161" aria-describedby="caption-attachment-1161" style="width: 500px" class="wp-caption aligncenter"><a href="http://gergely.imreh.net/blog/wp-content/uploads/2012/10/bomon_kindle_opt1.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-1161" title="Bakeout Monitor on Kindle" src="http://gergely.imreh.net/blog/wp-content/uploads/2012/10/bomon_kindle_opt1.jpg" alt="Bakeout Monitor interface running on Kindle" width="500" height="416" /></a><figcaption id="caption-attachment-1161" class="wp-caption-text">Bakeout Monitor on running on Kindle 3, not perfect but does work</figcaption></figure></p>
<h2>Get on with it</h2>
<p>I did learn a lot along the way, and I&#8217;m sure that with this experience I will be let to do a little bit more in the lab in terms of programming ideas. I don&#8217;t like that the rest of the system is currently forced to be LabView, but that&#8217;s for another post, and there are so many things that can be improved in general as well. Let&#8217;s just go and do that.</p>
<p>The post <a href="https://gergely.imreh.net/blog/2012/10/laboratory-2-0-a-monitoring-system/">Laboratory 2.0 &#8211; a monitoring system</a> appeared first on <a href="https://gergely.imreh.net/blog">ClickedyClick</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://gergely.imreh.net/blog/2012/10/laboratory-2-0-a-monitoring-system/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Object Caching 22/131 objects using APC
Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: gergely.imreh.net @ 2026-06-21 13:51:32 by W3 Total Cache
-->