<?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>Smörgåsbord</title>
	<atom:link href="http://smorgasbord.gavagai.nl/feed/" rel="self" type="application/rss+xml" />
	<link>http://smorgasbord.gavagai.nl</link>
	<description>Ambachtelijk bereide beschouwingen.</description>
	<lastBuildDate>Fri, 05 Mar 2010 13:27:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Foto&#8217;s van Noord-Zweden</title>
		<link>http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/</link>
		<comments>http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 19:01:21 +0000</pubDate>
		<dc:creator>Wicher</dc:creator>
				<category><![CDATA[Umeå]]></category>
		<category><![CDATA[foto]]></category>
		<category><![CDATA[höga kusten]]></category>

		<guid isPermaLink="false">http://smorgasbord.gavagai.nl/?p=885</guid>
		<description><![CDATA[Bijna een jaar geleden vertrok ik naar Zweden om een paar maanden in Umeå te gaan wonen. Nu zat ik in de foto&#8217;s te rommelen (heimwee?) en sommige daarvan zijn best aardig als je benieuwd bent naar hoe het daar was/is. 
]]></description>
			<content:encoded><![CDATA[<p>Bijna een jaar geleden vertrok ik naar Zweden om een paar maanden in Umeå te gaan wonen. Nu zat ik in de foto&#8217;s te rommelen (heimwee?) en sommige daarvan zijn best aardig als je benieuwd bent naar hoe het daar was/is. </p>

<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0547/' title='uitzicht kamertje Umeå'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0547-150x150.jpg" class="attachment-thumbnail" alt="Uitzicht vanuit studentenkamertje" title="uitzicht kamertje Umeå" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0563/' title='Kladdkaka'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0563-150x150.jpg" class="attachment-thumbnail" alt="Huisgenootjes en chocoladecake" title="Kladdkaka" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0546/' title='Nydalasjön'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0546-150x150.jpg" class="attachment-thumbnail" alt="Meer naast m&#039;n huis. Niet duiken hè!" title="Nydalasjön" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0470/' title='IJsvissen Nydalasjön'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0470-150x150.jpg" class="attachment-thumbnail" alt="Dan maar ijsvissen" title="IJsvissen Nydalasjön" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0474/' title='Zonnen Nydalasjön'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0474-150x150.jpg" class="attachment-thumbnail" alt="Of liggen" title="Zonnen Nydalasjön" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0480/' title='Loopgraaf'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0480-150x150.jpg" class="attachment-thumbnail" alt="Voetpaden worden loopgraven" title="Loopgraaf" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0487/' title='Bobsleebaan'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0487-150x150.jpg" class="attachment-thumbnail" alt="Fietspaden worden bobsleebanen" title="Bobsleebaan" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0488/' title='Sneeuwruimen'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0488-150x150.jpg" class="attachment-thumbnail" alt="Dus afgraven die sneeuw" title="Sneeuwruimen" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0481/' title='Skipiste'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0481-150x150.jpg" class="attachment-thumbnail" alt="Maar hier dan weer niet, want dit is de stadsskipiste" title="Skipiste" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0491/' title='Straatje'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0491-150x150.jpg" class="attachment-thumbnail" alt="Bomen tussen de gebouwen" title="Straatje" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0519/' title='Bomen'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0519-150x150.jpg" class="attachment-thumbnail" alt="Gebouwen tussen de bomen" title="Bomen" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0527/' title='Vastgevroren fiets'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0527-150x150.jpg" class="attachment-thumbnail" alt="Parkeren vergt extra aandacht" title="Vastgevroren fiets" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0552/' title='Umeälven'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0552-150x150.jpg" class="attachment-thumbnail" alt="Bevroren rivier, vaselinewangetjes" title="Umeälven" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0565/' title='Umeälven'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0565-150x150.jpg" class="attachment-thumbnail" alt="Van de andere kant" title="Umeälven" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0518/' title='Varm Badhus'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0518-150x150.jpg" class="attachment-thumbnail" alt="Koud badhuis lijkt me geen succes nee" title="Varm Badhus" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0517/' title='Nobody puts Baby in a corner'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0517-150x150.jpg" class="attachment-thumbnail" alt="Waarom niet, eigenlijk?" title="Nobody puts Baby in a corner" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0628/' title='Tempelriddareorden'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0628-150x150.jpg" class="attachment-thumbnail" alt="Ridders!" title="Tempelriddareorden" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0585/' title='Barbecueue'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0585-150x150.jpg" class="attachment-thumbnail" alt="Barbecueue aan het meer. Rechts aan de horizon mijn huis." title="Barbecueue" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0589/' title='fikkie'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0589-150x150.jpg" class="attachment-thumbnail" alt="Brandhout wordt door de gemeente bijgevuld (!)" title="fikkie" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0592/' title='zonsondergang dichtgevroren Nydalasjön'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0592-150x150.jpg" class="attachment-thumbnail" alt="Mooi hoor" title="zonsondergang dichtgevroren Nydalasjön" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0597/' title='Barbecueue'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0597-150x150.jpg" class="attachment-thumbnail" alt="Koud ook wel" title="Barbecueue" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0598/' title='IJsvissen'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0598-150x150.jpg" class="attachment-thumbnail" alt="IJsvissen: gaatje boren in een rivier" title="IJsvissen" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0607/' title='IJsvissen'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0607-150x150.jpg" class="attachment-thumbnail" alt="En dan maar wachten" title="IJsvissen" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0612/' title='Lente Lindelhallen'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0612-150x150.jpg" class="attachment-thumbnail" alt="23 april: Sneeuwnegeerdag (Universiteitsbibliotheek)" title="Lente Lindelhallen" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0613/' title='IJsschotsen'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0613-150x150.jpg" class="attachment-thumbnail" alt="Dag ijs!" title="IJsschotsen" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0617/' title='Meeuwen op reis'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0617-150x150.jpg" class="attachment-thumbnail" alt="Verliefde meeuwen op reis" title="Meeuwen op reis" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0725/' title='Fiets wassen'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0725-150x150.jpg" class="attachment-thumbnail" alt="Lui fietswassen" title="Fiets wassen" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0660/' title='Höga Kusten'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0660-150x150.jpg" class="attachment-thumbnail" alt="16 mei, weekend hiken: Höga Kusten." title="Höga Kusten" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0666/' title='Finse'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0666-150x150.jpg" class="attachment-thumbnail" alt="Finse mee voor de humor" title="Finse" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0849/' title='ontberingen'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0849-150x150.jpg" class="attachment-thumbnail" alt="Deed het ook maar voor het eerst" title="ontberingen" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0858/' title='Skrattabbörttjärn'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0858-150x150.jpg" class="attachment-thumbnail" alt="Boswandelaarsinfra" title="Skrattabbörttjärn" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0670/' title='Müsli'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0670-150x150.jpg" class="attachment-thumbnail" alt="mmmüsli" title="Müsli" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0673/' title='Sneeuwmeer'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0673-150x150.jpg" class="attachment-thumbnail" alt="Sneeuw+meer= adembenemende ochtendduik." title="Sneeuwmeer" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0680/' title='Ödla'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0680-150x150.jpg" class="attachment-thumbnail" alt="Ödla, nog sloom van de kou" title="Ödla" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0870/' title='Höga Kusten'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0870-150x150.jpg" class="attachment-thumbnail" alt="Hierom heet het Höga Kusten" title="Höga Kusten" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0873/' title='Omhoog'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0873-150x150.jpg" class="attachment-thumbnail" alt="Betekent dus dat je soms omhöga moet" title="Omhoog" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0685/' title='Ravijn'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0685-150x150.jpg" class="attachment-thumbnail" alt="ravijnen en alles" title="Ravijn" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0697/' title='Vatten'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0697-150x150.jpg" class="attachment-thumbnail" alt="Kraakhelder meertje" title="Vatten" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0688/' title='Bevers'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0688-150x150.jpg" class="attachment-thumbnail" alt="Bevers: Nature&#039;s Hooligans" title="Bevers" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0687/' title='Mos'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0687-150x150.jpg" class="attachment-thumbnail" alt="En" title="Mos" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0686/' title='Mos'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0686-150x150.jpg" class="attachment-thumbnail" alt="heel veel" title="Mos" /></a>
<a href='http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/img_0703/' title='Mos'><img width="150" height="150" src="http://smorgasbord.gavagai.nl/wp-content/uploads/2010/02/IMG_0703-150x150.jpg" class="attachment-thumbnail" alt="(korst)mos" title="Mos" /></a>

]]></content:encoded>
			<wfw:commentRss>http://smorgasbord.gavagai.nl/2010/02/fotos-van-noord-zweden/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SheevaPlug hardware crypto</title>
		<link>http://smorgasbord.gavagai.nl/2010/02/sheevaplug-hardware-crypto/</link>
		<comments>http://smorgasbord.gavagai.nl/2010/02/sheevaplug-hardware-crypto/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 23:25:16 +0000</pubDate>
		<dc:creator>Wicher</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[sheevaplug]]></category>

		<guid isPermaLink="false">http://smorgasbord.gavagai.nl/?p=872</guid>
		<description><![CDATA[Some quick numbers for those looking for performance figures on the CESA crypto accelerator. Like I was, since my SheevaPlug has one. From the kernel config:

CRYPTO_DEV_MV_CESA
This driver allows you to utilize the Cryptographic Engines and Security Accelerator (CESA) which can be found on the Marvell Orion and Kirkwood SoCs, such as QNAP&#8217;s TS-209.
Currently the driver [...]]]></description>
			<content:encoded><![CDATA[<p>Some quick numbers for those looking for performance figures on the CESA crypto accelerator. Like I was, since my <a href="http://en.wikipedia.org/wiki/SheevaPlug">SheevaPlug</a> has one. From the kernel config:</p>
<blockquote><p>
CRYPTO_DEV_MV_CESA<br />
This driver allows you to utilize the Cryptographic Engines and Security Accelerator (CESA) which can be found on the Marvell Orion and Kirkwood SoCs, such as QNAP&#8217;s TS-209.<br />
Currently the driver supports AES in ECB and CBC mode without DMA.
</p></blockquote>
<p>Whether the accelerator will be used depends on whether an application uses the in-kernel crypto algorithms. OpenSSL does not unless it is explicitly enabled to use a certain accelerator, such as is the case with the Via Padlock engine. So this particular engine won&#8217;t let your SSH run faster. But it will speed up device mapper crypto if you use an AES cipher.</p>
<p>Right, let&#8217;s get on with it.<br />
<code><br />
#uname -a<br />
Linux sheeva 2.6.32-gentoo-r3 #3 Thu Feb 4 23:02:42 CET 2010 armv5tel Feroceon 88FR131 rev 1 (v5l) Marvell SheevaPlug Reference Board GNU/Linux<br />
</code></p>
<p>Quick &#038; oh-so-dirty way of getting a RAM-backed block device (that is, if you don&#8217;t have swap enabled):<br />
<code><br />
#mount -t tmpfs tmpfs /mnt/tmp/<br />
#dd if=/dev/zero of=/mnt/tmp/blob bs=1M count=224<br />
#losetup /dev/loop0 /mnt/tmp/blob<br />
#cryptsetup -c aes -h sha1 -d /dev/urandom create test /dev/loop0<br />
</code><br />
First we test without CESA.<br />
<code><br />
#dd if=/dev/zero of=/dev/mapper/test bs=1M count=224<br />
234881024 bytes (235 MB) copied, 41.858 s, 5.6 MB/s<br />
</code><br />
Only 5.6 MB/s and the <code>[kcryptd]</code> kernel process is having your CPU for lunch.<br />
Enter CESA:<br />
<code><br />
#dmsetup remove test<br />
#modprobe mv_cesa<br />
#cryptsetup -c aes -h sha1 -d /dev/urandom create test /dev/loop0<br />
#dd if=/dev/zero of=/dev/mapper/test bs=1M count=224<br />
234881024 bytes (235 MB) copied, 18.0525 s, 13.0 MB/s<br />
</code><br />
13.0 MB/s and there&#8217;s a new kernel process, <code>[mv_crypto]</code>. It&#8217;s eating about three times as much CPU as <code>[kcryptd]</code>. That means it&#8217;s offloading, which is good. The results are consistent over time so let&#8217;s say there&#8217;s a 2.5-fold performance gain.<br />
The loop device setup causes some overhead. Out in the wild you&#8217;ll get about 19 MB/s writing to USB HDD. Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://smorgasbord.gavagai.nl/2010/02/sheevaplug-hardware-crypto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network security 101: &#8216;Stealth mode&#8217; + ARP cache inoculation</title>
		<link>http://smorgasbord.gavagai.nl/2010/01/network-security-101-stealth-mode-arp-cache-inoculation/</link>
		<comments>http://smorgasbord.gavagai.nl/2010/01/network-security-101-stealth-mode-arp-cache-inoculation/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 19:28:48 +0000</pubDate>
		<dc:creator>Wicher</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[arp spoofing]]></category>
		<category><![CDATA[en_GB]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://smorgasbord.gavagai.nl/?p=820</guid>
		<description><![CDATA[There are times you need to connect to &#8216;dirty&#8217; networks such as public WiFi hotspots. Hopefully you&#8217;re ensuring that sensitive information is encapsulated in transport layer security enabled protocols such as SSL, because anyone on the same link (in the case of WiFi, that&#8217;s the air surrounding you. A vacuum will do, too, but that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>There are times you need to connect to &#8216;dirty&#8217; networks such as public WiFi hotspots. Hopefully you&#8217;re ensuring that sensitive information is encapsulated in transport layer security enabled protocols such as SSL, because anyone on the same link (in the case of WiFi, that&#8217;s the air surrounding you. A vacuum will do, too, but that&#8217;s less common) can listen in on the traffic you&#8217;re sending. With SSL encapsulation such as HTTP over SSL (https://), your traffic can still be read — but for those who do it&#8217;s an extremely boring read because they don&#8217;t know the session key, only you and the other endpoint do. Hopefully.</p>
<p>One particularly nasty thing that can happen to you is when your machine is subverted into using the attacker&#8217;s machine as the router.  That is known as <a href="http://en.wikipedia.org/wiki/Arp_poisoning">ARP poison routing</a>. The attacker can proceed to not only read the traffic coming from your machine (which, on a shared medium, could be done anyway), or read the traffic going into your machine (again: on a shared medium, that could be done anyway), but the attacker can now also <em><strong>modify</strong></em> the traffic between you and the rest of the non-local network, e.g., the internet, in both directions. And that&#8217;s when he can really go to town with your traffic. Injecting a <a href="http://code.google.com/p/middler/">javascript keylogger</a> into all the webpages you visit. &#8216;<a href="http://hamster.erratasec.com/help/index.html">Sidejacking</a>&#8216; your sessions, so he does not even need to know your passwords, just your session cookies — which you happen to transmit with every page request.</p>
<p>All possible unless you use transport layer security, which is tamper-proof once properly set up. <em><strong>Once properly set up</strong></em>. But setting up can have problems of itself — there are ways of preventing you ever going from HTTP to HTTPS. If you know a thing or two about HTTP and SSL you&#8217;ll be <a href="http://www.archive.org/details/MoxieMarlinspikeBlackHat2009Talk">delighted</a> to <a href="http://securitytube.net/Defeating-SSL-using-SSLStrip-%28Marlinspike-Blackhat%29-video.aspx">learn about</a> Moxie&#8217;s <a href="http://www.thoughtcrime.org/software/sslstrip/">very evil but very clever ways</a> of doing so.</p>
<p>Anyway, some level of security can be achieved if you tell your machine to ignore any messages sent to you from the other machines on the local network. That includes messages that will make your machine believe that the router has suddenly changed its physical address — which is quite unlikely to happen, but those messages are exactly the type of message an impersonator would send you. Of course we&#8217;d need to whitelist the routers of the network, otherwise we can&#8217;t get traffic out of it and onto other networks. DNS resolvers will need whitelisting too, unless you&#8217;re running one on your own machine (probably not).<br />
Not openly announcing your presence may also be something you wish for. If you have ever been on a network with a Mac user you have probably seen them popping up in your Zeroconf service browser as &#8220;Firstname Lastname&#8217;s iSomething&#8221;. Let&#8217;s cut down on that kind of promiscuity, too. But you should understand now that you can not actually hide unless you turn off your WiFi. Shared medium, remember?</p>
<p>I prepared a simple script to accomplish the above. I&#8217;ve used <code>ip</code> from the iproute2 package instead of sticking to old-school <code>route</code>, <code>ifconfig</code>, <code>arp</code> &#038; co. And I must say <code>ip neigh flush nud stale</code> has a poetic ring to it, <a href="http://ars.userfriendly.org/cartoons/?id=20100124">wouldn&#8217;t you agree?</a></p>
<p>Take note: this will only protect you from some kind of attacks, and only partially. An attacker has a window of opportunity between your machine getting assigned a DHCP lease and you running this script, for instance. Or maybe the access point <a href="http://www.viddler.com/explore/hak5/videos/56/">is rigged</a>. Actually all protection other than end-to-end encryption combined with mutual authentication is pretty useless on shared networks ;-)</p>
<p>Here&#8217;s the script. Linux-only. If you want to use it, get the latest version from <a href="http://smormedia.gavagai.nl/dist">my public repository</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># arpshield 0.2</span>
<span style="color: #666666; font-style: italic;"># Protects against ARP poisoning and cloaks your machine for all </span>
<span style="color: #666666; font-style: italic;"># local link devices but the router(s) and the DNS server(s).</span>
<span style="color: #666666; font-style: italic;"># Whitelisting DHCP servers also works if you use the dhcpcd program</span>
<span style="color: #666666; font-style: italic;"># to obtain DHCP leases.</span>
<span style="color: #666666; font-style: italic;"># This program is of no help if your setup is already poisoned.</span>
<span style="color: #666666; font-style: italic;"># Have a look at ArpON (http://arpon.sourceforge.net/manpage.html) if</span>
<span style="color: #666666; font-style: italic;"># you need more extensive protection.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Needs 'ip', 'awk', 'sed', 'arptables', and 'arping' and expects</span>
<span style="color: #666666; font-style: italic;"># them on $PATH. Needs appropriate privileges (so use sudo).</span>
<span style="color: #666666; font-style: italic;"># Takes a network interface as an argument. The network interface</span>
<span style="color: #666666; font-style: italic;"># should be up and configured. If no argument is given, clear all</span>
<span style="color: #666666; font-style: italic;"># rules. Obviously you should do that before connecting to a new</span>
<span style="color: #666666; font-style: italic;"># network.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Copyright 2010 Wicher Minnaard (wicher@gavagai.eu)</span>
<span style="color: #666666; font-style: italic;"># License: Creative Commons Attribution-Share Alike 3.0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Do you use dhcpcd for aquiring DHCP leases? And is it running?</span>
<span style="color: #007800;">dhcpcdLEASEFILE</span>=<span style="color: #ff0000;">&quot;/var/lib/dhcpcd-<span style="color: #007800;">${1}</span>.info&quot;</span>
<span style="color: #007800;">dhcpcdPIDFILE</span>=<span style="color: #ff0000;">&quot;/var/run/dhcpcd-<span style="color: #007800;">${1}</span>.pid&quot;</span>
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-f</span> <span style="color: #800000;">${dhcpcdLEASEFILE}</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-f</span> <span style="color: #800000;">${dhcpcdPIDFILE}</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #800000;">${dhcpcdLEASEFILE}</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># In case you lack the luxury of dhcpcd, where is your resolv.conf?</span>
<span style="color: #007800;">RESOLV</span>=<span style="color: #ff0000;">&quot;/etc/resolv.conf&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># No user-servicable parts below this line.</span>
<span style="color: #007800;">DEV</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># I know, I know. But if your routing table contains 0.333.456.789 you have bigger problems ;-)</span>
<span style="color: #007800;">IPREGEX</span>=<span style="color: #ff0000;">&quot;\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Register</span>
<span style="color: #007800;">MACreg</span>=<span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If not run as root, bail</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(id -u)</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;You need root privileges to modify networking parameters. Exiting.&quot;</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">2</span>
&nbsp;
getmac<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #666666; font-style: italic;"># sets MAC register by IP. Sets to nil, if the MAC is not on the local link. </span>
  <span style="color: #007800;">getMAC</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>ip neigh show <span style="color: #800000;">${1}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $5}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${getMAC}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    arping <span style="color: #660033;">-c1</span> <span style="color: #660033;">-I</span> <span style="color: #800000;">${DEV}</span> <span style="color: #800000;">${1}</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
    <span style="color: #007800;">getMAC</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>ip neigh show <span style="color: #800000;">${1}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $5}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #007800;">MACreg</span>=<span style="color: #800000;">${getMAC}</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
allow<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># Whitelists traffic to and from particular IP+MAC pairings and</span>
  <span style="color: #666666; font-style: italic;"># adds them to static ARP.</span>
  <span style="color: #007800;">IP</span>=<span style="color: #800000;">${1}</span>
  <span style="color: #007800;">MAC</span>=<span style="color: #800000;">${2}</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${IP}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${MAC}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    arptables <span style="color: #660033;">-A</span> INPUT  <span style="color: #660033;">-s</span> <span style="color: #800000;">${IP}</span> <span style="color: #660033;">--source-mac</span>      <span style="color: #800000;">${MAC}</span> <span style="color: #660033;">-j</span> ACCEPT
    arptables <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-d</span> <span style="color: #800000;">${IP}</span> <span style="color: #660033;">--destination-mac</span> <span style="color: #800000;">${MAC}</span> <span style="color: #660033;">-j</span> ACCEPT
    ip neigh replace <span style="color: #800000;">${IP}</span> lladdr <span style="color: #800000;">${MAC}</span> nud permanent dev <span style="color: #800000;">${DEV}</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${DEV}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #666666; font-style: italic;"># whitelist the routers</span>
  <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-z</span> <span style="color: #800000;">${GATEWAYS}</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #007800;">GATEWAYS</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>ip route show dev <span style="color: #800000;">${DEV}</span><span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;s:.* via \(<span style="color: #007800;">${IPREGEX}</span>\).*:\1:p&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #000000; font-weight: bold;">for</span> GWIP <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${GATEWAYS}</span>; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #007800;">MACreg</span>=<span style="color: #ff0000;">&quot;&quot;</span>
    getmac <span style="color: #800000;">${GWIP}</span>
    allow <span style="color: #800000;">${GWIP}</span> <span style="color: #800000;">${MACreg}</span>
  <span style="color: #000000; font-weight: bold;">done</span>
  <span style="color: #666666; font-style: italic;"># whitelist the DNS servers</span>
  <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-z</span> <span style="color: #800000;">${DNSSERVERS}</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #007800;">DNSSERVERS</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;s:^nameserver \(<span style="color: #007800;">${IPREGEX}</span>\):\1:p&quot;</span> <span style="color: #800000;">${RESOLV}</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #000000; font-weight: bold;">for</span> DNS <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${DNSSERVERS}</span>; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #007800;">MACreg</span>=<span style="color: #ff0000;">&quot;&quot;</span>
    getmac <span style="color: #800000;">${DNS}</span>
    allow <span style="color: #800000;">${DNS}</span> <span style="color: #800000;">${MACreg}</span>
  <span style="color: #000000; font-weight: bold;">done</span>
  <span style="color: #666666; font-style: italic;"># if using dhcpcd, we can whitelist the DHCP server too</span>
  <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-n</span> <span style="color: #800000;">${DHCPSID}</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> getmac <span style="color: #800000;">${DHCPSID}</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> allow <span style="color: #800000;">${DHCPSID}</span> <span style="color: #800000;">${MACreg}</span>
  <span style="color: #666666; font-style: italic;"># set default policy to DROP    </span>
  arptables <span style="color: #660033;">-P</span> INPUT DROP
  arptables <span style="color: #660033;">-P</span> OUTPUT DROP
  <span style="color: #666666; font-style: italic;"># clear out non-hardcoded ARP cache entries</span>
  ip neigh flush nud reachable
  ip neigh flush nud stale
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #666666; font-style: italic;"># No argument given, so clean up.</span>
  arptables <span style="color: #660033;">-F</span>
  arptables <span style="color: #660033;">-P</span> INPUT ACCEPT
  arptables <span style="color: #660033;">-P</span> OUTPUT ACCEPT
  ip neigh flush nud permanent
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://smorgasbord.gavagai.nl/2010/01/network-security-101-stealth-mode-arp-cache-inoculation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Democratietje spelen</title>
		<link>http://smorgasbord.gavagai.nl/2010/01/democratietje-spelen/</link>
		<comments>http://smorgasbord.gavagai.nl/2010/01/democratietje-spelen/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 01:06:51 +0000</pubDate>
		<dc:creator>Wicher</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[kilometerheffing]]></category>
		<category><![CDATA[politiek]]></category>
		<category><![CDATA[rekeningrijden]]></category>

		<guid isPermaLink="false">http://smorgasbord.gavagai.nl/?p=777</guid>
		<description><![CDATA[Ik ben kwaad. Sacha vertelt waarom:

Dus. We hebben een regering van gekozen volksvertegenwoordigers. Goede zaak zou je zeggen, want die maken beleid dat het algemeen belang dient. Het algemeen belang.
Maar wat doet je minister, Camiel Eurlings? Die gaat nog even exclusief aan de leden van één (1!) belangenvereniging vragen of het beleid hen wel kan [...]]]></description>
			<content:encoded><![CDATA[<p>Ik ben kwaad. Sacha vertelt waarom:</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" longdesc="http://smormedia.gavagai.nl/2010/01/kilometerheffing.ogv" width="320" height="180" src="http://smorgasbord.gavagai.nl/wp-content/plugins/embedtheora/vid_play_thumb.png" onClick="insertVid(this);"/></p>
<p>Dus. We hebben een regering van gekozen volksvertegenwoordigers. Goede zaak zou je zeggen, want die maken beleid dat het algemeen belang dient. Het <b><i>algemeen</i> belang</b>.</p>
<p>Maar wat doet je minister, Camiel Eurlings? Die gaat nog even exclusief aan de leden van één (1!) belangenvereniging vragen of het beleid hen wel kan bekoren, want zo niet, dan gaat-ie het natuurlijk niet uitvoeren. Maar het is potdorie een hamerstuk waar onze tweede kamer (die jou vertegenwoordigt) al achter staat. </p>
<p>Camiel houdt een privéreferendumpje. Waarmee wordt beslist of autorijden duur mag worden. En alle automobilisten zijn uitgenodigd! Moet je in Nederland een ANWB-partijkaart hebben om je stem uit te mogen brengen? </p>
<p>Die heeft niet iedereen. Marietje, die vanochtend op de fiets naar d&#8217;r werk nog door een Hummer de stoep op werd gedrukt, wil er niet eens een. En Camiel gaat dus niet aan oma Truus in d&#8217;r met vrachtwagenroet bedekte woning aan de Fijnstofallee vragen wat zij van auto&#8217;s vindt. En hij vraagt het ook niet aan kleine Kareltje die achter z&#8217;n Playstation kinderdiabetes zit krijgen omdat er buiten niks te spelen valt omdat z&#8217;n huis temidden parkeerplaatsen, blik, drukke wegen en andere automobielinfra staat.<br />
Als je het deze mensen zou vragen mag het autorijden best ontmoedigd worden. Maar nee, er wordt een voorstel gedaan zodanig dat autorijders het mee eens zullen zijn — en dus zullen die er niet al te veel op achteruit gaan. Met andere woorden: dat is dus niet het voorstel worden dat er voor gaat zorgen dat jongere generaties een fijne leefomgeving tegemoet gaan.</p>
<p>Goed hee Camiel, draagvlak zoeken. Dat zouden we vaker moeten doen. Zo vind ik dus dat de regering aan de Vereniging Stinkrijke Bonusbankiers had moeten vragen of ze er eigenlijk wel mee akkoord gaan dat die pret aan banden gaat. En we zullen ook nog maar moeten zien of de Nederlandse Delinquentenbond instemt met beter toezicht op verlofregelingen. Ze mogen dan trouwens zelf dat privéreferendumpje organiseren en de stemmen tellen, net als de ANWB. <a href="http://www.eenvandaag.nl/politiek/31156/beveiliging_stemcomputer_zo_lek_als_een_mandje">Zo nauw nemen we het immers toch al niet</a> met de integriteit van volksraadpleegmechanismen.</p>
<p>Camiel, als je e.e.a. wil toelichten (graag!), dan kan dat door hieronder je reactie toe te voegen.</p>
]]></content:encoded>
			<wfw:commentRss>http://smorgasbord.gavagai.nl/2010/01/democratietje-spelen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://smormedia.gavagai.nl/2010/01/kilometerheffing.ogv" length="1825974" type="video/ogg" />
		</item>
		<item>
		<title>SOCAT: access your X server&#8217;s domain socket over TCP</title>
		<link>http://smorgasbord.gavagai.nl/2010/01/socat-access-your-x-servers-domain-socket-over-tcp/</link>
		<comments>http://smorgasbord.gavagai.nl/2010/01/socat-access-your-x-servers-domain-socket-over-tcp/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 18:09:11 +0000</pubDate>
		<dc:creator>Wicher</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[en_GB]]></category>
		<category><![CDATA[socat]]></category>
		<category><![CDATA[X11]]></category>
		<category><![CDATA[xauth]]></category>
		<category><![CDATA[xhost]]></category>

		<guid isPermaLink="false">http://smorgasbord.gavagai.nl/?p=761</guid>
		<description><![CDATA[Access remote X11 servers that have their TCP socket disabled
This happens to me regularly. Someone brings a machine along and I want to display some app, running on my machine, on their display. Networked X11 to the rescue, you say? No, their X11 server is started with &#8216;-nolisten TCP&#8217; wich is the default on most [...]]]></description>
			<content:encoded><![CDATA[<h3>Access remote X11 servers that have their TCP socket disabled</h3>
<p>This happens to me regularly. Someone brings a machine along and I want to display some app, running on my machine, on their display. Networked X11 to the rescue, you say? No, their X11 server is started with &#8216;-nolisten TCP&#8217; wich is the default on most modern Linux distros. Sadly, the TCP socket can&#8217;t be enabled &#8216;in-flight&#8217; — if you decide you <strong>do</strong> fancy a TCP socket after all, you&#8217;ll have to restart your X server which may be a pain if you&#8217;re in the middle of something (besides, restarting is just plain uncool).<br />
But there is a way to expose the Unix domain socket as a TCP socket, with the help of <a href="http://www.dest-unreach.org/socat/">socat</a>. The following examples all use bash, so if you run a different shell (if you don&#8217;t know, you probably aren&#8217;t) you may need to define environment variables differently.</p>
<h4>Braindead Proof of Concept (BPOC)</h4>
<p>Situation: You want to display an application running on a machine called <code>w00t</code> on another machine, called <code>bling</code>. There&#8217;s an X11 server running on bling, but it&#8217;s not configured to listen on any TCP socket. DNS is properly setup, so if you ping w00t from bling, you get replies from bling&#8217;s IP, and vice versa.</p>
<ol>
<li>On bling, find the domain socket of bling&#8217;s X11 server. Have a look in <code>/tmp/.X11-unix/</code>. The socket&#8217;s name usually reflects its X server display number (which you can determine by running <code>echo $DISPLAY</code> in an xterm).</li>
<li>On bling, run something along the lines of<br />
<code>socat TCP-LISTEN:6066 UNIX-CONNECT:/tmp/.X11-unix/X0</code><br />
This will open up TCP port 6066 on all of bling&#8217;s network interfaces, connecting it to the Unix domain socket of the X server.</li>
<li>In an xterm on bling, run <code>xhost +</code>. You have now opened up your X11 server to the whole wide world, a silly thing to do. Anyone with access to the TCP socket can now read your keystrokes, read your window contents, click your mouse buttons&#8230;</li>
<li>In an xterm on w00t, run <code>DISPLAY="bling:66" xclock</code>. You may have noticed that 66 = 6066 &#8211; 6000 and indeed, by convention the TCP port number for a certain display is its display number + 6000. Anyhow&#8230;. yay, a clock! It&#8217;s displayed on bling, but running on w00t.</li>
</ol>
<h4>Improvements</h4>
<ul>
<li>You may have noticed that in the BPOC, you can use the display on bling only once. <code>socat</code> will allow only one client, and will exit once that client exits. In some situations, you may consider that a feature (it&#8217;s a one-time access grant), but in others you may not. If you want a reusable TCP socket, run something along the lines of<br />
<code>socat TCP-listen:6066,fork,reuseaddr UNIX-CONNECT:/tmp/.X11-unix/X0</code> which forks off a socat process for every TCP connection.
</li>
<li>You may not want to expose a TCP socket on all interfaces. Maybe you only want to expose a socket on the LAN interface, or on the localhost interface (and wrap the packets in an SSH tunnel). Well, you can, using the &#8216;bind&#8217; option:<br />
<code>socat TCP-LISTEN:6066,bind=localhost UNIX-CONNECT:/tmp/.X11-unix/X0</code><br />
Now tunnel it over SSH. On w00t, run <code>ssh -L 6011:localhost:6023 bling</code>. Now localhost:6011 on woot is actually localhost:6023 on bling which is actually /tmp/.X11-unix/X0 on bling. So on w00t you can  start an xclock with its display on bling by running <code>DISPLAY="localhost:11" xclock</code>.
</li>
<li><code>xhost +</code> from the BPOC is braindead indeed. There are a couple things you could have done instead, there are good ways of tightening up your authorization scheme.
<ul>
<li>First off, you don&#8217;t really need to run <code>xhost +</code> if you properly set up X11 cookies, which you should. <a href="http://tldp.org/HOWTO/Remote-X-Apps-6.html#ss6.2">Here are some examples on using the xauth scheme</a>, but take note: <code>xauth generate</code> will probably not work on recent X11 releases since the XSECURITY extension is disabled by default. Just use the same cookies on the client and the server.
</li>
<li>Run <code>xhost +w00t</code>. That&#8217;s host-based authentication, which is stupid, but not as stupid as no authorization at all. Any user on w00t can now connect.
</li>
<li>Suppose that on bling (of course!) you&#8217;d run <code>xhost +SI:localuser:theuser</code> with &#8216;theuser&#8217; being the userID of the unix-user running the socat instance. Now from the point of view of the X server, any client connecting through socat will be coming from &#8216;theuser&#8217; and will therefore be allowed access. Entertaining, but not much different from just running <code>xhost +</code>. It is something to keep in mind though! Many distros by default add the unix-user that started the X server to the authorization list. That user does not need a cookie. If you run socat as that user you will have the effect of running <code>xhost +</code> even if you run <code>xhost -</code>.
</li>
<li>Just run a nested X11 server, such as Xnest or Xephyr. This way you put untrusted users in a sandbox, preventing them from snooping your keyboard and windows. It&#8217;s the X11 equivalent of a chroot.
</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://smorgasbord.gavagai.nl/2010/01/socat-access-your-x-servers-domain-socket-over-tcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paste the X selection buffer with a keyboard shortcut</title>
		<link>http://smorgasbord.gavagai.nl/2009/12/paste-the-x-selection-buffer-with-a-keyboard-shortcut/</link>
		<comments>http://smorgasbord.gavagai.nl/2009/12/paste-the-x-selection-buffer-with-a-keyboard-shortcut/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 19:02:14 +0000</pubDate>
		<dc:creator>Wicher</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[clipboard]]></category>
		<category><![CDATA[en_GB]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://smorgasbord.gavagai.nl/?p=728</guid>
		<description><![CDATA[Here&#8217;s a trick. Many laptop trackpads lack a middle mouse button. On a regular mouse input device, the middle mouse button is the scroll wheel, and when you press it down it emits a button event. In X11 this button event is used to paste the X selection buffer into the position right beneath the [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a trick. Many laptop trackpads lack a middle mouse button. On a regular mouse input device, the middle mouse button is the scroll wheel, and when you press it down it emits a button event. In X11 this button event is used to paste the X selection buffer into the position right beneath the cursor (<a href="/2009/12/windowsmac-focus-models-and-copy-pasting-doing-it-wrong-both-of-you/">there lies sublime usability in this simple fact</a>).<br />
You can emulate a middle-mouse-button event by pressing the left and right mouse buttons at the same time. Since I lack the manual dexterity to do this on my tiny netbook trackpad I wanted to be able to do middle-mouse-button-paste <b>with my keyboard</b>. Well, that appeared to be easy to accomplish with the X11 Xtest extension for which the <a href="http://hoopajoo.net/projects/xautomation.html">Xautomation</a> collection includes a utility in the form of <code>xte</code>. If you&#8217;d enter <code>xte 'mouseclick 2'</code> in a terminal (within an X11 session, of course), you&#8217;d get the same effect as if you&#8217;d just pressed the middle mouse button. Only thing left is to add a keyboard shortcut to run this command; in my favourite window manager, XFCE, this can be done clickwise via the Settings Manager or simply by running something like <code>xfconf-query -c xfce4-keyboard-shortcuts -p '/commands/custom/&lt;Super&gt;v' -s "xte 'mouseclick 2'"</code>. I can now paste my X selection buffer by pressing the funny &#8216;four-wobbly-squares key&#8217; and &#8216;v&#8217; simultaneously.</p>
]]></content:encoded>
			<wfw:commentRss>http://smorgasbord.gavagai.nl/2009/12/paste-the-x-selection-buffer-with-a-keyboard-shortcut/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows/Mac focus models and copy-pasting: Doing it wrong, both of you</title>
		<link>http://smorgasbord.gavagai.nl/2009/12/windowsmac-focus-models-and-copy-pasting-doing-it-wrong-both-of-you/</link>
		<comments>http://smorgasbord.gavagai.nl/2009/12/windowsmac-focus-models-and-copy-pasting-doing-it-wrong-both-of-you/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 18:47:54 +0000</pubDate>
		<dc:creator>Wicher</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[clipboard]]></category>
		<category><![CDATA[en_GB]]></category>
		<category><![CDATA[sloppy focus]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://smorgasbord.gavagai.nl/?p=731</guid>
		<description><![CDATA[Today we talk usability. Specifically, desktop interaction differences between the X11 windowing system and the windowing systems that come with those operating systems you can actually buy in a shop downtown.
Select &#8211; Copy &#8211; Positionyourcursor &#8211; Paste
Say I&#8217;d like to copy some text from some window (which may or may not have the input focus) [...]]]></description>
			<content:encoded><![CDATA[<p>Today we talk usability. Specifically, desktop interaction differences between the X11 windowing system and the windowing systems that come with those operating systems you can actually buy in a shop downtown.</p>
<h3>Select &#8211; Copy &#8211; Positionyourcursor &#8211; Paste</h3>
<p>Say I&#8217;d like to copy some text from some window (which may or may not have the input focus) into some other window (which also may or may not have input focus). This action is commonly called &#8216;copy-paste&#8217;. Copy-paste. That sounds like two steps, doesn&#8217;t it?<br />
Let&#8217;s say both windows are visible on the current desktop. Outside the of the X11 world &#8211; say, on a Windows machine, you&#8217;d have to undertake the following steps:</p>
<ol>
<li>Drag-select the text in the first window.</li>
<li>Press ctrl-c or click edit/copy.</li>
<li>In the second window, click the position you where you want the text to be inserted.</li>
<li>Paste the text with ctrl-v or edit/paste.</li>
</ol>
<p>This is not &#8220;copy-paste&#8221;. This is &#8220;select-copy-positionyourcursor-paste&#8221;. Here&#8217;s how you do it on X11:</p>
<ol>
<li>Drag-select the text in the first window.</li>
<li>Hover over (you don&#8217;t need to click<a name="voednoodpunt1" href="#voednood1">[*]</a>) the position you want the text to be inserted at in the second window and paste by clicking with the middle mouse button.</li>
</ol>
<p>There. Copy-paste. There are two atomic actions involved with that. You can&#8217;t get this down to less than two. You need to specify <b>what</b> you want to copy, and you need to specify <b>where</b> you want to paste it. The X11 engineers understood this. I entertain the thought that they must have valued my time as well, put two and two together, and that this why we have the X selection buffer on X11<a name="voednoodpunt2" href="#voednood2">[**]</a> that makes copy-paste really copy-paste.<br />
(Read the footnote. I will show that not all is smooth in X11-land with respect to clipboards.)</p>
<h3>Window focus</h3>
<p>Whenever I venture out of X11-land there&#8217;s something else I dearly miss. It&#8217;s the ability of an inactive window to receive cursor input events when the cursor is on top of it. It&#8217;s immensely useful. Consider the following scenario.<br />
Let&#8217;s say you&#8217;re browsing the web and you stumble upon a page which you want to discuss with a friend. It&#8217;s a long page, so there&#8217;s going to be some scrolling. You open up an instant messaging window to chat with your friend. You&#8217;re short on screen real estate so the IM window partly occludes the browser window. Meaning the IM window is on top of the browser window.<br />
What you want to do now is to scroll occluded pieces of webpage text into view. But you also want to continue to see what you&#8217;re friend is saying. <b>On Windows, you simply cannot</b>. If you want to scroll the browser window, you&#8217;ll have to activate it, which means it will be raised, which means it will be above your IM window, which means you cannot see what your friend is typing. <b>On X11, you can<a name="voednoodpunt1" href="#voednood1">[*]</a></b>. If your mouse cursor is over the browser window you can use the scroll wheel to scroll text into view, without the browser window being raised. Meaning your IM window is still on top, meaning you can still see what your friend is telling you. In fact, the IM window still has input focus so you can scroll the browser window <b>and</b> continue typing messages to your friend, limited only by your manual dexterity.<br />
<a name="voednoodpunt3" href="#voednood3">[Update: Added video to illustrate Windows behaviour][***]</a></p>
<h3>Extravagance</h3>
<p>If you think these situations are exotic, here&#8217;s and extravagant example for you. Open a file browser (Windows Explorer) window. Expand some folder trees in the left pane until you get a scroll bar in this pane. Navigate to a folder which has a lot of files (C:\Windows will do nicely) so the file pane also receives a scroll bar. You now have two panes, both with a scroll bar, within the same application. Thing is, you can only scroll in one of them at the time! If you want to look around in a &#8220;non-active&#8221; <i>folder pane</i>, you first have to click it. But don&#8217;t just click anywhere! You have to take special care to click it somewhere that doesn&#8217;t change your view in the <i>file pane</i> — better not click (near) one of the folders! Now suppose you&#8217;d like to scroll some files in the file pane into view. Better &#8220;activate&#8221; the file pane first then. Again, take extra special care: don&#8217;t just click anywhere in the file pane because then you may lose any previously made selection. It&#8217;s perverse, it really is. This is all happening inside <u>one single application window</u>. And the folder pane actually <b>does</b> notice when I hover over it (it underlines folders) so why can&#8217;t I scroll the view, then? Perverse. The OS is wasting my time.</p>
<h3>Sloppy focus on Windows</h3>
<p>I remember activating this on Windows 95 and it appears it still works. You can have crude &#8217;sloppy focus&#8217; on Windows. <a href="http://bogomip.net/blog/2008/09/08/sloppy-focus-in-windows/">Just hex-edit your UserPreferencesMask</a> in the Registry</a> (Half of the times that I&#8217;m doing anything remotely interesting on Windows, I find myself entering hex values. Why is that.).<br />
Refreshing as this may be, this will not help you with any of the above scenarios:</p>
<ul>
<li>In the copy-paste scenario, you still can&#8217;t specify insertion position and insert into that position in one single action.</li>
<li>In the IM-while-browsing scenario, your IM window loses input focus when you scroll the web page in the browser window.</li>
<li>Windows Explorer cursor behaviour stays just as perverse as it was with the standard click-to-focus model.</li>
</ul>
<p>But hey, at least Windows users have <b>some</b> choice (provided they understand regedit.exe and hex). On OS-X, <a href="http://jeremy.zawodny.com/blog/archives/000149.html">you don&#8217;t have a choice at all</a> because Apple understands usability better than you do. For instance, Apple knows you head will explode if they&#8217;d give you the option of resizing your application windows by pulling any border or corner. You know very well that you will only want to resize your windows by grabbing the bottom right corner and will thank Apple for protecting you against yourself. (No, you&#8217;re not allowed to rebut until you&#8217;ve read and understand <a href="http://steve-yegge.blogspot.com/2008/04/settling-osx-focus-follows-mouse-debate.html">this mountain of insight and humour</a>.)</p>
<h3>Footnotes</h3>
<p><a name="voednood1" href="#voednoodpunt1">[*]</a> Actually, this is dependent on the focus policy. X11 itself does not specify the focus policy. X11 strives to provide mechanism, not policy. Policy is implemented by the window manager, and there are many window managers available for X11. A couple of them provide a &#8216;click to focus&#8217; policy. Many of them provide &#8217;sloppy focus&#8217; and/or &#8216;focus follows mouse&#8217; policies. <a href="http://people.cs.uchicago.edu/~ahiorean/ahwm/sloppy-focus.html">This page</a> has some concise definitions and elaborates on focus problems encountered the different models.</p>
<p><a name="voednood2" href="#voednoodpunt2">[**]</a> Most window managers also have a &#8216;clipboard&#8217;, running in parallel with the X selection buffer. The clipboard only holds stuff you put there explicitly, whereas the X selection buffer holds whatever text you last selected anywhere in the X11 session. Furthermore, both clipboards usually only accept character data. So if you select and copy some pixels in drawing program A, you can&#8217;t paste them in drawing program B. Program A will have a private clipboard to hold pixel data, and B has one of its own, too. If you stay within the realm of one particular desktop environment with applications specific to this desktop environment, you may actually be able to use the clipboard inter-applicationwise for both text and binary data. But in general, you can&#8217;t. This plurality confuses the hell out of newcomers. </p>
<p><a name="voednood3" href="#voednoodpunt3">[***]</a>A video demonstrating the Windows scroll focus issue:<br />
<img longdesc="http://smormedia.gavagai.nl/2010/03/winfocussnafu.ogv" style="display: block; margin-left: auto; margin-right: auto;" width="400" height="368" src="http://smorgasbord.gavagai.nl/wp-content/plugins/embedtheora/vid_play_thumb.png" onClick="insertVid(this);"/></p>
]]></content:encoded>
			<wfw:commentRss>http://smorgasbord.gavagai.nl/2009/12/windowsmac-focus-models-and-copy-pasting-doing-it-wrong-both-of-you/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://smormedia.gavagai.nl/2010/03/winfocussnafu.ogv" length="1378284" type="video/ogg" />
		</item>
		<item>
		<title>LIRC plugin for Exaile</title>
		<link>http://smorgasbord.gavagai.nl/2009/12/lirc-plugin-for-exaile/</link>
		<comments>http://smorgasbord.gavagai.nl/2009/12/lirc-plugin-for-exaile/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 01:44:58 +0000</pubDate>
		<dc:creator>Wicher</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[en_GB]]></category>
		<category><![CDATA[exaile]]></category>
		<category><![CDATA[lirc]]></category>
		<category><![CDATA[lircaile]]></category>
		<category><![CDATA[remote]]></category>

		<guid isPermaLink="false">http://smorgasbord.gavagai.nl/?p=718</guid>
		<description><![CDATA[Just finished up a 0.1 version of a LIRC (Linux Infrared Control) plugin for the Exaile media player. Now you can use your remote with Exaile efficiently. The plugin is in the public repository and is called Lircaile.
I haven&#8217;t touched Python much as of yet, but I&#8217;m pleased with it: it appears to be a [...]]]></description>
			<content:encoded><![CDATA[<p>Just finished up a 0.1 version of a <a href="http://lirc.org">LIRC</a> (Linux Infrared Control) plugin for the <a href="http://exaile.org/">Exaile media player</a>. Now you can use your remote with Exaile efficiently. The plugin is in <a href="http://smormedia.gavagai.nl/dist/">the public repository</a> and is called Lircaile.<br />
I haven&#8217;t touched Python much as of yet, but I&#8217;m pleased with it: it appears to be a consistent language. Well, here&#8217;s my 0.1 effort. I desperately wanted to have some fun with introspection, but I have the feeling the nested exception logic is a bit&#8230; unusual.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># A LIRC plugin for Exaile. Depends on pylirc from http://sourceforge.net/projects/pylirc/</span>
<span style="color: #808080; font-style: italic;"># Copyright (C) 2009 Wicher Minnaard, http://smorgasbord.gavagai.nl / wicher@gavagai.eu</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># This program is free software: you can redistribute it and/or modify</span>
<span style="color: #808080; font-style: italic;"># it under the terms of the GNU General Public License as published by</span>
<span style="color: #808080; font-style: italic;"># the Free Software Foundation, either version 3 of the License, or</span>
<span style="color: #808080; font-style: italic;"># (at your option) any later version.</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> xl <span style="color: #ff7700;font-weight:bold;">import</span> playlist, player, event
<span style="color: #ff7700;font-weight:bold;">import</span> pylirc, <span style="color: #dc143c;">logging</span>
&nbsp;
LIRCAILE = <span style="color: #008000;">None</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> enable<span style="color: black;">&#40;</span>exaile<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>exaile.<span style="color: black;">loading</span><span style="color: black;">&#41;</span>:
        event.<span style="color: black;">add_callback</span><span style="color: black;">&#40;</span>_enable, <span style="color: #483d8b;">'exaile_loaded'</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        _enable<span style="color: black;">&#40;</span><span style="color: #008000;">None</span>, exaile, <span style="color: #008000;">None</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> _enable<span style="color: black;">&#40;</span>eventname, exaile, nothing<span style="color: black;">&#41;</span>:
  <span style="color: #ff7700;font-weight:bold;">global</span> LIRCAILE
  LIRCAILE = Lircaile<span style="color: black;">&#40;</span>exaile<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> disable<span style="color: black;">&#40;</span>exaile<span style="color: black;">&#41;</span>:
  pylirc.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Lircaile<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">def</span> polLirc<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Pops all queued signals off of the LIRC queue and hands them to
    handleCode() for further processing.&quot;&quot;&quot;</span>
    gopoll = <span style="color: #008000;">True</span>
    <span style="color: #ff7700;font-weight:bold;">while</span><span style="color: black;">&#40;</span>gopoll<span style="color: black;">&#41;</span>:
      <span style="color: #dc143c;">code</span> = <span style="color: black;">&#40;</span>pylirc.<span style="color: black;">nextcode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
      <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #dc143c;">code</span><span style="color: black;">&#41;</span>:
        comval = <span style="color: #dc143c;">code</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>comval<span style="color: black;">&#41;</span> == <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:
          <span style="color: #008000;">self</span>.<span style="color: black;">handleCode</span><span style="color: black;">&#40;</span>comval<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>          
        <span style="color: #ff7700;font-weight:bold;">else</span>:
          <span style="color: #008000;">self</span>.<span style="color: black;">handleCode</span><span style="color: black;">&#40;</span>comval<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>, comval<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
      <span style="color: #ff7700;font-weight:bold;">else</span>:
        <span style="color: #808080; font-style: italic;"># We're done, the queue is empty.</span>
        gopoll = <span style="color: #008000;">False</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">True</span>
&nbsp;
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, exaile<span style="color: black;">&#41;</span>:
    <span style="color: #008000;">self</span>.<span style="color: black;">exaile</span> = exaile
    <span style="color: #008000;">self</span>.<span style="color: black;">logger</span> = <span style="color: #dc143c;">logging</span>.<span style="color: black;">getLogger</span><span style="color: black;">&#40;</span>__name__<span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">socket</span> = pylirc.<span style="color: black;">init</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'lircaile'</span><span style="color: black;">&#41;</span>
    event.<span style="color: black;">EventTimer</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.05</span>, <span style="color: #008000;">self</span>.<span style="color: black;">polLirc</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">def</span> handleCode<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, command, <span style="color: #66cc66;">*</span>arg<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Takes LIRC signals and uses introspection to try to find appropriate 
    exaile functions to call based on the name of the signal. &quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>command == <span style="color: #483d8b;">'chvol'</span><span style="color: black;">&#41;</span>:
      <span style="color: #008000;">self</span>.<span style="color: black;">exaile</span>.<span style="color: black;">player</span>.<span style="color: black;">set_volume</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">exaile</span>.<span style="color: black;">player</span>.<span style="color: black;">get_volume</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> + <span style="color: #008000;">float</span><span style="color: black;">&#40;</span>arg<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
      func = <span style="color: #008000;">None</span>
      <span style="color: #808080; font-style: italic;"># Look for a matching playlist function</span>
      <span style="color: #ff7700;font-weight:bold;">try</span>:
        func = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">exaile</span>.<span style="color: black;">queue</span>, command<span style="color: black;">&#41;</span>
      <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">AttributeError</span>:
        <span style="color: #808080; font-style: italic;"># No? Then look for a matching player function</span>
        <span style="color: #ff7700;font-weight:bold;">try</span>:
          func = <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">exaile</span>.<span style="color: black;">player</span>, command<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">AttributeError</span>:
          <span style="color: #808080; font-style: italic;"># No? Then we're out of options</span>
          <span style="color: #008000;">self</span>.<span style="color: black;">logger</span>.<span style="color: black;">warning</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'No function to handle &quot;'</span>+ command +<span style="color: #483d8b;">'&quot; LIRC event'</span><span style="color: black;">&#41;</span>
      <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">callable</span><span style="color: black;">&#40;</span>func<span style="color: black;">&#41;</span>:
        func<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://smorgasbord.gavagai.nl/2009/12/lirc-plugin-for-exaile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ja hoor! De deuropener.</title>
		<link>http://smorgasbord.gavagai.nl/2009/11/ja-hoor-de-deuropener/</link>
		<comments>http://smorgasbord.gavagai.nl/2009/11/ja-hoor-de-deuropener/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 18:57:50 +0000</pubDate>
		<dc:creator>Wicher</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[EMI]]></category>
		<category><![CDATA[UPS]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://smorgasbord.gavagai.nl/?p=649</guid>
		<description><![CDATA[Er was eens een handige networksoundserver gebruikmakend van PulseAudio en een USB-soundcard.
Dat werkte dan leuk. Voor een poosje. Soms duurde het poosje lang, soms duurde het poosje kort. Maar het eindigde altijd zo:

hub 2-0:1.0: port 2 disabled by hub (EMI?), re-enabling...
usb 2-2: USB disconnect, address 2

En dan ging ik maar weer de pulseaudio-daemon herstarten. Hmmpf. [...]]]></description>
			<content:encoded><![CDATA[<p>Er was eens een handige networksoundserver gebruikmakend van <a href="http://www.pulseaudio.org/">PulseAudio</a> en een <a href="http://www.terratec.net/en/products/Aureon_Dual_USB_9842.html">USB-soundcard</a>.<br />
Dat werkte dan leuk. Voor een poosje. Soms duurde het poosje lang, soms duurde het poosje kort. Maar het eindigde altijd zo:<br />
<code><br />
hub 2-0:1.0: port 2 disabled by hub (EMI?), re-enabling...<br />
usb 2-2: USB disconnect, address 2<br />
</code><br />
En dan ging ik maar weer de pulseaudio-daemon herstarten. Hmmpf. Frutselen aan de softwareconfiguratie mocht niet baten.</p>
<p>Op een dag ging de bel en zat ik net muziek te luisteren. Iemand gebruikte de elektrische deurontgrendelaar en flop, muziek weg, port disabled. Aha! Dat bleek reproduceerbaar te zijn.</p>
<p>Die deurontgrendelaar werkt met een flinke elektromagneet die ik op de 8V-aftakking van de meterkast heb aangesloten. Kennelijk geeft dat een lekkere optater aan het binnenshuiselijk stroomnet. Mijn versterker zegt ook PATS en geeft de stoot over z&#8217;n line-in door aan het USB-geluidskaartje, en die weer aan de interne USB-hub van de machine waar-ie aan hangt. De hub vindt dat onbehoorlijk en sluit de poort, en terecht. Met &#8220;<code>(EMI?)</code>&#8221; probeert de kernel te vertellen dat er misschien wel iets met elektromagnetische interferentie aan de hand is, maar ja, dat begrijp ik nu pas.</p>
<p>De oplossing blijkt om ook de versterker ook op mijn UPS (Uninterruptable Power Supply) aan te sluiten. Die UPS tovert lelijke rotstroom om in voorbeeldig sinusoïde prik.</p>
<p>Conclusies?</p>
<ol>
<li>Als je de hele dag met softwareproblemen bezig bent wil het wel eens voorkomen dat je een laagbijdegrondse oorzaak (zoals vieze rotstroom) over het hoofd ziet.</li>
<li>Stroom kan vies zijn, en als er Gekke Dingen gebeuren, probeer dan eens een goeie UPS.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://smorgasbord.gavagai.nl/2009/11/ja-hoor-de-deuropener/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fortune files for &#8220;Fight Club&#8221; and Slashdot World History</title>
		<link>http://smorgasbord.gavagai.nl/2009/11/fortune-files-for-fight-club-and-slashdot-world-history/</link>
		<comments>http://smorgasbord.gavagai.nl/2009/11/fortune-files-for-fight-club-and-slashdot-world-history/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 15:42:16 +0000</pubDate>
		<dc:creator>Wicher</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[en_GB]]></category>
		<category><![CDATA[fight club]]></category>
		<category><![CDATA[fortune]]></category>
		<category><![CDATA[slashdot]]></category>

		<guid isPermaLink="false">http://smorgasbord.gavagai.nl/?p=693</guid>
		<description><![CDATA[Instead of cleaning out the kitchen I&#8217;ve prepared two fortune modules and ebuilds to go with them. One contains quotes from &#8220;Fight Club&#8221;, both the movie and the novel. The other one contains the Slashdot history of the world (posted AC).
Get them here.
Teasers
From fightclub-0.1:

That old saying, you always kill the one you love, well look, [...]]]></description>
			<content:encoded><![CDATA[<p>Instead of cleaning out the kitchen I&#8217;ve prepared two fortune modules and ebuilds to go with them. One contains quotes from &#8220;Fight Club&#8221;, both the movie and the novel. The other one contains the <a href="http://games.slashdot.org/comments.pl?sid=180352&#038;cid=14931349">Slashdot history of the world</a> (posted AC).</p>
<p><a href="http://smormedia.gavagai.nl/dist/fortunes/">Get them here</a>.</p>
<h3>Teasers</h3>
<p>From fightclub-0.1:</p>
<blockquote><p>
That old saying, you always kill the one you love, well look, it works both<br />
ways.<br />
	&#8211; Narrator, &#8220;Fight Club&#8221; (novel)
</p></blockquote>
<p>From slashistory-0.1:</p>
<blockquote><p>
A.D. 1789: The French Revolution begins with a distributed denial of service<br />
(DDoS) attack on the Bastille.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://smorgasbord.gavagai.nl/2009/11/fortune-files-for-fight-club-and-slashdot-world-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
