<?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>john.geek.nz - 38911 Basic Bytes Free &#187; General Randomness</title>
	<atom:link href="http://www.john.geek.nz/category/general-randomness/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.john.geek.nz</link>
	<description>SQL Tips, Apple Tips and Randomness</description>
	<lastBuildDate>Tue, 17 Jan 2012 20:18:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Kiwicon Reminder</title>
		<link>http://www.john.geek.nz/2011/11/kiwicon-reminder/</link>
		<comments>http://www.john.geek.nz/2011/11/kiwicon-reminder/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 01:05:14 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[General Randomness]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=2131</guid>
		<description><![CDATA[I'm off to Kiwicon V this coming weekend.

If you're interested in computer security and haven't got a ticket, I suggest you make some very last minute plans to get to Wellington for the 5th and 6th November.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m off to <a href="https://www.kiwicon.org/" target="_blank">Kiwicon V</a> this coming weekend.</p>
<p>If you&#8217;re interested in computer security and haven&#8217;t got a ticket, I suggest you make some very last minute plans to get to Wellington for the 5th and 6th November.</p>
<p class="wp-flattr-button"></p> <p><a href="http://www.john.geek.nz/?flattrss_redirect&amp;id=2131&amp;md5=06c63199a04c17f9f139386cb4b326cf" title="Flattr" target="_blank"><img src="http://www.john.geek.nz/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2011/11/kiwicon-reminder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stag hat with a difference</title>
		<link>http://www.john.geek.nz/2010/11/stag-hat-with-a-difference/</link>
		<comments>http://www.john.geek.nz/2010/11/stag-hat-with-a-difference/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 22:53:49 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[General Randomness]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1619</guid>
		<description><![CDATA[My brother recently got married and as per the rules of engagement, the lead up to the event included a Stag night.

For my Stag night, I was given a hard hat complete with a flashing LED light and plastic antlers.

I decided I wanted to make something special for my brother.  Something minimalistic, but ...]]></description>
			<content:encoded><![CDATA[<p>My brother recently got married and as per the rules of engagement, the lead up to the event included a Stag night.</p>
<p>For my Stag night, I was given a hard hat complete with a flashing LED light and plastic antlers.</p>
<p>I decided I wanted to make something special for my brother.  Something minimalistic, but effective.</p>
<p>The result was this&#8230;..<br />
<span id="more-1619"></span><br />
<div id="attachment_1620" class="wp-caption alignnone" style="width: 235px"><a href="http://www.john.geek.nz/wp-content/uploads/2010/11/staghat.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2010/11/staghat-225x300.jpg" alt="" title="staghat" width="225" height="300" class="size-medium wp-image-1620" /></a><p class="wp-caption-text">Days, Hours, Minutes and Seconds remaining...</p></div></p>
<p>It was my first project using an Atmel AVR microcontroller.  I&#8217;ve always planned on using an AVR, but normally settled for a simpler device such as a PIC or PICAXE, but this time I was determined to take the plunge and learn how to program the AVR.</p>
<p>To add difficulty to the project, I wanted to use a real time clock crystal too.  This upped the ante a lot.  It meant using the internal clock for the processor, external clock for the time counting and interrupts to decrement the displayed count.</p>
<p>I decided to use a pair of <a href="http://www.sparkfun.com/products/9766">Red 4-digit 7-segment serial displays from SparkFun</a> to simplify the display side of things.  These turned out to be an excellent choice as they also support SPI control meaning I could send data to both displays with only four pins.</p>
<p>Here&#8217;s a sketch from my notebook of the schematic.  It&#8217;s probably wise to add some capacitors to smooth the power supply.  I was using batteries and the aim was small size and low weight.</p>
<div id="attachment_1622" class="wp-caption alignnone" style="width: 282px"><a href="http://www.john.geek.nz/wp-content/uploads/2010/11/staghat_circuit.png"><img src="http://www.john.geek.nz/wp-content/uploads/2010/11/staghat_circuit-272x300.png" alt="" title="staghat_circuit" width="272" height="300" class="size-medium wp-image-1622" /></a><p class="wp-caption-text">Schematic of the hat circuit</p></div>
<p>The button is used to program the time remaining.  I wrote some interesting code to de-bounce the input.  The button is held in for about 5 seconds, then it goes into program mode where each single digit can be incremented and a two second hold jumps to the next digit.  The programmed time is then stored into the EEPROM.</p>
<p>The Red LED on the top of the helmet is turned on at the start of each second for the period of time it takes to update the display (about 75ms) before it&#8217;s turned off and the microcontroller goes into a power saving sleep mode.</p>
<p>And, the most important part, here&#8217;s a photo of the helmet in use by Mr Pixel.  This was 6 days, 18 hours, 18 minutes and 18 seconds before the wedding.  I was unable to get a picture with the flashing LED lit up as it stays lit for such a brief period of time.</p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2010/11/staghat2.jpg"><img src="http://www.john.geek.nz/wp-content/uploads/2010/11/staghat2-300x294.jpg" alt="" title="staghat2" width="300" height="294" class="alignnone size-medium wp-image-1621" /></a></p>
<p>While we were out and about, people seemed to quickly work out what the numbers meant and were very interested to find out where to buy one from.</p>
<p>Overall, a successful endeavor.</p>
<p class="wp-flattr-button"></p> <p><a href="http://www.john.geek.nz/?flattrss_redirect&amp;id=1619&amp;md5=b5bb8dfb57c0c95dcaa4f8a9bd42fcbd" title="Flattr" target="_blank"><img src="http://www.john.geek.nz/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/11/stag-hat-with-a-difference/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Downloading routes from a GlobalSat DG-100 with gpsbabel on Linux</title>
		<link>http://www.john.geek.nz/2010/11/downloading-routes-from-a-globalsat-dg-100-with-gpsbabel-on-linux/</link>
		<comments>http://www.john.geek.nz/2010/11/downloading-routes-from-a-globalsat-dg-100-with-gpsbabel-on-linux/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 23:07:16 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[General Randomness]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1605</guid>
		<description><![CDATA[This is a GlobalSat DG-100



It's an amazing piece of Kit, but the software that comes with it is absolutely rubbish.

You can download all of the routes (and delete them from the unit) in one simple command with gpsbabel.

gpsbabel -t -i dg-100,erase -o gpx /dev/ttyUSB0 outputfile2.gpx

You'll still need to set up the times/distance for recording ...]]></description>
			<content:encoded><![CDATA[<p>This is a GlobalSat DG-100</p>
<p><img src="http://www.john.geek.nz/wp-content/uploads/2010/11/dg-100-300x239.jpg" alt="" title="dg-100" width="300" height="239" class="alignnone size-medium wp-image-1606" /></p>
<p>It&#8217;s an amazing piece of Kit, but the software that comes with it is absolutely rubbish.</p>
<p>You can download all of the routes (and delete them from the unit) in one simple command with <a href="www.gpsbabel.org/" target="_blank">gpsbabel</a>.</p>
<pre>gpsbabel -t -i dg-100,erase -o gpx /dev/ttyUSB0 outputfile2.gpx</pre>
<p>You&#8217;ll still need to set up the times/distance for recording for the switch positions A,B &#038; C.  I have mine set to 1,5 and 10 seconds.  Easiest way to set these up is on a windows machine with <a href="http://sourceforge.net/projects/dgmanager-net/" target="_blank">DG Manager</a>.</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/11/downloading-routes-from-a-globalsat-dg-100-with-gpsbabel-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Combining two images with ImageMagick</title>
		<link>http://www.john.geek.nz/2010/06/combining-two-images-with-imagemagick/</link>
		<comments>http://www.john.geek.nz/2010/06/combining-two-images-with-imagemagick/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 23:39:54 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[General Randomness]]></category>
		<category><![CDATA[PC Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1592</guid>
		<description><![CDATA[To combine two images of the same size with ImageMagick, you simply do the following:

The following will overlay overlay.png on top of output.png

mogrify -draw "image SrcOver 0,0 0,0 'overlay.png'" output.png


While this one will overlay overlay.png on top of input.png and save it as output.png

convert input.png -draw "image SrcOver 0,0 0,0 'overlay.png'" output.png


You can download ...]]></description>
			<content:encoded><![CDATA[<p>To combine two images of the same size with ImageMagick, you simply do the following:</p>
<p>The following will overlay overlay.png on top of output.png</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">mogrify -draw &quot;image SrcOver 0,0 0,0 'overlay.png'&quot; output.png</pre></div></div>

<p>While this one will overlay overlay.png on top of input.png and save it as output.png</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">convert input.png -draw &quot;image SrcOver 0,0 0,0 'overlay.png'&quot; output.png</pre></div></div>

<p>You can download imagemagick from <a href="http://www.imagemagick.org/" target="_blank">http://www.imagemagick.org/</a></p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/06/combining-two-images-with-imagemagick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selective colour replacement with imagemagick</title>
		<link>http://www.john.geek.nz/2010/06/selective-colour-replacement-with-imagemagick/</link>
		<comments>http://www.john.geek.nz/2010/06/selective-colour-replacement-with-imagemagick/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 23:31:07 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[General Randomness]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Mac OS X Tips]]></category>
		<category><![CDATA[PC Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1590</guid>
		<description><![CDATA[Selective colour replacement is easy from the command line with imagemagick.

You can download imagemagick from http://www.imagemagick.org/

The following will replace all red (#FF0000) pixels with blue (#0000FF)


convert sourceimage.png -fill "#FF0000" -opaque "#0000FF" destimage.png
]]></description>
			<content:encoded><![CDATA[<p>Selective colour replacement is easy from the command line with imagemagick.</p>
<p>You can download imagemagick from <a href="http://www.imagemagick.org/" target="_blank">http://www.imagemagick.org/</a></p>
<p>The following will replace all red (#FF0000) pixels with blue (#0000FF)</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">convert sourceimage.png -fill &quot;#FF0000&quot; -opaque &quot;#0000FF&quot; destimage.png</pre></div></div>

<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/06/selective-colour-replacement-with-imagemagick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Super Cache plugin &#8211; Performance Benchmarking</title>
		<link>http://www.john.geek.nz/2010/04/wordpress-super-cache-plugin-performance-benchmarking/</link>
		<comments>http://www.john.geek.nz/2010/04/wordpress-super-cache-plugin-performance-benchmarking/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 13:24:05 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[General Randomness]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[PC Tips]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1562</guid>
		<description><![CDATA[I've been doing some performance tests on WordPress to see how much of a difference the WordPress Super Cache plugin made.

It turns out that the plugin makes a huge difference.


I kept increasing the rate of requests until the Disk IO rate was the same for both tests.  With the cache turned off, CPU ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing some performance tests on WordPress to see how much of a difference the <a href="http://wordpress.org/extend/plugins/wp-super-cache/" target="_blank">WordPress Super Cache plugin</a> made.</p>
<p>It turns out that the plugin makes a huge difference.<span id="more-1562"></span><br />
<div id="attachment_1564" class="wp-caption aligncenter" style="width: 224px"><a href="http://www.john.geek.nz/wp-content/uploads/2010/04/cache_graphs1.png"><img src="http://www.john.geek.nz/wp-content/uploads/2010/04/cache_graphs1-214x300.png" alt="" title="cache_graphs" width="214" height="300" class="size-medium wp-image-1564" /></a><p class="wp-caption-text">Resource usage comparison over two (highlighted) tests.  Cache is OFF on the left, ON on the right.</p></div></p>
<p>I kept increasing the rate of requests until the Disk IO rate was the same for both tests.  With the cache turned off, CPU usage went through the roof to 400% of my allocation while still only serving up pages at five megabits per second. With the cache enabled, CPU usage settled at 20% and the data rate peaked at over 45 Megabit/sec.</p>
<p>I&#8217;m very impressed with the results&#8230; It seems that with a moderate spec server, you&#8217;ll hit your disk and/or network limit before you run out of CPU or RAM.</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/04/wordpress-super-cache-plugin-performance-benchmarking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bear with me while I change servers</title>
		<link>http://www.john.geek.nz/2010/04/bear-with-me-while-i-change-servers/</link>
		<comments>http://www.john.geek.nz/2010/04/bear-with-me-while-i-change-servers/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 23:08:04 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[General Randomness]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1492</guid>
		<description><![CDATA[I've taken the plunge, and this time I'm not doing it by halves.

I'm moving from my Windows Server 2003 physical co-located server to a Virtual Private Server (VPS) running Linux.

All of the websites have been transferred across, everything else is still to be moved over.

In the meantime, if you find any problems, or anything ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve taken the plunge, and this time I&#8217;m not doing it by halves.</p>
<p>I&#8217;m moving from my Windows Server 2003 physical co-located server to a Virtual Private Server (VPS) running Linux.</p>
<p>All of the websites have been transferred across, everything else is still to be moved over.</p>
<p>In the meantime, if you find any problems, or anything 404&#8242;s, please flick me an email at b<a href="http://mailhide.recaptcha.net/d?k=01eMBcA0shvqZWhYiiReg3ig==&amp;c=R1ZFcO6DJya4El8IGhAbzw1H27x5uumjIEM6-a0nN3U=" onclick="window.open('http://mailhide.recaptcha.net/d?k=01eMBcA0shvqZWhYiiReg3ig==&amp;c=R1ZFcO6DJya4El8IGhAbzw1H27x5uumjIEM6-a0nN3U=', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;" title="Reveal this e-mail address">&#8230;</a>@john.geek.nz</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/04/bear-with-me-while-i-change-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Live Renders of Earth</title>
		<link>http://www.john.geek.nz/2010/02/live-renders-of-earth/</link>
		<comments>http://www.john.geek.nz/2010/02/live-renders-of-earth/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 02:26:58 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[General Randomness]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1488</guid>
		<description><![CDATA[I've recently come across the open source software Xplanet, which will render images of the globe with very realistic results.

I render them in 512x256, 1024x512, 2048x1024 and 4096x2048 resolutions.  The clouds information is obtained from weather satellites and is typically around three hours old.

I also use monthly map files so that the snow/ice ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently come across the open source software <a href="http://xplanet.sourceforge.net/">Xplanet</a>, which will render images of the globe with very realistic results.</p>
<p>I render them in 512&#215;256, 1024&#215;512, 2048&#215;1024 and 4096&#215;2048 resolutions.  The clouds information is obtained from weather satellites and is typically around three hours old.</p>
<p>I also use monthly map files so that the snow/ice on the planet is more realistic.</p>
<p>Check out my real time renders at <a href="http://www.john.geek.nz/earth/">http://www.john.geek.nz/earth/</a>.</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/02/live-renders-of-earth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I was photo bombed</title>
		<link>http://www.john.geek.nz/2010/01/i-was-photo-bombed/</link>
		<comments>http://www.john.geek.nz/2010/01/i-was-photo-bombed/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 10:48:26 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[General Randomness]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1461</guid>
		<description><![CDATA[It turns out, back in June I was photobombed while having my photo taken with Rob Brydon...

]]></description>
			<content:encoded><![CDATA[<p>It turns out, back in June I was photobombed while having my photo taken with Rob Brydon&#8230;</p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2010/01/IXS2_09041.JPG"><img src="http://www.john.geek.nz/wp-content/uploads/2010/01/IXS2_09041-300x225.jpg" alt="IXS2_0904[1]" title="IXS2_0904[1]" width="300" height="225" class="alignnone size-medium wp-image-1462" /></a></p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/01/i-was-photo-bombed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>12 November 1969 &#8211; Today in Apollo History</title>
		<link>http://www.john.geek.nz/2009/11/12-november-1969-in-apollo-history/</link>
		<comments>http://www.john.geek.nz/2009/11/12-november-1969-in-apollo-history/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 07:58:26 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Astronomy]]></category>
		<category><![CDATA[General Randomness]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1437</guid>
		<description><![CDATA[Apollo 12 stories from Newspapers on the 12th November 1969.









]]></description>
			<content:encoded><![CDATA[<p>Apollo 12 stories from Newspapers on the 12th November 1969.<br />
<span id="more-1437"></span><br />
<a href="http://www.john.geek.nz/wp-content/uploads/2009/11/apollo12_20091112_01.gif"><img src="http://www.john.geek.nz/wp-content/uploads/2009/11/apollo12_20091112_01-186x300.gif" alt="apollo12_20091112_01" title="apollo12_20091112_01" width="186" height="300" class="alignnone size-medium wp-image-1438" /></a></p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2009/11/apollo12_20091112_02.gif"><img src="http://www.john.geek.nz/wp-content/uploads/2009/11/apollo12_20091112_02-186x300.gif" alt="apollo12_20091112_02" title="apollo12_20091112_02" width="186" height="300" class="alignnone size-medium wp-image-1439" /></a></p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2009/11/apollo12_20091112_03.gif"><img src="http://www.john.geek.nz/wp-content/uploads/2009/11/apollo12_20091112_03-131x300.gif" alt="apollo12_20091112_03" title="apollo12_20091112_03" width="131" height="300" class="alignnone size-medium wp-image-1440" /></a></p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2009/11/apollo12_20091112_04.gif"><img src="http://www.john.geek.nz/wp-content/uploads/2009/11/apollo12_20091112_04-245x300.gif" alt="apollo12_20091112_04" title="apollo12_20091112_04" width="245" height="300" class="alignnone size-medium wp-image-1441" /></a></p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2009/11/apollo12_20091112_05.gif"><img src="http://www.john.geek.nz/wp-content/uploads/2009/11/apollo12_20091112_05-57x300.gif" alt="apollo12_20091112_05" title="apollo12_20091112_05" width="57" height="300" class="alignnone size-medium wp-image-1442" /></a></p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2009/11/12-november-1969-in-apollo-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

