<?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>Techie Turmoil &#187; Techie Notes</title>
	<atom:link href="http://techieturmoil.co.uk/category/techie-notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://techieturmoil.co.uk</link>
	<description>A techie in a world of luddites</description>
	<lastBuildDate>Tue, 13 Sep 2011 17:17:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Canon iP1900 driver</title>
		<link>http://techieturmoil.co.uk/2011/04/02/canon-ip1900-driver/</link>
		<comments>http://techieturmoil.co.uk/2011/04/02/canon-ip1900-driver/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 10:32:08 +0000</pubDate>
		<dc:creator>JT</dc:creator>
				<category><![CDATA[Techie Notes]]></category>

		<guid isPermaLink="false">http://techieturmoil.co.uk/?p=130</guid>
		<description><![CDATA[Canon provide a Debian package for this printer, which is great. Unfortunately it will not install on recent distributions of Debian or Ubuntu, as it depends on old-school libcupsys2. I&#8217;ve repackaged them to adjust the dependency. Here is the modified version.]]></description>
			<content:encoded><![CDATA[<p>Canon provide a Debian package for this printer, which is great. Unfortunately it will not install on recent distributions of Debian or Ubuntu, as it depends on old-school libcupsys2. I&#8217;ve repackaged them to adjust the dependency. <a title="Canon iP1900 Printer Driver" href="http://techieturmoil.co.uk/wp-content/uploads/2011/04/iP1900_debian_printer.tar.gz">Here</a> is the modified version.</p>
]]></content:encoded>
			<wfw:commentRss>http://techieturmoil.co.uk/2011/04/02/canon-ip1900-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing those pesky PNGs</title>
		<link>http://techieturmoil.co.uk/2011/03/24/fixing-those-pesky-pngs/</link>
		<comments>http://techieturmoil.co.uk/2011/03/24/fixing-those-pesky-pngs/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 23:53:04 +0000</pubDate>
		<dc:creator>JT</dc:creator>
				<category><![CDATA[Techie Notes]]></category>

		<guid isPermaLink="false">http://techieturmoil.co.uk/?p=127</guid>
		<description><![CDATA[I&#8217;ve been struggling with PNG colour matching for a while. It&#8217;s fine on my Linux boxes, with a standard sRGB colour profile, but on Macs and Win/IE with an ICCP in place, the colours never match up with the CSS colours. This is always frustrating, as PNGs are so nice for proper alpha transparency. I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been struggling with PNG colour matching for a while. It&#8217;s fine on my Linux boxes, with a standard sRGB colour profile, but on Macs and Win/IE with an ICCP in place, the colours never match up with the CSS colours. This is always frustrating, as PNGs are so nice for proper alpha transparency.</p>
<p>I just found this handy snippet out there in the ether, to get rid of the gamma and colour profile info from PNGs.</p>
<pre>pngcrush -d outputdir -rem gAMA -rem cHRM -rem iCCP *.png</pre>
<p>pngcrush also optimizes the file and reduces the size, which is nice. Handy little tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://techieturmoil.co.uk/2011/03/24/fixing-those-pesky-pngs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx and WordPress with SSL and Queries</title>
		<link>http://techieturmoil.co.uk/2011/03/22/nginx-and-wordpress-with-ssl-and-queries/</link>
		<comments>http://techieturmoil.co.uk/2011/03/22/nginx-and-wordpress-with-ssl-and-queries/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 18:28:55 +0000</pubDate>
		<dc:creator>JT</dc:creator>
				<category><![CDATA[Techie Notes]]></category>

		<guid isPermaLink="false">http://techieturmoil.co.uk/?p=125</guid>
		<description><![CDATA[So setting up WordPress on Nginx isn&#8217;t difficult. You could follow the example here. This works fine for just a basic install, but what about something that has a load of plugins, for forms and such like? Here we need to tweak the config a bit. SSL: using SSL with Nginx is not as simple [...]]]></description>
			<content:encoded><![CDATA[<p>So setting up WordPress on Nginx isn&#8217;t difficult. You could follow the example <a title="Nginx WordPress configuration example" href="http://wiki.nginx.org/Wordpress">here</a>. This works fine for just a basic install, but what about something that has a load of plugins, for forms and such like? Here we need to tweak the config a bit.</p>
<p><strong>SSL</strong>: using SSL with Nginx is not as simple as just turning on the HTTPS section from the default/example config file and copying over the location directives from the port 80 section. You need to ensure that the PHP fastcgi knows that HTTPS is on, so add the directive:</p>
<pre>fastcgi_param HTTPS on;</pre>
<p>to your location ~ \.php$ section.</p>
<p><strong>Queries</strong>: if you are using a forms plugin, or something else that sends GET requests, you may find that they don&#8217;t work. Change your default rewrite to:</p>
<pre>try_files $uri $uri/ /index.php?$args;</pre>
<p><strong>Security</strong>: if you are using php5-fpm (you should be!) then it is quite possible to execute remote php files. We don&#8217;t want that! Add this line to your php section:</p>
<pre>try_files $uri = 404;</pre>
<p><strong>Suhosin</strong>: you may want to use the Suhosin patch (I do), but this can cause problems with file uploads (and phpMyAdmin). Add the following to your php.ini:</p>
<pre>suhosin.post.max_array_index_length = 256
suhosin.post.max_totalname_length = 65535
suhosin.post.max_vars = 1024
suhosin.request.max_array_index_length = 256
suhosin.request.max_totalname_length = 65535
suhosin.request.max_vars = 1024</pre>
<p>I added this in /etc/php5/conf.d/suhosin.ini, but you may wish to add it elsewhere.</p>
<p>Nginx + php5-fpm + APC + memcache is a super speedy combination. I use it everywhere now. But it does take a bit of getting used to if you are accustomed to Apache.</p>
<p>Just as an afterthought, the docs for setting up WordPress on Nginx in the <a href="http://codex.wordpress.org/Nginx">codex</a> suggest that unless you use APC and a WordPress caching plugin, you will get no performance benefit over Apache. This is utter drivel. Yes I highly recommend APC &#8211; it&#8217;s great &#8211; but you can use it on Apache too. Nginx is fundamentally faster than Apache, even if you compare apples with apples and set up Apache with fastcgi instead of the more common mod_php. This is because Nginx uses an asynchronous, event driven architecture, thus using significantly less resources. It is all explained <a title="Nginx Wiki" href="http://wiki.nginx.org/Main">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://techieturmoil.co.uk/2011/03/22/nginx-and-wordpress-with-ssl-and-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get rid of caption inline styles in WordPress</title>
		<link>http://techieturmoil.co.uk/2011/03/03/get-rid-of-caption-inline-styles-in-wordpress/</link>
		<comments>http://techieturmoil.co.uk/2011/03/03/get-rid-of-caption-inline-styles-in-wordpress/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 23:27:52 +0000</pubDate>
		<dc:creator>JT</dc:creator>
				<category><![CDATA[Techie Notes]]></category>

		<guid isPermaLink="false">http://techieturmoil.co.uk/?p=115</guid>
		<description><![CDATA[For some stupid reason, WordPress injects an inline style to its image caption divs, setting the width to 10px larger than the enclosed image. This is wrong in so many ways: You should never use inline styles. WordPress normally leaves styling to the themes (as it should). Even if you wanted this behaviour, padding would [...]]]></description>
			<content:encoded><![CDATA[<p>For some stupid reason, <a href="http://wordpress.org">WordPress</a> injects an inline style to its image caption divs, setting the width to 10px larger than the enclosed image. This is wrong in so many ways:</p>
<ol>
<li> You should never use inline styles.</li>
<li>WordPress normally leaves styling to the themes (as it should).</li>
<li>Even if you wanted this behaviour, padding would have been more appropriate.</li>
</ol>
<p>So how do we fix it? Well I just spent a while searching and found a few ill thought out suggestions, like overriding the style with !important (doesn&#8217;t work on all browsers and could cause problems if you want to override it again in a specific class) or replacing the shortcode function, either directly in wp-includes/media.php (just plain crazy) or in your functions.php (better but doesn&#8217;t work too well and not very maintainable). This last idea did lead me to find a good solution though. The img_caption_shortcode function has a filter, which effectively overrides its own output. So here&#8217;s what I used (tested on WP 3.1):</p>
<pre>add_filter( 'img_caption_shortcode', 'my_img_caption', 10, 3 );

function my_img_caption( $nowt, $attr, $content )
{
	extract( shortcode_atts( array(
		'id' =&gt; '',
		'align' =&gt; 'alignnone',
		'width' =&gt; '',
		'caption' =&gt; '',
	), $attr ) );

	if ( empty( $caption ) )
		return $content;

	if ( $id )
		$id = 'id="' . esc_attr( $id ) . '" ';

	return '&lt;div ' . $id . 'class="wp-caption ' . esc_attr( $align ) .
		'"&gt;' . do_shortcode( $content ) . '&lt;p class="wp-caption-text"&gt;' .
		$caption . '&lt;/p&gt;&lt;/div&gt;';
}</pre>
<p>Shove that in your theme&#8217;s functions.php and it will replace the core caption function, with the inline style removed. If you&#8217;re wondering what the $nowt variable is about, it is an unused blank string passed by the filter.</p>
]]></content:encoded>
			<wfw:commentRss>http://techieturmoil.co.uk/2011/03/03/get-rid-of-caption-inline-styles-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update to Canon iP1500 drivers</title>
		<link>http://techieturmoil.co.uk/2010/10/12/update-to-canon-ip1500-drivers/</link>
		<comments>http://techieturmoil.co.uk/2010/10/12/update-to-canon-ip1500-drivers/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 15:55:19 +0000</pubDate>
		<dc:creator>JT</dc:creator>
				<category><![CDATA[Techie Notes]]></category>

		<guid isPermaLink="false">http://techieturmoil.co.uk/?p=104</guid>
		<description><![CDATA[﻿I&#8217;ve updated this previous post about the Canon iP1500 drivers for Ubuntu. I&#8217;ve added a new package with a script that actually works. The details of what&#8217;s in the script are here if you want to know what&#8217;s really going on.]]></description>
			<content:encoded><![CDATA[<p>﻿I&#8217;ve updated <a href="http://techieturmoil.co.uk/2010/01/27/canon-ip1500-ubuntu-driver/">this previous post</a> about the Canon iP1500 drivers for Ubuntu. I&#8217;ve added a new package with a script that actually works. The details of what&#8217;s in the script are <a href="https://wiki.ubuntu.com/CanonPixmaIP1500">here</a> if you want to know what&#8217;s really going on.</p>
]]></content:encoded>
			<wfw:commentRss>http://techieturmoil.co.uk/2010/10/12/update-to-canon-ip1500-drivers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pure Genius</title>
		<link>http://techieturmoil.co.uk/2010/10/02/pure-genius/</link>
		<comments>http://techieturmoil.co.uk/2010/10/02/pure-genius/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 12:31:37 +0000</pubDate>
		<dc:creator>JT</dc:creator>
				<category><![CDATA[Techie Notes]]></category>

		<guid isPermaLink="false">http://techieturmoil.co.uk/?p=97</guid>
		<description><![CDATA[Just found this on Google&#8217;s developer site. It&#8217;s called Chrome Frame and basically makes Internet Explorer render using Chrome, via a plugin. So we developers can make our sites insist on it, not have to worry about crappy IE rendering and drag those pesky, luddite IE users into the wonderful world of HTML5/CSS3/decent JS. Sounds [...]]]></description>
			<content:encoded><![CDATA[<p>Just found <a title="Google Chrome Frame" href="http://code.google.com/chrome/chromeframe/">this</a> on Google&#8217;s developer site. It&#8217;s called <a title="Google Chrome Frame" href="http://code.google.com/chrome/chromeframe/">Chrome Frame</a> and basically makes Internet Explorer render using Chrome, via a plugin. So we developers can make our sites insist on it, not have to worry about <a title="Check out how bad it is at QuirksMode.org" href="http://quirksmode.org">crappy IE rendering</a> and drag those pesky, luddite IE users into the wonderful world of HTML5/CSS3/decent JS.</p>
<p>Sounds perfect? We shall see. I shall test it out soon. On this very blog&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://techieturmoil.co.uk/2010/10/02/pure-genius/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Canon iP1500 Ubuntu Driver</title>
		<link>http://techieturmoil.co.uk/2010/01/27/canon-ip1500-ubuntu-driver/</link>
		<comments>http://techieturmoil.co.uk/2010/01/27/canon-ip1500-ubuntu-driver/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 17:53:15 +0000</pubDate>
		<dc:creator>JT</dc:creator>
				<category><![CDATA[Techie Notes]]></category>

		<guid isPermaLink="false">http://techieturmoil.co.uk/?p=78</guid>
		<description><![CDATA[The iP1500 is a cheap, reliable little printer, but Canon didn&#8217;t bother with Linux drivers until recently. They now publish a driver for this printer, but it is a bit old and compatible with RHEL 3 and Suse 9.1, so in rpm format. Even after converting the packages with alien, there is still some fiddling [...]]]></description>
			<content:encoded><![CDATA[<p>The iP1500 is a cheap, reliable little printer, but Canon didn&#8217;t bother with Linux drivers until recently. They now publish a driver for this printer, but it is a bit old and compatible with RHEL 3 and Suse 9.1, so in rpm format. Even after converting the packages with alien, there is still some fiddling required, so I&#8217;ve made a gzipped archive of the three Canon packages. You can get it <a href="http://techieturmoil.co.uk/wp-content/uploads/2010/01/Canon-iP1500.tar.gz">here</a>. Just extract it to a new folder and run the setup script: on the command line, cd to the folder and type</p>
<pre>./setup</pre>
<p>You will be asked for your password, as the script requires sudo. Then plug in your printer. You may then need to add it manually via the printer configuration tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://techieturmoil.co.uk/2010/01/27/canon-ip1500-ubuntu-driver/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Browse CUPS shares on Leopard</title>
		<link>http://techieturmoil.co.uk/2009/04/07/browse-cups-shares-on-leopard/</link>
		<comments>http://techieturmoil.co.uk/2009/04/07/browse-cups-shares-on-leopard/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 15:08:09 +0000</pubDate>
		<dc:creator>JT</dc:creator>
				<category><![CDATA[Techie Notes]]></category>

		<guid isPermaLink="false">http://jtandnait.co.uk/jt/2009/04/07/browse-cups-shares-on-leopard/</guid>
		<description><![CDATA[Apple annoyingly disabled CUPS browsing on Leopard. It always worked in previous versions and is particularly wierd as they own the CUPS project. In fact they claim to have written it, although they did not. Anyway to fix the browsing issue type: cupsctl BrowseProtocols='"cups dnssd"' in your much neglected OSX terminal. Job done.]]></description>
			<content:encoded><![CDATA[<p>Apple annoyingly disabled CUPS browsing on Leopard. It always worked in previous versions and is particularly wierd as they own the CUPS project. In fact they claim to have written it, although they did not.</p>
<p>Anyway to fix the browsing issue type:<br />
<code>cupsctl BrowseProtocols='"cups dnssd"'</code><br />
in your much neglected OSX terminal.</p>
<p>Job done.</p>
]]></content:encoded>
			<wfw:commentRss>http://techieturmoil.co.uk/2009/04/07/browse-cups-shares-on-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why you should never call submit, &quot;submit&quot;&#8230;</title>
		<link>http://techieturmoil.co.uk/2008/11/23/why-you-should-never-call-submit-submit/</link>
		<comments>http://techieturmoil.co.uk/2008/11/23/why-you-should-never-call-submit-submit/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 10:53:11 +0000</pubDate>
		<dc:creator>JT</dc:creator>
				<category><![CDATA[Techie Notes]]></category>

		<guid isPermaLink="false">http://jtandnait.co.uk/jt/?p=36</guid>
		<description><![CDATA[So I spent several hours trying to get to the bottom of a rather annoying Javascript problem. I wanted a form that auto-submitted. For good reason of course &#8211; to enable data to be saved to a database, before it was transmitted somewhere else. I created a test page to check the Javascript method required: [...]]]></description>
			<content:encoded><![CDATA[<p>So I spent several hours trying to get to the bottom of a rather annoying Javascript problem. I wanted a form that auto-submitted. For good reason of course &#8211; to enable data to be saved to a database, before it was transmitted somewhere else.<span id="more-36"></span></p>
<p>I created a test page to check the Javascript method required: <code>document.formname.submit()</code> or <code>document.forms['formID'].submit()</code> (my Javascript is a little rusty because, I&#8217;m glad to say, I rarely use it). This worked fine, so I added the little bit of code to the real page. It promptly refused to work. No matter what I tried, it wouldn&#8217;t auto-submit, and the debug console said <code>"document.formname.submit is not a function"</code>. How bizzare! No end of googling could find an answer. The code was right, according to all sources. I changed names of the form and added IDs galore, but no joy.</p>
<p>Then it hit me &#8211; the submit button in the form (I included one for those who might have no Javascript, or Javascript turned off) had the name attribute of <code>"submit"</code>! This meant that the submit button was the object: <code>document.formname.submit</code> , but I was trying to execute the method: <code>document.formname.submit()</code> . Javascript can&#8217;t cope with one object and a method of another object, having the same name. As soon as I changed the name of the submit button, all was well. It worked!</p>
<p>What a load of hassle for such a tiny error. So remember, when you give your form elements names or IDs, make sure they are different from the element tag. A good practice is to give the form a generic name, such as <code>"mysite_signup"</code> and then name its child elements with the formname as the prefix. So, an input field might be <code>"mysite_signup_email_address"</code>, and the submit button might be <code>"mysite_signup_submit"</code>. Unique naming baby &#8211; it&#8217;s the way forward.</p>
]]></content:encoded>
			<wfw:commentRss>http://techieturmoil.co.uk/2008/11/23/why-you-should-never-call-submit-submit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IBM Linux Ad</title>
		<link>http://techieturmoil.co.uk/2008/10/29/ibm-linux-ad/</link>
		<comments>http://techieturmoil.co.uk/2008/10/29/ibm-linux-ad/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 01:28:08 +0000</pubDate>
		<dc:creator>JT</dc:creator>
				<category><![CDATA[JT]]></category>
		<category><![CDATA[Techie Notes]]></category>

		<guid isPermaLink="false">http://jtandnait.co.uk/jt/?p=33</guid>
		<description><![CDATA[So this is an old ad, but I kinda liked it&#8230;]]></description>
			<content:encoded><![CDATA[<p>So this is an old ad, but I kinda liked it&#8230;<span id="more-33"></span><br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/EwL0G9wK8j4" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/EwL0G9wK8j4" wmode="transparent"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://techieturmoil.co.uk/2008/10/29/ibm-linux-ad/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

