<?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>jamesoff.net &#187; Sysadmin</title>
	<atom:link href="http://jamesoff.net/site/category/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamesoff.net/site</link>
	<description>you heard</description>
	<lastBuildDate>Thu, 01 Sep 2011 17:39:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Alfred script to toggle AirPort</title>
		<link>http://jamesoff.net/site/2011/07/13/alfred-script-to-toggle-airport/</link>
		<comments>http://jamesoff.net/site/2011/07/13/alfred-script-to-toggle-airport/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 08:25:41 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[airport]]></category>
		<category><![CDATA[alfred]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=448</guid>
		<description><![CDATA[Please see my Alfred Extensions page for updates! A quick and easy one for Alfred: a command which toggles AirPort on/off. If you are using Alfred 0.9.9 (or better), you should be able to download this ZIP file and import it! If you are using an earlier version of Alfred, follow these instructions: AIRPORT=`networksetup -getairportpower [...]]]></description>
			<content:encoded><![CDATA[<p><b>Please see my <a href="http://jamesoff.net/site/alfred-extensions/">Alfred Extensions</a> page for updates!</b></p>

<p>A quick and easy one for Alfred: a command which toggles AirPort on/off.</p>

<p>If you are using Alfred 0.9.9 (or better), you should be able to download <a href="http://cl.ly/2m0G3a110E141B3j3t03">this ZIP file</a> and import it!</p>

<p>If you are using an earlier version of Alfred, follow these instructions:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">AIRPORT</span>=<span style="color: #000000; font-weight: bold;">`</span>networksetup <span style="color: #660033;">-getairportpower</span> AirPort <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> Off<span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$?&quot;</span> = <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> networksetup <span style="color: #660033;">-setairportpower</span> AirPort on; <span style="color: #007800;">MSG</span>=<span style="color: #ff0000;">&quot;AirPort enabled&quot;</span>; <span style="color: #000000; font-weight: bold;">else</span> networksetup <span style="color: #660033;">-setairportpower</span> Airport off; <span style="color: #007800;">MSG</span>=<span style="color: #ff0000;">&quot;AirPort disabled&quot;</span>; <span style="color: #000000; font-weight: bold;">fi</span>; <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>growlnotify <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MSG</span>&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #ff0000;">&quot;/Applications/Utilities/Airport Utility.app&quot;</span> AirPort status</pre></div></div>


<p>Create as a terminal script and configure it to be silent. I also borrowed the icon from AirPort utility for the script (Alfred for &#8220;airport&#8221; and then use Reveal in Finder on it; Get Info; click Icon and ⌘C; click the icon area in Alfred and ⌘V).</p>

<p><img src="http://f.cl.ly/items/0l3e1R2t3Z35233r310U/Screen%20shot%202011-07-13%20at%2009.19.44.png" alt="Script configuration screenshot" /></p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2011/07/13/alfred-script-to-toggle-airport/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alfred script to change network location in OS X</title>
		<link>http://jamesoff.net/site/2011/06/09/alfred-script-to-change-network-location-in-os-x/</link>
		<comments>http://jamesoff.net/site/2011/06/09/alfred-script-to-change-network-location-in-os-x/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 18:43:32 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[alfred]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[useful]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=434</guid>
		<description><![CDATA[Please see my Alfred Extensions page for updates! I wrote this little scriptlet to change network location in OS X using Alfred, but you could trigger it using whatever method you wanted. If you&#8217;re using Alfred 0.9.9 or later, you should be able to download this ZIP file and import it! if you using an [...]]]></description>
			<content:encoded><![CDATA[<p><b>Please see my <a href="http://jamesoff.net/site/alfred-extensions/">Alfred Extensions</a> page for updates!</b></p>

<p>I wrote this little scriptlet to change network location in OS X using <a href="http://alfredapp.com">Alfred</a>, but you could trigger it using whatever method you wanted.</p>

<p>If you&#8217;re using Alfred 0.9.9 or later, you should be able to download <a href="http://cl.ly/2t1O2G16341p2E1z3407">this ZIP file</a> and import it!</p>

<p>if you using an earlier version, follow the instructions below:</p>

<p><strike></p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>query<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">4</span>-<span style="color: #000000;">39</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect</pre></div></div>


<p></strike></p>

<p><b>UPDATE</b> 2011-06-11: I have significantly improved the script to work around a bug caused by the 3Connect profile (3Connect is pants FYI), as well as use <code>growlnotify</code> to tell you if the change worked or not. It also allows substring matches (anchored at the start) so you can use &#8220;auto&#8221; for &#8220;Automatic&#8221;. If you have more than one profile that starts with a matching substring, the behaviour is currently undefined.</p>

<p><a href="http://jamesoff.net/site/wp-content/uploads/2011/06/Screen-shot-2011-06-11-at-19.02.40.png"><img src="http://jamesoff.net/site/wp-content/uploads/2011/06/Screen-shot-2011-06-11-at-19.02.40.png" alt="Growl showing network change notification" title="Screen shot 2011-06-11 at 19.02.40" width="322" height="100" class="alignnone size-full wp-image-441" /></a></p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">MSG</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;\({query}&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">4</span>- <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-E</span> <span style="color: #ff0000;">'s/.+ \((.+)\)/Location changed to \1/'</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MSG</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>growlnotify <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>PreferencePanes<span style="color: #000000; font-weight: bold;">/</span>Network.prefPane <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Unable to change location&quot;</span> Error; <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>growlnotify <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>PreferencePanes<span style="color: #000000; font-weight: bold;">/</span>Network.prefPane <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MSG</span>&quot;</span> Location changed; <span style="color: #000000; font-weight: bold;">fi</span>;</pre></div></div>


<p>If you want it without Growl notifications, use this version:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;\({query}&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">4</span>- <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect</pre></div></div>


<p>It&#8217;s slightly convoluted as it&#8217;s case-insensitive. To use it, create a Terminal/Shell script entry like this:</p>

<p><img src="http://f.cl.ly/items/3t0B301j3Q2X102y1C0V/Screen%20shot%202011-06-09%20at%2020.38.05.png" alt="Alfred settings" /></p>

<p>Now you can just type &#8220;location work&#8221; or similar into Alfred to change network location. I&#8217;ll add Growl-confirmation support when the next version of Alfred is released :)</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2011/06/09/alfred-script-to-change-network-location-in-os-x/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>iPhone apps, Xcode and Dropbox</title>
		<link>http://jamesoff.net/site/2011/01/10/iphone-apps-xcode-and-dropbox/</link>
		<comments>http://jamesoff.net/site/2011/01/10/iphone-apps-xcode-and-dropbox/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 12:33:27 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[my stuff]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=428</guid>
		<description><![CDATA[A while back I put some of my Xcode bits (i.e. the Random Recipe Generator) into my Dropbox to make it easier to stay up to date on my laptop and my desktop. (Yes, I know, source control blah blah blah :) However, building the Distribution version of the app gave me this warning: &#8220;The [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I put some of my Xcode bits (i.e. the <a href="http://itunes.com/apps/jamesseward/randomrecipegenerator">Random Recipe Generator</a>) into my <a href="http://db.tt/ojcracC">Dropbox</a> to make it easier to stay up to date on my laptop and my desktop. (Yes, I know, source control blah blah blah :)</p>

<p>However, building the Distribution version of the app gave me this warning:</p>

<blockquote>&#8220;The CodeResources file must be a symbolic link to _CodeSignature/CodeResources&#8221;</blockquote>

<p>which I duly ignored. However, the Application Loader (used to push the new binary to the App Store) also complained about that and wouldn&#8217;t upload it.</p>

<p>It looks like Dropbox&#8217;s replication may have been to blame for the symlink stopping being a symlink, so the solution is to use the handy new selective sync option in Dropbox and not sync the build/ directory between my machines (which is pretty much pointless anyway and certainly generates a lot of network overhead when you build). Having done that and built a clean copy it worked fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2011/01/10/iphone-apps-xcode-and-dropbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMware Fusion upgrade error messages</title>
		<link>http://jamesoff.net/site/2010/12/03/vmware-fusion-upgrade-error-messages/</link>
		<comments>http://jamesoff.net/site/2010/12/03/vmware-fusion-upgrade-error-messages/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 09:18:10 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[fusion]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=422</guid>
		<description><![CDATA[CDS Internal Error (3014) Means: Can&#8217;t reach the HTTP proxy you have configured. Maybe you should turn it off.]]></description>
			<content:encoded><![CDATA[<blockquote>CDS Internal Error (3014)</blockquote>

<p>Means: Can&#8217;t reach the HTTP proxy you have configured. Maybe you should turn it off.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2010/12/03/vmware-fusion-upgrade-error-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tarsnap under cygwin</title>
		<link>http://jamesoff.net/site/2009/09/10/tarsnap-under-cygwin/</link>
		<comments>http://jamesoff.net/site/2009/09/10/tarsnap-under-cygwin/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 10:36:31 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[tarsnap]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=386</guid>
		<description><![CDATA[To get tarsnap working under cygwin, here&#8217;s what you need to do: Install the following packages using the cygwin setup tool: gcc4 make openssl (needed for runtime, not for building) openssl-devel zlib-devel Download and extract the tarsnap code. Run ./configure (this seems to be much slower on cygwin than on other more UNIXy platforms) Run [...]]]></description>
			<content:encoded><![CDATA[<p>To get <a href="http://beta.tarsnap.com">tarsnap </a>working under cygwin, here&#8217;s what you need to do:</p>

<ol>
    <li>Install the following packages using the cygwin setup tool:
<ul>
    <li>gcc4</li>
    <li>make</li>
    <li>openssl (needed for runtime, not for building)</li>
    <li>openssl-devel</li>
    <li>zlib-devel</li>
</ul></li>


    <li>Download and extract the <a href="https://beta.tarsnap.com/download.html">tarsnap code</a>.</li>

    <li>Run <code>./configure</code> (this seems to be much slower on cygwin than on other more UNIXy platforms)</li>

    <li>Run <code>make all install clean</code></li>
</ol>

<p>Tarsnap should now be installed and you can use it in the normal fashion &#8211; create a host key with <code>tarsnap-keygen</code> and then get backing up!</p>

<p>Edit 2009-12-16: checkers from #tarsnap on EFnet has written a post with scripts for Linux and Cygwin tarsnapping at <a href="http://www.bluebottle.net.au/blog/2009/tarsnap-backups-on-windows-and-linux">http://www.bluebottle.net.au/blog/2009/tarsnap-backups-on-windows-and-linux</a></p>

<p>You may also wish at add <code>--prefix=/</code> to the <code>configure</code> command line, as <code>/usr/local</code> isn&#8217;t in the default path.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2009/09/10/tarsnap-under-cygwin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Risk Disk and Squid</title>
		<link>http://jamesoff.net/site/2008/09/10/risk-disk-and-squid/</link>
		<comments>http://jamesoff.net/site/2008/09/10/risk-disk-and-squid/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 15:06:18 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[riskdisk]]></category>
		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=357</guid>
		<description><![CDATA[We use RiskDisk at work to see if a company we&#8217;re going to do business with is trustworthy, but recently it was complaining HTTP Error 417: Expectation Failed when it tried to do any online lookups. I tracked this down to it sending Expect: 100-continue in the headers of the request it sent to its [...]]]></description>
			<content:encoded><![CDATA[<p>We use <a href="http://www.riskdisk.com/">RiskDisk</a> at work to see if a company we&#8217;re going to do business with is trustworthy, but recently it was complaining <code>HTTP Error 417: Expectation Failed</code> when it tried to do any online lookups.</p>

<p>I tracked this down to it sending <code>Expect: 100-continue</code> in the headers of the request it sent to its server. However, it was going via our web proxy at work, which is <a href="http://www.squid-cache.org/">Squid</a>. Recently I upgraded Squid to 2.7, and this seems to be the cause of the problems. Squid 2.7 is less forgiving about that particular header (which is apparently an RFC violation on the part of the client).</p>

<p>It&#8217;s easily fixed by adding <code>ignore_expect_100 on</code> to your Squid configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2008/09/10/risk-disk-and-squid/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>grepping the output of ccze</title>
		<link>http://jamesoff.net/site/2008/07/09/grepping-the-output-of-ccze/</link>
		<comments>http://jamesoff.net/site/2008/07/09/grepping-the-output-of-ccze/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 13:46:34 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=356</guid>
		<description><![CDATA[If you ever want to grep the output of ccze and found it didn&#8217;t work right, here&#8217;s the magic incantation to do it: tail somefile &#124; ccze -A -o noscroll &#124; grep ... -A makes ccze output ASCII sequences, and -o noscroll turns off the scroll option &#8211; whatever that is exactly. The man page [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever want to grep the output of ccze and found it didn&#8217;t work right, here&#8217;s the magic incantation to do it:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tail</span> somefile <span style="color: #000000; font-weight: bold;">|</span> ccze <span style="color: #660033;">-A</span> <span style="color: #660033;">-o</span> noscroll <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> ...</pre></div></div>


<p><code>-A</code> makes ccze output ASCII sequences, and <code>-o noscroll</code> turns off the scroll option &#8211; whatever that is exactly. The man page says it&#8217;s a good idea to turn it off if you&#8217;re redirecting the output. Omitting it seems to make the output appear in lumps :)</p>

<p>For example, keep an eye on squid logs omitting all MSN crap:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-F</span> access.log <span style="color: #000000; font-weight: bold;">|</span> ccze <span style="color: #660033;">-A</span> <span style="color: #660033;">-C</span> <span style="color: #660033;">-o</span> noscroll <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> gateway.dll</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2008/07/09/grepping-the-output-of-ccze/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>vim as a man-page reader</title>
		<link>http://jamesoff.net/site/2008/03/06/vim-as-a-man-page-reader/</link>
		<comments>http://jamesoff.net/site/2008/03/06/vim-as-a-man-page-reader/#comments</comments>
		<pubDate>Thu, 06 Mar 2008 16:56:09 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2008/03/06/vim-as-a-man-page-reader/</guid>
		<description><![CDATA[Sure, why not :) This goes in your zshrc: vman&#40;&#41; &#123; if &#91; $# -eq 0 &#93;; then /usr/bin/man else if man -w $* &#62;/dev/null 2&#62;/dev/null then /usr/bin/man $* &#124; col -b &#124; vim -c 'set ft=man nomod' - else echo No man page for $* fi fi &#125; alias man='vman' And this goes in [...]]]></description>
			<content:encoded><![CDATA[<p>Sure, why not :)</p>

<p>This goes in your zshrc:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  vman<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span>
    <span style="color: #000000; font-weight: bold;">else</span>
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #660033;">-w</span> <span style="color: #007800;">$*</span> <span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
      <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #007800;">$*</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">col</span> <span style="color: #660033;">-b</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'set ft=man nomod'</span> -
      <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> No <span style="color: #c20cb9; font-weight: bold;">man</span> page <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #007800;">$*</span>
      <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #7a0874; font-weight: bold;">&#125;</span>
  <span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">man</span>=<span style="color: #ff0000;">'vman'</span></pre></div></div>


<p>And this goes in your vimrc (in a suitable <code>augroup</code>):</p>

<pre lang="">
  autocmd FileType man setlocal ro nonumber nolist fdm=indent fdn=2 sw=4 foldlevel=2 | nmap q :quit<CR>
</pre>

<p>Now you&#8217;ll get nicely highlighted man pages with folded sections, and you can hit <code>q</code> to quit just like <code>less</code>.</p>

<p><img src='http://jamesoff.net/site/wp-content/uploads/2008/03/vim-manpage.png' alt='Vim as a manpage viewer' /></p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2008/03/06/vim-as-a-man-page-reader/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>irssi and ZNC</title>
		<link>http://jamesoff.net/site/2008/02/21/irssi-and-znc/</link>
		<comments>http://jamesoff.net/site/2008/02/21/irssi-and-znc/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 22:38:24 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[internets]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[irssi]]></category>
		<category><![CDATA[znc]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2008/02/21/irssi-and-znc/</guid>
		<description><![CDATA[ZNC is an IRC bouncer with some pretty nice features. For a number of reasons I wanted to move my ircing from home to a shell, so I decided to give ZNC a try. ZNC isn&#8217;t in ports, but compiles fine using gmake. The only problem I encountered was getting it set up to work [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.znc.in">ZNC</a> is an IRC bouncer with some pretty nice features. For a number of reasons I wanted to move my ircing from home to a shell, so I decided to give ZNC a try. ZNC isn&#8217;t in ports, but compiles fine using <code>gmake</code>.</p>

<p>The only problem I encountered was getting it set up to work with multiple networks in irssi. Configuring ZNC itself to put me on many networks was easy enough, and when I connected irssi to it for each network using <code>/connect</code> it worked fine. Using <code>/server add</code> to set up irssi&#8217;s server list didn&#8217;t work out so well.</p>

<p>Every time I tried to add another server (for connecting to another network), irssi would remove the first one. This is because irssi only considers a server&#8217;s hostname and port when trying to work out if it&#8217;s unique. When I added another server which differed from the first only by password and associated network, irssi assumed I was updating the existing one and changed it. Putting the required entries in irssi&#8217;s config by hand also didn&#8217;t work.</p>

<p>The solution was easy enough; one ZNC instance can listen on multiple ports, so I got it to listen on a selection of ports using multiple <code>Listen</code> directives in its config file, and then added each network&#8217;s server to irssi using a different port number.</p>

<p>Now I can take advantage of cool things like buffer replay and detaching from channels. Sorry, irssi-proxy &#8211; you don&#8217;t quite cut it now :)</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2008/02/21/irssi-and-znc/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Random tip: monitoring progress in fsck</title>
		<link>http://jamesoff.net/site/2008/02/01/random-tip-monitoring-progress-in-fsck/</link>
		<comments>http://jamesoff.net/site/2008/02/01/random-tip-monitoring-progress-in-fsck/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 16:11:13 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[fsck]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2008/02/01/random-tip-monitoring-progress-in-fsck/</guid>
		<description><![CDATA[fsck in Linux has had some kind of progress bar for a while now (at least, last time I used SuSE it did). FreeBSD&#8217;s fsck is Too Advanced for such things, and if you&#8217;re checking a big disk (like /usr) you can find yourself just sitting there with no idea of what progress it&#8217;s making. [...]]]></description>
			<content:encoded><![CDATA[<p><code>fsck</code> in Linux has had some kind of progress bar for a while now (at least, last time I used SuSE it did). FreeBSD&#8217;s fsck is Too Advanced for such things, and if you&#8217;re checking a big disk (like <code>/usr</code>) you can find yourself just sitting there with no idea of what progress it&#8217;s making.</p>

<p>Sit no more! Just hit <code>Ctrl-t</code> and <code>fsck</code> will reveal its secrets. (This sends the currently running process a <code>SIGINFO</code>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2008/02/01/random-tip-monitoring-progress-in-fsck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

