<?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>www.jhodges.co.uk &#187; How To</title>
	<atom:link href="http://jhodges.co.uk/category/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://jhodges.co.uk</link>
	<description>I ain&#039;t not never done nothing to nobody and there ain&#039;t not no way none of that couldn&#039;t not never have happened. See?</description>
	<lastBuildDate>Tue, 08 Jun 2010 20:34:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DynDNS Lite!</title>
		<link>http://jhodges.co.uk/dyndns-lite/</link>
		<comments>http://jhodges.co.uk/dyndns-lite/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 22:47:18 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.jhodges.co.uk/?p=269</guid>
		<description><![CDATA[As my IP address changes so rarely, my Dynamic DNS accounts keep expiring before the IP changes!

Here is a cron line to download my ip address from whatismyip.org and then upload it via ssh to a file on a server every hour!
00 * * * * curl whatismyip.org 2>/dev/null &#124; ssh user@server.tld "cat >ip.txt"
]]></description>
			<content:encoded><![CDATA[<p>As my IP address changes so rarely, my Dynamic DNS accounts keep expiring before the IP changes!<br />
<span id="more-269"></span></p>
<p>Here is a cron line to download my ip address from whatismyip.org and then upload it via ssh to a file on a server every hour!</p>
<p><code>00 * * * * curl whatismyip.org 2>/dev/null | ssh user@server.tld "cat >ip.txt"</p>
]]></content:encoded>
			<wfw:commentRss>http://jhodges.co.uk/dyndns-lite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Digikam in Ubuntu 9.10</title>
		<link>http://jhodges.co.uk/digikam-in-ubuntu-9-10/</link>
		<comments>http://jhodges.co.uk/digikam-in-ubuntu-9-10/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 22:34:04 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.jhodges.co.uk/digikam-in-ubuntu-9-10/</guid>
		<description><![CDATA[After installing Digikam on Ubuntu, I had no video thumbnails or ability to play video.

When trying to play a video I recieved the error &#8220;an error has occurred with the media player digikam&#8221; and on the terminal &#8220;xine is asking to seek behind the end of the data stream&#8221;
To resolve this I installed mplayer thumbs [...]]]></description>
			<content:encoded><![CDATA[<p>After installing Digikam on Ubuntu, I had no video thumbnails or ability to play video.<br />
<span id="more-268"></span></p>
<p>When trying to play a video I recieved the error &#8220;an error has occurred with the media player digikam&#8221; and on the terminal &#8220;xine is asking to seek behind the end of the data stream&#8221;</p>
<p>To resolve this I installed mplayer thumbs for the thumbnails and xine-ui to play the vids.</p>
]]></content:encoded>
			<wfw:commentRss>http://jhodges.co.uk/digikam-in-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Count unique IP address in Apache&#8217;s access log</title>
		<link>http://jhodges.co.uk/count-unique-ip-address-in-apaches-access-log/</link>
		<comments>http://jhodges.co.uk/count-unique-ip-address-in-apaches-access-log/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 23:14:43 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.jhodges.co.uk/count-unique-ip-address-in-apaches-access-log/</guid>
		<description><![CDATA[sed < /var/log/httpd/access_log -e 's/ .*$//' &#124; sort &#124; uniq -c
]]></description>
			<content:encoded><![CDATA[<pre>sed < /var/log/httpd/access_log -e 's/ .*$//' | sort | uniq -c</pre>
]]></content:encoded>
			<wfw:commentRss>http://jhodges.co.uk/count-unique-ip-address-in-apaches-access-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu &#8211; Purge configuration files for removed packages</title>
		<link>http://jhodges.co.uk/ubuntu-purge-configuration-files-for-removed-packages/</link>
		<comments>http://jhodges.co.uk/ubuntu-purge-configuration-files-for-removed-packages/#comments</comments>
		<pubDate>Tue, 26 May 2009 11:24:05 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.jhodges.co.uk/?p=224</guid>
		<description><![CDATA[This bash command will remove the left over config files from old packages that were removed with &#8220;apt-get remove&#8221;.
dpkg -l &#124; awk '/^rc/ {print $2}' &#124; xargs sudo dpkg --purge
See the source article for an explanation of how it works.
]]></description>
			<content:encoded><![CDATA[<p>This bash command will remove the left over config files from old packages that were removed with &#8220;apt-get remove&#8221;.</p>
<p><code style="padding:10px;border:1px solid #4f4;background:#dfd;">dpkg -l | awk '/^rc/ {print $2}' | xargs sudo dpkg --purge</code></p>
<p>See the <a href="http://ascending.wordpress.com/2007/04/10/apt-tip-purge-removed-packages/">source article</a> for an explanation of how it works.</p>
]]></content:encoded>
			<wfw:commentRss>http://jhodges.co.uk/ubuntu-purge-configuration-files-for-removed-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SD card and Arduino</title>
		<link>http://jhodges.co.uk/sd-card-and-arduino/</link>
		<comments>http://jhodges.co.uk/sd-card-and-arduino/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 20:23:50 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://map.jhodges.co.uk/?p=8</guid>
		<description><![CDATA[So, I have not long had my Arduino development board, my first project was to try and get it to log data to an SD card. This will be essential for a few future projects I have in mind. The internal EEPROM is only 512bytes, so not particularly useful for logging large amounts of data.
I [...]]]></description>
			<content:encoded><![CDATA[<p>So, I have not long had my Arduino development board, my first project was to try and get it to log data to an SD card. This will be essential for a few future projects I have in mind. The internal EEPROM is only 512bytes, so not particularly useful for logging large amounts of data.</p>
<p><span id="more-8"></span>I found the pin outs to the SD card <a href="http://pinouts.ru/Memory/sdcard_pinout.shtml">here</a>, and a good schematic, along with the required libraries on <a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206874649/8">this thread</a>.</p>
<p>I could not get the raw read and write library to work, along with many others on the above thread. It looked like it was working, but after a reset there was no sign of the data on the card, So I tried the other library that was posted on that thread, uFat, which actually sounded much better as it allowed reading and writing to a file on the fat file system, which then could be read in my laptop or any computer with a card reader. This worked straight away, so I was happy to get my soldering iron out and wire it up permanently&#8230;</p>
<p><img src="http://www.jhodges.co.uk/media/arduino-sd/sd1.jpg" alt="Image" /></p>
<p>There is not much to it, the pins practically wire straight from the SD card into the Arduino, however the SD card runs on 3.3v and the outputs from the Arduino are 5v, not a problem with a few resisters 5v can be dropped down to 3.3v. I got the card slot out of an old card reader, attached pins to it from the headers of an old motherboard, and the strip board I just had laying around with junk soldered to it which I just removed.</p>
<p>Another quick test and something didn&#8217;t seem quite right, it would only work once between reset, so I got my multimeter and checked all my connections, everything seemed fine, I gave a bit of a scrape between the strips of the strip board and tried again, this time it worked perfectly. I guess there must have been a strand of wire or solder where there shouldn&#8217;t have!</p>
<p>Time to hide that ugly strip board, and soldering&#8230;</p>
<p><img src="http://www.jhodges.co.uk/media/arduino-sd/sd2.jpg" alt="Image" /></p>
<p>And there it is, a nice little module that I can plug in whenever I need it <img src='http://jhodges.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://jhodges.co.uk/sd-card-and-arduino/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Explode into associative array</title>
		<link>http://jhodges.co.uk/explode-into-associative-array/</link>
		<comments>http://jhodges.co.uk/explode-into-associative-array/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 18:32:20 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.jhodges.co.uk/?p=55</guid>
		<description><![CDATA[Simple function to explode a string into an associative array. Works in the same way as the normal explode but takes an extra argument which is an array of keys to use for the returned associative array.

&#60;?php
function aexplode($delim,$string,$keys){
    foreach(explode($delim,$string) as $k=&#62;$v){
        $result[$keys[$k]]=$v;
    [...]]]></description>
			<content:encoded><![CDATA[<p>Simple function to explode a string into an associative array. Works in the same way as the normal explode but takes an extra argument which is an array of keys to use for the returned associative array.</p>
<p><span id="more-55"></span>
<pre style="color: #000080;" language="PHP">&lt;?php
function aexplode($delim,$string,$keys){
    foreach(explode($delim,$string) as $k=&gt;$v){
        $result[$keys[$k]]=$v;
    }
    return $result;
}
?&gt;</pre>
<p></span></p>
<p>Example:</p>
<p>print_r(aexplode(&#8220;|&#8221;,&#8221;silly|nice|chin|thanks&#8221;,array(&#8220;one&#8221;,&#8221;two&#8221;,&#8221;three&#8221;,&#8221;four&#8221;)));</p>
<p>Array<br />
(<br />
[one] =&gt; silly<br />
[two] =&gt; nice<br />
[three] =&gt; chin<br />
[four] =&gt; thanks<br />
)</p>
]]></content:encoded>
			<wfw:commentRss>http://jhodges.co.uk/explode-into-associative-array/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>List files/folders ordered by size</title>
		<link>http://jhodges.co.uk/list-files-foloders-ordered-by-size/</link>
		<comments>http://jhodges.co.uk/list-files-foloders-ordered-by-size/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 11:13:45 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.jhodges.co.uk/?p=47</guid>
		<description><![CDATA[du -s * &#124; sort -n
]]></description>
			<content:encoded><![CDATA[<pre style="color:#000080">du -s * | sort -n</pre>
]]></content:encoded>
			<wfw:commentRss>http://jhodges.co.uk/list-files-foloders-ordered-by-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
