<?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; Tips</title>
	<atom:link href="http://www.john.geek.nz/category/tips/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>iPhone templates for UI prototypes</title>
		<link>http://www.john.geek.nz/2011/04/iphone-templates-for-ui-prototypes/</link>
		<comments>http://www.john.geek.nz/2011/04/iphone-templates-for-ui-prototypes/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 04:24:08 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1732</guid>
		<description><![CDATA[I've recently started doing a lot of development for the iPhone and iPad and I wanted to be able to sketch layouts on paper.

Now it's one thing to draw a rough iPhone layout, but it's another to actually have them looking like an iPhone.

I started using the A4 iPhone Template from http://www.uistencils.com, but soon ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently started doing a lot of development for the iPhone and iPad and I wanted to be able to sketch layouts on paper.</p>
<p>Now it&#8217;s one thing to draw a rough iPhone layout, but it&#8217;s another to actually have them looking like an iPhone.</p>
<p>I started using the A4 iPhone Template from <a href="http://www.uistencils.com/products/iphone-stencil-kit" target="_blank">http://www.uistencils.com</a>, but soon wanted something more photo realistic.</p>
<p>Behold my designs&#8230;..<br />
<span id="more-1732"></span><br />
They contain seven pages each of layouts.</p>
<ul>
<li>Completely blank screen</li>
<li>Portrait with top carrier bar</li>
<li>Landscape with top carrier bar</li>
<li>Portrait Web Browser</li>
<li>Portrait Web Browser with address bar</li>
<li>Landscape Web Browser</li>
<li>Landscape Web Browser with address bar</li>
</ul>
<p>Here are the download links:</p>
<ul>
<li><a href="http://www.john.geek.nz/wp-content/uploads/2011/05/iphone4_1.pdf">1 per page (5,981 KB)</a></li>
<li><a href="http://www.john.geek.nz/wp-content/uploads/2011/05/iphone4_2.pdf">2 per page (4,398 KB)</a></li>
<li><a href="http://www.john.geek.nz/wp-content/uploads/2011/05/iphone4_6.pdf">6 per page (4,118 KB)</a></li>
</ul>
<p class="wp-flattr-button"></p> <p><a href="http://www.john.geek.nz/?flattrss_redirect&amp;id=1732&amp;md5=659ea93f4a7338dea25c0c2cb44f010b" 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/04/iphone-templates-for-ui-prototypes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting PDF files to HTML on Ubuntu</title>
		<link>http://www.john.geek.nz/2010/11/converting-pdf-files-to-html-on-ubuntu/</link>
		<comments>http://www.john.geek.nz/2010/11/converting-pdf-files-to-html-on-ubuntu/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 11:45:27 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Linux Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1615</guid>
		<description><![CDATA[It's very easy to convert PDFs to HTML on Ubuntu.

The command is pdftohtml

If it's not installed, you can install it with:

sudo apt-get install poppler-utils



Options:

-f  : first page to convert
-l  : last page to convert
-q : don't print any messages or errors
-h : print usage information
 -help : print usage information
 -p : ...]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s very easy to convert PDFs to HTML on Ubuntu.</p>
<p>The command is pdftohtml<br />
<span id="more-1615"></span><br />
If it&#8217;s not installed, you can install it with:</p>
<pre>
sudo apt-get install poppler-utils
</pre>
<p>Options:</p>
<pre>
-f <int> : first page to convert
-l <int> : last page to convert
-q : don't print any messages or errors
-h : print usage information
 -help : print usage information
 -p : exchange .pdf links by .html
 -c : generate complex document
 -i : ignore images
 -noframes : generate no frames
 -stdout : use standard output
 -zoom <fp> : zoom the pdf document (default 1.5)
 -xml : output for XML post-processing
 -hidden : output hidden text
 -nomerge : do not merge paragraphs
 -enc <string> : output text encoding name
 -dev <string> : output device name for Ghostscript (png16m, jpeg etc)
 -v : print copyright and version info
 -opw <string> : owner password (for encrypted files)
 -upw <string> : user password (for encrypted files)
 -nodrm : override document DRM settings
</pre>
<p>Here&#8217;s a usage example</p>
<pre>
pdftohtml infile.pdf outfile.html
</pre>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/11/converting-pdf-files-to-html-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</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>Stopping Javascript from resizing the window in Firefox</title>
		<link>http://www.john.geek.nz/2010/10/stopping-javascript-from-resizing-the-window-in-firefox/</link>
		<comments>http://www.john.geek.nz/2010/10/stopping-javascript-from-resizing-the-window-in-firefox/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 22:30:02 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<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=1596</guid>
		<description><![CDATA[One of my pet hates on the internet is shopping sites which resize the window when you're looking at a zoomed in image. Not all of us still use a windowed browser, in fact, most people now use a tabbed one.

Here's how to stop javascript from taking control of your window size in firefox....

Firstly, ...]]></description>
			<content:encoded><![CDATA[<p>One of my pet hates on the internet is shopping sites which resize the window when you&#8217;re looking at a zoomed in image. Not all of us still use a windowed browser, in fact, most people now use a tabbed one.</p>
<p>Here&#8217;s how to stop javascript from taking control of your window size in firefox&#8230;.<br />
<span id="more-1596"></span><br />
Firstly, Select &#8220;Preferences&#8221; from the &#8220;Edit&#8221; menu.</p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2010/10/Screenshot-Firefox-Preferences.png"><img src="http://www.john.geek.nz/wp-content/uploads/2010/10/Screenshot-Firefox-Preferences-300x266.png" alt="" title="Screenshot-Firefox Preferences" width="300" height="266" class="alignnone size-medium wp-image-1598" /></a></p>
<p>Click the advanced button&#8230;</p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2010/10/Screenshot-Advanced-JavaScript-Settings.png"><img src="http://www.john.geek.nz/wp-content/uploads/2010/10/Screenshot-Advanced-JavaScript-Settings.png" alt="" title="Screenshot-Advanced JavaScript Settings" width="299" height="200" class="alignnone size-full wp-image-1597" /></a></p>
<p>And uncheck the &#8220;Move or resize existing windows&#8221; option.</p>
<p>Job Done!</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/10/stopping-javascript-from-resizing-the-window-in-firefox/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>Deleting folders recursively</title>
		<link>http://www.john.geek.nz/2010/06/deleting-folders-recursively/</link>
		<comments>http://www.john.geek.nz/2010/06/deleting-folders-recursively/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 22:26:51 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[PC Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1586</guid>
		<description><![CDATA[I needed recursively delete folders named .svn within a directory structure.

The following will allow you dto do this from a command prompt:

FOR /F "tokens=*" %G IN ('DIR /B /AD /S .svn') DO RMDIR /S /Q %G


Remember, if you're doing it from a batch file, you'll need to double up the percent signs, thus:

FOR /F ...]]></description>
			<content:encoded><![CDATA[<p>I needed recursively delete folders named .svn within a directory structure.</p>
<p>The following will allow you dto do this from a command prompt:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #00b100; font-weight: bold;">FOR</span> /F &quot;tokens=*&quot; <span style="color: #33cc33;">%</span><span style="color: #448888;">G</span> <span style="color: #00b100; font-weight: bold;">IN</span> <span style="color: #33cc33;">(</span>'<span style="color: #b1b100; font-weight: bold;">DIR</span> /B /AD /S .svn'<span style="color: #33cc33;">)</span> <span style="color: #00b100; font-weight: bold;">DO</span> <span style="color: #b1b100; font-weight: bold;">RMDIR</span> /S /Q <span style="color: #33cc33;">%</span><span style="color: #448888;">G</span></pre></div></div>

<p>Remember, if you&#8217;re doing it from a batch file, you&#8217;ll need to double up the percent signs, thus:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #00b100; font-weight: bold;">FOR</span> /F &quot;tokens=*&quot; <span style="color: #33cc33;">%%</span><span style="color: #448888;">G</span> <span style="color: #00b100; font-weight: bold;">IN</span> <span style="color: #33cc33;">(</span>'<span style="color: #b1b100; font-weight: bold;">DIR</span> /B /AD /S .svn'<span style="color: #33cc33;">)</span> <span style="color: #00b100; font-weight: bold;">DO</span> <span style="color: #b1b100; font-weight: bold;">RMDIR</span> /S /Q <span style="color: #33cc33;">%%</span><span style="color: #448888;">G</span></pre></div></div>

<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/06/deleting-folders-recursively/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS 6- Setting up a write only FTP directory</title>
		<link>http://www.john.geek.nz/2010/04/iis-6-setting-up-a-write-only-ftp-directory/</link>
		<comments>http://www.john.geek.nz/2010/04/iis-6-setting-up-a-write-only-ftp-directory/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 22:21:22 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[PC Tips]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1580</guid>
		<description><![CDATA[So, you want to set up a write only ftp directory on IIS?  One where you can upload files, but not list them?

Easy...

First, create a new user which you will log in as.
Make sure this user is explicitly denied access to all files and folders on the system.
Now, add the following 'special' permissions ...]]></description>
			<content:encoded><![CDATA[<p>So, you want to set up a write only ftp directory on IIS?  One where you can upload files, but not list them?</p>
<p>Easy&#8230;<br />
<span id="more-1580"></span><br />
First, create a new user which you will log in as.<br />
Make sure this user is explicitly denied access to all files and folders on the system.<br />
Now, add the following &#8216;special&#8217; permissions to the directory you wish to make write only..</p>
<p><a href="http://www.john.geek.nz/wp-content/uploads/2010/04/writeonly_ftp.png"><img src="http://www.john.geek.nz/wp-content/uploads/2010/04/writeonly_ftp-221x300.png" alt="" title="writeonly_ftp" width="221" height="300" class="aligncenter size-medium wp-image-1584" /></a></p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/04/iis-6-setting-up-a-write-only-ftp-directory/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>WordPress not sending emails on ubuntu &#8211; nrcpts=0</title>
		<link>http://www.john.geek.nz/2010/04/wordpress-not-sending-emails-on-ubuntu-nrcpts0/</link>
		<comments>http://www.john.geek.nz/2010/04/wordpress-not-sending-emails-on-ubuntu-nrcpts0/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 23:55:09 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1521</guid>
		<description><![CDATA[So, you're using sendmail to try and send emails from php/wordpress and it's not working?

Are your mail logs (/var/log/mail.log) showing nrcpts=0 ??

Make sure the sendmail_path in your php.ini file (/etc/php5/apache2/php.ini) is set up correctly.

It should probably be...

sendmail_path = /usr/sbin/sendmail -t -i

]]></description>
			<content:encoded><![CDATA[<p>So, you&#8217;re using sendmail to try and send emails from php/wordpress and it&#8217;s not working?</p>
<p>Are your mail logs (/var/log/mail.log) showing nrcpts=0 ??</p>
<p>Make sure the sendmail_path in your php.ini file (/etc/php5/apache2/php.ini) is set up correctly.</p>
<p>It should probably be&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="apache" style="font-family:monospace;">sendmail_path = /usr/sbin/sendmail -t -i</pre></td></tr></table></div>

<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/04/wordpress-not-sending-emails-on-ubuntu-nrcpts0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

