<?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>Elfstone</title>
	<atom:link href="http://elfstone.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://elfstone.nl</link>
	<description>Don&#039;t believe the hype</description>
	<lastBuildDate>Sun, 03 Feb 2013 17:34:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Shofanduino 2</title>
		<link>http://elfstone.nl/2013/02/03/shofanduino-2/</link>
		<comments>http://elfstone.nl/2013/02/03/shofanduino-2/#comments</comments>
		<pubDate>Sun, 03 Feb 2013 17:21:06 +0000</pubDate>
		<dc:creator>michiel</dc:creator>
				<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://elfstone.nl/?p=535</guid>
		<description><![CDATA[Today I&#8217;ve installed a second version of shofanduino, one with a digital sensor. The old (analog) sensor is replaced with the digital one and this is what the analog sensor looks like after a couple of months: It was cleaned &#8230; <a href="http://elfstone.nl/2013/02/03/shofanduino-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Today I&#8217;ve installed a second version of shofanduino, one with a digital sensor. The old (analog) sensor is replaced with the digital one and this is what the analog sensor looks like after a couple of months:</p>
<p><a href="http://elfstone.nl/uploads/2013/02/humidity-sensor.jpg"><img src="http://elfstone.nl/uploads/2013/02/humidity-sensor-1024x668.jpg" alt="Exif_JPEG_PICTURE" width="584" height="380" class="aligncenter size-large wp-image-536" /></a></p>
<p>It was cleaned a couple of months ago when I noticed it was giving more noisy readings. The noisy readings didn&#8217;t stop after cleaning and you can see why in the image: lots of dirt on the sensor itself (the one with the protective blue casing) and white stuff on the contacts. That can&#8217;t be good!</p>
<p>Below you can see the difference in sensor readings (both taken at the same time). You can see that the second one is much smoother.</p>
<p><a href="http://elfstone.nl/uploads/2013/02/humidity.png"><img src="http://elfstone.nl/uploads/2013/02/humidity.png" alt="shofanduino" width="497" height="340" class="aligncenter size-full wp-image-541" /></a></p>
<p><a href="http://elfstone.nl/uploads/2013/02/shofanduino2.png"><img src="http://elfstone.nl/uploads/2013/02/shofanduino2.png" alt="shofanduino2" width="497" height="352" class="aligncenter size-full wp-image-542" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://elfstone.nl/2013/02/03/shofanduino-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shofanduino</title>
		<link>http://elfstone.nl/2012/11/05/shofanduino/</link>
		<comments>http://elfstone.nl/2012/11/05/shofanduino/#comments</comments>
		<pubDate>Mon, 05 Nov 2012 19:22:28 +0000</pubDate>
		<dc:creator>michiel</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://elfstone.nl/?p=511</guid>
		<description><![CDATA[A shower fan Arduino project. Shofanduino uses an Arduino to measure the humidity in the bathroom and bypasses a 3-way switch with relays to turn on the shower fan (240 Volts). Shofanduino will autodetect when to switch on and off &#8230; <a href="http://elfstone.nl/2012/11/05/shofanduino/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A shower fan Arduino project.</p>
<p>Shofanduino uses an Arduino to measure the humidity in the bathroom and bypasses<br />
a 3-way switch with relays to turn on the shower fan (240 Volts). Shofanduino<br />
will autodetect when to switch on and off by keeping track of humidity data and<br />
then automatically selecting tresholds.</p>
<p>The shower fan is normally controlled by a 3-way switch: slow, medium and high<br />
speed. When the shower is on, the switch should be set to high to prevent mold<br />
in the bathroom. Unfortunately, the switch is located in the kitchen (the fan also<br />
sucks air from the kitchen and other parts of the house), not really convenient.</p>
<p>Obviously, this needed to be automated, which I did.</p>
<p>Future improvements:</p>
<ul>
<li>Use a smaller Arduino (Teensy 2)</li>
<li>Insulate humidity sensor circuit against moisture&#8230;</li>
<li>Tidy up connections and cables</li>
</ul>
<p>Using Teensy has the additional benefit that the Arduino doesn&#8217;t reset whenever you connect on the USB serial (which causes shofanduino to reset the thresholds, not what you want).</p>
<p>Please check out <a href="https://github.com/mjholtkamp/shofanduino" title="Shofanduino on github" target="_blank">Shofanduino on github</a>. Pictures and more explanations below.</p>
<p>Humidity sensor in the bathroom:<br />
<a href="http://elfstone.nl/uploads/2012/11/R0018335.jpg"><img src="http://elfstone.nl/uploads/2012/11/R0018335.jpg" alt="" title="Humidity sensor in the bathroom" width="979" height="779" class="alignright size-full wp-image-517" /></a><br />
The humidity sensor gives me some problems (see also plots below), I might have to insulate it against moisture (ironic).</p>
<p>Arduino and relays on a board:<br />
<a href="http://elfstone.nl/uploads/2012/11/R0018338.jpg"><img src="http://elfstone.nl/uploads/2012/11/R0018338-1024x768.jpg" alt="" title="Arduino and relays on a board" width="584" height="438" class="alignright size-large wp-image-518" /></a></p>
<p>The black USB cable provides power and is used to get the information to plot the data below. The grey cable from the Arduino to the white box is used to switch the relays (in the white box). The frayed, badly connected UTP cable runs through the air ducts and is connected to the sensor (see top image). In the picture you can also see that the Shofanduino is basically between the normal plug and the normal outlet (they are <a href="http://en.wikipedia.org/wiki/Perilex" target="_blank">Perilex</a> by the way).</p>
<p>Example plot of humidity data (day):<br />
<img src="https://github.com/mjholtkamp/shofanduino/raw/master/plots/humidity-day.png" alt="plot" /><br />
You can see I took a shower slightly after 8:00 am. The rest of the day, sometimes you see a small peak in the humidity readings. I don&#8217;t know for sure what this is, but I think this is sensor noise or interference because of moisture on the circuit. I hope this will go away after I insulate the circuit.</p>
<p>Example plot of humidity data (week):<br />
<img src="https://raw.github.com/mjholtkamp/shofanduino/master/plots/humidity-week.png" alt="plot" /><br />
Here you see the data over one week. You can see the top reading (deviation) drop slowly over time and go up on November 5th. This deviation is basically the difference between the maximum reading and the average. It is used to automatically select the tresholds so you don&#8217;t have to configure anything, just plug it in. More detailed information can be found in the <a href="https://github.com/mjholtkamp/shofanduino/blob/master/README" target="_blank">README of the github project</a>.</p>
<p>Breadboard design:<br />
<a href="https://raw.github.com/mjholtkamp/shofanduino/master/design/shofanduino_bb.png"><img src="http://elfstone.nl/uploads/2012/11/shofanduino_bb-1024x735.png" alt="Breadboard of shofanduino" title="shofanduino_bb" width="584" height="419" class="alignright size-large wp-image-513" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://elfstone.nl/2012/11/05/shofanduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fighting spam: Sender Policy Framework</title>
		<link>http://elfstone.nl/2012/07/24/fighting-spam-sender-policy-framework/</link>
		<comments>http://elfstone.nl/2012/07/24/fighting-spam-sender-policy-framework/#comments</comments>
		<pubDate>Tue, 24 Jul 2012 07:07:53 +0000</pubDate>
		<dc:creator>michiel</dc:creator>
				<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://elfstone.nl/?p=501</guid>
		<description><![CDATA[Lately, I got a lot of spam claiming to come from me. I don&#8217;t use a spam filter because I think most spam can be stopped by enforcing strict checks on the (incoming) mail servers. I know it&#8217;s only a &#8230; <a href="http://elfstone.nl/2012/07/24/fighting-spam-sender-policy-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Lately, I got a lot of spam claiming to come from me. I don&#8217;t use a spam filter because I think most spam can be stopped by enforcing strict checks on the (incoming) mail servers. I know it&#8217;s only a matter of time before the spammers will adapt and be more strict as well, but I&#8217;m happy about that because then at least they will confirm to the standards ;)</p>
<p>Anyway, because I was sick of deleting the spam (I rarely got spam until recently), I was looking for a way to stop it without using a spam filter. Then I remembered SPF. I never got around to enabling it, so I did. It turned out a lot simpler than I thought so I&#8217;m happy I took the effort to do it. Should&#8217;ve done this a long time ago.</p>
<p>Enabling SPF is basically done in two parts: DNS and mail server. The DNS part makes sure that all incoming mail servers (not only yours, but others as well) that support SPF can check if the sender is allowed to send mail in your name (the domain name of the sender, to be precise). How this is done is explained pretty extensively on the Wikipedia article on SPF: <a href="http://en.wikipedia.org/wiki/Sender_Policy_Framework#Implementation">http://en.wikipedia.org/wiki/Sender_Policy_Framework#Implementation</a>.</p>
<p>The mail server part basically checks the domain name of the sender, to see if it is setup for SPF. If it is, this info is used to check if the sender IP-address is allowed to send mail with that domain name as sender address. Ubuntu has an excellent page on how to enable this for postfix (the mail server I&#8217;m using): <a href="https://help.ubuntu.com/community/Postfix/SPF">https://help.ubuntu.com/community/Postfix/SPF</a></p>
<p>Let&#8217;s see what the spammers will come up next, after they comply to the standards :)</p>
<p><em>Update: SPF will still pass fake &#8216;From: your@domain.tld&#8217; if they supply a &#8220;HELO&#8221; and/or &#8220;MAIL FROM:&#8221; with a domain that does not have SPF. Oh well, you can&#8217;t have it all!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://elfstone.nl/2012/07/24/fighting-spam-sender-policy-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Irssi trackbar resize</title>
		<link>http://elfstone.nl/2012/07/02/irssi-trackbar-resize/</link>
		<comments>http://elfstone.nl/2012/07/02/irssi-trackbar-resize/#comments</comments>
		<pubDate>Mon, 02 Jul 2012 22:52:04 +0000</pubDate>
		<dc:creator>michiel</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://elfstone.nl/?p=482</guid>
		<description><![CDATA[[Update: this is not stable yet, after using it for a while, the trackbar sometimes disappears. It reappears after resizing your window. This is not what I wanted! I'll investigate further. In the mean time, feel free to try my &#8230; <a href="http://elfstone.nl/2012/07/02/irssi-trackbar-resize/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>[<strong>Update</strong>: this is <strong>not stable</strong> yet, after using it for a while, the trackbar sometimes disappears. It reappears after resizing your window. This is not what I wanted! I'll investigate further. In the mean time, feel free to try my patch, but be aware that this glitch might occur]</p>
<p>If you are using irssi with the trackbar.pl plugin, you might know the annoyance that the trackbar doesn&#8217;t resize when the terminal width changes. This is especially annoying if the terminal width decreases; the trackbar spans several lines.</p>
<p>This bug is known, the bug is listed in the source (version 1.4):<br />
<code><br />
    - if you resize your irssi (in xterm or so) the bar is not resized<br />
</code></p>
<p>My new version fixes this, but it was a bit more complex than I thought (see below for technical details). I&#8217;ve contacted the original author, because I want to update the version on <a href="http://scripts.irssi.org/">scripts.irssi.org</a> so everyone can benefit from my patch.</p>
<p>Downloads:</p>
<ul>
<li><a href='http://elfstone.nl/uploads/2012/07/trackbar.pl_.txt'>trackbar.pl version 1.5 (new)</a></li>
<li><a href='http://elfstone.nl/uploads/2012/07/trackbar-v1.4-v1.5.diff_.txt'>Changes between trackbar.pl 1.4 and 1.5</a></li>
</ul>
<p>Technical details:<br />
First, I&#8217;ve added a signal handler for &#8216;terminal resized&#8217;. I&#8217;ve based this on <a href="http://scripts.irssi.org/scripts/nicklist.pl">nicklist.pl</a>. I&#8217;ve added resize_trackbar() (called by the signal handler after a delay), which loops over all windows in irssi and tries to find a trackbar. If this is found, it will add a new trackbar with the new width after the old trackbar and sets the bookmark to that trackbar, so it can be found later. Finally, the trackbar with the old width is removed. After all windows have been treated like this, the current window is redrawn, to get rid of potential artifacts.</p>
<p>My original idea was a bit different: I wanted to replace the old trackbar with the new one. This wasn&#8217;t possible; only insert and remove functions were provided with irssi. Then I wanted to remove the old one and insert the new (by saving a reference to the previous line and inserting it after). This created a weird glitch: if the trackbar wasn&#8217;t the bottom line before the switch, irssi wouldn&#8217;t scroll down to the bottom line (so the bottom line was hidden). The line wasn&#8217;t gone: if you would switch to another window and back (thus resetting the trackbar to the bottom), the line reappeared. This looks like a bug/glitch in irssi. Somehow, when the remove action is done last (or when the a line is added to the end of the buffer), this glitch does not occur [Update: sorry, it does, but much less often!]. To my laymen eyes, it seems that irssi is not designed to have lines inserted midway :)</p>
]]></content:encoded>
			<wfw:commentRss>http://elfstone.nl/2012/07/02/irssi-trackbar-resize/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gaki no Tsukai&#8217;s: No Laughing Spy</title>
		<link>http://elfstone.nl/2012/05/06/gaki-no-tsukai-s-no-laughing-spy/</link>
		<comments>http://elfstone.nl/2012/05/06/gaki-no-tsukai-s-no-laughing-spy/#comments</comments>
		<pubDate>Sun, 06 May 2012 14:13:02 +0000</pubDate>
		<dc:creator>michiel</dc:creator>
				<category><![CDATA[Comedy]]></category>
		<category><![CDATA[Japan]]></category>

		<guid isPermaLink="false">http://elfstone.nl/?p=463</guid>
		<description><![CDATA[It&#8217;s been a while since I&#8217;ve seen a Gaku no Tsukai &#8220;No Laughing&#8221; Batsu game, a New Year&#8217;s eve special made by Japanese comedians. I saw the &#8220;No laughing spy&#8221; (aired on the New Year&#8217;s eve of 2010-2011) recently and &#8230; <a href="http://elfstone.nl/2012/05/06/gaki-no-tsukai-s-no-laughing-spy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been a while since I&#8217;ve seen a Gaku no Tsukai &#8220;No Laughing&#8221; <a href="http://en.wikipedia.org/wiki/Downtown_no_Gaki_no_Tsukai_ya_Arahende!!#Batsu_Games" title="Batsu games" target="_blank">Batsu game</a>, a New Year&#8217;s eve special made by Japanese comedians. I saw the &#8220;No laughing spy&#8221; (aired on the New Year&#8217;s eve of 2010-2011) recently and wanted to share this happiness.</p>
<p>For those of you who haven&#8217;t heard about this: the comedians that lost a bet (not shown, but aired before) have to reside for 24 hours in a setting where they are confronted with strange situations designed to make them laugh. Each time they laugh, &#8220;punishers&#8221; come out to hit them on the buttocks with an object.</p>
<p>The situations are often funny, sometimes not so, sometimes hilarious, but the thing I like the most is when the comedians make each other laugh (and often themselves too), resulting in even more punishment.</p>
<p>The &#8220;<a href="http://www.veoh.com/find/?query=gnt+no+laughing+spy" title="No Laughing Spy" target="_blank">No laughing spy</a>&#8221; broadcast is almost 5 hours long. It is split up in &#8220;episodes&#8221; of 30 minutes, so you do not have to watch it all in one run (I did). Hope you enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://elfstone.nl/2012/05/06/gaki-no-tsukai-s-no-laughing-spy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5.1 audio through Airport Express</title>
		<link>http://elfstone.nl/2012/03/04/5-1-audio-through-airport-express/</link>
		<comments>http://elfstone.nl/2012/03/04/5-1-audio-through-airport-express/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 22:45:06 +0000</pubDate>
		<dc:creator>michiel</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://elfstone.nl/?p=389</guid>
		<description><![CDATA[I&#8217;ve always wondered if it is possible to have 5.1 audio through my Airport Express. So is it? Yes it is. How? Once you know it, it&#8217;s deceptively simple: you need three things: 5.1 audio source 5.1 audio capable cable &#8230; <a href="http://elfstone.nl/2012/03/04/5-1-audio-through-airport-express/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve always wondered if it is possible to have 5.1 audio through my Airport Express. So is it? Yes it is. How? Once you know it, it&#8217;s deceptively simple: you need three things:</p>
<ol>
<li>5.1 audio source</li>
<li>5.1 audio capable cable (e.g. optic fibre)</li>
<li>iTunes (or something else that can output to AirTunes/AirPlay)</li>
</ol>
<p>I used <a href="http://www.diatonis.com/surround_sound_music.html">http://www.diatonis.com/surround_sound_music.html</a> or <a href="http://www.kellyindustries.com/sounds.html">http://www.kellyindustries.com/sounds.html</a> for the 5.1 audio sources (WAV files, iTunes wouldn&#8217;t play the .ac3 files). I borrowed an optic cable (thanks Michele!) with a TOSLINK plug on one side (goes into the receiver) and a Mini-TOSLINK plug on the other side (goes into the Airport Express). The important thing is <strong>to put the volume of iTunes to 100%</strong>.</p>
<p>If the volume of iTunes is not set to a 100%, the receiver will not detect that your source is DTS or DD5.1 (whatever your source is), and will output noise. I guess this is because DTS and DD5.1 should be passed through the receiver unchanged (volume control is done at the very last). I think iTunes doesn&#8217;t handle this gracefully (in my opinion it should output it unchanged no matter what the volume control is set to).</p>
<p>Anyway it does work, so enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://elfstone.nl/2012/03/04/5-1-audio-through-airport-express/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PSU power usage</title>
		<link>http://elfstone.nl/2010/10/18/psu-power-usage/</link>
		<comments>http://elfstone.nl/2010/10/18/psu-power-usage/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 21:22:04 +0000</pubDate>
		<dc:creator>michiel</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[PowerSaving]]></category>

		<guid isPermaLink="false">http://elfstone.nl/?p=354</guid>
		<description><![CDATA[When I was swapping my motherboard in for a different one, I found something interesting. I used my kill-a-watt to measure how much my old motherboard + CPU + memory was using compared to my new (used) one. The hardware &#8230; <a href="http://elfstone.nl/2010/10/18/psu-power-usage/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>When I was swapping my motherboard in for a different one, I found something interesting. I used my kill-a-watt to measure how much my old motherboard + CPU + memory was using compared to my new (used) one.</p>
<p><strong>The hardware</strong><br />
I swapped out a Pentium D 930 (yes, I know, old hardware, but it served its purpose) with a Core2Duo T5500. Impressive! The motherboards are nothing impressive (read: I forgot the brand and model), and the only thing noting was the difference in memory: from 2 GB to 4 GB. Other than that, they are pretty similar in performance (I measured with 3DMark2006: 6500-ish vs 7100-ish, respectively).</p>
<p><strong>Interesting!</strong><br />
The interesting thing wasn&#8217;t the power usage difference between them (well, I expected a drop in power usage and got it), <em>but the difference in power usage when I used a 400 W PSU with the new setup compared to a 500 W PSU</em>. For the record, the only thing I changed was the PSU. No settings changed, no other hardware changed. I didn&#8217;t even run windows updates in between them. Unfortunately, I don&#8217;t have the numbers for the D930 with the 500W PSU, because I already swapped it for the other motherboard when I thought about trying that.</p>
<p><strong>The details</strong><br />
In the table below you can see power usage that I measured (it was oscillating a bit sometimes (a few percentage of the total), I took a number that looked average). The activities are: Busy (Battlefield: Bad Company 2, ingame), Idle (Windows desktop, no programs running), Windows Standby (as the name implies), Off (shutdown, cable plugged in).</p>
<style>
#tabel {
 border: 1px solid black;
 border-collapse:collapse;
}
#tabel tr td, #tabel tr th {
 border: 1px solid black;
}
</style>
<p>Anyway, the measurements:</p>
<table id="tabel">
<tr>
<th>Activity</th>
<th>Pentium D 930 400W</th>
<th>C2D T5500 500W</th>
<th>C2D T5500 400W</th>
</tr>
<tr>
<td>Busy</td>
<td>210 W</td>
<td>145 W</td>
<td>120 W</td>
</tr>
<tr>
<td>Idle</td>
<td>133 W</td>
<td>85 W</td>
<td>69 W</td>
</tr>
<tr>
<td>Windows Standby</td>
<td>121 W</td>
<td>6 W</td>
<td>4 W</td>
</tr>
<tr>
<td>Off</td>
<td>3 W</td>
<td>6 W</td>
<td>3 W</td>
</tr>
</table>
<p>As expected, there is some difference between the Pentium D930 and the C2D T5500 (max 115 W, min 3 W), even forget that the D930 is terrible at being Standby (I mean: 121 W? really?) but look at the difference between the same C2D with a 400 W and 500 W PSU (max 25 W, min 2 W). I guess the 400 W PSU I have is more power efficient. By the way, I rechecked 3DMark2006 for both the 400 W and 500 W PSU, both are around 7100-ish, so no big change there.</p>
<p>Update: 400 W PSU is FSP Group Inc, 500 W PSU is Coolermaster</p>
]]></content:encoded>
			<wfw:commentRss>http://elfstone.nl/2010/10/18/psu-power-usage/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Debian packages: debugging postinst</title>
		<link>http://elfstone.nl/2010/06/02/debian-packages-debugging-postinst/</link>
		<comments>http://elfstone.nl/2010/06/02/debian-packages-debugging-postinst/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 12:37:16 +0000</pubDate>
		<dc:creator>michiel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://elfstone.nl/?p=348</guid>
		<description><![CDATA[When writing debian packages, sometimes things go wrong in the postinst stage. An error like &#8220;the postinstallation script returned an error code of 1&#8243; will occur. This is not very informative. If you want to debug postinst scripts, you can &#8230; <a href="http://elfstone.nl/2010/06/02/debian-packages-debugging-postinst/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>When writing debian packages, sometimes things go wrong in the postinst stage. An error like &#8220;the postinstallation script returned an error code of 1&#8243; will occur. This is not very informative.</p>
<p>If you want to debug postinst scripts, you can easily do this on the machine where you (half) installed the package. Normally you can execute /var/lib/dpkg/info/foo.postinst like this:<br />
<code><br />
sh -x /var/lib/dpkg/info/foo.postinst configure<br />
</code></p>
<p>However, if you use debconf, the output will be like this:<br />
<code>+ . /usr/share/debconf/confmodule<br />
+ [ !  ]<br />
+ PERL_DL_NONLAZY=1<br />
+ export PERL_DL_NONLAZY<br />
+ [  ]<br />
+ exec /usr/share/debconf/frontend /var/lib/dpkg/info/foo.postinst<br />
</code></p>
<p>Which is not helpful either. However, you can add &#8220;set -x&#8221; in /var/lib/dpkg/info/foo.postinst and then just execute it, it will give you the full output.</p>
<p><code><br />
sh /var/lib/dpkg/info/foo.postinst configure<br />
</code></p>
<p>Now the debugging process can begin!</p>
]]></content:encoded>
			<wfw:commentRss>http://elfstone.nl/2010/06/02/debian-packages-debugging-postinst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian packaging: multiple packages</title>
		<link>http://elfstone.nl/2009/11/25/debian-packaging-multiple-packages/</link>
		<comments>http://elfstone.nl/2009/11/25/debian-packaging-multiple-packages/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 12:08:52 +0000</pubDate>
		<dc:creator>michiel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://elfstone.nl/?p=224</guid>
		<description><![CDATA[For different projects, I&#8217;ve made debian packages before, but I&#8217;ve never had a project where multiple packages were created from one control file. Today, I had to work on a project where I had to do this. Everything went as &#8230; <a href="http://elfstone.nl/2009/11/25/debian-packaging-multiple-packages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>For different projects, I&#8217;ve made debian packages before, but I&#8217;ve never had a project where multiple packages were created from one control file. Today, I had to work on a project where I had to do this. Everything went as normal, except that I could not find out where to install the files so dh_builddeb could include them in their respective packages.</p>
<p>When only one package is made, this is easy: just install the files in debian/tmp as you would when installing on the system. For multiple packages, each package has its own directory: debian/&lt;package-name&gt;. How does dh_builddeb figure out which directory to use?</p>
<p><strong>Apparently, the default behaviour is to let the first package use the debian/tmp dir, and the other packages use the debian/&lt;package-name&gt; directory.<br />
</strong></p>
<p>I would rather have them all using the debian/&lt;package-name&gt; directory, but I could not find an option to do this.</p>
<p><em>Update:</em><br />
It seems that setting the compatibility level to 7 fixes this behaviour (echo &#8220;7&#8243; &gt; debian/compat), see man debhelper (section &#8220;Compatibility levels&#8221; for more info.</p>
]]></content:encoded>
			<wfw:commentRss>http://elfstone.nl/2009/11/25/debian-packaging-multiple-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Munin plugin bind9</title>
		<link>http://elfstone.nl/2009/11/01/munin-plugin-bind9/</link>
		<comments>http://elfstone.nl/2009/11/01/munin-plugin-bind9/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 14:42:38 +0000</pubDate>
		<dc:creator>michiel</dc:creator>
				<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://elfstone.nl/?p=219</guid>
		<description><![CDATA[Today, I was trying to get the &#8216;bind9&#8242; plugin to work, but it didn&#8217;t work out-of-the-box. So I debugged and I found out that the standard bind9 plugin does not consider &#8216;views&#8217;. My bind9 setup has an &#8216;internal&#8217; as well &#8230; <a href="http://elfstone.nl/2009/11/01/munin-plugin-bind9/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Today, I was trying to get the &#8216;bind9&#8242; plugin to work, but it didn&#8217;t work out-of-the-box. So I debugged and I found out that the standard bind9 plugin does not consider &#8216;views&#8217;. My bind9 setup has an &#8216;internal&#8217; as well as an &#8216;external&#8217; view. In the bind9 query log, this adds a &#8216;view internal: &#8216; for each line, so the plugin didn&#8217;t see it as a valid query line:</p>
<pre>
client 192.168.1.1#37242: view internal: query: www.apple.com IN A +
</pre>
<p>I changed the regexp and I archive it here in case anyone else (or future-me) wants to use this:</p>
<pre>
--- bind9.orig	2009-11-01 15:06:16.000000000 +0100
+++ bind9.new	2009-11-01 15:06:07.000000000 +0100
@@ -73,9 +73,9 @@
     open(Q,"< $QUERYLOG") or die "$!";
     while (&lt;Q&gt;) {
 	chomp;
-	if (/client \d+\.\d+.\d+.\d+\#\d+: query\: \S+ (\w+) (\w+)/) {
-	    if ($1 eq 'IN' and $2 !~ /^TYPE/) {
-		$IN{$2}++;
+	if (/client \d+\.\d+.\d+.\d+\#\d+: (view \w+: )?query\: \S+ (\w+) (\w+)/) {
+	    if ($2 eq 'IN' and $3 !~ /^TYPE/) {
+		$IN{$3}++;
 	    } else {
 		$OTHER++;
 	    }
</pre>
<p>By the way, I also found out that there is a program called 'munin-run' which can be used to run the plugin as munin would, this saves a lot of hassle with sudo and environment settings!</p>
]]></content:encoded>
			<wfw:commentRss>http://elfstone.nl/2009/11/01/munin-plugin-bind9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
