<?xml version="1.0" encoding="utf-8"?><!-- generator="b2evolution/4.1.3" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Persistent Waffle</title>
		<link>http://natox.be/blog/index.php/waffle/</link>
		<atom:link rel="self" type="application/rss+xml" href="http://natox.be/blog/index.php/waffle/?tempskin=_rss2" />
		<description></description>
		<language>en-US-utf8</language>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=4.1.3"/>
		<ttl>60</ttl>
				<item>
			<title>Indianio: rlimits crash</title>
			<link>http://natox.be/blog/index.php/waffle/2013/02/19/indianio-rlimits-crash</link>
			<pubDate>Tue, 19 Feb 2013 20:40:00 +0000</pubDate>			<dc:creator>davy</dc:creator>
			<category domain="alt">Univ</category>
<category domain="alt">Linux</category>
<category domain="main">At work</category>
<category domain="alt">Indianio</category>			<guid isPermaLink="false">21@http://natox.be/blog/</guid>
						<description>&lt;p&gt;[&lt;a href=&quot;https://indianio.ugent.be/&quot;&gt;&lt;span&gt;&lt;span&gt;Indianio&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; is an online hand-in assignment platform I develop and maintain &lt;a href=&quot;http://www.twi.ugent.be/&quot;&gt;at work&lt;/a&gt;. It checks what the students submit -file type, content of archives, etc.- and rejects if necessary. Accepted files can be processed further: compiling, converting to PDF, automatic unit-tests, etc. It even has integration with &lt;a href=&quot;http://www.bluej.org/&quot;&gt;BlueJ&lt;/a&gt; and &lt;a href=&quot;http://www.spoj.com/&quot;&gt;SPOJ&lt;/a&gt;.]&lt;br /&gt;&lt;br /&gt;As administrator of &lt;a href=&quot;https://indianio.ugent.be/&quot;&gt;&lt;span&gt;&lt;span&gt;Indianio&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;, I had the displeasure of watching it crash and burn a few weeks ago. During an exam. &lt;span&gt;Granted, the number of students was higher than &lt;span&gt;Indianio&lt;/span&gt; ever had to endure before. And all those students wanted to hand-in their solutions at the same time: at the end of the exam. But still, there were only 287 students...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When I received the phone call with the message that the server was unreachable, I immediately logged into the server. The Apache daemon had crashed, and the error log was filled with&lt;/p&gt;
&lt;pre&gt;[emerg] (43)Identifier removed: couldn&#039;t grab the accept mutex&lt;br /&gt;...&lt;br /&gt;[emerg] (22)Invalid argument: couldn&#039;t grab the accept mutex&lt;/pre&gt;
&lt;p&gt;After fiddling about a bit with &lt;a href=&quot;http://httpd.apache.org/docs/2.2/mod/mpm_common.html#AcceptMutex&quot;&gt;AcceptMutex&lt;/a&gt; (to no avail), I noticed the following lines, preceding the ones about mutexes:&lt;/p&gt;
&lt;pre&gt;[alert] (11)Resource temporarily unavailable: setuid: unable to change to uid: 33&lt;br /&gt;[alert] Child $p returned a Fatal error... Apache is exiting!&lt;/pre&gt;
&lt;p&gt;A resource exhaustion! The Apache server tried to use system resources, but ran into a limitation. Had I set my &lt;a href=&quot;http://linux.die.net/man/5/limits.conf&quot;&gt;limits.conf&lt;/a&gt; wrong? Turns out, kind of.&lt;/p&gt;
&lt;p&gt;To protect the server agains processing scripts that go haywire, there is a limit of 25 processes for all users that are part of the Indianio platform (group indianio). As it happens, the account that I use to administer server, is also a member of this group. But that poses no problem, because everything happens through &lt;code&gt;sudo&lt;/code&gt;, which resets the rlimits, right?&lt;/p&gt;
&lt;p&gt;Well, on my server, it didn&#039;t:&lt;/p&gt;
&lt;pre&gt;davy@indianio:~$ ulimit -u&lt;br /&gt;25&lt;br /&gt;davy@indianio:~$ sudo bash -c &quot;ulimit -u&quot;&lt;br /&gt;25&lt;/pre&gt;
&lt;p&gt;This limitation was also imposed on the Apache daemon and its subprocesses, after restarting it with &lt;code&gt;sudo /etc/init.d/apache2 restart&lt;/code&gt;. The output of the CGI-script I installed to verify my suspicion:&lt;/p&gt;
&lt;pre&gt;id
+ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
ulimit -u
+ ulimit -u
25&lt;/pre&gt;
&lt;p&gt;Oops...&lt;/p&gt;
&lt;p&gt;Note that this doesn&#039;t happen when restaring Apache with &lt;code&gt;apachectl&lt;/code&gt;, because that doesn&#039;t create a new process.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://natox.be/blog/index.php/waffle/2013/02/19/indianio-rlimits-crash&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>[<a href="https://indianio.ugent.be/"><span><span>Indianio</span></span></a> is an online hand-in assignment platform I develop and maintain <a href="http://www.twi.ugent.be/">at work</a>. It checks what the students submit -file type, content of archives, etc.- and rejects if necessary. Accepted files can be processed further: compiling, converting to PDF, automatic unit-tests, etc. It even has integration with <a href="http://www.bluej.org/">BlueJ</a> and <a href="http://www.spoj.com/">SPOJ</a>.]<br /><br />As administrator of <a href="https://indianio.ugent.be/"><span><span>Indianio</span></span></a>, I had the displeasure of watching it crash and burn a few weeks ago. During an exam. <span>Granted, the number of students was higher than <span>Indianio</span> ever had to endure before. And all those students wanted to hand-in their solutions at the same time: at the end of the exam. But still, there were only 287 students...</span></p>
<p>When I received the phone call with the message that the server was unreachable, I immediately logged into the server. The Apache daemon had crashed, and the error log was filled with</p>
<pre>[emerg] (43)Identifier removed: couldn't grab the accept mutex<br />...<br />[emerg] (22)Invalid argument: couldn't grab the accept mutex</pre>
<p>After fiddling about a bit with <a href="http://httpd.apache.org/docs/2.2/mod/mpm_common.html#AcceptMutex">AcceptMutex</a> (to no avail), I noticed the following lines, preceding the ones about mutexes:</p>
<pre>[alert] (11)Resource temporarily unavailable: setuid: unable to change to uid: 33<br />[alert] Child $p returned a Fatal error... Apache is exiting!</pre>
<p>A resource exhaustion! The Apache server tried to use system resources, but ran into a limitation. Had I set my <a href="http://linux.die.net/man/5/limits.conf">limits.conf</a> wrong? Turns out, kind of.</p>
<p>To protect the server agains processing scripts that go haywire, there is a limit of 25 processes for all users that are part of the Indianio platform (group indianio). As it happens, the account that I use to administer server, is also a member of this group. But that poses no problem, because everything happens through <code>sudo</code>, which resets the rlimits, right?</p>
<p>Well, on my server, it didn't:</p>
<pre>davy@indianio:~$ ulimit -u<br />25<br />davy@indianio:~$ sudo bash -c "ulimit -u"<br />25</pre>
<p>This limitation was also imposed on the Apache daemon and its subprocesses, after restarting it with <code>sudo /etc/init.d/apache2 restart</code>. The output of the CGI-script I installed to verify my suspicion:</p>
<pre>id
+ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
ulimit -u
+ ulimit -u
25</pre>
<p>Oops...</p>
<p>Note that this doesn't happen when restaring Apache with <code>apachectl</code>, because that doesn't create a new process.</p><div class="item_footer"><p><small><a href="http://natox.be/blog/index.php/waffle/2013/02/19/indianio-rlimits-crash">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://natox.be/blog/index.php/waffle/2013/02/19/indianio-rlimits-crash#comments</comments>
			<wfw:commentRss>http://natox.be/blog/index.php/waffle/?tempskin=_rss2&#38;disp=comments&#38;p=21</wfw:commentRss>
		</item>
				<item>
			<title>Living room LED lights</title>
			<link>http://natox.be/blog/index.php/waffle/2013/01/15/living-room-led-lights</link>
			<pubDate>Tue, 15 Jan 2013 09:26:00 +0000</pubDate>			<dc:creator>davy</dc:creator>
			<category domain="main">Projects</category>
<category domain="alt">Home</category>
<category domain="alt">Electronics</category>			<guid isPermaLink="false">18@http://natox.be/blog/</guid>
						<description>&lt;p class=&quot;image_block&quot;&gt;The sole purpose of this post is to show-off the new LED lighting in our living room.&lt;/p&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;a href=&quot;http://natox.be/blog/media/blogs/waffle/leds.jpg?mtime=1358240904&quot;&gt;&lt;img title=&quot;&quot; src=&quot;http://natox.be/blog/media/blogs/waffle/leds.jpg?mtime=1358240904&quot; alt=&quot;&quot; width=&quot;450&quot; height=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;image_block&quot;&gt; &lt;/div&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;a href=&quot;http://natox.be/blog/media/blogs/waffle/awwyiss.jpg?mtime=1358241733&quot;&gt;&lt;img src=&quot;http://natox.be/blog/media/blogs/waffle/awwyiss.jpg?mtime=1358241733&quot; alt=&quot;&quot; width=&quot;350&quot; height=&quot;235&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://natox.be/blog/index.php/waffle/2013/01/15/living-room-led-lights&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p class="image_block">The sole purpose of this post is to show-off the new LED lighting in our living room.</p>
<div class="image_block"><a href="http://natox.be/blog/media/blogs/waffle/leds.jpg?mtime=1358240904"><img title="" src="http://natox.be/blog/media/blogs/waffle/leds.jpg?mtime=1358240904" alt="" width="450" height="300" /></a></div>
<div class="image_block"> </div>
<div class="image_block"><a href="http://natox.be/blog/media/blogs/waffle/awwyiss.jpg?mtime=1358241733"><img src="http://natox.be/blog/media/blogs/waffle/awwyiss.jpg?mtime=1358241733" alt="" width="350" height="235" /></a></div><div class="item_footer"><p><small><a href="http://natox.be/blog/index.php/waffle/2013/01/15/living-room-led-lights">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://natox.be/blog/index.php/waffle/2013/01/15/living-room-led-lights#comments</comments>
			<wfw:commentRss>http://natox.be/blog/index.php/waffle/?tempskin=_rss2&#38;disp=comments&#38;p=18</wfw:commentRss>
		</item>
				<item>
			<title>Neil Badboy &#38; DJ Raz - The Master (Nightwalker Remix)</title>
			<link>http://natox.be/blog/index.php/waffle/2012/12/19/neil-badboy-dj-raz-the</link>
			<pubDate>Wed, 19 Dec 2012 08:32:00 +0000</pubDate>			<dc:creator>davy</dc:creator>
			<category domain="alt">At work</category>
<category domain="main">Music</category>			<guid isPermaLink="false">17@http://natox.be/blog/</guid>
						<description>&lt;p&gt;I just had to share this with you; marvelous song!&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;videoblock&quot;&gt;&lt;object data=&quot;http://www.youtube.com/v/URF4dKzWvfM&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/URF4dKzWvfM&quot; /&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot; /&gt;&lt;/object&gt;&lt;/div&gt;&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://natox.be/blog/index.php/waffle/2012/12/19/neil-badboy-dj-raz-the&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>I just had to share this with you; marvelous song!</p>
<p><div class="videoblock"><object data="http://www.youtube.com/v/URF4dKzWvfM" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"><param name="movie" value="http://www.youtube.com/v/URF4dKzWvfM" /><param name="wmode" value="transparent" /></object></div></p><div class="item_footer"><p><small><a href="http://natox.be/blog/index.php/waffle/2012/12/19/neil-badboy-dj-raz-the">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://natox.be/blog/index.php/waffle/2012/12/19/neil-badboy-dj-raz-the#comments</comments>
			<wfw:commentRss>http://natox.be/blog/index.php/waffle/?tempskin=_rss2&#38;disp=comments&#38;p=17</wfw:commentRss>
		</item>
				<item>
			<title>Onion</title>
			<link>http://natox.be/blog/index.php/waffle/2012/06/12/onion</link>
			<pubDate>Tue, 12 Jun 2012 13:45:00 +0000</pubDate>			<dc:creator>davy</dc:creator>
			<category domain="alt">Linux</category>
<category domain="main">At work</category>			<guid isPermaLink="false">16@http://natox.be/blog/</guid>
						<description>&lt;p&gt;I&#039;m currently working on my computer at work. Not local, but remotely, from a computer room during an exam. All the computers here are switched into exam mode, which means everything is filtered, except for access to the Citrix server and some other stuff. Using &lt;a href=&quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/&quot;&gt;putty&lt;/a&gt; on the Citrix server, I set up a tunnel to a server in the data center. On the desktop I&#039;m currently working on, something  similar was done in advance, in such a way that the two tunnels would connect. Next to putty, I&#039;m also running a &lt;a href=&quot;http://www.tightvnc.com/&quot;&gt;TightVNC&lt;/a&gt; viewer, connected, through those tunnels, with &lt;a href=&quot;http://www.kde.org/applications/system/krfb/&quot;&gt;krfb&lt;/a&gt;, which is sharing this desktop.&lt;/p&gt;
&lt;p&gt;I feel like a bug digging throught an onion!&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://natox.be/blog/index.php/waffle/2012/06/12/onion&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>I'm currently working on my computer at work. Not local, but remotely, from a computer room during an exam. All the computers here are switched into exam mode, which means everything is filtered, except for access to the Citrix server and some other stuff. Using <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">putty</a> on the Citrix server, I set up a tunnel to a server in the data center. On the desktop I'm currently working on, something  similar was done in advance, in such a way that the two tunnels would connect. Next to putty, I'm also running a <a href="http://www.tightvnc.com/">TightVNC</a> viewer, connected, through those tunnels, with <a href="http://www.kde.org/applications/system/krfb/">krfb</a>, which is sharing this desktop.</p>
<p>I feel like a bug digging throught an onion!</p><div class="item_footer"><p><small><a href="http://natox.be/blog/index.php/waffle/2012/06/12/onion">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://natox.be/blog/index.php/waffle/2012/06/12/onion#comments</comments>
			<wfw:commentRss>http://natox.be/blog/index.php/waffle/?tempskin=_rss2&#38;disp=comments&#38;p=16</wfw:commentRss>
		</item>
				<item>
			<title>ChAssNAS: buggy ethernet</title>
			<link>http://natox.be/blog/index.php/waffle/2012/03/15/chassnas-buggy-ethernet</link>
			<pubDate>Thu, 15 Mar 2012 21:46:00 +0000</pubDate>			<dc:creator>davy</dc:creator>
			<category domain="alt">Projects</category>
<category domain="alt">Home</category>
<category domain="alt">Arduino</category>
<category domain="alt">Electronics</category>
<category domain="main">ChAssNAS</category>
<category domain="alt">ChAssNAS</category>			<guid isPermaLink="false">15@http://natox.be/blog/</guid>
						<description>&lt;p&gt;Since I installed my &lt;a href=&quot;http://natox.be/blog/index.php/waffle/2011/10/29/chassnas-cheap-ass-network-attached&quot;&gt;ChAssNAS device (aka snake)&lt;/a&gt; in my basement, I&#039;ve been having problems with the ethernet connection. The thing becomes unreachable at seemingly random times and nothing but waiting helps. Restarting the entire thing, disabling and enabling the &lt;code&gt;eth0&lt;/code&gt; device, reconnecting the cable: no dice. I found &lt;a href=&quot;http://code.google.com/p/snake-os/issues/detail?id=11&quot;&gt;a thread on the issue tracker of snake-os&lt;/a&gt; in which some guys suggest that EMI/RFI are causing troubles. I tried their suggestion with a few ferrite beads I had lying around, but that didn&#039;t seem to improve anything.&lt;/p&gt;
&lt;p&gt;Instead of trying to improve my probably poor attempt at eliminating noise, I ordered a usb2ethernet thingy from DealExtreme. The idea was that this would suffice until I could replace the NS-K330 with a &lt;a href=&quot;http://www.raspberrypi.org/&quot;&gt;Raspberry Pi&lt;/a&gt;. But alas, delivery from Hong Kong seems to take more time than usual. Luckily, my ADSL-router also has a USB network connection: snake is now has an &lt;code&gt;eth1&lt;/code&gt; device, provided by &lt;code&gt;usbnet&lt;/code&gt; and ﻿﻿&lt;code&gt;cdc_ether&lt;/code&gt;. The connection is only USB1.1,  so the speed is not really that high, but it&#039;ll do for now.&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img style=&quot;border-style: initial; border-color: initial;&quot; src=&quot;http://natox.be/blog/media/blogs/waffle/chassnas/Foto0057.jpg?mtime=1331849717&quot; alt=&quot;&quot; width=&quot;400&quot; height=&quot;300&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Extra content! I found an old picture on my cellphone from when I first screwed around with the NS-K330. &#039;&#039;Twas the time that I bricked the board by flashing the wrong SnakeOS image (the one without bootloader, damn!). The only option was desoldering the flash chip and reflashing it with the proper firmware. Luckily, I had a Seeeduino lying around to reflash the 3.3v SPI chip. Instead of resoldering the flash chip in its original place, I did what you can see in the picture. I didn&#039;t want to risk a second tricky desolder operation, since the first already destroyed a trace...&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://natox.be/blog/index.php/waffle/2012/03/15/chassnas-buggy-ethernet&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>Since I installed my <a href="http://natox.be/blog/index.php/waffle/2011/10/29/chassnas-cheap-ass-network-attached">ChAssNAS device (aka snake)</a> in my basement, I've been having problems with the ethernet connection. The thing becomes unreachable at seemingly random times and nothing but waiting helps. Restarting the entire thing, disabling and enabling the <code>eth0</code> device, reconnecting the cable: no dice. I found <a href="http://code.google.com/p/snake-os/issues/detail?id=11">a thread on the issue tracker of snake-os</a> in which some guys suggest that EMI/RFI are causing troubles. I tried their suggestion with a few ferrite beads I had lying around, but that didn't seem to improve anything.</p>
<p>Instead of trying to improve my probably poor attempt at eliminating noise, I ordered a usb2ethernet thingy from DealExtreme. The idea was that this would suffice until I could replace the NS-K330 with a <a href="http://www.raspberrypi.org/">Raspberry Pi</a>. But alas, delivery from Hong Kong seems to take more time than usual. Luckily, my ADSL-router also has a USB network connection: snake is now has an <code>eth1</code> device, provided by <code>usbnet</code> and ﻿﻿<code>cdc_ether</code>. The connection is only USB1.1,  so the speed is not really that high, but it'll do for now.</p>
<p style="text-align: center;"><img style="border-style: initial; border-color: initial;" src="http://natox.be/blog/media/blogs/waffle/chassnas/Foto0057.jpg?mtime=1331849717" alt="" width="400" height="300" /></p>
<p>Extra content! I found an old picture on my cellphone from when I first screwed around with the NS-K330. ''Twas the time that I bricked the board by flashing the wrong SnakeOS image (the one without bootloader, damn!). The only option was desoldering the flash chip and reflashing it with the proper firmware. Luckily, I had a Seeeduino lying around to reflash the 3.3v SPI chip. Instead of resoldering the flash chip in its original place, I did what you can see in the picture. I didn't want to risk a second tricky desolder operation, since the first already destroyed a trace...</p><div class="item_footer"><p><small><a href="http://natox.be/blog/index.php/waffle/2012/03/15/chassnas-buggy-ethernet">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://natox.be/blog/index.php/waffle/2012/03/15/chassnas-buggy-ethernet#comments</comments>
			<wfw:commentRss>http://natox.be/blog/index.php/waffle/?tempskin=_rss2&#38;disp=comments&#38;p=15</wfw:commentRss>
		</item>
				<item>
			<title>Compiling a kernel module</title>
			<link>http://natox.be/blog/index.php/waffle/2012/02/03/compiling-a-kernel-module</link>
			<pubDate>Fri, 03 Feb 2012 21:48:00 +0000</pubDate>			<dc:creator>davy</dc:creator>
			<category domain="alt">Home</category>
<category domain="main">Linux</category>			<guid isPermaLink="false">14@http://natox.be/blog/</guid>
						<description>&lt;p&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;This post is mainly a note for myself, in case I need this again, but forgot (and I will, both).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To compile a module (e.g. fuse.ko) for a kernel of which you only have the headers (e.g. some &lt;a href=&quot;http://linaro.org&quot;&gt;linaro&lt;/a&gt; build for a Pandaboard), do the following:&lt;/p&gt;
&lt;pre&gt;make -C /lib/modules/3.1.1-8-linaro-lt-omap/build/ CONFIG_FUSE_FS=m SUBDIRS=$PWD/fs/fuse modules&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;The argument for -C compiles the module in the proper environment: the target kernel. The &quot;CONFIG_FUSE_FS&quot; enables building fuse as module (linaro default is n). What to build is restricted by SUBDIRS, in which $PWD is the location of the stock 3.1.1 source (similar enough), and the target &quot;modules&quot;.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://natox.be/blog/index.php/waffle/2012/02/03/compiling-a-kernel-module&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p><span style="font-size: xx-small;">This post is mainly a note for myself, in case I need this again, but forgot (and I will, both).</span></p>
<p>To compile a module (e.g. fuse.ko) for a kernel of which you only have the headers (e.g. some <a href="http://linaro.org">linaro</a> build for a Pandaboard), do the following:</p>
<pre>make -C /lib/modules/3.1.1-8-linaro-lt-omap/build/ CONFIG_FUSE_FS=m SUBDIRS=$PWD/fs/fuse modules</pre>
<p><br />The argument for -C compiles the module in the proper environment: the target kernel. The "CONFIG_FUSE_FS" enables building fuse as module (linaro default is n). What to build is restricted by SUBDIRS, in which $PWD is the location of the stock 3.1.1 source (similar enough), and the target "modules".</p><div class="item_footer"><p><small><a href="http://natox.be/blog/index.php/waffle/2012/02/03/compiling-a-kernel-module">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://natox.be/blog/index.php/waffle/2012/02/03/compiling-a-kernel-module#comments</comments>
			<wfw:commentRss>http://natox.be/blog/index.php/waffle/?tempskin=_rss2&#38;disp=comments&#38;p=14</wfw:commentRss>
		</item>
				<item>
			<title>ChAssNAS: activation</title>
			<link>http://natox.be/blog/index.php/waffle/2011/12/23/chassnas-activation</link>
			<pubDate>Fri, 23 Dec 2011 11:12:00 +0000</pubDate>			<dc:creator>davy</dc:creator>
			<category domain="alt">Projects</category>
<category domain="alt">Home</category>
<category domain="alt">Electronics</category>
<category domain="main">ChAssNAS</category>
<category domain="alt">ChAssNAS</category>			<guid isPermaLink="false">13@http://natox.be/blog/</guid>
						<description>&lt;p&gt;This week, I had some spare time and I had set my mind to looking into an easy way to activate ChAssNAS from &lt;a href=&quot;http://xbmc.org/&quot;&gt;XBMC&lt;/a&gt; (running on my &lt;a href=&quot;http://pandaboard.org/&quot;&gt;pandaboard&lt;/a&gt;, more on that later).&lt;/p&gt;
&lt;p&gt;As noted in my &lt;a href=&quot;http://natox.be/blog/index.php/waffle/2011/10/29/chassnas-cheap-ass-network-attached&quot;&gt;previous post&lt;/a&gt; on this project, the drives can be triggered from a local shell or by knocking on port 5002. However, neither is easily done from the XMBC interface. The most ideal solution would be activating on demand: when mountd receives a request for a volume that is not mounted nor present, it fires up the PSU to start all drives. Eventually, the requested volume shows up, it gets mounted and all is well.&lt;/p&gt;
&lt;p&gt;I decided to settle -for now- for an intermediate solution. When mountd receives a request for a volume with id &quot;&lt;code&gt;activate&lt;/code&gt;&quot;, it starts the drives. Since we know in advance there actually is no volume with this name, we don&#039;t have to worry about waiting for the device, etc. This would be necessary for true on-demand activation.&lt;/p&gt;
&lt;p&gt;With this set-up, I can add a &lt;em&gt;location&lt;/em&gt; to XBMC with path &lt;code&gt;/path/to/rfs/mount/.mounts/activate&lt;/code&gt; with name &quot;ChAssNAS activate&quot;. If the XMBC user tries to access this location, (s)he gets an error message but knows the drives are being started. After a few seconds, other locations become available, as the volumes are mounted on the ChAssNAS side.&lt;/p&gt;
&lt;p&gt;While testing these modifications to mountd (&lt;a href=&quot;http://natox.be/blog/media/blogs/waffle/chassnas/060-activate.patch?mtime=1324637555&quot;&gt;060-activate.patch&lt;/a&gt;) I ran into some odd behaviour. Both remotefs and mountd are started at boot time, through the init mechanism of OpenWRT. Whenever remotefs requests a non-existing path on the autofs mount created by mountd, the latter leaps into action and &lt;a href=&quot;http://www.youtube.com/watch?v=714-Ioa4XQw&quot;&gt;does whatever a mountd does&lt;/a&gt;. However, it didn&#039;t: mountd did not receive any autofs packages, until either was restarted from shell. After spending almost an entire day trying to find out what&#039;s wrong, I called MacGyver. He suggested starting remotefs right after mountd, through an SSH session. The current version of &lt;code&gt;/etc/init.d/mountd&lt;/code&gt; now contains the following line:&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: &#039;Courier New&#039;, monospace; line-height: 18px; white-space: pre;&quot;&gt;/usr/bin/dbclient -i /path/to/private.key &lt;/span&gt;&lt;span style=&quot;font-family: &#039;Courier New&#039;, monospace; line-height: 18px; white-space: pre;&quot;&gt;localhost &lt;br /&gt; &quot;PATH=/bin:/sbin:/usr/bin:/usr/sbin /etc/init.d/rfsd start&quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;For shame. But it works now.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://natox.be/blog/index.php/waffle/2011/12/23/chassnas-activation&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>This week, I had some spare time and I had set my mind to looking into an easy way to activate ChAssNAS from <a href="http://xbmc.org/">XBMC</a> (running on my <a href="http://pandaboard.org/">pandaboard</a>, more on that later).</p>
<p>As noted in my <a href="http://natox.be/blog/index.php/waffle/2011/10/29/chassnas-cheap-ass-network-attached">previous post</a> on this project, the drives can be triggered from a local shell or by knocking on port 5002. However, neither is easily done from the XMBC interface. The most ideal solution would be activating on demand: when mountd receives a request for a volume that is not mounted nor present, it fires up the PSU to start all drives. Eventually, the requested volume shows up, it gets mounted and all is well.</p>
<p>I decided to settle -for now- for an intermediate solution. When mountd receives a request for a volume with id "<code>activate</code>", it starts the drives. Since we know in advance there actually is no volume with this name, we don't have to worry about waiting for the device, etc. This would be necessary for true on-demand activation.</p>
<p>With this set-up, I can add a <em>location</em> to XBMC with path <code>/path/to/rfs/mount/.mounts/activate</code> with name "ChAssNAS activate". If the XMBC user tries to access this location, (s)he gets an error message but knows the drives are being started. After a few seconds, other locations become available, as the volumes are mounted on the ChAssNAS side.</p>
<p>While testing these modifications to mountd (<a href="http://natox.be/blog/media/blogs/waffle/chassnas/060-activate.patch?mtime=1324637555">060-activate.patch</a>) I ran into some odd behaviour. Both remotefs and mountd are started at boot time, through the init mechanism of OpenWRT. Whenever remotefs requests a non-existing path on the autofs mount created by mountd, the latter leaps into action and <a href="http://www.youtube.com/watch?v=714-Ioa4XQw">does whatever a mountd does</a>. However, it didn't: mountd did not receive any autofs packages, until either was restarted from shell. After spending almost an entire day trying to find out what's wrong, I called MacGyver. He suggested starting remotefs right after mountd, through an SSH session. The current version of <code>/etc/init.d/mountd</code> now contains the following line:</p>
<p><span style="font-family: 'Courier New', monospace; line-height: 18px; white-space: pre;">/usr/bin/dbclient -i /path/to/private.key </span><span style="font-family: 'Courier New', monospace; line-height: 18px; white-space: pre;">localhost <br /> "PATH=/bin:/sbin:/usr/bin:/usr/sbin /etc/init.d/rfsd start"</span></p>
<p>For shame. But it works now.</p><div class="item_footer"><p><small><a href="http://natox.be/blog/index.php/waffle/2011/12/23/chassnas-activation">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://natox.be/blog/index.php/waffle/2011/12/23/chassnas-activation#comments</comments>
			<wfw:commentRss>http://natox.be/blog/index.php/waffle/?tempskin=_rss2&#38;disp=comments&#38;p=13</wfw:commentRss>
		</item>
				<item>
			<title>ChAssNAS: Cheap-ass network-attached storage</title>
			<link>http://natox.be/blog/index.php/waffle/2011/10/29/chassnas-cheap-ass-network-attached</link>
			<pubDate>Sat, 29 Oct 2011 15:35:00 +0000</pubDate>			<dc:creator>davy</dc:creator>
			<category domain="main">Projects</category>
<category domain="alt">Home</category>
<category domain="alt">Electronics</category>
<category domain="alt">ChAssNAS</category>			<guid isPermaLink="false">11@http://natox.be/blog/</guid>
						<description>&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In this post, I would like to present my custom, cheap-ass NAS-like device. It is an embedded Linux device running &lt;a href=&quot;http://wiki.openwrt.org/&quot;&gt;OpenWRT&lt;/a&gt; with a bunch of (spare) hard disk attached to it through &lt;a href=&quot;http://www.dealextreme.com/p/usb-sata-ide-cable-set-474&quot;&gt;IDE/SATA-USB convertors&lt;/a&gt;. The device exposes the disk to my internal network through &lt;a href=&quot;http://www.samba.org/&quot;&gt;Samba&lt;/a&gt; and &lt;a href=&quot;http://remotefs.sourceforge.net/&quot;&gt;remotefs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The base of the project is a &lt;a href=&quot;http://www.dealextreme.com/p/standalone-bittorrent-bt-client-usb-nas-ftp-samba-printer-upnp-sharing-network-lan-server-26320&quot;&gt;NS-K330 I bought from DealExtreme&lt;/a&gt; already quite some time ago. It features a CNS2132/str8132/﻿FA526 (it depends on who you ask) ARMv4 core with Ethernet and two USB 2.0 ports. I didn&#039;t like the idea of having the disk(s) running continuously, so I wanted to make something with an on-demand activation. The entire contraption is powered by an old ATX-PSU and the disks can be activated from across the network.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hardware&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;a href=&quot;http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7655s.JPG?mtime=1319383692&quot;&gt;&lt;img src=&quot;http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7655s.JPG?mtime=1319383692&quot; alt=&quot;&quot; width=&quot;400&quot; height=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;In the first picture, on the right, you can see the custom-made male &lt;a href=&quot;http://en.wikipedia.org/wiki/Atx#Power_supply&quot;&gt;24pin power supply connector&lt;/a&gt;: a bunch of nails fixed with hot glue and some wires attached to it. The NS-K330 board is connected to the &lt;em&gt;+5V standby power&lt;/em&gt; pin, so if the PSU is connected to the grid, the device runs. The yellow wire is connected to &lt;em&gt;PS_ON:&lt;/em&gt; an ATX power supply is activated by pulling that pin to ground. The NS-K330 board has 4 leds that can be controlled from software. In hardware, this is also done by connecting something to ground. By connecting the yellow wire to the the cathode pin of one of the leds, the PSU can be started by triggering that led. The hard drives are powered through the molex connectors of the PSU, which means they only run when the led is lit.&lt;/p&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;a href=&quot;http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7656s.JPG?mtime=1319383682&quot;&gt;&lt;img src=&quot;http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7656s.JPG?mtime=1319383682&quot; alt=&quot;&quot; width=&quot;400&quot; height=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;The PSU was recovered from an old Dell PC. The &lt;a href=&quot;http://pinouts.ru/Power/dell_atxpower_pinout.shtml&quot;&gt;pin-out of the connector&lt;/a&gt;, I discovered, is different from a standard ATX power plug. Wtf, Dell? The board is attached to the back plate of an old PC case. I also recycled an old case fan (or perhaps it was a PSU fan) to create a bit of airflow. The extra heatsink on the CPU (a quarter of a Pentium heatsink) hopefully reduces the temperature a bit.&lt;/p&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;a href=&quot;http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7657s.JPG?mtime=1319383666&quot;&gt;&lt;img src=&quot;http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7657s.JPG?mtime=1319383666&quot; alt=&quot;&quot; width=&quot;400&quot; height=&quot;333&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;The third picture shows a test setup with one disk and a USB flash drive. I&#039;m still waiting for the&lt;a href=&quot;http://www.dealextreme.com/p/mini-rectangle-shape-usb-2-0-hi-speed-4-port-hub-480mbps-45773&quot;&gt; USB hubs&lt;/a&gt; I ordered from DealExtreme. The idea is that they will also be powered by the PSU (I just noticed there is no port for external power, damn! Ah well, some more DIY I guess), which means that the IDE-USB convertors would also be powered down when not in use.&lt;/p&gt;
&lt;h2&gt;Software&lt;/h2&gt;
&lt;p&gt;The default firmware was at first replaced with &lt;a href=&quot;http://code.google.com/p/snake-os/&quot;&gt;snake-os&lt;/a&gt;, a environment developed for devices based on this chip, but now it runs the cns21xx flavour of &lt;a href=&quot;http://wiki.openwrt.org/&quot;&gt;OpenWRT&lt;/a&gt; backfire. This port is still work in progress (although it works just fine) and has to be built from source. OpenWRT contains a package called &lt;a href=&quot;http://wiki.openwrt.org/doc/uci/mountd&quot;&gt;mountd&lt;/a&gt;, that uses AutoFS to mount and umount attached volumes on demand. I did modify the code a bit: a device is now mounted on a directory named after its serial instead of the block name (&lt;a href=&quot;http://natox.be/blog/media/blogs/waffle/chassnas/050-chassnas.patch?mtime=1319900754&quot;&gt;050-chassnas.patch&lt;/a&gt;), and the serial is computed differently (&lt;a href=&quot;http://natox.be/blog/media/blogs/waffle/chassnas/040-serial.patch?mtime=1319900754&quot;&gt;040-serial.patch&lt;/a&gt;).&lt;/p&gt;
&lt;h3&gt;Activation&lt;/h3&gt;
&lt;p&gt;For now, the hard drives can be activated from on the device itself (it runs a &lt;a href=&quot;http://matt.ucc.asn.au/dropbear/dropbear.html&quot;&gt;Dropbear SSH server&lt;/a&gt;, included in OpenWRT) and by port-knocking on port 5002 (that&#039;s remotefs + 1). That last bit was surprisingly easy to set up: there is an iptables LED target to trigger leds on network events. &lt;a href=&quot;http://www.youtube.com/watch?v=TebUMhJAKSM&quot;&gt;Niceee&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Later, I will try to integrate the activation (and perhaps deactivation) into mountd. In a way, the patches above are already working in that direction.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://natox.be/blog/index.php/waffle/2011/10/29/chassnas-cheap-ass-network-attached&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this post, I would like to present my custom, cheap-ass NAS-like device. It is an embedded Linux device running <a href="http://wiki.openwrt.org/">OpenWRT</a> with a bunch of (spare) hard disk attached to it through <a href="http://www.dealextreme.com/p/usb-sata-ide-cable-set-474">IDE/SATA-USB convertors</a>. The device exposes the disk to my internal network through <a href="http://www.samba.org/">Samba</a> and <a href="http://remotefs.sourceforge.net/">remotefs</a>.</p>
<p>The base of the project is a <a href="http://www.dealextreme.com/p/standalone-bittorrent-bt-client-usb-nas-ftp-samba-printer-upnp-sharing-network-lan-server-26320">NS-K330 I bought from DealExtreme</a> already quite some time ago. It features a CNS2132/str8132/﻿FA526 (it depends on who you ask) ARMv4 core with Ethernet and two USB 2.0 ports. I didn't like the idea of having the disk(s) running continuously, so I wanted to make something with an on-demand activation. The entire contraption is powered by an old ATX-PSU and the disks can be activated from across the network.</p>
<p><strong>Hardware</strong></p>
<div class="image_block"><a href="http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7655s.JPG?mtime=1319383692"><img src="http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7655s.JPG?mtime=1319383692" alt="" width="400" height="300" /></a></div>
<p>In the first picture, on the right, you can see the custom-made male <a href="http://en.wikipedia.org/wiki/Atx#Power_supply">24pin power supply connector</a>: a bunch of nails fixed with hot glue and some wires attached to it. The NS-K330 board is connected to the <em>+5V standby power</em> pin, so if the PSU is connected to the grid, the device runs. The yellow wire is connected to <em>PS_ON:</em> an ATX power supply is activated by pulling that pin to ground. The NS-K330 board has 4 leds that can be controlled from software. In hardware, this is also done by connecting something to ground. By connecting the yellow wire to the the cathode pin of one of the leds, the PSU can be started by triggering that led. The hard drives are powered through the molex connectors of the PSU, which means they only run when the led is lit.</p>
<div class="image_block"><a href="http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7656s.JPG?mtime=1319383682"><img src="http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7656s.JPG?mtime=1319383682" alt="" width="400" height="300" /></a></div>
<p>The PSU was recovered from an old Dell PC. The <a href="http://pinouts.ru/Power/dell_atxpower_pinout.shtml">pin-out of the connector</a>, I discovered, is different from a standard ATX power plug. Wtf, Dell? The board is attached to the back plate of an old PC case. I also recycled an old case fan (or perhaps it was a PSU fan) to create a bit of airflow. The extra heatsink on the CPU (a quarter of a Pentium heatsink) hopefully reduces the temperature a bit.</p>
<div class="image_block"><a href="http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7657s.JPG?mtime=1319383666"><img src="http://natox.be/blog/media/blogs/waffle/chassnas/IMG_7657s.JPG?mtime=1319383666" alt="" width="400" height="333" /></a></div>
<p>The third picture shows a test setup with one disk and a USB flash drive. I'm still waiting for the<a href="http://www.dealextreme.com/p/mini-rectangle-shape-usb-2-0-hi-speed-4-port-hub-480mbps-45773"> USB hubs</a> I ordered from DealExtreme. The idea is that they will also be powered by the PSU (I just noticed there is no port for external power, damn! Ah well, some more DIY I guess), which means that the IDE-USB convertors would also be powered down when not in use.</p>
<h2>Software</h2>
<p>The default firmware was at first replaced with <a href="http://code.google.com/p/snake-os/">snake-os</a>, a environment developed for devices based on this chip, but now it runs the cns21xx flavour of <a href="http://wiki.openwrt.org/">OpenWRT</a> backfire. This port is still work in progress (although it works just fine) and has to be built from source. OpenWRT contains a package called <a href="http://wiki.openwrt.org/doc/uci/mountd">mountd</a>, that uses AutoFS to mount and umount attached volumes on demand. I did modify the code a bit: a device is now mounted on a directory named after its serial instead of the block name (<a href="http://natox.be/blog/media/blogs/waffle/chassnas/050-chassnas.patch?mtime=1319900754">050-chassnas.patch</a>), and the serial is computed differently (<a href="http://natox.be/blog/media/blogs/waffle/chassnas/040-serial.patch?mtime=1319900754">040-serial.patch</a>).</p>
<h3>Activation</h3>
<p>For now, the hard drives can be activated from on the device itself (it runs a <a href="http://matt.ucc.asn.au/dropbear/dropbear.html">Dropbear SSH server</a>, included in OpenWRT) and by port-knocking on port 5002 (that's remotefs + 1). That last bit was surprisingly easy to set up: there is an iptables LED target to trigger leds on network events. <a href="http://www.youtube.com/watch?v=TebUMhJAKSM">Niceee</a>.</p>
<p>Later, I will try to integrate the activation (and perhaps deactivation) into mountd. In a way, the patches above are already working in that direction.</p><div class="item_footer"><p><small><a href="http://natox.be/blog/index.php/waffle/2011/10/29/chassnas-cheap-ass-network-attached">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://natox.be/blog/index.php/waffle/2011/10/29/chassnas-cheap-ass-network-attached#comments</comments>
			<wfw:commentRss>http://natox.be/blog/index.php/waffle/?tempskin=_rss2&#38;disp=comments&#38;p=11</wfw:commentRss>
		</item>
			</channel>
</rss>
