<?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/"
	xmlns:georss="http://www.georss.org/georss" >

<channel>
	<title>Even the wrong words seem to rhyme &#187; linux</title>
	<atom:link href="http://www.kevinblake.co.uk/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kevinblake.co.uk</link>
	<description>a blog-life by Kevin Blake</description>
	<lastBuildDate>Thu, 13 May 2010 22:27:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Auto running commands when plugging in usb drives with udev in Linux</title>
		<link>http://www.kevinblake.co.uk/auto-running-commands-when-plugging-in-usb-drives-with-udev-in-linux/732/</link>
		<comments>http://www.kevinblake.co.uk/auto-running-commands-when-plugging-in-usb-drives-with-udev-in-linux/732/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 22:53:52 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[udev]]></category>

		<guid isPermaLink="false">http://www.kevinblake.co.uk/?p=732</guid>
		<description><![CDATA[My backup strategy for my machines at home can be effectively described as &#8220;scatty, but thorough&#8220;.  Or at least until I actually have a major crash and need to recover that important file that was outside of my normal documents, code repositories, and archived folders. I am one of those sorts of people that has [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_745" class="wp-caption alignright" style="width: 160px"><a href="http://www.kevinblake.co.uk/wp-content/uploads/2010/01/backups-of-backups.jpg" rel="lightbox"><img class="size-thumbnail wp-image-745" title="Backups of Backups" src="http://www.kevinblake.co.uk/wp-content/uploads/2010/01/backups-of-backups-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">Backups of Backups</p></div>
<p>My backup strategy for my machines at home can be effectively described as &#8220;<em>scatty, but thorough</em>&#8220;.  Or at least until I actually have a major crash and need to recover that important file that was outside of my normal documents, code repositories, and archived folders.</p>
<p>I am one of those sorts of people that has backups everywhere.  Folders stacked away with old dusty (and probably now useless) dvds.  Old hard drives filled with duplicates and archived files, stacked up in the back of cupboards and flung next to jam jars.  SD cards, USB keys, backups to other drives, backups to the machines on the other side of my flat, backups off-site.  Backups of backups backed up during the last backup.</p>
<p>So I decided to add one more with an external hard drive that I could plug in every now and then.  But backups aren&#8217;t really the point of this post.</p>
<p>Linux has a really powerful device manager called udev which detects when things are plugged into your machine (including hard drives), which you can write rules against, and have commands automagically executed.  This is really cool for my new hard drive, which can now automatically start backing up without regular cron jobs checking to see if it&#8217;s plugged in or not.  This is not the same as autorun files, it relies on <strong>that </strong>hard drive being plugged into <strong>that </strong>machine.  So don&#8217;t start crying about all the security risks with autorun, please.</p>
<p>Here&#8217;s how you do it.</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">udevadm info <span class="re5">-a</span> <span class="re5">-p</span>  $<span class="br0">&#40;</span>udevadm info <span class="re5">-q</span> path <span class="re5">-n</span> <span class="sy0">/</span>dev<span class="sy0">/</span>sdc<span class="br0">&#41;</span></pre></div></div>
<p>You&#8217;ll get a whole bunch of output from that, including (among a lot of other output) a line that might look a little like this:</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">ATTR<span class="br0">&#123;</span>serial<span class="br0">&#125;</span>==<span class="st0">&quot;312581808&quot;</span></pre></div></div>
<p>There are a lot more you can use as well, but this will identify your device.</p>
<p>Now create a new file inside <em>/etc/udev/rules.d/</em>, such as <em>/etc/udev/rules.d/81-usb-drive.rules</em></p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="re2">KERNEL</span>==<span class="st0">&quot;sd?1&quot;</span>, ATTRS<span class="br0">&#123;</span>serial<span class="br0">&#125;</span>==<span class="st0">&quot;312581808&quot;</span>, SYMLINK+=<span class="st0">&quot;backup-drive&quot;</span>, RUN+=<span class="st0">&quot;/bin/sh /home/user/scripts/backup-to-drive.sh&quot;</span></pre></div></div>
<p>Now every time you plug in that drive, that command is going to be executed (so include for example, the script that is going to run your backups).  Cool, eh?</p>
<p>I started thinking about other applications; syncing podcasts, ebooks and music are the obvious choices. Even as a crude simple method of executing commands on a box you don&#8217;t even usually login to.  Or you could use this technique to build yourself some poor man usb-based security.  Keep decryption keys on your thumb drive, and have it auto decrypt volumes on your machine when you plug in that particular drive.</p>
<p>Just don&#8217;t forget to keep a backup of the thumb drive, yeah?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/auto-running-commands-when-plugging-in-usb-drives-with-udev-in-linux/732/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Internet on the Eee PC (Ubuntu Eee)</title>
		<link>http://www.kevinblake.co.uk/mobile-internet-on-the-eee-pc-ubuntu-eee/242/</link>
		<comments>http://www.kevinblake.co.uk/mobile-internet-on-the-eee-pc-ubuntu-eee/242/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 20:04:19 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[eee]]></category>
		<category><![CDATA[gprs]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[N95]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.kevinblake.co.uk/?p=242</guid>
		<description><![CDATA[Setting up the Internet on the Eee PC over bluetooth to my Nokia N95 with T-Mobile GPRS/EDGE/3G connection can be tricky.  Yet it sounds like one of those setups that could be so easy, right?  Well it seems stable for the moment, so here&#8217;s what you&#8217;ll need.  Or rather, what I have&#8230; Eee PC 701 [...]]]></description>
			<content:encoded><![CDATA[<p>Setting up the Internet on the Eee PC over bluetooth to my Nokia N95 with T-Mobile GPRS/EDGE/3G connection can be tricky.  Yet it sounds like one of those setups that could be so easy, right?  Well it seems stable for the moment, so here&#8217;s what you&#8217;ll need.  Or rather, what I have&#8230;</p>
<ul>
<li><a href="http://www.expansys.com/p.aspx?i=158485" target="_blank">Eee PC 701</a></li>
<li>Nokia N95</li>
<li><a href="http://www.memorybits.co.uk/shop/bluetooth-dongles/bluemicronext-pro-v2.0-bluetooth-dongle-/8156" target="_blank">Bluetooth dongle</a></li>
<li><a href="http://www.ubuntu-eee.com/" target="_blank">Ubuntu Eee installed</a> on the 701 (not Xandros &#8211; although check out <a href="http://www.3eportal.com/index.php?option=com_content&amp;task=view&amp;id=17&amp;Itemid=1" target="_blank">these scripts</a> if you don&#8217;t want to change)</li>
<li>T-Mobile UK contract with included data plan (preferably).  And Internet already working on the phone.</li>
</ul>
<p>You&#8217;re going to be setting up your connection though pppd, and all of these instructions are <a href="http://davesource.com/Solutions/20070520.T-Mobile-Nokia-E65-Ubuntu-Linux.html#bluetooth" target="_blank">based on instructions</a> that I&#8217;m going to steal, slightly change and probably skip parts to suit my purposes (and hopefully yours) perfectly.</p>
<p>If your set-up doesn&#8217;t match exactly, perhaps you can make use of both pages and work out where things should change.  Or lovingly rip these instructions off, as I did &#8211; to make your own.</p>
<p><strong>Setup your bluetooth dongle</strong><br />
First off, you&#8217;re going to need an apt repository that has the bluez-utils packages in.  So open up a terminal<br />
<code>sudo nano /etc/apt/sources.list</code><br />
and add the line<br />
<code>deb http://ftp.de.debian.org/debian etch main</code></p>
<p>Then you can install the package.</p>
<p><code>apt-update<br />
apt-get install bluez-utils<br />
/etc/init.d/bluetooth restart<br />
lsusb | grep -i bluetooth<br />
<em>(should show the bluetooth device)</em><br />
hcitool dev<br />
<em> (also lists bluetooth devices)</em><br />
</code></p>
<p><strong>Setup networking</strong></p>
<p>You can grab my <a href="http://www.kevinblake.co.uk/wp-content/uploads/2008/09/gprs-settings.tar">gprs-settings</a> which should be put into /etc/ppp/peers directory, and untarred.<br />
<code>tar -xvf gprs-settings.tar</code></p>
<p><strong>Pair the phone</strong></p>
<p>First, get the bluetooth ID of the N95<br />
<code>hcitool scan</code><br />
Then pair your Eee with your phone, you have to do this from the N95.<br />
<code>Bluetooth -&gt; right arrow (Paired devices) - Options<br />
New paired devices (search)<br />
Choose your eee and then type the pairing keys (anything of your choosing</code></p>
<p><strong>Bind bluetooth to an rfcomm device</strong></p>
<p>We use &#8220;rfcomm&#8221; to bind the bluetooth connection to a device. So first, find out the channel the phones bluetooth dial up networking system is on.  You can do this with sdptool (Service Discovery Protocol tool):<br />
<code>sdptool search dun<br />
Service Name: Dial-Up Networking<br />
Service RecHandle: 0x1001e<br />
Service Class ID List:<br />
"Dialup Networking" (0x1103)<br />
Protocol Descriptor List:<br />
"L2CAP" (0x0100)<br />
"RFCOMM" (0x0003)<br />
<strong>Channel: 2</strong><br />
Language Base Attr List:<br />
code_ISO639: 0x454e<br />
encoding:    0x6a<br />
base_offset: 0x100<br />
Profile Descriptor List:<br />
"Dialup Networking" (0x1103)<br />
Version: 0x0100</code></p>
<p>Note the &#8220;Channel: 2&#8243; which show which channel to bind.</p>
<p>Then to bind the channel (in this case #2) to one of the rfcomm devices (for example, rfcomm0):<br />
<code>rfcomm bind 0 11:22:BE:EF:44:33 2</code><br />
You can see the binding with:<br />
<code>rfcomm<br />
rfcomm0: 11:22:BE:EF:44:33 channel 2 clean</code><br />
You might find you need to reset the bind and restart it every now and then (especially failed connection attempts)<br />
<code>rfcomm release 0<br />
rfcomm bind 0 11:22:BE:EF:44:33 2</code><br />
You can edit the settings in &#8220;/etc/bluetooth/rfcomm.conf,&#8221; set bind to &#8220;yes&#8221; and give the device and channel for rfcomm0.  Then you can put these commands into /etc/init.d/bluetooth and it will automatically bind and release the rfcomm device:<br />
<code># At the end of the "start)" section<br />
rfcomm bind all<br />
# At the beginning of the "stop)" section<br />
rfcomm release all</code><br />
<strong>Start pppd to connect.</strong><br />
Start up pppd.  Command line first, but because we&#8217;ve called it ppp0, you will later be able to do this via the normal ubuntu eee networking menu in the menu bar.<br />
<code>% pppd call ppp0</code><br />
You should now have a <tt>ppp0</tt> interface in your &#8216;ifconfig&#8217; output that is up and running.  The output should look something like this:<br />
<code># pppd call ppp0<br />
Press CTRL-C to close the connection at any stage!<br />
defining PDP context...<br />
rAT<br />
OK<br />
ATH<br />
OK<br />
ATE1<br />
OK<br />
AT+CGDCONT=1,"IP","general.t-mobile.uk","",0,0<br />
OK<br />
waiting for connect...<br />
ATD*99#<br />
CONNECT<br />
Connected.<br />
If the following ppp negotiations fail,<br />
try restarting the phone.<br />
Serial connection established.<br />
using channel 1<br />
Using interface ppp0<br />
Connect: ppp0 &lt;--&gt; /dev/rfcomm0</code></p>
<p>You can hit control-c on the pppd process and it will shut down the connection, then you can release the rfcomm binding.</p>
<p>So&#8230; as I was saying&#8230; It&#8217;s not the easiest thing in the world to get going, but once you&#8217;ve got the hang of it, and set it up once you&#8217;ll have a connection everywhere you go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/mobile-internet-on-the-eee-pc-ubuntu-eee/242/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<georss:point>51.6548576 -0.3982030</georss:point>	</item>
		<item>
		<title>Eee PC &#8211; cheap mobile computing for the masses</title>
		<link>http://www.kevinblake.co.uk/eee-pc-cheap-mobile-computing-for-the-masses/236/</link>
		<comments>http://www.kevinblake.co.uk/eee-pc-cheap-mobile-computing-for-the-masses/236/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 14:48:36 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eee]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.kevinblake.co.uk/?p=236</guid>
		<description><![CDATA[I recently bought myself an Asus Eee 701 4G Surf from Expansys for the bargain price of 169.33 including delivery.  If you don&#8217;t know about these tiny laptops, they&#8217;re low-spec, cheap machines often times running a Debian-based Linux installation called Xandros, rather than Windows (although XP versions are also available in the higher spec versions).  [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_240" class="wp-caption alignright" style="width: 160px"><a href="http://www.kevinblake.co.uk/wp-content/uploads/2008/09/p10208781.jpg" rel="lightbox"><img class="size-thumbnail wp-image-240" title="Eee PC" src="http://www.kevinblake.co.uk/wp-content/uploads/2008/09/p10208781-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">Eee PC compared to a John Grisham paperback, and full size laptop</p></div>
<p>I recently bought myself an <a href="http://en.wikipedia.org/wiki/ASUS_Eee_PC" target="_blank">Asus Eee 701 4G Surf</a> from <a href="http://www.expansys.com/p.aspx?i=158607" target="_blank">Expansys</a> for the bargain price of 169.33 including delivery.  If you don&#8217;t know about these tiny laptops, they&#8217;re low-spec, cheap machines often times running a Debian-based Linux installation called Xandros, rather than Windows (although XP versions are also available in the higher spec versions).  Its key specs are a 7-inch screen, 512MB of RAM (upgradeable to 2GB), built-in WiFi and hard wired ethernet ports, 4GB solid-state drive, weighing only 922g, and really really small.</p>
<p>For those of you that just about nodded off to sleep &#8211; it&#8217;s really light, really small (for a feature-packed laptop, I mean), and lets you use word processing, spreadsheets, browse the Internet, read emails, blogging, instant messenger, Skype and, well &#8211; just about everything you&#8217;d normally do on your laptop really.  Except&#8230; did I mention it&#8217;s really portable?</p>
<p>I&#8217;m not totally sure where it fits into my technology arsenal yet.  It&#8217;s certainly not a desktop replacement, and it might even be best described as a second-laptop (the first of which, I hasten to add, spends way more time charging than it ever does getting used).  But the Eee PC is certainly a lot easier to carry around, and more likely to be dropped into my rucksuck as an afterthought since it takes up so little space.</p>
<p>It&#8217;s also been described as &#8220;something to play with&#8221; and the Eee fits into this category just as well as it would as a solid dependable netbook (if you&#8217;d rather leave the endless tinkering alone).  Perhaps it&#8217;s because the device is so cheap, or easy to reinstall the base system with all your essential apps in tact (take that Microsoft) &#8211; but even if you&#8217;re just looking for an alternative to Windows, the Eee might just be a good place to start.</p>
<p>So, expect more posts about the Eee shortly &#8211; the usual technical-guides are going to help me rebuild the system if I do manage to break it &#8211; as well as give me an excuse for something to write about <img src='http://www.kevinblake.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/eee-pc-cheap-mobile-computing-for-the-masses/236/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<georss:point>51.6548576 -0.3982030</georss:point>	</item>
		<item>
		<title>Twitter &#8211; Conversation in the Machine</title>
		<link>http://www.kevinblake.co.uk/twitter-conversation-in-the-machine/184/</link>
		<comments>http://www.kevinblake.co.uk/twitter-conversation-in-the-machine/184/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 18:49:29 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mashup]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.kevinblake.co.uk/?p=184</guid>
		<description><![CDATA[It&#8217;s another of those life-changing technologies which will not only improve the way you interact your fellow humans across the planet, but also shape and change the web as we know it for a brighter future beyond our current limited borders. No it&#8217;s not. It&#8217;s a micro-blogging tool which performs about the same function as [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s another of those life-changing technologies which will not only improve the way you interact your fellow humans across the planet, but also shape and change the web as we know it for a brighter future beyond our current limited borders.</p>
<p>No it&#8217;s not.</p>
<p>It&#8217;s a micro-blogging tool which performs about the same function as your Facebook status, with a bit more history and more conversation potential than real speaking.  It also falls into the category of &#8220;shiny web things&#8221; that the magpie&#8217;s of the Internet world run bounding towards with wings flapping, declaring their undying allegiance and overwhelming excitement about the grand new era of technology, society and communication.</p>
<p>I am said magpie.  I just haven&#8217;t had much use for it, so whilst most people are bounding towards <a href="http://pownce.com/" target="_blank">Pownce</a> with their wings wide open, I&#8217;m still trying to find an excuse.</p>
<p>My <a href="http://twitter.com/puzzlebox" target="_blank">Twitter feed</a> is decidedly empty, having originally opened it as a way only of updating my Facebook status before I realised that was syndication for the sake of it (See integrations with <a href="http://blog.brightkite.com/" target="_blank">BrightKite</a>, <a href="http://www.loopt.com/" target="_blank">Loopt</a>, and <a href="http://flickr.twittergram.com/" target="_blank">Flickr </a>integration for reference).  But I do get a kick out of things like the <a href="http://infovore.org/archives/2008/02/28/making-bridges-talk/" target="_blank">Tower Bridge Tweets</a>.  The wonderful thing about this Web 2.0 stuff is that you don&#8217;t have to use any of it for what it was intended for (which is usually so vague and fluffy, it only really starts to take shape after the rules have been broken).</p>
<p>So I grabbed a copy of the <a href="http://search.cpan.org/~cthom/Net-Twitter-1.14/lib/Net/Twitter.pm" target="_blank">Net::Twitter module</a> for Perl and before you know it, my script that monitors if the Wifi connection on the <a href="http://www.blakepics.com" target="_blank">Blakepics </a>server had gone down was <a href="http://www.twitter.com/puzzleboxneco" target="_blank">happily tweeting away</a> with only three more lines of (my) code.</p>
<p><code>use Net::Twitter;<br />
my $twit = Net::Twitter-&gt;new(username=&gt;"<em>username</em>", password=&gt;"<em>password</em>",  source =&gt; "DowntimeMonitor" );<br />
$twit-&gt;update("Internet connection ".($state ? "is now up" : "has been restarted"));</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/twitter-conversation-in-the-machine/184/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Upgrading Fedora 8 to Fedora 9</title>
		<link>http://www.kevinblake.co.uk/upgrading-fedora-8-to-fedora-9/171/</link>
		<comments>http://www.kevinblake.co.uk/upgrading-fedora-8-to-fedora-9/171/#comments</comments>
		<pubDate>Sat, 17 May 2008 18:07:17 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cyrus]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.kevinblake.co.uk/?p=171</guid>
		<description><![CDATA[It&#8217;s time for another Fedora upgrade. Whilst the installations aren&#8217;t necessarily getting any better &#8211; fixing them is becoming a bit faster, because the problems are pretty similar every time and these notes I&#8217;m keeping are helping. System won&#8221;t boot. Met with a grub&#62; prompt, and no menu Boot the system from the DVD again, [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s time for another Fedora upgrade.  Whilst the installations aren&#8217;t necessarily getting any better &#8211; fixing them is becoming a bit faster, because the problems are pretty similar every time and these notes I&#8217;m keeping are helping.</p>
<div class="entry">
<div id="post_content_153" class="post_content">
<ol>
<li><strong>System won&#8221;t boot. Met with a grub&gt; prompt, and no menu</strong>
<ul>
<li>Boot the system from the DVD again, and select &#8220;rescue an install system&#8221;.</li>
<li>&#8216;chroot /mnt/sysimage/&#8217;</li>
<li>&#8220;nano /boot/grub/grub.conf&#8221;</li>
<li>Change this line, &#8220;root (hd2,0)&#8221; to root &#8220;(hd0,0)&#8221;.  (I&#8217;m not sure why Grub seems incapable of finding the right hard drive to boot from each time&#8230; It doesn&#8217;t change.)</li>
<li>Uncomment the line at the top #boot</li>
</ul>
</li>
<li><strong>Cyrus imapd won&#8221;t start.  Complaining of libcrypto.so.6 library missing.</strong>
<ul>
<li>Upgrade Cyrus &#8211; &#8220;yum upgrade -y cyrus&#8221;</li>
<li>Restart the service &#8211; &#8216;service cyrus-imapd restart&#8217;</li>
</ul>
</li>
<li><strong>Rss2imap no longer posts the messages into Cyrus IMAPD</strong>
<ul>
<li>Difficult to place the blame on this one.  One turning on Rss2imap debug mode, I see i@m getting the error &#8216;Message contains bare newlines&#8217;, and although Rss2imap has posted the message.  It&#8217;s been discarded by Cyrus.  This is actually proper RFC behaviour for Cyrus &#8211; as message&#8217;s shouldn&#8217;t contain the broken &#8216;\n&#8217; character, but rather &#8216;\r\n&#8217;.  At the same time, I also think, &#8216;so what?&#8217;.  Either way, the Cyrus behaviour has changed, or Mail::IMAPClient modules have.</li>
<li>So the fix&#8230; Edit Rss2imap\RSS2IMAPLIB\Rss2imap.pm, and add the bold text.<br />
<code> &nbsp;my $message = ($headers . $body);<br />
<strong> $message =~ s/\n/\r\n/g;</strong><br />
utf8::encode ( $message );<br />
</code><br />
and<br />
<code> &nbsp;my $folder = $this-&gt;get_real_folder_name ($this-&gt;{'last-modified-folder'});<br />
<strong> $body =~ s/\n/\r\n/g;</strong><br />
$this-&gt;{imap}-&gt;append_string ($folder, $body);</code></p>
<p>You&#8217;ll notice we&#8217;ve replaced all the \n line endings with the more correct \r\n.  Let&#8217;s just hope we don&#8217;t have to undo that later when the problem gets resolved elsewhere <img src='http://www.kevinblake.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
</ul>
</li>
</ol>
<p>Remarkably, this was the first time the wireless card started up immediately after the upgrade, perhaps things are improving after all <img src='http://www.kevinblake.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/upgrading-fedora-8-to-fedora-9/171/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux server as a wireless bridge</title>
		<link>http://www.kevinblake.co.uk/linux-server-as-a-wireless-bridge/169/</link>
		<comments>http://www.kevinblake.co.uk/linux-server-as-a-wireless-bridge/169/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 22:05:47 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[xbox 360]]></category>

		<guid isPermaLink="false">http://www.kevinblake.co.uk/?p=169</guid>
		<description><![CDATA[Since learning the XBox 360 doesn&#8217;t come with a wifi adapter, and that buying such a thing would add another 60 pounds to the cost of the console&#8230; I&#8217;ve been thinking of different ways to get an Internet connection from my high-speed wired network in the living room out to the router way out in [...]]]></description>
			<content:encoded><![CDATA[<p>Since learning the XBox 360 doesn&#8217;t come with a wifi adapter, and that buying such a thing would add another 60 pounds to the cost of the console&#8230; I&#8217;ve been thinking of different ways to get an Internet connection from my high-speed wired network in the living room out to the router way out in the spare room.  For many reasons, it&#8217;s just not practical for me to wire the whole flat.</p>
<p>Most of the solutions I came up with involved things like &#8216;spending money&#8217;, which I&#8217;m slightly adverse to do if I can do it with the existing kit, so these are the really basic steps to turn the existing linux box (with both wireless and wired cards) into a useful bridge.  As usual, don&#8217;t be fooled into thinking this guide is here for anyone else, as much as it&#8217;s here for me when I need to rebuild the machine and I&#8217;ve forgotten it all.  But feel free to leave a comment about how much warmer and fuzzier I&#8217;ve made your life through your use of these &#8220;instructions&#8221;.</p>
<p><strong>The current configuration</strong></p>
<p>Fedora 8 installation<br />
Wireless Ethernet (ath0) card is connected as 192.168.0.8<br />
Wired Ethernet (eth1) card is connected as 192.168.1.8<br />
Named/bind/DNS server already configured and set-up to accept requests on 192.168.1.8<br />
The Xbox will be wired, on 192.168.1.20</p>
<p><strong>Setting up Fedora</strong></p>
<p>Setup the forwarding rules</p>
<p><code>#Outgoing requests<br />
iptables -t nat -A POSTROUTING -s 192.168.1.8/24 -o ath0 -j MASQUERADE<br />
iptables -A FORWARD -s 192.168.1.0/24 -o ath0 -j ACCEPT<br />
iptables -A FORWARD -d 192.168.1.0/24 -m state --state ESTABLISHED,RELATED -i eth1 -j ACCEPT<br />
#Incoming requests (port forwarding)<br />
iptables -t nat -A PREROUTING -p tcp -i ath0 -d 192.168.0.8 --dport 88 -j DNAT --to 192.168.1.20:88<br />
iptables -t nat -A PREROUTING -p tcp -i ath0 -d 192.168.0.8 --dport 3074 -j DNAT --to 192.168.1.20:3074</code></p>
<p>Save your rules so they&#8217;re applied on start-up<br />
<code>sudo iptables-save &gt; /etc/sysconfig/iptables</code></p>
<p>Enable ipv4 port forwarding<br />
<code>nano /etc/sysctl.conf</code><br />
Change this line<br />
<code>net.ipv4.ip_forward = 0</code><br />
to<br />
<code>net.ipv4.ip_forward = 1</code></p>
<p><strong>The client machine / Xbox 360</strong></p>
<p>Now on your client machine (note this will only have a wired connection).<br />
<code>IP Address: 192.168.1.20<br />
Subnet mask: 255.255.255.0<br />
Default Gateway: 192.168.1.8<br />
DNS Server: 192.168.1.8</code></p>
<p>You&#8217;re going to need a DHCP server so that these settings are automatically assigned to the XBox 360.  If don&#8217;t have one for your subnet already, you can set it up through dhcpd.  You&#8217;ll probably want to do something about</p>
<p>Edit /etc/dhcpd.conf</p>
<p><code>ddns-update-style interim;<br />
# HardWired<br />
subnet 192.168.1.0 netmask 255.255.255.0 {<br />
option routers 192.168.1.8;<br />
option domain-name-servers 192.168.1.8;<br />
authoritative;<br />
range 192.168.1.10 192.168.1.20;<br />
}<br />
# Assign a static IP<br />
host xbox {<br />
hardware ethernet 00:45:40:10:FE:12;<br />
fixed-address 192.168.1.20;<br />
}</code></p>
<p>Then restart dhcpd<br />
<code>/etc/rc.d/init.d/dhcpd restart</code></p>
<p><strong>Router</strong></p>
<p>Remember those ports we forwarded on the server?  You&#8217;ll also need to add port forwarding to your router, to forward the same ports (88, 3074) to the Fedora machine on 192.168.0.8.</p>
<p>And that&#8217;s really it.  You should now be able to connect to the Internet without any troubles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/linux-server-as-a-wireless-bridge/169/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Upgrading Fedora 7 to Fedora 8</title>
		<link>http://www.kevinblake.co.uk/153/153/</link>
		<comments>http://www.kevinblake.co.uk/153/153/#comments</comments>
		<pubDate>Sun, 11 Nov 2007 19:01:42 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.kevinblake.co.uk/technology/153/153/</guid>
		<description><![CDATA[Another Fedora upgrade later, and my system is back up and running. Hopefully this version will fix some of the problems from the previous Fedora 6 to 7 upgrade. When will I ever learn? System won&#8217;t boot. GRUB complains of Error 15: File not found when attempting to load kernel. Something bizarre happened to the [...]]]></description>
			<content:encoded><![CDATA[<p>Another Fedora upgrade later, and my system is back up and running.  Hopefully this version will fix some of the problems from the previous Fedora 6 to 7 upgrade.  When will I ever learn?</p>
<ol>
<li><strong>System won&#8217;t boot.  GRUB complains of Error 15: File not found when attempting to load kernel.</strong>
<ul>
<li>Something bizarre happened to the IDE / SATA ordering in this release?  Boot the system from the DVD again, and select &#8216;rescue an install system&#8217;.</li>
<li>Open up &#8216;nano /boot/grub/grub.conf&#8217;</li>
<li>Change this line, &#8216;root (hd1,0)&#8217; to root &#8216;(hd0,0)&#8217;</li>
</ul>
</li>
<li><strong>Wireless card won&#8217;t start.</strong>
<ul>
<li>Plug in Ethernet cable.</li>
<li>Make sure livna repository is enabled.</li>
<li>Upgrade the kernel to the latest: &#8216;yum -y upgrade kernel&#8217;</li>
<li>Reboot into new kernel.</li>
<li>Install madwifi drivers.  Why does this have to be done for EVERY upgrade?  &#8216;yum install madwifi&#8217;</li>
<li>Restart the network &#8216;/etc/rc.d/init.d/network restart&#8217;</li>
</ul>
</li>
<li><strong>Cyrus imapd won&#8217;t start.  Complaining of libdb-4.5 library missing.</strong>
<ul>
<li>Upgrade Cyrus, and make sure it installs the db4-utils package, this time.  &#8216;yum upgrade -y cyrus&#8217;</li>
</ul>
</li>
</ol>
<p>One of these days I&#8217;ll move to a real Linux distribution, rather than the current hobbyist affair provided by Fedora.  One of these days.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/153/153/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Myth TV on Fedora 7</title>
		<link>http://www.kevinblake.co.uk/myth-tv-on-fedora-7/122/</link>
		<comments>http://www.kevinblake.co.uk/myth-tv-on-fedora-7/122/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 21:40:59 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mythtv]]></category>

		<guid isPermaLink="false">http://www.kevinblake.co.uk/technology/mythtv/myth-tv-on-fedora-7/122/</guid>
		<description><![CDATA[Well, I&#8217;ve decided this blog was getting far too technology-based over the last few entries. I&#8217;m in desperate need of another hobby, writing about my travels is all very well &#8211; but I only have 27 days holiday each year to spare for that sort of thing. Code is falling in from the ceiling and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.blakepics.com/misc/IMG_0037.JPG.html" target="_blank"><img src="http://www.blakepics.com/d/47665-2/IMG_0037.JPG?g2_GALLERYSID=5e231e35ea118ea07920a4287e8756e4" width="150" height="150" alt="IMG_0037" title="IMG_0037" class="g2image_float_right" /></a>Well, I&#8217;ve decided this blog was getting far too technology-based over the last few entries.  I&#8217;m in desperate need of another hobby, writing about my travels is all very well &#8211; but I only have 27 days holiday each year to spare for that sort of thing.  Code is falling in from the ceiling and spilling out onto the posts.  In my deepest moments of insanity I&#8217;ve starting writing about branding.  Being able to claim the moral high ground in the past, I&#8217;ve now found myself getting into debates over logos, design and the public perception.</p>
<p>Well it has to change.  Right now..  So this evening is all about the introduction to my Myth TV posts, which will serve as some sort of inadequate guide to getting an open-source media center up and running with digital tv recording, playback, tv guides as well as all the networkable, internet-ready, upgradeable, linux hardware hell you&#8217;d expect from such a project.  Much more fun than going down the shop and buying a complete system.  You can&#8217;t imagine.</p>
<p>Wait.  Shit.</p>
<p>Okay, there will be code.  There will certainly be text-only configuration files.  Hopefully, I can get a llama in there somewhere&#8230; Hopefully.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/myth-tv-on-fedora-7/122/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cyrus Certificate Authentication</title>
		<link>http://www.kevinblake.co.uk/cyrus-certificate-authentication/52/</link>
		<comments>http://www.kevinblake.co.uk/cyrus-certificate-authentication/52/#comments</comments>
		<pubDate>Sun, 18 Dec 2005 16:37:22 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cyrus]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://blog.puzzlebox.co.uk/?p=52</guid>
		<description><![CDATA[This is probably of no interest to anyone whatsoever. Except me, in a few months time when I try and configure another mail server &#8211; and can&#8217;t remember how to generate certificates for Windows. So first off, create the certificates for your Cyrus IMAP server (you&#8217;ve already set all that up, right?) openssl req -new [...]]]></description>
			<content:encoded><![CDATA[<p>This is probably of no interest to anyone whatsoever.  Except me, in a few months time when I try and configure another mail server &#8211; and can&#8217;t remember how to generate certificates for Windows.</p>
<p>So first off, create the certificates for your Cyrus IMAP server (you&#8217;ve already set all that up, right?)</p>
<p><code>openssl req -new -nodes -out req.pem -keyout key.pem<br />
openssl rsa -in key.pem -out new.key.pem<br />
openssl x509 -in req.pem -out ca-cert -req \<br />
-signkey new.key.pem -days 999<br />
mkdir /var/imap<br />
cp new.key.pem /var/imap/server.pem<br />
rm new.key.pem<br />
cat ca-cert &gt;&gt; /var/imap/server.pem<br />
chown cyrus:mail /var/imap/server.pem<br />
chmod 600 /var/imap/server.pem # Your key should be protected<br />
echo tls_ca_file: /var/imap/server.pem &gt;&gt; /etc/imapd.conf<br />
echo tls_cert_file: /var/imap/server.pem &gt;&gt; /etc/imapd.conf<br />
echo tls_key_file: /var/imap/server.pem &gt;&gt; /etc/imapd.conf<br />
</code></p>
<p>Then generate the certificate for the client.</p>
<p><code>openssl pkcs12 -export -in server.pem -inkey server.pem -out iestuff.p12</code></p>
<p>You&#8217;ll need to add that iestuff to your trusted certificates &#8211; but that&#8217;s pretty much it <img src='http://www.kevinblake.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   No more annoying messages from Outlook.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/cyrus-certificate-authentication/52/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
