<?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; Linux Tips</title>
	<atom:link href="http://www.john.geek.nz/category/tips/linux-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>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>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>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>
		<item>
		<title>WordPress, Permalinks and 404 errors</title>
		<link>http://www.john.geek.nz/2010/04/wordpress-permalinks-and-404-errors/</link>
		<comments>http://www.john.geek.nz/2010/04/wordpress-permalinks-and-404-errors/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 23:30:01 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Linux Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1495</guid>
		<description><![CDATA[This page has the permalink http://www.john.geek.nz/2010/04/wordpress-permalinks-and-404-errors But internally its default URL is http://www.john.geek.nz/?p=1495.

Permalinks help people see the topic of a page before it's visited and generally mean that search engines will rank them higher too.

OK, so you're getting 404's as soon as you enable permalinks other than the default?

Firstly, make sure mod_rewrite is loaded. ...]]></description>
			<content:encoded><![CDATA[<p>This page has the permalink <a href="http://www.john.geek.nz/2010/04/wordpress-permalinks-and-404-errors">http://www.john.geek.nz/2010/04/wordpress-permalinks-and-404-errors</a> But internally its default URL is <a href="http://www.john.geek.nz/?p=1495">http://www.john.geek.nz/?p=1495</a>.</p>
<p>Permalinks help people see the topic of a page before it&#8217;s visited and generally mean that search engines will rank them higher too.</p>
<p>OK, so you&#8217;re getting 404&#8242;s as soon as you enable permalinks other than the default?<br />
<span id="more-1495"></span><br />
Firstly, make sure mod_rewrite is loaded.  The easiest way is to use the phpinfo() function.  This can be done by creating a php file containing the following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>You can then check the output of the phpinfo() function to see if &#8216;mod_rewrite&#8217; in enabled.</p>
<p>If mod_rewrite is not enabled, you will need to enable it on the command line by typing:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">a2enmod rewrite</pre></td></tr></table></div>

<p>You&#8217;ll then want to restart apache with</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></td></tr></table></div>

<p>If this doesn&#8217;t fix the problem, browse to the root of your website and check if the file &#8216;.htaccess&#8217; exists.<br />
If it doesn&#8217;t, create one by typing</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">touch</span> .htaccess</pre></td></tr></table></div>

<p>Make sure the .htaccess file is writeable with</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> .htaccess</pre></td></tr></table></div>

<p>If it&#8217;s still not working, check your apache config files.  The root directory of your website must have AllowOverride set to all.  For example, in the file /etc/apache2/sites-available/sitename</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">Directory</span> /srv/www/&gt;
	<span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">All</span>
&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;</pre></td></tr></table></div>

<p>Just make sure the AllowOverride is set to All.  The other items should stay the same.</p>
<p>Restart apache and hopefully your 404 errors will be gone.</p>
<p>Tell me how it goes&#8230;..</p>
<p class="wp-flattr-button"></p> <p><a href="http://www.john.geek.nz/?flattrss_redirect&amp;id=1495&amp;md5=fca0a93010871ed9229734410197ff62" 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/04/wordpress-permalinks-and-404-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plugging in headphones doesn&#039;t mute speakers in Ubuntu</title>
		<link>http://www.john.geek.nz/2010/01/plugging-in-headphones-doesnt-mute-speakers-in-ubuntu/</link>
		<comments>http://www.john.geek.nz/2010/01/plugging-in-headphones-doesnt-mute-speakers-in-ubuntu/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 14:37:16 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Linux Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1476</guid>
		<description><![CDATA[I upgraded to Ubuntu 9.10 in early December, but yesterday was the first time I tried to use headphones since then.

It turns out that plugging headphones into the headphones socket doesn't automatically mute the speakers anymore.

Here's a fix.

Open a terminal (Alt+F2 > gnome-terminal)
alsamixer (enter)
Use the arrow keys (left/right) to highlight Headphon
Press 'm'

This should fix ...]]></description>
			<content:encoded><![CDATA[<p>I upgraded to Ubuntu 9.10 in early December, but yesterday was the first time I tried to use headphones since then.</p>
<p>It turns out that plugging headphones into the headphones socket doesn&#8217;t automatically mute the speakers anymore.</p>
<p>Here&#8217;s a fix.</p>
<p>Open a terminal (Alt+F2 > gnome-terminal)<br />
alsamixer (enter)<br />
Use the arrow keys (left/right) to highlight Headphon<br />
Press &#8216;m&#8217;</p>
<p>This should fix it.  You can now hit Esc to exit and exit the terminal.</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/01/plugging-in-headphones-doesnt-mute-speakers-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Software Centre &#8211; Not available in the current data</title>
		<link>http://www.john.geek.nz/2010/01/ubuntu-software-centre-not-available-in-the-current-data/</link>
		<comments>http://www.john.geek.nz/2010/01/ubuntu-software-centre-not-available-in-the-current-data/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 11:32:20 +0000</pubDate>
		<dc:creator>John Burns</dc:creator>
				<category><![CDATA[Linux Tips]]></category>

		<guid isPermaLink="false">http://www.john.geek.nz/?p=1472</guid>
		<description><![CDATA[If you get the error "Not available in the current data" in the Ubuntu Software Centre, try opening a Terminal and running this:

sudo apt-get update

Update: This should also fix the error "Not available for your hardware architecture" as well]]></description>
			<content:encoded><![CDATA[<p>If you get the error &#8220;Not available in the current data&#8221; in the Ubuntu Software Centre, try opening a Terminal and running this:</p>
<p>sudo apt-get update</p>
<p>Update: This should also fix the error &#8220;Not available for your hardware architecture&#8221; as well</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.john.geek.nz/2010/01/ubuntu-software-centre-not-available-in-the-current-data/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

