<?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>trivia &#187; tips, tricks and howtos</title>
	<atom:link href="http://baldric.net/category/tips-tricks-and-howtos/feed/" rel="self" type="application/rss+xml" />
	<link>http://baldric.net</link>
	<description>another voice in the babble on the net</description>
	<lastBuildDate>Sat, 19 May 2012 20:18:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>rockbox rocks</title>
		<link>http://baldric.net/2012/04/16/rockbox-rocks/</link>
		<comments>http://baldric.net/2012/04/16/rockbox-rocks/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 15:26:39 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[free software]]></category>
		<category><![CDATA[linux and unix]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[tips, tricks and howtos]]></category>
		<category><![CDATA[open source software]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks and howtos]]></category>

		<guid isPermaLink="false">http://baldric.net/?p=1542</guid>
		<description><![CDATA[Some time ago my wife bought me a Sansa Sandisk Clip+ music player. When she asked me &#8220;what kind of MP3 player&#8221; I would like, I specifically specified the Clip+ because it could handle ogg vorbis encoded audio files. All my audio disks are encoded in this format. Picky I know, but there you go. &#8230; </p><p><a class="more-link block-button" href="http://baldric.net/2012/04/16/rockbox-rocks/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Some time ago my wife bought me a <a href="http://www.sandisk.com/products/sansa-music-and-video-players/sandisk-sansa-clipplus-mp3-player">Sansa Sandisk Clip+</a> music player. When she asked me &#8220;what kind of MP3 player&#8221; I would like, I specifically specified the Clip+ because it could handle ogg vorbis encoded audio files. All my audio disks are encoded in this format. Picky I know, but there you go.</p>
<p>The version she bought me was the 8 GB Black which comes with (you guessed it) 8 GB of internal storage &#8211; sufficient for a fair number of audio tracks. But this version also has a microSDHC slot which will take a maximum of another 32 GB. That should enable me to carry most of my music collection (which currently runs to around 47 GB) if I cut out some of the obvious duplicates and exclude some of my more embarrassing &#8217;70s choices. The device is small, neat and light and also has a pretty good battery life.</p>
<p><a href="http://baldric.net/wp-content/uploads/2012/04/clipplusbig.jpg"><img src="http://baldric.net/wp-content/uploads/2012/04/clipplusbig.jpg" alt="" title="sansa-clip+" width="130" height="189" class="aligncenter size-full wp-image-1543" /></a></p>
<p>But Sansa have not been entirely honest in their advertising. Sure, the device will accept additional storage, but it is largely unusable. Once you get past around 6 or 7 GB on the internal storage and even as little as 3 or 4 GB on the additional card, the device is not capable of building its database of the collection. The symptom is pretty obvious. As soon as you disconnect the Clip+ from the USB connection used to transfer files (and incidentally to charge the device) the display shows &#8220;Refreshing your media&#8221; and a progress bar which slowly fills from left to right. If you only use the internal storage, there is no problem, but as soon as you get past the 3 or 4 GB additional store on the external card, the clip+ will sit there, refreshing away, for hour after hour if you let it. </p>
<p>Even after a firmware upgrade, the device wouldn&#8217;t do what it was supposed to, so I turned to the FLOSS community yet again. This time in the shape of <a href="http://www.rockbox.org/wiki/WhyRockbox">rockbox</a>.  </p>
<p>Rockbox is a free, open source jukebox utility which runs on a wide variety of devices. The website provides detailed instructions on how to install and use rockbox and even comes with an installer for most operating systems so that you don&#8217;t have to get your hands dirty installing it manually. Most impressive of all however, is that the rockbox firmware can be installed alongside the original player&#8217;s firmware without danger of bricking the device. If you find that you don&#8217;t like rockbox (and what&#8217;s not to like about a free product that outperforms the paid for original?) you can still boot into the original firmware because rockbox provides a dual boot facility. And if you really don&#8217;t like it, then you can simply remove it and go back to using the original.</p>
<p>Thoroughly recommended. </p>
]]></content:encoded>
			<wfw:commentRss>http://baldric.net/2012/04/16/rockbox-rocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>android mail client is broken</title>
		<link>http://baldric.net/2012/03/24/android-mail-client-is-broken/</link>
		<comments>http://baldric.net/2012/03/24/android-mail-client-is-broken/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 22:03:12 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[mail and mail lists]]></category>
		<category><![CDATA[networks and networking]]></category>
		<category><![CDATA[tips, tricks and howtos]]></category>
		<category><![CDATA[trivial musing]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mobile phone]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[system administration]]></category>

		<guid isPermaLink="false">http://baldric.net/?p=1494</guid>
		<description><![CDATA[In January of this year I wrote about t-mobile&#8217;s apparent policy of actively looking for and blocking any TLS-secured SMTP sessions over their network. At the time I believed this to be a cockup rather than a deliberate policy. I still prefer to believe that, but the episode left a rather sour taste in my &#8230; </p><p><a class="more-link block-button" href="http://baldric.net/2012/03/24/android-mail-client-is-broken/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>In January of this year I wrote about<a href="http://baldric.net/2012/01/12/t-mobile-resets-its-policy/"> t-mobile&#8217;s apparent policy</a> of actively looking for and blocking any TLS-secured SMTP sessions over their network. At the time I believed this to be a cockup rather than a deliberate policy. I still prefer to believe that, but the episode left a rather sour taste in my mouth. So this month I took the opportunity presented by the end of my contract to shift to another provider. Of course, in doing so I gained a nice shiny new &#8216;phone which meant that I could spend a fun few hours setting it up the way I wanted it and nailing it down as much as possible so that it didn&#8217;t leak <strong>all</strong> my data to google. This is unnecessarily difficult, and much harder than it should be (and I know that people like Peter H will simply tell me that I shouldn&#8217;t be using an android &#8216;phone in the first place). But that is not the point of this post.</p>
<p>Like most people these days, I use my &#8216;phone to pick up email. The standard email client on my last &#8216;phone was pretty uninspiring so I used <a href="https://github.com/k9mail/k-9/wiki">K-9 mail</a> in its place. K-9 is a pretty good application, but it has a <a href="http://code.google.com/p/k9mail/issues/detail?id=350&amp;can=1&amp;q=CertPathValidatorException&amp;colspec=ID%20Product%20Type%20Status%20Priority%20Milestone%20Owner%20Summary">silly little bug</a> in it which is still not sorted properly. This bug manifests itself in a rather odd, and unpredictable way &#8211; K-9 seems to &#8220;forget&#8221; the X509 certificate used to protect the authentication process if that certificate is self-signed, or otherwise not verifiable by an external CA. The cure, such as it is, is to simply refresh the certificate by reloading the account settings and accepting the cert when K-9 warns you that &#8220;TrustAnchor found but validation failed&#8221;. The length of time between accepting the cert and K-9 &#8220;forgetting&#8221; it again seemed random to me, so I got into the habit of refreshing my account settings whenever I noticed that I hadn&#8217;t received any mail for a while. Annoying, but not ultimately a deal breaker for using what was otherwise a pretty good application.</p>
<p>So, the first application I looked at on my new mobile was, of course, email. The default mail client on this new phone looks a lot slicker than the old one on my previous phone, but then it is a much newer &#8216;phone, from a different manufacturer and the android version is much newer too, so no real surprise there. The setup seemed to have no problem with my self signed certs so I thought I might stay with the default to see if it would solve my annoying little problem with K-9.</p>
<p>Unfortunately not.</p>
<p>Whilst I had no problem with incoming mail over my IMAPS connection, all attempts to send mail failed. On checking my server logs I found the following (real details changed or obfuscated):</p>
<blockquote><p>Mar 20 20:45:57 pipe postfix/smtpd[7594]: NOQUEUE: reject: RCPT from home.baldric.net[12.34.56.78]: 504 5.5.2 &#60;localhost&#62;: Helo command rejected: need fully-qualified hostname; from=&#60;null@baldric.net&#62; to=&#60;noone@baldric.net&#62; proto=ESMTP helo=&#60;localhost&#62;
</p></blockquote>
<p>Aha! My postfix configuration is set up to reject hosts which do not have valid hostnames or do not announce themselves with fully qualified domain names (i.e. names of the form &#8220;host.domain&#8221;). Now since I use SASL authentication in my postfix configuration the fix is relatively easy; just ensure that the stanza &#8220;permit_sasl_authenticated&#8221; appears in both &#8220;smtpd_sender_restrictions&#8221; and &#8220;smtpd_helo_restrictions&#8221; <strong>before</strong> &#8220;reject_non_fqdn_hostname&#8221; &#8211; thusly:</p>
<blockquote><p>smtpd_helo_required = yes<br />
smtpd_helo_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_hostname, reject_invalid_hostname<br />
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain</p></blockquote>
<p>(In fact, this episode highlighted an error in my postfx configuration because my helo restriction was inadequate. By now checking the authentication before the helo restriction kicks in I am still well protected, but mail from valid authenticated users is permitted.)</p>
<p>I am in that (very) small minority of people who run their own mail servers and are able to change server side configurations. But, and this is a big but. I should <strong>not have to change the server side configuration to accommodate a broken client</strong> and the vast majority of people will not be able to do so anyway. Almost all well set up mail servers will reject mail where the client connection announces itself in the helo exchange as &#8220;localhost&#8221;. That is normally an indication of a spammer, indeed spamassassin will allocate a high score to any mail which is so flagged. This means that there will be a huge, and growing, number of people who cannot send mail from their android &#8216;phones.</p>
<p>If this is the default android mail behaviour, then google need to fix it now. Meanwhile, K-9 is looking attractive again.</p>
]]></content:encoded>
			<wfw:commentRss>http://baldric.net/2012/03/24/android-mail-client-is-broken/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>moxie&#8217;s proxy</title>
		<link>http://baldric.net/2012/01/22/moxies-proxy/</link>
		<comments>http://baldric.net/2012/01/22/moxies-proxy/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 19:02:14 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[free software]]></category>
		<category><![CDATA[net tools]]></category>
		<category><![CDATA[network (in)security]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[tips, tricks and howtos]]></category>
		<category><![CDATA[trivial musing]]></category>
		<category><![CDATA[anonymity]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[network security]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[TOR]]></category>
		<category><![CDATA[tricks and howtos]]></category>

		<guid isPermaLink="false">http://baldric.net/?p=1288</guid>
		<description><![CDATA[Moxie Marlinspike, a security researcher probably best known for his SSL proxy tool, likes google even less than I do. His googlesharing website says: &#8220;Google thrives where privacy does not. If you&#8217;re like most internet users, Google knows more about you than you might be comfortable with. Whether you were logged in to a Google &#8230; </p><p><a class="more-link block-button" href="http://baldric.net/2012/01/22/moxies-proxy/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Moxie Marlinspike, a security researcher probably best known for his <a href="http://www.thoughtcrime.org/software/sslsniff/">SSL proxy</a> tool, likes google even less than I do. His <a href="http://www.googlesharing.net/">googlesharing</a> website says:</p>
<blockquote><p>&#8220;Google thrives where privacy does not. If you&#8217;re like most internet users, Google knows more about you than you might be comfortable with. Whether you were logged in to a Google account or not, they know everything you&#8217;ve ever searched for, what search results you clicked on, what news you read, and every place you&#8217;ve ever gotten directions to. Most of the time, thanks to things like Google Analytics, they even know which websites you visited that you didn&#8217;t reach through Google. If you use Gmail, they know the content of every email you&#8217;ve ever sent or received, whether you&#8217;ve deleted it or not.</p>
<p>They know who your friends are, where you live, where you work, and where you spend your free time. They know about your health, your love life, and your political leanings. These days they are even branching out into collecting your realtime GPS location and your DNS lookups. In short, not only do they know a lot about what you&#8217;re doing, they also have significant insight into what you&#8217;re thinking.&#8221;
</p></blockquote>
<p>His solution to this problem was interesting. He came up with the idea of a proxy system which would intercept all google queries, strip off identifying material (such as cookies and UserAgent strings and other HTTP headers) substitute new identifiers and mix the requests up with those from other users before forwarding to google. Implementation depended upon a Firefox addon (nothing for other browsers) which identified google queries and forwarded them to the proxy. All other traffic was untouched.  </p>
<p><a href="http://baldric.net/wp-content/uploads/2012/01/google-sharing-proxy.png"><img src="http://baldric.net/wp-content/uploads/2012/01/google-sharing-proxy.png" alt="image of googlesharing proxy" title="google-sharing-proxy" width="192" height="268" class="aligncenter size-full wp-image-1289" /></a></p>
<p>I stopped using google (except via <a href="https://ssl.scroogle.org/">scoogle</a>) some time ago, and when Moxie&#8217;s new proxy first surfaced I thought it interesting but susceptible to the same problem I <a href="http://baldric.net/2009/07/05/tor-on-a-vps/">discussed in mid 2009</a> when writing about <a href="http://blogs.law.harvard.edu/hroberts/about/">Hal Roberts&#8217;</a> experience of GIFC &#8211; all you are doing is shifting knowledge of your searches from google to a new intermediary.  However, Moxie later addressed <a href="http://www.googlesharing.net/faq.html#faq7">this problem</a> with the release of version 0.20 of his addon so I thought I&#8217;d take another look at it. Unfortunately the addon won&#8217;t work with FF 9 (which I am using). Moxie&#8217;s proxy is not the only one out there however. Because he released the code under an open source licence, others have picked it up. I found one at <a href="http://gs.netsend.nl/">gs.netsend.nl</a>. They also provide an updated FF addon which will work with versions up to 15 (i.e. probably around next wednesday given the speed with which Mozilla is currently shipping new FF releases). </p>
<p>Once the addon is installed, it gives you two proxy options in the preferences settings &#8211; one is the original proxy.googlesharing.net, the other is gs.netsend.nl itself. In testing I found that the original googlesharing proxy seemed to be off-line, but when using the netsend.nl proxy I was reassured to see the message &#8220;Search results anonymized by GoogleSharing&#8221; added to the google homepage. I was even more reassured that my sniffer showed a connection to vps1101.pcextreme.nl on 31.21.98.201 and not to any known google network.</p>
<p>So, will I use it? Maybe. But the proxy mechanism seems to be unreliable. In many tests, the proxy connection seemed to be bypassed and the connection was obviously made direct to google (as evidenced by my sniffer). I think this failure is doubly unfortunate because it does not fail safe (i.e. the connection does not simply fail with an error message, it passes you direct through to google). This could lead the unwary to think that they are protected when in fact they are not.</p>
<p>I prefer not to use google at all. And in those cases where I do want to compare results with another search engine I prefer to do so via tor. But it is one more option in my toolkit if used carefully. And if using it pisses off google, then it is worth it occasionally.    </p>
]]></content:encoded>
			<wfw:commentRss>http://baldric.net/2012/01/22/moxies-proxy/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>tails in a spin</title>
		<link>http://baldric.net/2012/01/12/tails-in-a-spin/</link>
		<comments>http://baldric.net/2012/01/12/tails-in-a-spin/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 19:15:52 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[coding and admin]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[net tools]]></category>
		<category><![CDATA[networks and networking]]></category>
		<category><![CDATA[tips, tricks and howtos]]></category>
		<category><![CDATA[trivial musing]]></category>
		<category><![CDATA[anonymity]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://baldric.net/?p=1258</guid>
		<description><![CDATA[When I first tested running a tails mirror on one of my VMs, the traffic level reported by vnstat ran at around 20-30 GiB per day. I figured I could live with that because it meant that my total monthly traffic would be unlikely to exceed my monthly 1TB allowance. However, when I checked the &#8230; </p><p><a class="more-link block-button" href="http://baldric.net/2012/01/12/tails-in-a-spin/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>When I first tested running a <a href="http://baldric.net/2011/12/20/the-amnesic-incognito-live-system/">tails</a> mirror on one of my VMs, the traffic level reported by vnstat ran at around 20-30 GiB per day. I figured I could live with that because it meant that my total monthly traffic would be unlikely to exceed my monthly 1TB allowance. However, when I checked the stats on that server last week (around the 9th of Jan) I found that I was shipping out around 150 GiB per day and vnstat was predicting a monthly total of close to 3 TB. As the tails admins said when I told them that I would have to shut off the mirror on that VM while I sorted something, &#8220;Ooops&#8221;. Ooops indeed. I couldn&#8217;t chance a massive bill for exceeding my bandwidth allowance by quite that much. The actual stats for 4, 5, 6, 7, 8 and 9 January before I pulled the plug were: 34.23 GiB, 69.14 GiB, 178.31 GiB, 131.68 GiB, 99.05 GiB and 133.27 Gib. It turns out that tails 0.10 was released on 4 January and I hadn&#8217;t been prepared. A lesson learned.</p>
<p>Having shut down and had the DNS round robin amended, I attended to finding some way of throttling my traffic so that I could live within my allowance whilst still providing a useful mirror. I scratched my head for a while before stumbling on the obvious, I should be throttling at application level. (Sometimes I find that I miss simple answers because I am looking for complicated ones). </p>
<p>I started out by assuming that I should be using <a href="http://lartc.org/">tc</a> and <a href="http://www.netfilter.org/">iptables</a> mangling, or something like the userspace tool <a href="http://monkey.org/~marius/pages/?page=trickle">trickle</a>, all of which looked horribly more complicated than the approach taken by tor (which allows you to simply set the acceptable bandwidth rate to some limit, plus set an accounting period maximum of some total transfer limit per day/week whatever). And of course it turns out that my webserver (lighttpd) allows something similar. Just set the server limit to some chosen max transfer rate and, if necessary, also impose a per IP max rate. The magic configuration file options are:</p>
<blockquote><p># limit server throughput to 3000 kbytes/sec (~30000 kbits/sec)<br />
server.kbytes-per-second = 3000<br />
#<br />
# and limit individual connections to 50 kbytes (~500 kbits/sec) &#8211; NB. I don&#8217;t actually use this<br />
# connection.kbytes-per-second = 50
</p></blockquote>
<p>I tested this by pulling a copy of the tails iso from one of my other VMs which has a high bandwidth connection and got acceptable (and expected) results. So now I can go back on-line later this month safe in the knowledge that I&#8217;m not going to blow all my bandwidth in one week. </p>
]]></content:encoded>
			<wfw:commentRss>http://baldric.net/2012/01/12/tails-in-a-spin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tunnelling X over ssh</title>
		<link>http://baldric.net/2011/12/19/tunnelling-x-over-ssh/</link>
		<comments>http://baldric.net/2011/12/19/tunnelling-x-over-ssh/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 20:18:14 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[coding and admin]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[linux and unix]]></category>
		<category><![CDATA[network (in)security]]></category>
		<category><![CDATA[networks and networking]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tips, tricks and howtos]]></category>
		<category><![CDATA[trivial musing]]></category>
		<category><![CDATA[network security]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks and howtos]]></category>

		<guid isPermaLink="false">http://baldric.net/?p=1233</guid>
		<description><![CDATA[OK, yes, I know there are probably already a gazillion web pages on the &#8216;net explaining exactly how to do this, but I got caught out by a silly gotcha when I tried to do this a couple of days ago, so I thought I&#8217;d post a note. Firstly, X is not exactly a secure &#8230; </p><p><a class="more-link block-button" href="http://baldric.net/2011/12/19/tunnelling-x-over-ssh/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>OK, yes, I know there are probably already a gazillion web pages on the &#8216;net explaining exactly how to do this, but I got caught out by a silly gotcha when I tried to do this a couple of days ago, so I thought I&#8217;d post a note.</p>
<p>Firstly, X is not exactly a secure protocol, nor is it easy to filter at NAT firewalls, so the ability to tunnel it over ssh is hugely welcome. In fact, ssh can be used to tunnel practically any other protocol you care to name, so it should be your first port of call should you wish to connect to a remote system using an insecure protocol. (I use it to wrap rsync for example). </p>
<p>I don&#8217;t run X on my VMs (there is no need, they don&#8217;t run desktop software) and I had not previously seen the need to run X based graphical programs on those servers. However, a couple of days ago I thought it would be really useful to run etherape on one particular remote server so that I could watch the traffic patterns. Normally I use iptraf (which is ncurses based) when I want to monitor network traffic in real time, but etherape is pretty cool and gives a nice graphical view of your network connections. But it runs on an X based gui.</p>
<p>So. I changed the remote server&#8217;s sshd_config to enable X forwarding (<strong>&#8220;X11Forwarding no&#8221;</strong> becomes <strong>&#8220;X11Forwarding yes&#8221;</strong>) and restarted sshd. On my desktop I similarly changed my local ssh_config file to allow X forwarding (<strong>&#8220;ForwardX11 no&#8221;</strong> becomes <strong>&#8220;ForwardX11 yes&#8221;</strong>) to obviate the need to use the -X switch on the command line. I then installed etherape on the remote server and fired it up only to get the message <strong>&#8220;Error: no display specified&#8221;</strong>. Sure enough <strong>&#8220;echo $DISPLAY&#8221;</strong> showed nothing. But I had thought (and everything I had read confirmed) that ssh should take care of setting the appropriate display when X11 forwarding was set. </p>
<p>So I then tried setting a display manually (<strong>export DISPLAY=localhost:10.0</strong> on the remote server) and then got the response <strong>&#8220;Error: cannot open display: localhost:10.0&#8243;</strong>. So, still no deal.  I spent some time scratching my head (and reading man pages) and sent off a query to my local Linux User group in parallel asking for advice. They were gentle with me.</p>
<p>The first, and rapid, response, said: </p>
<blockquote><p>On the server:</p>
<p>    sudo apt-get install xauth</p>
<p>Then disconnect and reconnect the client.</p>
<p>Jobs a good un.</p></blockquote>
<p>Thank you Brett.</p>
<p>So the moral is, make sure that you have X authorisation working properly on the remote system (check for the existence of $HOME/.Xauthority) if you experience the same symptoms I did. </p>
]]></content:encoded>
			<wfw:commentRss>http://baldric.net/2011/12/19/tunnelling-x-over-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>webcam mark II</title>
		<link>http://baldric.net/2011/09/27/webcam-mark-ii/</link>
		<comments>http://baldric.net/2011/09/27/webcam-mark-ii/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 20:30:46 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[linux and unix]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[tips, tricks and howtos]]></category>
		<category><![CDATA[trivial musing]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[NSLU2]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://baldric.net/?p=862</guid>
		<description><![CDATA[Upgrading the slugs to squeeze killed the webcam. At first I thought that squeeze was missing the necessary gspca drivers, but no, a quick look in /dev revealed an entry for video0 and &#8220;lsmod&#8221; reported &#8220;gspca_zc3xx&#8221; loaded correctly. This is a different driver to that which my camera loaded in lenny (spca5xx) but a quick &#8230; </p><p><a class="more-link block-button" href="http://baldric.net/2011/09/27/webcam-mark-ii/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Upgrading the slugs to squeeze killed the <a href="http://webcam.baldric.net/">webcam</a>. At first I thought that squeeze was missing the necessary gspca drivers, but no, a quick look in /dev revealed an entry for video0 and &#8220;lsmod&#8221; reported &#8220;gspca_zc3xx&#8221; loaded correctly. This is a different driver to that which my camera loaded in lenny (spca5xx) but a quick search around the web confirmed that the camera should be happy with the new driver. So clearly the webcam program itself was at fault (confirmed by checking the output when running the program by hand). Time to find an alternative.</p>
<p>A scan of the debian <a href="http://packages.debian.org/">repositories</a> turned up a bunch of possibilities, some of which I had looked at in the past when first installing the camera. I eventually plumped for <a href="http://www.firestorm.cx/fswebcam/">fswebcam</a> because it was quick and easy to install and configure, it seemed to be actively supported (unlike Gerd Knorr&#8217;s old program) and it didn&#8217;t need a GUI. More to the point, it works with my old Logitech camera.</p>
<p>The program can be run from the command line with option switches or configured to read its options from a config file. And despite being advertised as a tiny, it has quite a rich feature set.  It can even perform simple manipulation of the captured image, such as resizing, averaging multiple frames or overlaying a caption on the image. Nifty.</p>
<p>My current config file is shown below as an example. I may change this because I&#8217;m not quite happy with the brightness/contrast mixture and I&#8217;m still playing with the options available. Still, a recommended package.</p>
<blockquote><p>
# /etc/fswebcam.conf<br />
#<br />
# config file for fswebcam utility<br />
#<br />
# device and input are defaults<br />
device /dev/video0<br />
input 0<br />
# log messages  &#8211; only use this is debugging setup<br />
# log /var/log/fswebcam.log<br />
# repeat image capture every 30 seconds<br />
loop 30<br />
# set number of frames to skip if the camera sends bad frames on startup.<br />
# Note &#8211; this is only necessary when using the camera for video capture<br />
# skip 10<br />
# background the webcam process<br />
background<br />
# set resolution of image (default is 384 x 288)<br />
resolution 320X240<br />
# set the palette to use in the output format (here JPEG) and the jpeg quality<br />
# (my camera doesn&#8217;t like this option so it is commented out)<br />
# palette JPEG<br />
jpeg 95<br />
# set some additional controls<br />
# (use &#8220;fswebcam -d v4l2:/dev/video0 &#8211;list-controls&#8221; to see options)<br />
set brightness=55%<br />
set contrast=40%<br />
# place the banner at the bottom of the image (default)<br />
bottom-banner<br />
# and colour it black<br />
banner-colour #000000<br />
# set the font to use in the banner title and timestamp<br />
font /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf<br />
# set the title and timestamp to display in the banner &#8211; (timestamp uses strftime format)<br />
title &#8220;Webcam on the Slug&#8221;<br />
timestamp &#8220;%d %B %Y  at  %H:%M:%S&#8221;<br />
# where we save the image<br />
save /home/web/webcam.baldric.net/images/webcam.jpeg<br />
#<br />
# end
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://baldric.net/2011/09/27/webcam-mark-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>squeezing the slugs</title>
		<link>http://baldric.net/2011/09/26/squeezing-the-slugs/</link>
		<comments>http://baldric.net/2011/09/26/squeezing-the-slugs/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 19:32:43 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[coding and admin]]></category>
		<category><![CDATA[linux and unix]]></category>
		<category><![CDATA[tips, tricks and howtos]]></category>
		<category><![CDATA[trivial musing]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[NSLU2]]></category>
		<category><![CDATA[system administration]]></category>

		<guid isPermaLink="false">http://baldric.net/?p=856</guid>
		<description><![CDATA[Debian 6 (squeeze) has been the current stable version since February 2011. The latest version (6.02) was released in late June. I have put off updating my slugs from lenny (old stable) for a while because I wanted to see how others faired before committing myself. Indeed, initial reports on the debian arm list indicated &#8230; </p><p><a class="more-link block-button" href="http://baldric.net/2011/09/26/squeezing-the-slugs/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.debian.org/releases/">Debian 6</a> (squeeze) has been the current stable version since February 2011. The latest version (6.02) was released in late June. I have put off updating my <a href="http://baldric.net/2008/04/07/slugs-as-pets/">slugs</a> from lenny (old stable) for a while because I wanted to see how others faired before committing myself. Indeed, initial reports on the debian arm list indicated that the upgrade could be problematic. Worse, a completely clean install of squeeze turns out to be impossible because the debian installer uses more memory than is physically available on the slugs. So the only way to go, even for a clean new installation, is to install lenny first, then upgrade. </p>
<p>Given that both my slugs are operational, and are now an integral part of my network, I decided to invest in a new one as a development machine to test the upgrade rather than risk fritzing a perfectly good setup. (Back in the day I would have been happy to &#8220;fix it &#8217;till it broke&#8221;, but these days I don&#8217;t really need to experiment that much and I&#8217;d rather keep a working system, well, working).</p>
<p>Second hand slugs go for around £25 on ebay, and there are still plenty about, so I bid for one that had only about a day to go and was successful. Unfortunately, when it turned up I found that the power supply was fsckd and so I had to switch off one of my operational slugs in order to test the new one. Happily it appeared to boot up OK so I fired off a disgruntled email to the seller and then ordered a new PSU. The seller claimed that it &#8220;worked OK when I boxed it&#8221; and didn&#8217;t offer to pay for the replacement PSU so I wasn&#8217;t too happy with him. I became even less happy when the new PSU arrived and I booted up the slug in preparation for reconfiguration to match my network before installing debian. </p>
<p>The debian installation process is handled via an SSH shell. You need to know the address of the slug in order to connect and install. The installer also needs the addresses of a local DNS server and the default route to the outside world (so it can find the servers containing the installation packages). Now the default, factory settings, for slugs includes a fixed IP address of 192.168.1.77. If this does not match your requirements, it must be changed <strong>before</strong> reflashing with debian. Guess what? The default address didn&#8217;t work, so the previous owner must have reconfigured the slug to match his network and he had not bothered to reset to factory default before selling. Nor had he been considerate enough to let me know the new configuration. Needless to say I won&#8217;t be buying anything else from him. Nor did he get decent feedback.</p>
<p>I couldn&#8217;t reconfigure the new slug until I could connect so I needed to find out what address it was using. A quick nmap scan of the 192.168.1.0/24 netblock showed that it wasn&#8217;t even on the default network range so I fired up wireshark and etherape on one of my machines in the hope of catching the slug arping and getting the address from the request. In the event, etherape proved to be quicker (and easier) in providing the answer since the slug quickly popped up and disclosed its IP address as 192.168.2.10. Adding a route to the 192.168.2.0/24 net then allowed me to finally connect and reconfigure the new beast to suit my network. I then rebooted and started a fresh installation of lenny (as previously <a href="http://baldric.net/debian-linux-on-a-linksys-nslu2-the-slug/">described</a> in one of my earlier posts). About four hours later I had a nice new clean slug running lenny.</p>
<p>However, since the main purpose of getting the new slug was to allow me to test the upgrade to squeeze in safety I really needed to make it look like my main operational slug. That slug is my DNS and DHCP server, and primary rsync backup for my desktops. It also runs a webserver. Like most (lazy) sysadmins my system documentation tends to lag somewhat behind reality so I can&#8217;t rely on the various readme files I routinely create on my boxes to be <em>completely</em> up to date (or even accurate). Fortunately for me though, debian provides a neat way of snapshotting installed packages on a system. You can then use this snaphot to create a mirror of that system which will include all the same packages. Here&#8217;s how:</p>
<p>On the source system:</p>
<blockquote><p>
dpkg &#8211;get-selections | grep -v deinstall > packages.txt
</p></blockquote>
<p>This lists all active packages, except those deinstalled, and sticks the list in a text file. </p>
<p>Now copy that file to the target system, ensure that the target system&#8217;s &#8220;sources.list&#8221; file matches that on the source, and then run:</p>
<blockquote><p>
dpkg &#8211;clear-selections<br />
dpkg &#8211;set-selections < packages.txt<br />
apt-get dselect-upgrade
</p></blockquote>
<p>This will download and install all the packages necessary to get the target system matching the source. </p>
<p>All that is now left to do is copy across any relevant configuration files so that the two systems fully match and then rebooot the target to check that everything looks OK. </p>
<p>New slug now finally matching old slug it was time to upgrade to squeeze. Martin Michalmayr&#8217;s excellent <a href="http://www.cyrius.com/debian/nslu2/tips.html#upgrade">website</a> documents the upgrade process in meticulous detail. The key points to note here are his recommendation that you read the release notes for debian 6.0. In particular, note and follow the <a href="http://www.debian.org/releases/stable/armel/release-notes/ch-upgrading.en.html">chapter</a> on upgrades from debian 5.0 before attempting an actual upgrade. One of the main differences between 5.0 and 6.0 is the use of UUIDs to reference disks. In my case this meant changing my /etc/fstab from this:</p>
<blockquote><p>
# /etc/fstab: static file system information.<br />
#<br />
# <file system> <mount point>   <type><br />
<options>       <dump>
<pass>
proc            /proc           proc    defaults        0       0<br />
/dev/sda2       /               ext3    errors=remount-ro 0       1<br />
/dev/sda1       /boot           ext2    defaults        0       2<br />
/dev/sda5       none            swap    sw              0       0
</p></blockquote>
<p>to this:</p>
<blockquote><p>
# /etc/fstab: static file system information.<br />
#<br />
# <file system> <mount point>   <type><br />
<options>       <dump>
<pass>
proc            /proc           proc    defaults        0       0<br />
UUID=db57451a-e3e5-4d8a-95b9-494c48bb5e8d      /        ext3    errors=remount-ro 0       1<br />
UUID=022bc211-1c52-4848-9ee1-e211e72b28e4      /boot    ext2    defaults        0       2<br />
/dev/sda5       none            swap    sw              0       0
</p></blockquote>
<p>Before finally starting the upgrade I opened two separate SSH sessions to the slug. In one I ran the upgrade process as below:</p>
<p>first a partial upgrade as recommended at Section 4.4.4, “Minimal system upgrade”</p>
<blockquote><p>
apt-get update<br />
apt-get upgrade
</p></blockquote>
<p>then install the required linux kernel image and udev as outlined in Section 4.4.5. &#8220;Upgrading the kernel and udev&#8221;</p>
<blockquote><p>
apt-get install linux-image-2.6-ixp4xx<br />
apt-get install udev
</p></blockquote>
<p>followed by</p>
<blockquote><p>
reboot
</p></blockquote>
<p>and</p>
<blockquote><p>
apt-get upgrade<br />
apt-get dist-upgrade
</p></blockquote>
<p>to complete the system upgrade. </p>
<p>Now here is where the second SSH session is most useful. The final upgrade and distribution upgrade installs the file indexing package &#8220;apt-xapian-index&#8221;. Correspondents on the debian arm list have noted that this package consumes more memory than is available on the poor old slug and it starts swapping itself to death. The process must be killed immediately and the package removed. If you leave it too long after the upgrade has completed you will find it impossible to log in until the initial indexation has completed (in excess of 24 hours or more has been reported) because the system is too busy. I ran &#8220;top&#8221; in the second shell during the dist-upgrade process and kept an eye on the load averages. As soon as they started climbing above 3 I knew that it was time to watch out for the apt-xapian-indexer and kill it. Once the system load returned to normal I was then able to finalise the upgrade with:</p>
<blockquote><p>
apt-get purge apt-xapian-index<br />
apt-get autoremove
</p></blockquote>
<p>to remove the offending indexer and clean up any residual unneeded packages. A final reboot to check all was well was sufficient to convince me that it was safe to upgrade my two operational slugs using the same process. Testing the upgrade on the new slug in the way I did also meant that I now had a backup slug configured exactly like my main DNS server but running squeeze. Any failure on the remaining upgrade would not then be critical.</p>
<p>I must be getting old. I never used to be this cautious.  </p>
]]></content:encoded>
			<wfw:commentRss>http://baldric.net/2011/09/26/squeezing-the-slugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress setup</title>
		<link>http://baldric.net/2011/01/24/wordpress-setup/</link>
		<comments>http://baldric.net/2011/01/24/wordpress-setup/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 17:03:30 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[tips, tricks and howtos]]></category>
		<category><![CDATA[trivial musing]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[blogs]]></category>

		<guid isPermaLink="false">http://baldric.net/?p=721</guid>
		<description><![CDATA[I have just added a couple of new plugins to this blog and tidied up some old cruft that I had been meaning to get around to for a while. One of the plugins I have added is a really rather good statistcs tool called Counterize II. It provides a very quick (and impressively comprehensive) &#8230; </p><p><a class="more-link block-button" href="http://baldric.net/2011/01/24/wordpress-setup/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I have just added a couple of new plugins to this blog and tidied up some old cruft that I had been meaning to get around to for a while. One of the plugins I have added is a really rather good statistcs tool called <a href="http://www.navision-blog.de/counterize-ii-english/">Counterize II</a>. It provides a very quick (and impressively comprehensive) set of stats about page hits, browser types, referring URLs etc. all readily accessible from the wordpress admin dashboard &#8211; so no need to trawl through web logs to find out where your visitors are coming from or which is your most popular post or page. Thoroughly recommended.</p>
<p>In the process of searching for such a plugin I also came across <a href="http://www.problogdesign.com/wordpress/the-ultimate-guide-to-setting-up-wordpress-after-an-install/">Angie Bowen&#8217;s posting</a> about the top ten things she always does when setting up a new blog. Whilst I don&#8217;t agree with all her recommendations (identifying the ones I disagree with is left as an exercise for the class) I think this is a very handy aide-memoire. Her pointers about blog security and discussion settings in particular are sensible and worth reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://baldric.net/2011/01/24/wordpress-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a graphical web of trust</title>
		<link>http://baldric.net/2010/09/12/a-graphical-web-of-trust/</link>
		<comments>http://baldric.net/2010/09/12/a-graphical-web-of-trust/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 19:53:34 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[free software]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[tips, tricks and howtos]]></category>
		<category><![CDATA[trivial musing]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source software]]></category>
		<category><![CDATA[pgp]]></category>

		<guid isPermaLink="false">http://baldric.net/?p=660</guid>
		<description><![CDATA[I recently stumbled upon sig2dot, a gpg/pgp keyring graph generator. In fact this seems to have been around for some time, but I&#8217;d never come across it before. It can be used to generate a graph of all of the signature relationships in a GPG/PGP keyring, and, like other visualisation tools, this graphical image producing &#8230; </p><p><a class="more-link block-button" href="http://baldric.net/2010/09/12/a-graphical-web-of-trust/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I recently stumbled upon <a href="http://www.chaosreigns.com/code/sig2dot/">sig2dot</a>, a gpg/pgp keyring graph generator. In fact this seems to have been around for some time, but I&#8217;d never come across it before. It can be used to generate a graph of all of the signature relationships in a GPG/PGP keyring, and, like other visualisation tools, this graphical image producing program can give new insight into relationships between objects. </p>
<p>The sig2dot program itself is available in the debian/ubuntu repositories in the package called &#8220;signing-party&#8221;. But unless you want to install a shed load of other unnecessary cruft along with it (exim? for god&#8217;s sake, why?), I recommend you simply pull the perl code direct from the author&#8217;s site. Along with the sig2dot program itself, you will need &#8220;neato&#8221; from the graphviz package and &#8220;convert&#8221; from the wondrous imagemagick package suite. If you don&#8217;t already have those installed then it is pretty safe to pull them from your distro&#8217;s package repository.</p>
<p>That done, try the following:</p>
<blockquote><p>first create an ascii graphviz dot file ready for neato</p>
<p>$ gpg &#8211;list-sigs &#8211;keyring ~/.gnupg./pubring.gpg | sig2dot.pl > ~/.gnupg/pubring.dot</p>
<p>now convert to a postscipt file</p>
<p>$ neato -Tps ~/.gnupg/pubring.dot > ~/.gnupg/pubring.ps</p>
<p>before using imagmagick to convert to a png graphic</p>
<p>$ convert ~/.gnupg/pubring.ps ~/.gnupg/pubring.png</p>
</blockquote>
<p>Those of you with gpg keyrings may wish to try it out (and no. I&#8217;m not going to show you mine).</p>
]]></content:encoded>
			<wfw:commentRss>http://baldric.net/2010/09/12/a-graphical-web-of-trust/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>update to autossh &#8211; or how ServerAliveInterval makes this unnecessary</title>
		<link>http://baldric.net/2010/08/27/update-to-autossh-or-how-serveraliveinterval-makes-this-unnecessary/</link>
		<comments>http://baldric.net/2010/08/27/update-to-autossh-or-how-serveraliveinterval-makes-this-unnecessary/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 20:16:04 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[networks and networking]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tips, tricks and howtos]]></category>
		<category><![CDATA[trivial musing]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://baldric.net/?p=633</guid>
		<description><![CDATA[I had a couple of comments on my earlier post about autossh which suggested that I should look at alternative mechanisms for keeping my ssh tunnel up. Rob in particular suggested that setting &#8220;ServerAliveInterval&#8221; should work. Oddly I had tried this in the past whilst trying out various configuration options and I swear it didn&#8217;t &#8230; </p><p><a class="more-link block-button" href="http://baldric.net/2010/08/27/update-to-autossh-or-how-serveraliveinterval-makes-this-unnecessary/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I had a couple of comments on my earlier post about autossh which suggested that I should look at alternative mechanisms for keeping my ssh tunnel up. Rob in particular suggested that setting &#8220;ServerAliveInterval&#8221; should work. Oddly I had tried this in the past whilst trying out various configuration options and I swear it didn&#8217;t work for me. But since the autossh mechanism felt inelegant I thought I&#8217;d revisit my ssh_config file as Rob suggested. And indeed setting ServerAliveInterval to 300 (i.e. 5 minutes) solved my tunnel drop problem. I&#8217;d guess that other intervals of less than 1 hour would equally work but I haven&#8217;t checked.</p>
<p>I have no idea why my earlier experiments failed.</p>
]]></content:encoded>
			<wfw:commentRss>http://baldric.net/2010/08/27/update-to-autossh-or-how-serveraliveinterval-makes-this-unnecessary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

