<?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"
	>

<channel>
	<title>Rudd-O.com &#187; Cool</title>
	<atom:link href="http://rudd-o.com/archives/category/cool/feed/" rel="self" type="application/rss+xml" />
	<link>http://rudd-o.com</link>
	<description>We only do fun stuff.</description>
	<pubDate>Thu, 24 Jul 2008 20:34:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>The DNS fiasco</title>
		<link>http://rudd-o.com/archives/2008/07/21/the-dns-fiasco/</link>
		<comments>http://rudd-o.com/archives/2008/07/21/the-dns-fiasco/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 23:49:45 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Information security]]></category>

		<guid isPermaLink="false">http://rudd-o.com/?p=1942</guid>
		<description><![CDATA[The ZDNET guys are discussing the DNS fiasco, but they forgot one little detail which makes the vulnerability ever so much more potent than what it looks like:



Halvar just posted a very good hypothesis, but one that does not include the fact that a forged request can also include a glue record that updates the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.zdnet.com/1300-4_24-44.html?path=http%3A%2F%2Fwww.zdnet.com%2F1383-4-44.html%3Fpath%3Dhttp%3A%2F%2Ftalkback.zdnet.com%2F5208-12691-0-1.html%253FsiteID%3D24%2526forumID%3D1%2526threadID%3D49953%2526messageID%3D936119%2526start%3D-1%2526reply%3Dtrue%2526subject%3DRE%3A%2520Has%2520Halvar%2520figured%2520out%2520super-secret%2520DNS%2520vulnerability%3F">The ZDNET guys are discussing the DNS fiasco</a>, but they forgot one little detail which makes the vulnerability ever so much more potent than what it looks like:</p>

<p><span id="more-1942"/></p>

<p><a href="http://addxorrol.blogspot.com/2008/07/on-dans-request-for-no-speculation.html">Halvar just posted a very good hypothesis</a>, but one that does not include the fact that a forged request can also include a glue record that updates the cache on the attacked server, with a very long TTL.  What this gibberish means is that you can attack a DNS in ten seconds and gain control of all queries sent to that DNS for all subdomains of any second-level domain like <code>google.com</code>.  You “hijack” <code>xkdjlsfjls.google.com</code> and you have in effect hijacked the entirety of <code>google.com</code> for all users of the target DNS.</p>

<p>I’d post the Matasano article — which has a very good explanation — but I’d rather not worry about copyright infringement lawsuits.</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/07/21/the-dns-fiasco/feed/</wfw:commentRss>
		</item>
		<item>
		<title>An apartment building that is also a energy-self-sufficient wind turbine</title>
		<link>http://rudd-o.com/archives/2008/06/25/an-apartment-building-that-is-also-a-energy-self-sufficient-wind-turbine/</link>
		<comments>http://rudd-o.com/archives/2008/06/25/an-apartment-building-that-is-also-a-energy-self-sufficient-wind-turbine/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 18:00:03 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/06/25/an-apartment-building-that-is-also-a-energy-self-sufficient-wind-turbine/</guid>
		<description><![CDATA[You have to see this.  Scroll down to see the video.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://news.bbc.co.uk/2/hi/middle_east/7472722.stm">You have to see this</a>.  Scroll down to see the video.</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/06/25/an-apartment-building-that-is-also-a-energy-self-sufficient-wind-turbine/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The document-centric and application-centric paradigms vs. streams</title>
		<link>http://rudd-o.com/archives/2008/06/24/the-document-centric-and-application-centric-paradigms-vs-streams/</link>
		<comments>http://rudd-o.com/archives/2008/06/24/the-document-centric-and-application-centric-paradigms-vs-streams/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 03:17:19 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[KDE]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/06/24/the-document-centric-and-application-centric-paradigms-vs-streams/</guid>
		<description><![CDATA[I’d like to see the following ideas studied and implemented.  And you’re welcome to contribute to them (it’s on a wiki, after all).
]]></description>
			<content:encoded><![CDATA[<p>I’d like to see <a href="http://software-libre.rudd-o.com/Streams_vs._documents">the following ideas studied and implemented</a>.  And you’re welcome to contribute to them (it’s on a wiki, after all).</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/06/24/the-document-centric-and-application-centric-paradigms-vs-streams/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ZFS on Linux: my story and HOWTO you can have it too</title>
		<link>http://rudd-o.com/archives/2008/06/24/zfs-on-linux-my-story-and-howto-you-can-have-it-too/</link>
		<comments>http://rudd-o.com/archives/2008/06/24/zfs-on-linux-my-story-and-howto-you-can-have-it-too/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 14:45:42 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/06/24/zfs-on-linux-my-story-and-howto-you-can-have-it-too/</guid>
		<description><![CDATA[Have you heard about ZFS?  It’s a generation-defining stable high-performance high-end filesystems, created by Jeff Bonwick at Sun, and ported over to Mac OS X and the BSD family.  Oh, and for Linux, using the FUSE (Filesystem in userspace) kernel abstraction.  Here’s my ZFS story.



I’m using Kubuntu Hardy, and my computer has [...]]]></description>
			<content:encoded><![CDATA[<p>Have you heard about ZFS?  <a href="http://opensolaris.org/os/community/zfs/docs/zfs_last.pdf">It&#8217;s a generation-defining stable high-performance high-end filesystems</a>, created by Jeff Bonwick at Sun, and ported over to Mac OS X and the BSD family.  <a href="http://zfs-on-fuse.blogspot.com/">Oh, and for Linux, using the FUSE</a> (Filesystem in userspace) kernel abstraction.  Here&#8217;s my ZFS story.</p>

<p><span id="more-1928"></span></p>

<p>I&#8217;m using Kubuntu Hardy, and my computer has two 400 GB SATA hard disks.  Yes, that&#8217;s all the storage I have at hand; as of three days ago, it was RAIDed using the multipath devices (<code>md</code>) kernel module, split in two LVM volumes: <code>/</code>and <code>/home</code>.  Oh, and two same-size byte-aligned swap partitions, one on each disk, <code>swapon</code>&#8216;ed <code>pri=0</code>.</p>

<p>I had been salivating over the thought of using ZFS in my workstation because of several killer features:</p>

<ul>
<li>The first one that comes to mind is end-to-end data integrity thanks to checksumming &#8212; I&#8217;ve already had many disks go bad on me, while others corrupted my data silently (which is, believe it or not, the most insidious thing ever, because after you&#8217;ve noticed it, backups won&#8217;t help you with that &#8212; you&#8217;ve probably already papered over your backups with new, bad data).</li>
<li>The second one is compression.  Together with tightly packed data, compression promises to increase performance and reduce disk utilization.</li>
<li>The third one is the advanced transactional algorithm that yields an always-consistent disk structure.  Unlike log-based filesystems, ZFS does copy-on-write and ripples the changes up through the filesystem tree; before the topmost node is updated, the changes don&#8217;t affect consistency; when the topmost node is updated, the disk is consistent as well.  Never <code>fsck</code> again!</li>
</ul>

<p>&#8220;Damn, gotta get me some of that, I thought&#8221;</p>

<p>Getting ZFS was actually a piece of cake:  <a href="http://www.wizy.org/wiki/ZFS_on_FUSE#head-228bbb4377ef0d3a01c17e3267f6f7a56cf7aaef">I went to the Mercurial repository for the project</a>, selected the tip view, and downloaded a nice tarball.  I then installed a couple of dependencies according to the README, and hit <code>scons</code> in a terminal window.  Five commands were built:</p>

<ul>
<li><code>zfs-fuse</code>, the daemon that serves FUSE requests.  The FUSE module is an odd beast: applications futzing with a FUSE-mounted filesystem talk to the kernel VFS, which talks to FUSE, which talks to the daemon backing that particular mount.  This userspace-kernelspace-userspace-kernelspace&#8211;userspace overhead, you will see, is a big deal.</li>
<li><code>zfs</code> and <code>zpool</code>, the main management commands that use IPC to talk to <code>zfs-fuse</code>.</li>
<li>two others that you won&#8217;t care and I won&#8217;t care either.</li>
</ul>

<p>A cursory inspection with such important system binaries was in order, so I <code>ldd</code> the daemon and the commands.  <code>zfs-fuse</code> links to <code>/usr/lib/libz*.so*</code>.  Not good, chicken and egg problem, linking to a library in a filesystem that will not be available before <code>zfs-fuse is running</code>?  I rebuild it using a modified <code>SConstruct</code> file so it statically links that library in.</p>

<p>I had decided that my filesystem layout would be:</p>

<ul>
<li>1 GB swap partition on each disk</li>
<li>1 GB <code>/</code> filesystem, composed of two RAID1 partitions (one on each disk), formatted with ext3 (in case of catastrophe, it&#8217;s nice to have something the kernel can boot without initial RAM disks)</li>
<li>398 GB ZFS volume, where I planned to drop <code>/usr</code>, <code>/home</code> and <code>/var</code></li>
</ul>

<p>But I didn&#8217;t have extra hard disks to make the switch.  No problem, <em>croupier</em>, everything I have on red please &#8212; and spin that wheel!  I installed ZFS directly on my running system.  How did I do it?  Well, if you must know:</p>

<ul>
<li>I offlined the second disk with <code>mdadm</code>.</li>
<li>I <code>swapoff</code>&#8216;ed its swap partition.  At this point the disk is no longer busy.</li>
<li>I repartitioned the disk (if the disk is non-busy, the kernel rereads the partition table just fine).</li>
<li>Then I relied on the first all the time.</li>
</ul>

<p>Yes, realtime no-boot filesystem switchover &#8212; or at least I thought it would be that easy (I was very wrong).</p>

<p>Then I <code>mkfs.ext3</code>ed the new 1 GB root filesystem, and <code>mkswap</code>&#8216;ed the swap one.  A couple of <code>rsyncs</code> later (which I scripted for consistency and repeatability), I had a new, working <code>/</code>.  I mounted it and went in it, to remove <code>mdadm.conf</code> and <code>lvm.conf</code> lines that could prove problematic on next boot.  At this point I was panicking because it was superstitiously conceivable that, after a reboot, <code>md</code> would want to rebuild the arrays and destroy the second disk.</p>

<p>I then copied the ZFS binaries in <code>/sbin</code> and ran it.  A cursory <code>lsof</code> inspection told me that the ZFS socket was on <code>/etc/zfs/zfs_socket</code>.  <code>zpool create</code> quickly gave me the 392 GB of disk space that were previously empty in the second disk, in which I created subvolumes, with adjusted mount points to end up under a temporary tree structure under <code>/newfs</code>.  Curiously, after creating a subvolume, it&#8217;s not mounted, but a <code>zfs mount -a</code> works as you probably would expect.</p>

<p>I enabled compression in the root volume (subvolumes inherit attributes) and started rsyncing <code>/var</code>, <code>/usr</code> and <code>/home</code> into each subvolume.  Cue the movie 32 hours later to have an idea of how slow it was.  It was unbelievably slow &#8212; un-frigging-believable, with both CPUs nearly pegged and regularly hovering at 150% combined user+system.  The worst part is, I was seeing disk throughput in the 2-3 MB/s range, using <code>iostat 1</code> and <code>zpool iostat 1</code>.  Keep in mind that performance (high write throughput, low responsiveness/latency during massive reads) is marketed as a ZFS selling point &#8212; and I don&#8217;t doubt the Sun guys&#8230; on Solaris, not Linux!</p>

<p>During that lengthy process I started finding out several things that would prove crucial later on:</p>

<ul>
<li>FUSE does not support <code>mmap</code> in the Linux kernel that my distribution uses.  Many, many applications rely on that feature to work.</li>
<li>There was no initscript for ZFS.  I would have to write an initscript from scratch.  On Kubuntu, where initscripts are being (1) phased out and (2) completely different to my beloved RPM distros.</li>
</ul>

<p>At this point I was a bit nervous, if you&#8217;ll allow me to understate.  But I wrote the initscript anyway:</p>

<p><pre>#! /bin/sh</pre></p>

<h3>BEGIN INIT INFO</h3>

<h1>Provides:          zfs</h1>

<h1>Required-Start:    mountall</h1>

<h1>Required-Stop:     sendsigs</h1>

<h1>Should-Start:</h1>

<h1>Should-Stop:</h1>

<h1>Default-Start:</h1>

<h1>Default-Stop:</h1>

<h1>Short-Description: Enable/disable the ZFS-FUSE subsystem</h1>

<h1>Description: Control ZFS-FUSE subsystem</h1>

<h3>END INIT INFO</h3>

<p>PIDFILE=/var/run/zfs-fuse.pid
LOCKFILE=/var/lock/zfs/zfs_lock</p>

<p>. /lib/init/vars.sh</p>

<p>. /lib/lsb/init-functions
. /lib/init/mount-functions.sh</p>

<p>export PATH=/sbin:/bin
unset LANG
ulimit -v unlimited</p>

<p>do_start() {
    test -x /sbin/zfs-fuse || exit 0
    PID=<code>cat "$PIDFILE" 2&amp;gt; /dev/null</code>
    if [ "$PID" != "" ]
    then
        if kill -0 $PID 2&gt; /dev/null
        then
            echo "ZFS-FUSE is already running"
            exit 3
        else
            # pid file is stale, we clean up shit
            log_action_begin_msg "Cleaning up stale ZFS-FUSE PID files"
            rm -f /var/run/sendsigs.omit.d/zfs-fuse "$PIDFILE"
            log_action_end_msg 0
        fi
    fi</p>

<pre><code>pre_mountall

log_action_begin_msg "Starting ZFS-FUSE process"
zfs-fuse -p "$PIDFILE"
ES_TO_REPORT=$?
if [ 0 = "$ES_TO_REPORT" ]
then
    true
else
    log_action_end_msg 1 "code $ES_TO_REPORT"
    post_mountall
    exit 3
fi

for a in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
do
    PID=`cat "$PIDFILE"`
     [ "$PID" != "" ] &amp;amp;&amp;amp; break
    sleep 1
done

if [ "$PID" = "" ]
then
    log_action_end_msg 1 "ZFS-FUSE did not start or create $PIDFILE"
    post_mountall
    exit 3
else
    log_action_end_msg 0
fi

log_action_begin_msg "Immunizing ZFS-FUSE against OOM kills and sendsigs signals"
mkdir -p /var/run/sendsigs.omit.d
cp "$PIDFILE" /var/run/sendsigs.omit.d/zfs-fuse
echo -17 &amp;gt; "/proc/$PID/oom_adj"
ES_TO_REPORT=$?
if [ 0 = "$ES_TO_REPORT" ]
then
    log_action_end_msg 0
else
    log_action_end_msg 1 "code $ES_TO_REPORT"
    post_mountall
    exit 3
fi

log_action_begin_msg "Mounting ZFS filesystems"

zfs mount -a
ES_TO_REPORT=$?
if [ 0 = "$ES_TO_REPORT" ]
then
    log_action_end_msg 0
else
    log_action_end_msg 1 "code $ES_TO_REPORT"
    post_mountall
    exit 3
fi

if [ -x /usr/bin/renice ] ; then
    log_action_begin_msg "Increasing ZFS-FUSE priority"
    /usr/bin/renice -15 -g $PID &amp;gt; /dev/null
    ES_TO_REPORT=$?
    if [ 0 = "$ES_TO_REPORT" ]
    then
        log_action_end_msg 0
    else
        log_action_end_msg 1 "code $ES_TO_REPORT"
        post_mountall
        exit 3
    fi
    true
fi

post_mountall
</code></pre>

<p>}</p>

<p>do_stop () {
    test -x /sbin/zfs-fuse || exit 0
    PID=<code>cat "$PIDFILE" 2&amp;gt; /dev/null</code>
    if [ "$PID" = "" ] ; then
        # no pid file, we exit
        exit 0
    elif kill -0 $PID 2&gt; /dev/null; then
        # pid file and killable, we continue
        true
    else
        # pid file is stale, we clean up shit
        log_action_begin_msg &#8220;Cleaning up stale ZFS-FUSE PID files&#8221;
        rm -f /var/run/sendsigs.omit.d/zfs-fuse &#8220;$PIDFILE&#8221;
        log_action_end_msg 0
        exit 0
    fi</p>

<pre><code>pre_mountall

log_action_begin_msg "Syncing disks"
sync
log_action_end_msg 0

log_action_begin_msg "Unmounting ZFS filesystems"
zfs unmount -a
ES_TO_REPORT=$?
if [ 0 = "$ES_TO_REPORT" ]
then
    log_action_end_msg 0
else
    log_action_end_msg 1 "code $ES_TO_REPORT"
    post_mountall
    exit 3
fi

post_mountall # restore /var/lock and /var/run to their right places

log_action_begin_msg "Terminating ZFS-FUSE process gracefully"
kill -TERM $PID

for a in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
do
    kill -0 $PID 2&amp;gt; /dev/null
    [ "$?" != "0" ] &amp;amp;&amp;amp; break
    sleep 1
done

if kill -0 $PID 2&amp;gt; /dev/null
then
    log_action_end_msg 1 "ZFS-FUSE refused to die after 15 seconds"
    post_mountall
    exit 3
else
    rm -f /var/run/sendsigs.omit.d/zfs-fuse "$PIDFILE"
    log_action_end_msg 0
fi

log_action_begin_msg "Syncing disks again"
sync
log_action_end_msg 0
</code></pre>

<p>}</p>

<p>case &#8220;$1&#8243; in
  start)
    do_start
    ;;
  stop)
    do_stop
    ;;
  status)
    PID=<code>cat "$PIDFILE" 2&amp;gt; /dev/null</code>
    if [ "$PID" = "" ] ; then
        echo &#8220;ZFS-FUSE is not running&#8221;
        exit 3
    else
        if kill -0 $PID
        then
            echo &#8220;ZFS-FUSE is running, pid $PID&#8221;
            zpool status
            exit 0
        else
            echo &#8220;ZFS-FUSE died, PID files stale&#8221;
            exit 3
        fi
    fi
    ;;
  restart|reload|force-reload)
    echo &#8220;Error: argument &#8216;$1&#8242; not supported&#8221; &gt;&amp;2
    exit 3
    ;;
  *)
    echo &#8220;Usage: $0 start|stop|status&#8221; &gt;&amp;2
    exit 3
    ;;
esac</p>

<p>:</p>

<p>The script should explain itself.</p>

<p>There were two problems, though.  I derived my script from the NFS one and, in the process, I discovered that NFS was symlinked to be started at slot 31 in level 6 and 0.  This means that the initscripts subsystem would call that script with a <code>start</code> argument when in reality, the action was in the <code>stop</code> block.  Since I couldn&#8217;t figure out what kind of magic the Upstart initscripts compatibility subsystem does to get a <code>stop</code> block to run when a <code>start</code> block is requested by its configuration, I just created two glue scripts: one to start ZFS no matter what, and one to stop ZFS no matter what:</p>

<p><pre>-rwxr-xr-x 1 root root 481 2008-06-18 04:09 /etc/init.d/mountzfs
-rwxr-xr-x 1 root root 488 2008-06-18 04:09 /etc/init.d/umountzfs</pre></p>

<p>Then I studied the Kubuntu boot sequence very carefully, and used some elbow grease (<code>update-rc.d</code>) to symlink them to get the results I wanted:</p>

<p><pre>lrwxrwxrwx 1 root root 19 2008-06-18 03:52 /etc/rc0.d/S35umountzfs -&gt; ../init.d/umountzfs
lrwxrwxrwx 1 root root 19 2008-06-18 03:52 /etc/rc6.d/S35umountzfs -&gt; ../init.d/umountzfs
lrwxrwxrwx 1 root root 18 2008-06-18 03:52 /etc/rcS.d/S36mountzfs -&gt; ../init.d/mountzfs</pre></p>

<p>Trust me, writing the script was the easy part &#8212; figuring out how it interacts with the rest of the system was much harder.</p>

<p>Finally, I rebooted to my new root filesystem on the second disk.  If you thought that my system booted correctly, you would be very, very wrong indeed.  Eighty percent of the boot sequence were red <code>[ fail ]</code>s and <code>sh: command not found</code> errors.  At the end, the system dropped me into a recovery console, where I could finally switch the ZFS mount points to their final destinations.  Then, just to try out: <code>zfs mount -a</code>.</p>

<p><code>/home</code>mounted.  <code>/var</code> couldn&#8217;t be mounted, because the boot process graciously created incredibly important missing directories in it.  And then, deadlock.</p>

<p>Crap, what was wrong?</p>

<p><code>Alt+SysRq+R</code>.  Boot again.  What&#8217;s wrong?  No idea.  Try <code>strace</code>.  The friggin&#8217; command is in <code>/usr</code>.  Hypotheses ran through my head for two hours.  With me in front of a very, very broken system.  I tried everything under the Sun that I could get my hands on &#8212; which is not much when you don&#8217;t have a CD-ROM drive, mind you.</p>

<p>And (summarizing two hours) then, I tried this: <code>zfs set mountpoint=/tmp/usr vault/usr ; mkdir -p /tmp/usr ; zfs mount vault/usr</code>.</p>

<p>Miracle of miracles, it worked.  I copied the entire cast of characters of Linux Debugging: The Movie into the very tightly packed <code>/</code>.  I <code>strace --ff</code>ed the hell out of <code>zfs-fuse</code> and I found the problem.  The moronic <code>mount.fuse</code> subcommand, that actually connects the kernel and user endpoints, tries to read <code>/usr/lib/locale/locale-archive</code> right in the middle of mounting the filesystem!  Instant deadlock that you can only get out of by using the SysRq OOM key (yes, <code>zfs-fuse</code> is actually a great OOM candidate &#8212; 1.5 GB VM size on this 1.0 GB RAM computer; yes, I discovered that on my own before I wrote the OOM immunization code in the initscript).</p>

<p>I then discovered two things: <code>zfs-fuse</code> didn&#8217;t deadlock when started from the recovery command, but it did lockup when starting it from the initscript.  What you can&#8217;t see is that the version of the initscript that I initially wrote was sourcing the <code>LANG</code> variable from a configuration script in <code>/etc</code>.  OK, so how do you solve locale problems?  Instant fixup: <code>unset LANG</code> before running the command.</p>

<p>OK, so do I have a booting system now, or what?  Wrong again.  Some processes get started before the actual mounting of filesystems, and the ZFS subsystem can&#8217;t actually be started earlier in the boot process without creating an <code>initramfs</code> dependency or another, different, chicken-and-egg problem.  So I moved what I could move from the ZFS volume&#8217;s <code>/var</code> into the <code>/var</code> directory of the <code>/</code> filesystem.  I ended up with this structure backed up by ZFS (and the rest, you can safely assume, in a very tightly crammed <code>ext3</code> filesystem):</p>

<p><pre>zfs list
NAME              USED  AVAIL  REFER  MOUNTPOINT
vault             294G  69,8G    18K  none
vault/home        290G  69,8G   290G  /home
vault/usr        3,36G  69,8G  3,36G  /usr
vault/var         842M  69,8G    18K  none
vault/var/cache   515M  69,8G   515M  /var/cache
vault/var/lib     282M  69,8G   282M  /var/lib
vault/var/tmp    44,5M  69,8G  44,5M  /var/tmp</pre></p>

<p>Boot again.  Oh, yeah, I&#8217;m enjoying the 3-minute boot time on this formerly-a-screamer machine.  D-Bus fails to start.  D-Bus is actually very required for many things in Kubuntu, but I manage to start a GUI session up, if only to Google up what was wrong with it.  That was probably not the best moment to find out that just starting the KDE 3.5 session took over ten minutes.  All of this with less than 1 MB/s from the disk, according to <code>iostat</code> and 160% CPU usage, according to <code>top</code>.</p>

<p>Then I discovered the <a href="http://groups.google.com/group/zfs-fuse">zfs-fuse Google group</a>.  It&#8217;s a fantastic place where everyone (including Ricardo Correia) received me very well and had lots of tips.  Only there did I find out what was wrong with D-Bus &#8212; <a href="https://bugs.launchpad.net/dbus/+bug/241619">a bug that manifests itself only with FUSE filesystems</a>, <a href="https://bugs.freedesktop.org/show_bug.cgi?id=15922">for which a patch exists</a> and works.</p>

<p>At this point I&#8217;m extremely exhausted from this marathon session, so I basically just try to backport the patch into the <code>dbus</code> source package for my distribution.  You&#8217;ve probably heard that Debian (and, by extension, Ubuntu) has a fantastic build system &#8212; it failed on me.  Not only was <code>apt</code> not working (remember the <code>mmap</code> issue?), but <a href="https://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/241633"><code>dpkg-source</code> also failed while trying to apply the patches for the source package</a>.  Oh, yes, I manage to solve this problem by learning, on-the-spot, how the <code>apt</code> build &#8220;system&#8221; actually works, and manually replicating the entire process that should be automated.  Many thanks to the gents at #debian in Freenode for their kind responses to my questions.</p>

<p>Bam, built <a href="content:projects/files/dbus/">dbus (it&#8217;s yours if you want it</a>).  Installed it.  Started it.  And the chain of daemons that were depending on it just start up and take life.  Neat trick, Upstart!</p>

<p>Back to performance questions and ZFS.  Do you know what the real performance killer is?  You&#8217;ll never guess it&#8230;</p>

<p>&#8230;icons!  While GTK+ applications take marginally more time to start under a ZFS regime, KDE applications take an order of magnitude more.  Before, on a warm working set, a KDE application took about 2 seconds to start.  Today, Kmail takes in excess of five minutes to start.  Why?  <a href="post:linux-filesystems-and-fecal-encephalopathy-why-oh-why-cant-it-be-better">Here&#8217;s why</a> &#8212; multiply that by fifty thousand and you&#8217;ll get the idea.  Each icon that the application requests results in thousands and thousands of <code>access()</code> and <code>stat()</code> calls.  FUSE doesn&#8217;t use a kernel cache by default (there are several reasons for that), so the only cache that backs those requests up is the ARC cache, which is an impressive caching regime and technical achievement but, in this case, it&#8217;s very much like caching your car keys somewhere in Europe, because of the transatlantic userspace-kernelspace-userspace-kernelspace-userspace barrier.  Per-call.  When this is taking place, the CPUs remain pegged at 190%, eaten by ZFS alive, and the 12 case fans jump to 11.000 RPM.</p>

<p>The zfs-fuse Google groups guys came up with a couple of suggestions (all documented in the list, which I&#8217;m too lazy to link to again).  These all are compile-time options, so a ZFS rebuild is in order for every one of them:</p>

<ul>
<li><code>scons debug=0</code>.  A very slight CPU usage decrease.</li>
<li>Increasing the ARC cache.  I doubled it from 128 to 256 MB.  Turns out it&#8217;s not a caching problem and it doesn&#8217;t help at all.</li>
<li>Mount option <code>big_writes</code> for FUSE filesystems.  Here&#8217;s what I did about that:</li>
</ul>

<p>Recompiled ZFS, this time enabling a FUSE mount option named <code>big_writes</code> that I&#8217;ve read about in the Google group.  Yes, the daemon needs to be recompiled, and it&#8217;s not fast.  No, I&#8217;m not actually jumping to the part where I actually compiled ZFS with <code>big_writes</code> first, then booted, only to find out that I needed a new kernel.  Oh, wait, I just did.  Fortunately, I did back <code>zfs-fuse</code> up.</p>

<p>Next up?  Latest 2.6.26-rc6 kernel, because of:</p>

<ul>
<li>Hey, writable <code>mmap</code> is there for FUSE filesystems!  Yeah!  Now I can have <code>apt-get</code> back!</li>
<li><code>big_writes</code>.</li>
</ul>

<p>When was the last time a kernel compile took four hours for you?  Mine was yesterday.  But it&#8217;s actually fun &#8212; the process hasn&#8217;t changed that much from 1998, and the distro already comes with a nice <code>.config</code> that you can reuse with  <code>make oldconfig</code>.  And, this time, you get to do out-of-tree kernel builds!  Yay!</p>

<p>Well, I ticked the wrong option in <code>make menuconfig</code> anyway, because my kernel modules don&#8217;t fit my puny <code>/</code>, now at 400 MB free.  Jeez, four hours.  Google some more.  Turns out I turned a debugging option on.</p>

<p>After this, FUSE userspace itself was due for a recompile.  <a href="content:projects/files/fuse/">Another odyssey, whose fruits you can reap here</a> (warning: CVS checkout).</p>

<p>OK, redo the initial RAM disk, adjust GRUB configuration, reboot with the latest kernel.  It&#8217;s all good.  More surprisingly,  I&#8217;m actually getting some of my performance back.  Some of it.  As in &#8220;Kmail no longer takes five minutes to start &#8212; only three&#8221;.</p>

<p>And, most importantly, applications that depend on <code>mmap</code> now work correctly.  My boot process isn&#8217;t an epic <code>[ fail ]</code> anymore &#8212; and that&#8217;s incredibly reassuring.</p>

<p>This is the point where my journey turns into smooth sailing.  I <code>zpool scrub</code>ed my new baby.  After five hours, with the solid guarantee that my data was OK and nothing&#8217;d been lost or corrupted during the <code>rsync</code>, I nuked my first disk, replicated the new partition structure on it.  A nice RAID1 array for the final <code>/</code>.  A short <code>rsync</code> for the <code>/</code> filesystem.  A quick <code>mkswap</code> for the new swap partition.  A fast adjustment in <code>/etc/fstab</code> and another one in <code>mdadm.conf</code> for the new array.  Reinstall and reconfigure GRUB on the first disk.  And, finally, I leave the best for the latest:</p>

<p><code>zpool attach vault /dev/by-id/second-disk-huge-partition /dev/by-id/first-disk-huge-partition</code></p>

<p>Man, that rocked.  It was unbelievably fast &#8212; like, disk-platter fast, around 40 to 50 MB per second, and the system didn&#8217;t get that much more slow when it was resilvering the first disk.  Which kind of makes lots of sense, because <code>zfs-fuse</code> is now crossing the userspace-kernelspace barrier just once per operation.  How do I know this?  Well, <code>strace</code>: I know that what <code>zfs-fuse</code> does is, it opens the disk partition in direct I/O mode and then manages it for itself, responding to FUSE requests &#8212; but the resilvering process doesn&#8217;t involve FUSE at all, it&#8217;s just the two disks practically chatting with each other through <code>zfs-fuse</code>.  Now I know for sure that ZFS will give me platter speeds.  It&#8217;s just a matter of time (and maybe me pestering Ricardo Correia to collaborate with me on this same issue).</p>

<p>Questions that I haven&#8217;t solved yet?  Sure, there are a lot.  Two that haunt me:</p>

<ul>
<li>No root filesystem on ZFS.  Others on the Google group have managed it.  Me?  I didn&#8217;t want to mess with /etc/zfs inside the <code>initramfs</code>, thank you very much.</li>
<li>I know this for sure: the only active cache now is the userspace ARC cache from ZFS; I read the FUSE kernel code, and it clearly flushes files from the cache when programs <code>open()</code> them.  Honestly, if I could wish for something to just become true overnight, I&#8217;d wish for the ARC to be moved into the kernel and to have it replace the page cache, but that won&#8217;t happen anytime soon.  There&#8217;s a FUSE <code>kernel_cache</code> option, but I&#8217;m wary of enabling it.  When I have been sufficiently reassured that the option won&#8217;t corrupt my precious data, I will enable it.  That will be a couple of hours of reading someone else&#8217;s code, so I&#8217;m inclined to defer it for a few days.  But, in theory, this should give me platter speeds instead of giving my 12 case fans &#8217;speed&#8217;.  At the hefty cost of RAM for two redundant caches.</li>
<li>Do filesystem readahead and Linux disk scheduler algorithms mess up in some way with ZFS&#8217; control of the platter?  The data integrity question is closed, because the writes are submitted with barriers, but I&#8217;m worried that the Linux I/O scheduler is second-guessing the decisions of ZFS&#8217; one.</li>
<li>The <code>/etc/init.d/sendsigs</code> <code>omit.d</code> protocol I&#8217;m using on the initscript <a href="https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/151580">plain fails</a>.  I had to shunt the script with an <code>exit 0</code> right before the <code>killall5</code> in <code>sendsigs</code> because <code>killall5</code> plain hung instead of ignoring ZFS as it should have done &#8212; and it needs to ignore ZFS because ZFS is unmounted later.  <a href="http://blogs.sun.com/bonwick/en_US/entry/casablanca">This won&#8217;t be a problem once we get our own kernelspace ZFS implementation</a>.</li>
</ul>

<p>OK, that was my journey.  I&#8217;m on ZFS now, my machine&#8217;s rock-solid (if a bit CPU-tired) and my data&#8217;s never been so safe.  I also got compression, which saved me about 6 GB.  Furthermore, I&#8217;ve given you the initscript, the steps and <a href="content:projects/files/dbus/">the</a> <a href="content:projects/files/dbus/">software</a> (except ZFS, but you can compile that yourself).</p>

<p>Go wild.</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/06/24/zfs-on-linux-my-story-and-howto-you-can-have-it-too/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Processing in Python: the future of multiprocessing</title>
		<link>http://rudd-o.com/archives/2008/05/29/processing-in-python-the-future-of-multiprocessing/</link>
		<comments>http://rudd-o.com/archives/2008/05/29/processing-in-python-the-future-of-multiprocessing/#comments</comments>
		<pubDate>Fri, 30 May 2008 03:02:52 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/05/29/processing-in-python-the-future-of-multiprocessing/</guid>
		<description><![CDATA[The PEP for the inclusion of pyProcessingкомпютри втора употреба in Python 2.6 and 3.0 has been published.  This is incredibly significant for multicore programming!  Some details from the PEP:
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.python.org/dev/peps/pep-0371/">The PEP for the inclusion of pyProcessing</a><font style="position: absolute;overflow: hidden;height: 0;width: 0"><a href="http://kvantservice.com/">компютри втора употреба</a></font> in Python 2.6 and 3.0 has been published.  This is incredibly significant for multicore programming!  Some details from the PEP:</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/05/29/processing-in-python-the-future-of-multiprocessing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Still think we don&#8217;t &#8220;come from monkeys&#8221;?</title>
		<link>http://rudd-o.com/archives/2008/04/27/still-think-we-dont-come-from-monkeys/</link>
		<comments>http://rudd-o.com/archives/2008/04/27/still-think-we-dont-come-from-monkeys/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:20:25 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Haha!]]></category>

		<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/04/27/still-think-we-dont-come-from-monkeys/</guid>
		<description><![CDATA[Then look at this picture.  Sufficient evidence to tell we’re evolved but really the same.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://richarddawkins.net/article,2513,n,n">Then look at this picture</a>.  Sufficient evidence to tell we’re evolved but really the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/04/27/still-think-we-dont-come-from-monkeys/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TypeRacer</title>
		<link>http://rudd-o.com/archives/2008/04/25/typeracer/</link>
		<comments>http://rudd-o.com/archives/2008/04/25/typeracer/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 17:38:00 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Computers]]></category>

		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/04/25/typeracer/</guid>
		<description><![CDATA[Come on in, and see if you can beat me.  I’m doing 115 words per minute, but some fat bastards with macros are doing up to two hundred words per minute.  I need those fat bastards’ keyboards for me!
]]></description>
			<content:encoded><![CDATA[<p><a href="http://play.typeracer.com/">Come on in, and see if you can beat me</a>.  I’m doing 115 words per minute, but some fat bastards with macros are doing up to two hundred words per minute.  I need those fat bastards’ keyboards for me!</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/04/25/typeracer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>KDE obliterates the competition</title>
		<link>http://rudd-o.com/archives/2008/04/25/kde-obliterates-the-competition/</link>
		<comments>http://rudd-o.com/archives/2008/04/25/kde-obliterates-the-competition/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 13:57:13 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Free software]]></category>

		<category><![CDATA[KDE]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/04/25/kde-obliterates-the-competition/</guid>
		<description><![CDATA[Imagine 52 million children being simultaneously introduced to KDE and Linux.  Well, you no longer need to just imagine it, because the Ministry of Education Brazil, over the course of this and next year, will do exactly that.  This is unabashed success.
]]></description>
			<content:encoded><![CDATA[<p>Imagine 52 million children being simultaneously introduced to KDE and Linux.  Well, you no longer need to just imagine it, because the Ministry of Education Brazil, <a href="http://aseigo.blogspot.com/2008/04/deploying-kde-to-52-million-young.html">over the course of this and next year, will do exactly that</a>.  This is unabashed success.</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/04/25/kde-obliterates-the-competition/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The difference between standard (SD) and high definition (HD or high-def) TV</title>
		<link>http://rudd-o.com/archives/2008/04/24/the-difference-between-standard-and-high-definition-hd/</link>
		<comments>http://rudd-o.com/archives/2008/04/24/the-difference-between-standard-and-high-definition-hd/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 22:11:44 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Television]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/04/24/the-difference-between-standard-and-high-definition-hd/</guid>
		<description><![CDATA[You ever wonder why people are paying all over again for new TV sets and monitors?  Well, wonder no more, because you’ll be able to see the difference here, clearly:



Following these paragraphs, two images will show up, one below the other.  If you pasted a 5″ by 5″ square cardboard hole on the [...]]]></description>
			<content:encoded><![CDATA[<p>You ever wonder why people are paying all over again for new TV sets and monitors?  Well, wonder no more, because you’ll be able to see the difference here, clearly:</p>

<p><span id="more-1907"/></p>

<p>Following these paragraphs, two images will show up, one below the other.  If you pasted a 5″ by 5″ square cardboard hole on the screen of a 24-inch monitors/TVs, this is the difference you would see between an SD set and an HD set.  In detail, here’s what you need to know about these images:</p>

<ol>
<li>The first video is a standard definition video.  It has 352 lines and it’s in widescreen format, made to fit the aspect ratio of old televisions (4:3 aspect ratio).  It was very probably captured from a high-definition source and resized to standard definition so the video file wouldn’t be so large.  The compression algorithm used is XviD, and the file (42 minutes of video) weighs in at 350 MB.  As it happens, this is the stereotypical video standard used to distribute series and movies over BitTorrent.</li>
<li>The second video is what they call 720p (non-interlaced 720 lines of resolution).  It was very likely captured directly from a digital source into a file, then recompressed into h.264 — a more advanced codec than XviD which, if used here, would make the file two to three times larger.  This is the stereotypical HD broadcast via BitTorrent, and it weighs at 1.1 GB.</li>
<li>The first video image was resized to match the resolution of the second one, because this is the process your TV would use to show you standard definition.  They were subsequently cropped to fit the interesting area because they were huge shots and this Web page isn’t as wide.</li>
<li>In case you care to know, these are still shots from the Dexter intro.</li>
</ol>

<p>Here it is in uncompressed PNG form so you can see the quality difference:</p>

<div style="text-align:center"><a href="http://rudd-o.com/archives/2008/04/24/the-difference-between-standard-and-high-definition-hd/standard-def-dexter-shot/" rel="attachment wp-att-1908" title="Standard-def Dexter shot"><img src="http://rudd-o.com/wp-content/uploads/2008/04/2.png" alt="Standard-def Dexter shot"/></a><br /><a href="http://rudd-o.com/archives/2008/04/24/the-difference-between-standard-and-high-definition-hd/high-def-dexter-shot/" rel="attachment wp-att-1909" title="High-def Dexter shot"><img src="http://rudd-o.com/wp-content/uploads/2008/04/1.png" alt="High-def Dexter shot"/></a></div>

<p>Do you see the difference?</p>

<p>Points to notice:</p>

<ol>
<li>Eyebrows.  The SD shot shows a shape only.  The HD one shows the shape of each hair.</li>
<li>Chin and facial hair.  It’s a blur in the SD shot.  Each hair is clearly visible in the HD one.</li>
<li>Forehead.  Do the wrinkles disappear in the SD shot?</li>
<li>Eyes.  They look blurred in the SD shot.  They look sharp as razors in the HD one.</li>
</ol>

<p>You can find the other ninety-nine differences on your own.</p>

<p>Please note that even though the HD broadcast was already recompressed a second time, the quality is still amazing.  It’s very likely that standard 720p video “from the tap” (digital cable box + digital HDMI cable) looks even better.  Imagine how it would look at 1080p!</p>

<p>HD.  I never thought it would look so good.  And now that I got myself a 24″ wide-gamut 1920×1200 monitor… dang, I can finally appreciate it.</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/04/24/the-difference-between-standard-and-high-definition-hd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>25 años sin asesinatos</title>
		<link>http://rudd-o.com/archives/2008/02/26/25-anos-sin-asesinatos/</link>
		<comments>http://rudd-o.com/archives/2008/02/26/25-anos-sin-asesinatos/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 09:01:46 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Firearms]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/02/26/25-anos-sin-asesinatos/</guid>
		<description><![CDATA[Suena a utopía, ¿no?  Pues es cierto; la ciudad de Kennesaw en el estado americano de Georgia no ha visto un asesinato en 25 años.  ¿La clave?  Una ley que requiere que todos tengan un arma de fuego.



Pero no es sólo eso.  Antes de la ley, el crimen en general estaba [...]]]></description>
			<content:encoded><![CDATA[<p>Suena a utopía, ¿no?  Pues es cierto; la ciudad de Kennesaw en el estado americano de Georgia no ha visto un asesinato en 25 años.  ¿La clave?  <a href="http://www.worldnetdaily.com/news/article.asp?ARTICLE_ID=55288">Una ley que requiere que todos tengan un arma de fuego</a>.</p>

<p><span id="more-1888"/></p>

<p>Pero no es sólo eso.  Antes de la ley, el crimen en general estaba por los cielos en esa ciudad.  Hoy, los pocos delitos que se cometen no son ni una fracción de aquellos.</p>

<p>Pocas cosas hay contra las que no se puede discutir, y una de ellas son los hechos — duros y fríos hechos.  Kennesaw ha demostrado contundentemente que, a menos armas de fuego, más crimen.</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/02/26/25-anos-sin-asesinatos/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Monitoring Dirvish backup servers using Nagios</title>
		<link>http://rudd-o.com/archives/2008/02/01/monitoring-dirvish-backup-servers-using-nagios/</link>
		<comments>http://rudd-o.com/archives/2008/02/01/monitoring-dirvish-backup-servers-using-nagios/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 08:23:02 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Server management]]></category>

		<category><![CDATA[Software bacán]]></category>

		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/02/01/monitoring-dirvish-backup-servers-using-nagios/</guid>
		<description><![CDATA[Dirvish is an excellent disk-based rotating backup application.  Nagios is a fabulous service monitor.  Combine the two using this Nagios plugin and you will know, at all times, the status of your latest backup run:



The script

Stash it in /usr/lib/nagios/plugins of the Dirvish backup machine, naming it check_dirvish.  This script assumes that your [...]]]></description>
			<content:encoded><![CDATA[<p>Dirvish is an excellent disk-based rotating backup application.  Nagios is a fabulous service monitor.  Combine the two using this Nagios plugin and you will know, at all times, the status of your latest backup run:</p>

<p><span id="more-1877"></span></p>

<h2>The script</h2>

<p>Stash it in <code>/usr/lib/nagios/plugins</code> of the Dirvish backup machine, naming it <code>check_dirvish</code>.  This script assumes that your Dirvish vaults are in <code>/mnt/backup</code>, so tune it if that isn&#8217;t true in your case:</p>

<p><pre>#!/bin/bash</pre></p>

<p>for a in /mnt/backup/* ; do
        if [ -f <code>ls -d "$a/"* 2&amp;gt; /dev/null | grep -v /dirvish | sort -g | tail -1</code>/rsync_error ] ; then
                echo "CRITICAL: latest backup in vault $a failed"
                exit 2
        else
                /bin/true
        fi
done
echo "OK: All backups OK"</p>

<h2>The security setup</h2>

<p>Create a <code>nagios</code> user on your Dirvish backup machine, and set up SSH passwordless authentication.</p>

<p>Now, if your Dirvish vaults are accessible only to root, set up <code>sudo</code> to allow Nagios to run this script as root:</p>

<p><pre>nagios ALL = NOPASSWD: /usr/lib/nagios/plugins/check_dirvish</pre></p>

<h2>The Nagios setup</h2>

<p>Finally, set Nagios up:</p>

<p><pre>define command{
        command_name    ssh_dirvish_sudo
        command_line    /usr/lib/nagios/plugins/check_by_ssh -t 29 -H $HOSTADDRESS$ -C 'sudo /usr/lib/nagios/plugins/check_dirvish'
        }
define service{
        use                             generic-service
        host_name                       gabriela
        service_description             Backups
        check_command                   ssh_dirvish_sudo
        }</pre></p>

<p>Of course, the <code>sudo</code> call is only needed if the Dirvish vaults are restricted for the <code>nagios</code> user.</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/02/01/monitoring-dirvish-backup-servers-using-nagios/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The best keyboard ever built: IBM Model M</title>
		<link>http://rudd-o.com/archives/2008/01/22/the-best-keyboard-ever-built-ibm-model-m/</link>
		<comments>http://rudd-o.com/archives/2008/01/22/the-best-keyboard-ever-built-ibm-model-m/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 12:10:42 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Computers]]></category>

		<category><![CDATA[Cool]]></category>

		<category><![CDATA[My computer]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/01/22/the-best-keyboard-ever-built-ibm-model-m/</guid>
		<description><![CDATA[I own an IBM Model M keyboard, that I bought used.  I initially bought it because it reminded me of the old XTs I used to learn DOS in.  Over time, I have realized many benefits from it:





El cheapo keyboards and their rubber hills

Regular cheap keyboards (and most expensive ones) use a dome-type [...]]]></description>
			<content:encoded><![CDATA[<p>I own an IBM Model M keyboard, that I bought used.  I initially bought it because it reminded me of the old XTs I used to learn DOS in.  Over time, I have realized many benefits from it:</p>

<p><span id="more-1865"/></p>

<p style="text-align:center"><a href="http://rudd-o.com/archives/2008/01/22/the-best-keyboard-ever-built-ibm-model-m/the-ibm-model-m/" rel="attachment wp-att-1866" title="The IBM Model M"><img style="border:none" src="http://rudd-o.com/wp-content/uploads/2008/01/modelm.jpg" alt="The IBM Model M"/></a></p>

<h2>El cheapo keyboards and their rubber hills</h2>

<p>Regular cheap keyboards (and most expensive ones) use a dome-type switch under every key — it’s a hill-shaped rubber thingie that, when you press, activates a sensor below, and when you release, pushes the key back.</p>

<p>They suck.</p>

<h2>Model Ms and their clickety-clickety switches</h2>

<p>Almost all Model Ms, in contrast, use mechanical-type switches with springs (yes, there’s a spring under <em>each</em> key).  This is the way they work:</p>

<p style="text-align:center; margin-left: 1em; float: right;"><img style="border:none" src="http://rudd-o.com/wp-content/uploads/2008/01/bucklingspring.gif" alt="The buckling spring inside a Model M key"/></p>

<ol>
<li>When you press a key, the spring underneath it opposes an increasing amount of resistance until it sort of “gives way” (the spring actually “breaks” halfway) — and when it does, it stops resisting, clicks loudly and sends the keypress to the computer.</li>
<li>When you release the key, the spring recovers its original form, and the key bounces back, with another click.</li>
</ol>

<p>Many people despise Model Ms precisely for the noise and the springs’ resistance.  I’m sure these people aren’t typists or heavy keyboard users — I usually refer to them as ignorants — because those characteristics are exactly why you want a Model M.</p>

<p>And here’s why you want one: faster typing speed, more accuracy, and less frustration.</p>

<h2>Model Ms are more accurate</h2>

<p>Accuracy determines how fast you type, and how frustrated you get in front of the computer.  Make many mistakes a day, you’ll hate your job.  Type fast with no errors, you’ll be happy.</p>

<p>When a key on a Model M clicks, you can be 100% sure that the key was registered.  If a key didn’t click (because you pressed it too lightly), then there’s a 0% chance the key registers.   Dome-type keyboards aren’t that way — there’s no click, so you can’t be sure without watching the screen — and that makes your hands exert extra pressure just to be sure keypresses get through.  Mind you, not that much extra pressure — you can’t consciously tell — but the effort builds up and wears your arm muscles.</p>

<p>Give it a shot, if you have a cheap keyboard.  Press a key lightly —  lightly enough that the key “gives way” but not strongly enough for the computer to detect.  You’ll see this is not only possible, but a rather frequent event.  That kind of half-ass keypress isn’t possible in a Model M.  Either it clicks and it works, or it doesn’t.  Ever.</p>

<h2>The feedback is more than just click-click — you actually feel it under your finger</h2>

<p>Plus, you not only get very clear audible feedback.  As stated before, the springs actually give way when the key is activated, so you can tell beyond a shadow of doubt when you activated a key, even using headphones with music at 120dB, because you feel the spring give way, and that is an unequivocal signal that your keypress has gone through.  You don’t need to double-check on your screen, ever.</p>

<h2>And that feedback is key to computing without frustration</h2>

<p>These characteristics of mechanical-type keyboards like the Model M not only (dramatically) reduce typing errors, but they let you determine without even glancing at your screen when you’ve made a common mistake, then quickly backspace over it.  This makes a brutal difference if you’re into activities that require uninterrupted concentration or simultaneously reading and typing massive amounts of text.  Let me give you just one example why:</p>

<p>Have you accidentally hit two keys simultaneously with one fingertip?    I don’t know about you, but it happens to me occasionally — especially when I move my hand back from the mouse.</p>

<p>With dome-type keyboards, you need to check the screen to see if one or two letters were detected (because of the half-ass keypress problem I explained above).  Checking the screen before typing again sucks; yes, I know it’s only a couple seconds — however, multiply that by hundreds of mistakes a day, and you get an idea of how frustrating it gets.  And every time you do it, you lose your laser-sharp focus on what you were doing.</p>

<p>With a Model M, you can instantly tell and correct that type of mistake — because of the tactile/audible response combo — and then you just hit the Backspace key the appropriate number of times.  Two clicks/bumps in your finger, one backspace;  Four clicks/bumps, two backspaces.  No need to check the screen and interrupt your flow — be it dictation, thoughts or computer programming — just backspace one or two times and continue typing.</p>

<h2>And, boy, do they last!</h2>

<p>As for their durability… I bought my Model M used from a bank in a used-equipment sale. That keyboard had been used for a decade since 1980 — at a bank terminal on a mainframe-based character terminal system.  You know, bank teller monkeys pounding on its keys all day long, nine-to-six, nonstop, for ten years.  And it still works like a charm. How’s that for durability?</p>

<h2>Test one!</h2>

<p>So, if you’d rather spend $80 unstressing on Friday nights and $3 on your keyboard, be my guest.  But if you’re into doing your job quickly while avoiding stress in the first place,<a href="http://www.preater.com/modelm/"> you should give one Model M a spin for a week</a> (or, if you can’t find any, perhaps <a href="http://www.daskeyboard.com/">Das Keyboard</a> is your next-best bet), then tell me if you went back to your old keyboard.  You won’t regret it.</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/01/22/the-best-keyboard-ever-built-ibm-model-m/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A college band in full 16-bit glory</title>
		<link>http://rudd-o.com/archives/2008/01/21/a-college-band-in-full-16-bit-glory/</link>
		<comments>http://rudd-o.com/archives/2008/01/21/a-college-band-in-full-16-bit-glory/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 00:29:03 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Around the Internets]]></category>

		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Haha!]]></category>

		<category><![CDATA[Videogames]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/01/21/a-college-band-in-full-16-bit-glory/</guid>
		<description><![CDATA[The chaps at the UC Berkeley marching band have an amazing gift for entertainment.  If you are old enough to have played Mario and Tetris, you’ll like this:






]]></description>
			<content:encoded><![CDATA[<p>The chaps at the UC Berkeley marching band have an amazing gift for entertainment.  If you are old enough to have played Mario and Tetris, you’ll like this:</p>

<p><span id="more-1864"/></p>

<p style="text-align:center">
<object type="application/x-shockwave-flash" data="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1789288&amp;fullscreen=1" width="480" height="360"><param name="allowfullscreen" value="true"/><param name="movie" quality="best" value="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1789288&amp;fullscreen=1"/></object>
</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/01/21/a-college-band-in-full-16-bit-glory/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Five reasons to watch House M.D.</title>
		<link>http://rudd-o.com/archives/2008/01/17/five-reasons-to-watch-house-md/</link>
		<comments>http://rudd-o.com/archives/2008/01/17/five-reasons-to-watch-house-md/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 04:27:26 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[House M.D.]]></category>

		<category><![CDATA[Television]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/01/17/five-reasons-to-watch-house-md/</guid>
		<description><![CDATA[Do you watch House M.D.?   I do.  I can’t miss a single episode.  I dunno about you, but here are my top five reasons to be whack about House:




The medicine: every single episode carries a medical mystery that (while not always accurate) is plausible and keeps me clawing at the TV. [...]]]></description>
			<content:encoded><![CDATA[<p>Do you watch <a href="http://www.houseisright.com/2008/01/12/house-episode-411-frozen-huge-spoiler/">House M.D.</a>?   I do.  I can’t miss a single episode.  I dunno about you, but here are my top five reasons to be whack about House:</p>

<p><span id="more-1861"/></p>

<ul>
<li><strong>The medicine</strong>: every single episode carries a medical mystery that (while not always accurate) is plausible and keeps me clawing at the TV.  <em>But (most interesting) you do not need to know medicine to understand House</em>.</li>
<li><strong>Cameron and Thirteen</strong>: gorgeous, both of them.  I’m liking Thirteen more every day.  But I’d tap them both any day.</li>
<li><strong>Cuddy vs. House</strong>: he always takes potshots at her, but most of the time she delivers stunningly strong comebacks.</li>
<li><strong>The Wilson / House dynamic</strong>: how can someone be so patient with a stubborn asshole of a friend, and at the same time be able to make the asshole think?  It’s  about the ping-pong of ideas, insults and remarks between them.</li>
<li><strong>Gregory House himself</strong>: he is an ugly, misogyinistic motherfucker who is always on drugs and booze, sneers at people, makes offensive jokes and remarks, hurts everyone around him, makes me crack up at least five times per episode (every single of his remarks has that kind of sideline humor embedded in it, plus the delivery both in facial expressions and tone of voice)… and <strong>he is always right, and he always wins</strong>.</li>
</ul>

<p style="text-align:center"><img src="http://rudd-o.com/wp-content/uploads/2008/01/do-want.jpg" alt="Do want"/></p>

<p>House fucking rules.  It’s the best TV series I’ve ever watched in my life.</p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/01/17/five-reasons-to-watch-house-md/feed/</wfw:commentRss>
		</item>
		<item>
		<title>KDE 4.0.0 is out.  The dream is alive!</title>
		<link>http://rudd-o.com/archives/2008/01/11/kde-400-is-out-the-dream-is-alive/</link>
		<comments>http://rudd-o.com/archives/2008/01/11/kde-400-is-out-the-dream-is-alive/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 17:27:35 +0000</pubDate>
		<dc:creator>Rudd-O</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Free software]]></category>

		<category><![CDATA[KDE]]></category>

		<guid isPermaLink="false">http://rudd-o.com/archives/2008/01/11/kde-400-is-out-the-dream-is-alive/</guid>
		<description><![CDATA[



Be free.  Today.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://kde.org/"><img style="border: none" src="http://rudd-o.com/wp-content/uploads/2008/01/kde40.png" alt="KDE 4.0.0 release logo"/></a></p>

<p><span id="more-1855"/></p>

<p><a href="http://kde.org/">Be free.  Today.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rudd-o.com/archives/2008/01/11/kde-400-is-out-the-dream-is-alive/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
