<?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>Robert Naylor &#187; Howtos</title>
	<atom:link href="http://robert.pobice.co.uk/cats/howtos/feed/" rel="self" type="application/rss+xml" />
	<link>http://robert.pobice.co.uk</link>
	<description>Random thoughts and tech tips</description>
	<lastBuildDate>Sun, 11 Apr 2010 18:13:12 +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>WordPress: Stopping the Sidebar from Printing</title>
		<link>http://robert.pobice.co.uk/2009/08/wordpress-stopping-the-sidebar-from-printing-2/</link>
		<comments>http://robert.pobice.co.uk/2009/08/wordpress-stopping-the-sidebar-from-printing-2/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 21:18:04 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://robert.pobice.co.uk/?p=51</guid>
		<description><![CDATA[I&#8217;ve already blogged about this, but here&#8217;s a new method on how to fix the problem.  This one doesn&#8217;t bloat the site as much, and keeps the css files down to a minimum.
Please note: I&#8217;m assuming you still use the default theme.  Things will be slightly different with other themes, but in general [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve already blogged about this, but here&#8217;s a new method on how to fix the problem.  This one doesn&#8217;t bloat the site as much, and keeps the css files down to a minimum.</p>
<p><strong>Please note: I&#8217;m assuming you still use the default theme.  Things will be slightly different with other themes, but in general the same principal should apply.</strong></p>
<p>In the file header.php remove media=&#8221;screen&#8221; from the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stylesheet_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;</pre></div></div>

<p>In style.css, just before the line</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Begin Typography &amp;amp; Colors */</span></pre></div></div>

<p>Add</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@media screen {</span></pre></div></div>

<p>At the bottom of the file add the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">&#125;</span>
<span style="color: #a1a100;">@media print {</span>
    <span style="color: #808080; font-style: italic;">/* style sheet for print goes here */</span>  
   <span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Bingo no wasted paper from printing the side bar.</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.pobice.co.uk/2009/08/wordpress-stopping-the-sidebar-from-printing-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exim: Deliver some email address on local domain remotely</title>
		<link>http://robert.pobice.co.uk/2009/07/exim-deliver-some-email-address-on-local-domain-remotely/</link>
		<comments>http://robert.pobice.co.uk/2009/07/exim-deliver-some-email-address-on-local-domain-remotely/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 20:01:13 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://robert.pobice.co.uk/?p=46</guid>
		<description><![CDATA[Most of my email is handled by a server I run, except for a few legacy address I can&#8217;t really move for now.  Before I had been lazy and send simply relayed all mail that didn&#8217;t have a local mailbox onto the second server.  However I was forwarding shed loads of emails to duff address. [...]]]></description>
			<content:encoded><![CDATA[<p>Most of my email is handled by a server I run, except for a few legacy address I can&#8217;t really move for now.  Before I had been lazy and send simply relayed all mail that didn&#8217;t have a local mailbox onto the second server.  However I was forwarding shed loads of emails to duff address.  To fix this I have entered a new router into exim and removed the other domain from the relay list.</p>
<pre>special_remote:
  debug_print = "R: special_remote for $local_part@$domain"
  driver = dnslookup
  domains = pobice.com
  local_parts = lsearch;/etc/exim4/non_local
  transport = remote_smtp
  ignore_target_hosts = 127.0.0.0/8
  no_more</pre>
<p>I then have entered the local_parts into a file.  Everything else then gets bounced, rather than been forwarded and bounced later on.  </p>
<p>Word of warning &#8211; I&#8217;m no exim expert, but this seems to do the trick for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.pobice.co.uk/2009/07/exim-deliver-some-email-address-on-local-domain-remotely/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: NUT &amp; CPU Throttling/Frequency Scaling</title>
		<link>http://robert.pobice.co.uk/2007/05/howto-nut-cpu-throttlingfrequency-scaling/</link>
		<comments>http://robert.pobice.co.uk/2007/05/howto-nut-cpu-throttlingfrequency-scaling/#comments</comments>
		<pubDate>Mon, 21 May 2007 19:03:33 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.pobice.co.uk/index/archives/2007/05/37</guid>
		<description><![CDATA[After a couple of power cuts lasting long enough for my UPS to shutdown my PC, I&#8217;ve been meaning to get NUTs to set my CPU to lowest speed possible when running on battery power, this week I finally got round to it.   Please note these instructions are based on Debian 4.0 (Etch) [...]]]></description>
			<content:encoded><![CDATA[<p>After a couple of power cuts lasting long enough for my UPS to shutdown my PC, I&#8217;ve been meaning to get NUTs to set my CPU to lowest speed possible when running on battery power, this week I finally got round to it.   Please note these instructions are based on Debian 4.0 (Etch) and may require extra steps to work on different distro&#8217;s.</p>
<p><span id="more-37"></span></p>
<p>For this to work you have to:</p>
<ol>
<li>Have a CPU that support Frequency Scaling</li>
<li>Have CPU Frequency scaling working</li>
<li>Use <a href="http://www.networkupstools.org/">NUT (Network UPS Tools)</a>
</li>
</ol>
<p>Here what you need to do to get thing working</p>
<ul>
<li><strong>Check you what &#8216;Governors&#8217; you have available</strong><br />
You need to make sure the correct modules are loaded so that you can scale to the correct settings. To see what you do have loaded run:<br />
<code>cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors</code><br />
You&#8217;ll need at least powersave and one other.  Powersave should set the CPU Frequency to the lowest setting.  If you don&#8217;t have powersave you&#8217;ll need to load the module.  As root run:<br />
<code>modprobe cpufreq_powersave</code> and add cpufreq_powersave to the file<br />
 /etc/modules.</p>
<p>To test that it is working, ideally run something that force you CPU to 100 for a while (say compress a large folder) and then run<br />
<code>cpufreq-selector --governor powersave<br />
sleep 1<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
cpufreq-selector --governor userspace<br />
sleep 1<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq<br />
</code><br />
The first number given should be the lowest CPU frequency and the last should be the highest (assuming the process is using a lot of CPU time still)
	</li>
<li><strong>Add a few new items to upssched.conf</strong><br />
Using you&#8217;re favorite editor open up /etc/nut/upssched.conf and add the following line:<br />
<code>AT ONBATT * START-TIMER powersave 30<br />
AT ONLINE * CANCEL-TIMER powersave<br />
AT ONLINE * START-TIMER userspace 30<br />
AT ONBATT * CANCEL-TIMER userspace</code><br />
I&#8217;ve used a timer (30 seconds) to smooth out jumpy power from triggering off any actions.  </li>
<li><strong>Add the command to the CMDSCRIPT file to change the CPU frequency govenor</strong></li>
<p>Edit the cmdscript file (the path is given in upssched.conf on the line starting CMDSCRIPT.  This file probably doesn&#8217;t exist &#8211; so just create a new one.  Assuming it doesn&#8217;t exist add the following lines:<br />
<code>#! /bin/sh<br />
case $1 in<br />
	powersave)<br />
		/usr/bin/cpufreq-selector --governor powersave &#038;&#038; logger -t upssched-cmd "Setting CPU Governor to powersave"<br />
		;;<br />
	userspace)<br />
		/usr/bin/cpufreq-selector --governor userspace  &#038;&#038; logger -t upssched-cmd "Setting CPU Governor to userspace"<br />
		;;<br />
	*)<br />
		logger -t upssched-cmd "Unrecognized command: $1"<br />
		;;<br />
esac</code></p>
<li><strong>Test</strong> Unplug you&#8217;re UPS for 1 min, plug back in and look at /var/log/syslog &#8211; you should see that NUTs has throttled you&#8217;re CPU.</li>
</ul>
<p>I haven&#8217;t had a power cut since I&#8217;ve implemented this, but from looking at the stats from the UPS I should gain another 7 min or so of battery time &#8211; an extra 21%.  An improvement on this may be stopping some process and task when on battery and starting them again when back on mains.  But for now, at least untill the next power cut this will do for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://robert.pobice.co.uk/2007/05/howto-nut-cpu-throttlingfrequency-scaling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: Stopping the Sidebar from Printing</title>
		<link>http://robert.pobice.co.uk/2007/05/wordpress-stopping-the-sidebar-from-printing/</link>
		<comments>http://robert.pobice.co.uk/2007/05/wordpress-stopping-the-sidebar-from-printing/#comments</comments>
		<pubDate>Wed, 09 May 2007 21:46:00 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.pobice.co.uk/index/archives/2007/05/35</guid>
		<description><![CDATA[If there&#8217;s one thing that really winds me up on the net is that when printing web-pages you end up with a load of crap you didn&#8217;t want usually.  For example with blogs you usually get a page or two with the content on the blog sidebar, which frankly I don&#8217;t need on a [...]]]></description>
			<content:encoded><![CDATA[<p>If there&#8217;s one thing that really winds me up on the net is that when printing web-pages you end up with a load of crap you didn&#8217;t want usually.  For example with blogs you usually get a page or two with the content on the blog sidebar, which frankly I don&#8217;t need on a print out.</p>
<p>Well I&#8217;ve done something about it (well at least on my blog) &#8211; I&#8217;ve changed my theme so that on browsers that supports css and media types the sidebar shouldn&#8217;t print out.  Here&#8217;s how you can add this to you&#8217;re WordPress blog</p>
<ol>
<li>Create a file print-style.css in the directory for you&#8217;re current theme with the following content<br />
<code> .dontprint{ display: none; }<br />
div#menu{ display: none; }</code></li>
<li>In wordpress, goto Presentation, Theme Editor and select the file Header</li>
<li>Just bellow the line setting the css style sheet &#8211; should be something like this :<br />
<code>&amp;lt;style type="text/css" media="screen"&gt;<br />
@import url( %lt;?php bloginfo('stylesheet_url'); ?&gt; );<br />
&lt;style&gt;<br />
</code><br />
add the lines<br />
<code> &amp;lt;style type="text/css" media="print"&gt;<br />
@import url(&amp;lt;?php bloginfo('template_directory'); ?&gt;/style-print.css);<br />
&lt;/style&gt;</code></li>
<li>Hopefully this should be enough, but if the theme author hasn&#8217;t used the div&#8217;s in the sidebar file you may have to add this line <code>&lt;div id="menu"&gt;</code> to the top of the file and this line <code>&lt;/div&gt;</code> to the bottom of the file</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://robert.pobice.co.uk/2007/05/wordpress-stopping-the-sidebar-from-printing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GVIM/Ubuntu/Debian Syntax Highlighting</title>
		<link>http://robert.pobice.co.uk/2006/11/gvimubuntudebian-syntax-highlighting/</link>
		<comments>http://robert.pobice.co.uk/2006/11/gvimubuntudebian-syntax-highlighting/#comments</comments>
		<pubDate>Mon, 20 Nov 2006 19:35:01 +0000</pubDate>
		<dc:creator>robert</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.pobice.co.uk/index/archives/2006/11/32</guid>
		<description><![CDATA[It appears in the Edgy Eft and Debian Etch that Syntax highlighting in gvim has been switched off by default.
To add it back add the following line to /etc/vim/gvimrc

" Also switch on highlighting the last used search pattern.
if has("syntax") &#038;&#038; (&#038;t_Co > 2 &#124;&#124; has("gui_running"))
  syntax on
  set hlsearch
endif
]]></description>
			<content:encoded><![CDATA[<p>It appears in the Edgy Eft and Debian Etch that Syntax highlighting in gvim has been switched off by default.</p>
<p>To add it back add the following line to /etc/vim/gvimrc<br />
<code><br />
" Also switch on highlighting the last used search pattern.<br />
if has("syntax") &#038;&#038; (&#038;t_Co > 2 || has("gui_running"))<br />
  syntax on<br />
  set hlsearch<br />
endif</code></p>
]]></content:encoded>
			<wfw:commentRss>http://robert.pobice.co.uk/2006/11/gvimubuntudebian-syntax-highlighting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
