<?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>Pillage and Plunder &#187; viking</title>
	<atom:link href="http://pillageandplunder.net/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://pillageandplunder.net</link>
	<description>Viking's programming blog</description>
	<lastBuildDate>Tue, 25 Aug 2009 00:21:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rails Rumble 2009 &#8211; lend.to</title>
		<link>http://pillageandplunder.net/2009/08/rails-rumble-2009-lend-to/</link>
		<comments>http://pillageandplunder.net/2009/08/rails-rumble-2009-lend-to/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 20:44:44 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[rumble]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=95</guid>
		<description><![CDATA[This year for Rails Rumble, our team decided to write an app for tracking whom you&#8217;ve loaned your items to:

It was a blast, just like last year.  Having James Pierce as our designer made a huge difference in the quality of our app.
Using Gawker, we recorded time lapse videos of our three sessions.
Session 1:

The [...]]]></description>
			<content:encoded><![CDATA[<p>This year for <a href="http://railsrumble.com">Rails Rumble</a>, our team decided to write an app for tracking whom you&#8217;ve loaned your items to:</p>
<p><a href="http://pillageandplunder.net/wp-content/uploads/2009/08/link-to.png"><img src="http://pillageandplunder.net/wp-content/uploads/2009/08/link-to-300x208.png" alt="link.to" title="link.to" width="300" height="208" class="alignnone size-medium wp-image-96" /></a></p>
<p>It was a blast, just like last year.  Having <a href="http://jpegjames.com">James Pierce</a> as our designer made a huge difference in the quality of our app.</p>
<p>Using <a href="http://gawker.sourceforge.net/Information.html">Gawker</a>, we recorded time lapse videos of our three sessions.</p>
<p><b>Session 1</b>:</p>
<p><object width="400" height="300" ><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.facebook.com/v/554057257992" /><embed src="http://www.facebook.com/v/554057257992" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="300"></embed></object></p>
<p>The fifth person in the video is our co-worker Will, who didn&#8217;t actually code anything for our Rumble app.  He was there to provide some <a href="http://git-scm.org">Git</a> (and morale) support and keep Rumble Helper updated.  So we didn&#8217;t cheat! <img src='http://pillageandplunder.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><b>Session 2</b>:</p>
<p><object width="400" height="300" ><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.facebook.com/v/554151104922" /><embed src="http://www.facebook.com/v/554151104922" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="300"></embed></object></p>
<p>I forgot the timestamps on this one, but it lasted from about 9:30am on Saturday to 5am on Sunday (the last 15 seconds [3 hours or so real time] is dark&#8230; we forgot to turn the camera off).  Ten points if you can spot our friends Ryan and Leah Stufflebam, who dropped off some homemade chili for us.  It was delicious.</p>
<p><b>Session 3:</b></p>
<p><object width="400" height="300" ><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.facebook.com/v/554151309512" /><embed src="http://www.facebook.com/v/554151309512" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="300"></embed></object></p>
<p>The last session!  In total, we got about 8 hours of sleep each, drank like I don&#8217;t know how many cans of soda, ate a buttload of chips and pizza (and chili).  It was a blast.</p>
<p>Go see our app: <b><a href="http://lend.to">lend.to</a></b>, and all the <a href="http://r09.railsrumble.com/snapshots/all.html">other Rumble apps</a> when you get a chance!</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2009/08/rails-rumble-2009-lend-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rumble Helper</title>
		<link>http://pillageandplunder.net/2009/08/rumble-helper/</link>
		<comments>http://pillageandplunder.net/2009/08/rumble-helper/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 20:08:34 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[rumble]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=83</guid>
		<description><![CDATA[After a meeting of our Rails Rumble team the week before the competition, I decided to undertake a little project to keep track of stuff we wanted to get done during the Rumble.  I came up with Rumble Helper:

You can drag and drop items from one bubble to another so you can easily track [...]]]></description>
			<content:encoded><![CDATA[<p>After a meeting of our <a href="http://r09.railsrumble.com/teams/team-shazbot">Rails Rumble team</a> the week before the competition, I decided to undertake a little project to keep track of stuff we wanted to get done during the Rumble.  I came up with <a href="http://rumble-helper.heroku.com">Rumble Helper</a>:</p>
<p><a href="http://pillageandplunder.net/wp-content/uploads/2009/08/screeny.jpg"><img src="http://pillageandplunder.net/wp-content/uploads/2009/08/screeny-thumb.jpg" alt="screeny-thumb" title="screeny-thumb" width="270" height="215" class="alignnone size-full wp-image-86" /></a></p>
<p>You can drag and drop items from one bubble to another so you can easily track what needs to be done.</p>
<p>We used it during the Rumble in combination with SmartBoard:</p>
<p><a href="http://pillageandplunder.net/wp-content/uploads/2009/08/smartboard.jpg"><img src="http://pillageandplunder.net/wp-content/uploads/2009/08/smartboard-300x200.jpg" alt="Rumble Helper on SmartBoard" title="Rumble Helper on SmartBoard" width="300" height="200" class="alignnone size-medium wp-image-88" /></a></p>
<p>It turned out pretty well!  <a href="http://twitter.com/Sutto">Darcy</a> was nice enough to put it up on the Rails Rumble blog before the competition.  At the end, 45 users had signed up (representing 20 different teams) and 327 tasks had been created.  I was happy it got some use. <img src='http://pillageandplunder.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It was a really good warmup for the Rumble.  I worked on it solid from Friday (August 14) to about Thursday (August 20).  There were several things about it that helped having experience with during Rails Rumble itself.</p>
<p>For next year I plan to add more features to it, like the ability to see what other teams are doing (if they made their team public, that is).  There are also some Javascript issues that I need to see if I can take care of.  If you leave the app open for too long, eventually the AJAX calls bloat up Firefox pretty badly.</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2009/08/rumble-helper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Init.d script for mounting a KVM/QEmu image in Linux</title>
		<link>http://pillageandplunder.net/2009/04/initd-script-for-mounting-a-kvmqemu-image-in-linux/</link>
		<comments>http://pillageandplunder.net/2009/04/initd-script-for-mounting-a-kvmqemu-image-in-linux/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 18:36:47 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=63</guid>
		<description><![CDATA[I have a couple of projects that are deployed on Windows, so I use a virtual Windows machine on my Ubuntu box for development.  At first, I tried using Samba to mount a share to my virtual machine, but that ended up causing problems.  If my virtual server went down and I forgot [...]]]></description>
			<content:encoded><![CDATA[<p>I have a couple of projects that are deployed on Windows, so I use a virtual Windows machine on my Ubuntu box for development.  At first, I tried using Samba to mount a share to my virtual machine, but that ended up causing problems.  If my virtual server went down and I forgot to unmount, bad things happened.</p>
<p>Googling around, I discovered a <a href="http://equivocation.org/node/107">how-to</a> on how to mount the virtual machine disk directly via loopback.  I decided to write an init script for it:</p>
<div style="height: 20em; overflow: auto">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/sh</span>
<span style="color: #666666; font-style: italic;">### BEGIN INIT INFO</span>
<span style="color: #666666; font-style: italic;"># Provides:          mount-windows-image</span>
<span style="color: #666666; font-style: italic;"># Required-Start:    $remote_fs</span>
<span style="color: #666666; font-style: italic;"># Required-Stop:     $remote_fs</span>
<span style="color: #666666; font-style: italic;"># Default-Start:     2 3 4 5</span>
<span style="color: #666666; font-style: italic;"># Default-Stop:      0 1 6</span>
<span style="color: #666666; font-style: italic;"># Short-Description: Mounts a KVM windows image</span>
<span style="color: #666666; font-style: italic;">### END INIT INFO</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Author: Jeremy Stephens &lt;viking415@gmail.com&gt;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Please remove the &quot;Author&quot; lines above and replace them</span>
<span style="color: #666666; font-style: italic;"># with your own name if you copy and modify this script.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Do NOT &quot;set -e&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># PATH should only include /usr/* if it runs after the mountnfs.sh script</span>
<span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #007800;">DESC</span>=<span style="color: #ff0000;">&quot;Mounts a KVM Windows image&quot;</span>
<span style="color: #007800;">SCRIPTNAME</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mount-windows-image
<span style="color: #007800;">DEV_FILE</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>mount-windows-image
&nbsp;
<span style="color: #007800;">MOUNT_DIR</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>win
<span style="color: #007800;">IMAGE_FILE</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>libvirt<span style="color: #000000; font-weight: bold;">/</span>qemu<span style="color: #000000; font-weight: bold;">/</span>xp.img
<span style="color: #007800;">UID</span>=<span style="color: #000000;">1017</span>
<span style="color: #007800;">GID</span>=<span style="color: #000000;">1017</span>
<span style="color: #007800;">FMASK</span>=0137
<span style="color: #007800;">DMASK</span>=0027
&nbsp;
<span style="color: #666666; font-style: italic;"># Load the VERBOSE setting and other rcS variables</span>
. <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>init<span style="color: #000000; font-weight: bold;">/</span>vars.sh
&nbsp;
<span style="color: #666666; font-style: italic;"># Define LSB log_* functions.</span>
<span style="color: #666666; font-style: italic;"># Depend on lsb-base (&gt;= 3.0-6) to ensure that this file is present.</span>
. <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>lsb<span style="color: #000000; font-weight: bold;">/</span>init-functions
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Function that starts the daemon/service</span>
<span style="color: #666666; font-style: italic;">#</span>
do_start<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: #666666; font-style: italic;"># Return</span>
	<span style="color: #666666; font-style: italic;">#   0 if daemon has been started</span>
	<span style="color: #666666; font-style: italic;">#   1 if daemon was already running</span>
	<span style="color: #666666; font-style: italic;">#   2 if daemon could not be started</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #007800;">$MOUNT_DIR</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #660033;">-gt</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: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
        <span style="color: #000000; font-weight: bold;">else</span>
          <span style="color: #007800;">DEV</span>=<span style="color: #000000; font-weight: bold;">`</span>losetup -f<span style="color: #000000; font-weight: bold;">`</span>
          <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$DEV</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$DEV_FILE</span>
          losetup <span style="color: #007800;">$DEV</span> <span style="color: #007800;">$IMAGE_FILE</span>
          kpartx <span style="color: #660033;">-a</span> <span style="color: #007800;">$DEV</span>
          <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-t</span> ntfs <span style="color: #660033;">-o</span> <span style="color: #007800;">uid</span>=<span style="color: #007800;">$UID</span>,<span style="color: #007800;">gid</span>=<span style="color: #007800;">$GID</span>,<span style="color: #007800;">fmask</span>=<span style="color: #007800;">$FMASK</span>,<span style="color: #007800;">dmask</span>=<span style="color: #007800;">$DMASK</span> \
            <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$DEV</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> -F<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #ff0000;">'{print $3}'</span><span style="color: #000000; font-weight: bold;">`</span>p1 <span style="color: #007800;">$MOUNT_DIR</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: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">0</span>
          <span style="color: #000000; font-weight: bold;">else</span>
            kpartx <span style="color: #660033;">-d</span> <span style="color: #007800;">$DEV</span>
            losetup <span style="color: #660033;">-d</span> <span style="color: #007800;">$DEV</span>
            <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$DEV_FILE</span>
            <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">2</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>
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Function that stops the daemon/service</span>
<span style="color: #666666; font-style: italic;">#</span>
do_stop<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: #666666; font-style: italic;"># Return</span>
	<span style="color: #666666; font-style: italic;">#   0 if daemon has been stopped</span>
	<span style="color: #666666; font-style: italic;">#   1 if daemon was already stopped</span>
	<span style="color: #666666; font-style: italic;">#   2 if daemon could not be stopped</span>
	<span style="color: #666666; font-style: italic;">#   other if a failure occurred</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #007800;">$MOUNT_DIR</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</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: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
        <span style="color: #000000; font-weight: bold;">else</span>
          <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #007800;">$MOUNT_DIR</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: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">1</span>
            <span style="color: #007800;">DEV</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$DEV_FILE</span><span style="color: #000000; font-weight: bold;">`</span>
            kpartx <span style="color: #660033;">-d</span> <span style="color: #007800;">$DEV</span>
            losetup <span style="color: #660033;">-d</span> <span style="color: #007800;">$DEV</span>
            <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$DEV_FILE</span>
            <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">0</span>
          <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">2</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>
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Function that sends a SIGHUP to the daemon/service</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#do_reload() {</span>
<span style="color: #666666; font-style: italic;">#	#</span>
<span style="color: #666666; font-style: italic;">#	# If the daemon can reload its configuration without</span>
<span style="color: #666666; font-style: italic;">#	# restarting (for example, when it is sent a SIGHUP),</span>
<span style="color: #666666; font-style: italic;">#	# then implement that here.</span>
<span style="color: #666666; font-style: italic;">#	#</span>
<span style="color: #666666; font-style: italic;">#	start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME</span>
<span style="color: #666666; font-style: italic;">#	return 0</span>
<span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
  start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VERBOSE</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= no <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> log_daemon_msg <span style="color: #ff0000;">&quot;Starting <span style="color: #007800;">$DESC</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$NAME</span>&quot;</span>
	do_start
	<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$?&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
		<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VERBOSE</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= no <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> log_end_msg <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">;;</span>
		<span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VERBOSE</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= no <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> log_end_msg <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">;;</span>
	<span style="color: #000000; font-weight: bold;">esac</span>
	<span style="color: #000000; font-weight: bold;">;;</span>
  stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VERBOSE</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= no <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> log_daemon_msg <span style="color: #ff0000;">&quot;Stopping <span style="color: #007800;">$DESC</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$NAME</span>&quot;</span>
	do_stop
	<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$?&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
		<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VERBOSE</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= no <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> log_end_msg <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">;;</span>
		<span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VERBOSE</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= no <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> log_end_msg <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">;;</span>
	<span style="color: #000000; font-weight: bold;">esac</span>
	<span style="color: #000000; font-weight: bold;">;;</span>
  <span style="color: #666666; font-style: italic;">#reload|force-reload)</span>
	<span style="color: #666666; font-style: italic;">#</span>
	<span style="color: #666666; font-style: italic;"># If do_reload() is not implemented then leave this commented out</span>
	<span style="color: #666666; font-style: italic;"># and leave 'force-reload' as an alias for 'restart'.</span>
	<span style="color: #666666; font-style: italic;">#</span>
	<span style="color: #666666; font-style: italic;">#log_daemon_msg &quot;Reloading $DESC&quot; &quot;$NAME&quot;</span>
	<span style="color: #666666; font-style: italic;">#do_reload</span>
	<span style="color: #666666; font-style: italic;">#log_end_msg $?</span>
	<span style="color: #666666; font-style: italic;">#;;</span>
<span style="color: #666666; font-style: italic;">#  restart|force-reload)</span>
<span style="color: #666666; font-style: italic;">#	#</span>
<span style="color: #666666; font-style: italic;">#	# If the &quot;reload&quot; option is implemented then remove the</span>
<span style="color: #666666; font-style: italic;">#	# 'force-reload' alias</span>
<span style="color: #666666; font-style: italic;">#	#</span>
<span style="color: #666666; font-style: italic;">#	log_daemon_msg &quot;Restarting $DESC&quot; &quot;$NAME&quot;</span>
<span style="color: #666666; font-style: italic;">#	do_stop</span>
<span style="color: #666666; font-style: italic;">#	case &quot;$?&quot; in</span>
<span style="color: #666666; font-style: italic;">#	  0|1)</span>
<span style="color: #666666; font-style: italic;">#		do_start</span>
<span style="color: #666666; font-style: italic;">#		case &quot;$?&quot; in</span>
<span style="color: #666666; font-style: italic;">#			0) log_end_msg 0 ;;</span>
<span style="color: #666666; font-style: italic;">#			1) log_end_msg 1 ;; # Old process is still running</span>
<span style="color: #666666; font-style: italic;">#			*) log_end_msg 1 ;; # Failed to start</span>
<span style="color: #666666; font-style: italic;">#		esac</span>
<span style="color: #666666; font-style: italic;">#		;;</span>
<span style="color: #666666; font-style: italic;">#	  *)</span>
<span style="color: #666666; font-style: italic;">#	  	# Failed to stop</span>
<span style="color: #666666; font-style: italic;">#		log_end_msg 1</span>
<span style="color: #666666; font-style: italic;">#		;;</span>
<span style="color: #666666; font-style: italic;">#	esac</span>
<span style="color: #666666; font-style: italic;">#	;;</span>
  <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #666666; font-style: italic;">#echo &quot;Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}&quot; &gt;&amp;2</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: <span style="color: #007800;">$SCRIPTNAME</span> {start|stop}&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">3</span>
	<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
:</pre></div></div>

</div>
<p><br/></p>
<p>Install the script in <code>/etc/init.d</code> and make it executable.  Make sure you change the following variables in the script: UID, GID, MOUNT_DIR, IMAGE_FILE.  You can add the script to the boot process via the <code>update-rc.d</code> command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mount-windows-image
update-rc.d mount-windows-image defaults</pre></div></div>

<p>This script mounts the first partition on a Windows virtual image, and it assumes the disk is formatted as NTFS.  Tweaking the script to fit your needs shouldn&#8217;t be too difficult.  I use Ubuntu, although I imagine the script would work in Debian.  Your mileage may vary.</p>
<p><b>Note</b>: I believe this only works with raw virtual images.  Also, It&#8217;s probably a good idea to at least skim <a href="http://equivocation.org/node/107">the post I linked above</a> for additional information and caveats.</p>
<p><a href='http://pillageandplunder.net/wp-content/uploads/2009/04/mount-windows-image'>&raquo; Download script</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2009/04/initd-script-for-mounting-a-kvmqemu-image-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More thoughts about OSS culture</title>
		<link>http://pillageandplunder.net/2009/04/more-thoughts-about-oss-culture/</link>
		<comments>http://pillageandplunder.net/2009/04/more-thoughts-about-oss-culture/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 05:37:26 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[oss]]></category>
		<category><![CDATA[soapbox]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=59</guid>
		<description><![CDATA[The movers and shakers in the OSS community seem to be people with strong opinions.  They feel strongly enough about a software paradigm to speak out about it and develop some software package or library that goes along with said paradigm.  Often, these people also tend to not be very friendly.  They [...]]]></description>
			<content:encoded><![CDATA[<p>The movers and shakers in the <acronym title="Open Source Software">OSS</acronym> community seem to be people with strong opinions.  They feel strongly enough about a software paradigm to speak out about it and develop some software package or library that goes along with said paradigm.  Often, these people also tend to not be very friendly.  They have an agenda.  They think that they are right, and if you think otherwise, you are wrong and/or ugly and/or stupid.</p>
<p>This is why OSS sometimes chafes me.  I am a people pleaser.  It&#8217;s just my personality.  Sometimes I disagree with something one of the big guys is doing.  But when it comes down to it, I really don&#8217;t have the chutzpah to express an adverse opinion openly.  I&#8217;m confident in my programming abilities, but I question myself when it comes to these sort of situations.</p>
<p>It&#8217;s sort of like road rage.  I can get quite angry at someone who is driving poorly in front of me, but if I were face to face with them, that anger would disappear.  In fact, I would feel bad about being angry in the first place.  Part of it has to do with my personality, and part of it has to do with the unapproachability of these software giants.</p>
<p>This is one of the reasons why I was so impressed with Matz, the creator of Ruby.  This guy has the most right in the Ruby community to boast, but the man is one of the most humble.  When I heard his keynote at last year&#8217;s RubyConf, I was blown away.  It was like a breath of fresh air.  Many of the American (and non-American) programmers seem quite arrogant.  I&#8217;m not blameless, either.  We can all learn from Matz and his attitude.</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2009/04/more-thoughts-about-oss-culture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dokuwiki Desert Template</title>
		<link>http://pillageandplunder.net/2009/03/dokuwiki-desert-template/</link>
		<comments>http://pillageandplunder.net/2009/03/dokuwiki-desert-template/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 20:35:35 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[web design]]></category>
		<category><![CDATA[dokuwiki]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=45</guid>
		<description><![CDATA[The default Dokuwiki template was frying my eyes, so I made a new one.  I simply took the default template and substituted some colors.

Download &#187;
For instructions on installation, see Dokuwiki&#8217;s template page.
UPDATE (2009-04-09): Fixed code blocks showing as white.
]]></description>
			<content:encoded><![CDATA[<p>The default <a href="http://dokuwiki.org">Dokuwiki</a> template was frying my eyes, so I made a new one.  I simply took the default template and substituted some colors.</p>
<p><a href="http://pillageandplunder.net/wp-content/uploads/2009/03/desert.png"><img src="http://pillageandplunder.net/wp-content/uploads/2009/03/desert-150x150.png" alt="desert" title="desert" width="150" height="150" class="alignnone size-thumbnail wp-image-51" /></a></p>
<p><a href='http://pillageandplunder.net/wp-content/uploads/2009/03/desert.zip'>Download &raquo;</a></p>
<p>For instructions on installation, see <a href="http://www.dokuwiki.org/template">Dokuwiki&#8217;s template page</a>.</p>
<p><strong>UPDATE (2009-04-09)</strong>: Fixed code blocks showing as white.</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2009/03/dokuwiki-desert-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails, PHP, and default check box values</title>
		<link>http://pillageandplunder.net/2009/03/rails-php-and-default-check-box-values/</link>
		<comments>http://pillageandplunder.net/2009/03/rails-php-and-default-check-box-values/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 18:59:34 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=42</guid>
		<description><![CDATA[The HTML specification dictates that unchecked check boxes should not supply a value in a form submission, which can be problematic for applications wishing to set a flag in a database based on an unchecked check box.  Rails gets around this by using a trick in the check_box helper.  It places a hidden [...]]]></description>
			<content:encoded><![CDATA[<p>The HTML specification dictates that unchecked check boxes should not supply a value in a form submission, which can be problematic for applications wishing to set a flag in a database based on an unchecked check box.  Rails gets around this by <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M001580">using a trick</a> in the <code>check_box</code> helper.  It places a hidden input tag with the requested default value <b>directly after</b> the check box tag.</p>
<p>The reason this works is because form parameters are sent in the order that they appear.  This means the hidden input value is submitted <i>after</i> the check box value would be, and Rails gives precedence to parameters appearing earlier in the request.</p>
<p>I tried this in PHP, hoping it would behave the same way.  It doesn&#8217;t.  It turns out that PHP overwrites earlier variables in the request with later ones.  This behavior is dictated by the <a href="http://us2.php.net/manual/en/ini.core.php#ini.request-order">request_order</a> directive (as of PHP 5.3.0, which is still in beta at the time of this post).  The fix is simply to place the hidden input tag before the check box tag.</p>
<p>Hopefully this helps someone avoid the moderate pain I went through figuring all this out.</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2009/03/rails-php-and-default-check-box-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GIMP animated progress bar background image</title>
		<link>http://pillageandplunder.net/2009/03/gimp-animated-progress-bar-background-image/</link>
		<comments>http://pillageandplunder.net/2009/03/gimp-animated-progress-bar-background-image/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 16:21:41 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[web design]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[progress bar]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=26</guid>
		<description><![CDATA[Yesterday I scoured the web for an animated progress bar background.  Not an animated progress bar, a background.  I wanted the ability to control my progress bar length with CSS and Javascript.  I found some stripey backgrounds and what not, but none of them were animated.  Maybe my Google skills failed [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I scoured the web for an animated progress bar background.  Not an animated progress bar, a <em>background</em>.  I wanted the ability to control my progress bar length with CSS and Javascript.  I found some stripey backgrounds and what not, but none of them were animated.  Maybe my Google skills failed me, but I couldn&#8217;t find one for the life of me.  So I decided to make my own in GIMP.</p>
<p><img class="alignnone size-medium wp-image-27" title="Progress bar" src="http://pillageandplunder.net/wp-content/uploads/2009/03/progress.gif" alt="Progress bar" width="300" height="25" /></p>
<p>Once I figured out the steps, it was quite simple.</p>
<ol>
<li>Start with a long solid color bar (I used 1000&#215;25, which is probably overkill)</li>
<li>Add a transparent layer and fill it with the <em>Warning</em> pattern (yellow and black stripes)</li>
<li>Remove the yellow stripes via select by color, then change the opacity to something low (like 15%)</li>
<li>Add a third layer for a white gradient in the top half to make it shiny</li>
<li>Change the canvas size to 300&#215;25 and align the layer to the right</li>
<li>Merge the three layers together</li>
<li>Copy the layer, move it 1 pixel to the right</li>
<li>Repeat until you have 20 layers, each 1 pixel further right than the previous one</li>
<li>Run the animation optimization filter, then save as animated GIF using 50ms delay</li>
<li>Drink a beer!</li>
</ol>
<p>Here&#8217;s the <a href="http://pillageandplunder.net/wp-content/uploads/2009/03/long-bar.xcf">GIMP file</a> before merging layers, and <a href="http://pillageandplunder.net/wp-content/uploads/2009/03/progress.xcf">here&#8217;s the one</a> just before optimization.  Please take them (or the image above) and do whatever the hell you want with them.</p>
<p>Here&#8217;s a <a href="http://pillageandplunder.net/wp-content/uploads/2009/03/germany.gif">German flag version</a> for good measure.</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2009/03/gimp-animated-progress-bar-background-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>View spec names and Autotest</title>
		<link>http://pillageandplunder.net/2008/12/view-spec-names-and-autotest/</link>
		<comments>http://pillageandplunder.net/2008/12/view-spec-names-and-autotest/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 23:05:59 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[autotest]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=24</guid>
		<description><![CDATA[In one of my Rails projects, I have some views that are rendered through ERB and others through HAML.  This makes it annoying to jump to a view&#8217;s spec via rails.vim, since it currently doesn&#8217;t handle custom Rcommand&#8217;s that accept multiple suffixes.
When I asked tpope today about this, he brought up a good point. [...]]]></description>
			<content:encoded><![CDATA[<p>In one of my Rails projects, I have some views that are rendered through ERB and others through HAML.  This makes it annoying to jump to a view&#8217;s spec via <a href="http://rails.vim.tpope.net">rails.vim</a>, since it currently doesn&#8217;t handle custom <code>Rcommand</code>&#8217;s that accept multiple suffixes.</p>
<p>When I asked <a href="http://tpope.net">tpope</a> today about this, he brought up a good point.  Why are view specs associated with an engine type (such as ERB or HAML) by default?  You should be able to convert an ERB view to a HAML view and use the same tests.</p>
<p>Per his tip, I renamed my views from names like <code>new.html.haml_spec.rb</code> to just <code>new.html_spec.rb</code>.  Unfortunately, autotest stopped recognizing the correlation between my views and my view specs.  Putting this in my <code>.autotest</code> file fixed the issue:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">Autotest.<span style="color:#9900CC;">add_hook</span> <span style="color:#ff3333; font-weight:bold;">:initialize</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>at<span style="color:#006600; font-weight:bold;">|</span>
  at.<span style="color:#9900CC;">remove_mapping</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">%</span>r<span style="color:#006600; font-weight:bold;">%</span>^app<span style="color:#006600; font-weight:bold;">/</span>views<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">%</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  at.<span style="color:#9900CC;">add_mapping</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">%</span>r<span style="color:#006600; font-weight:bold;">%</span>^app<span style="color:#006600; font-weight:bold;">/</span>views<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">%</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>f, md<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#008000; font-style:italic;"># strip off engine name</span>
    path = md<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#CC0066; font-weight:bold;">sub</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>\.<span style="color:#006600; font-weight:bold;">&#40;</span>erb<span style="color:#006600; font-weight:bold;">|</span>haml<span style="color:#006600; font-weight:bold;">&#41;</span>$<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    at.<span style="color:#9900CC;">files_matching</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">%</span>r<span style="color:#006600; font-weight:bold;">&#123;</span>spec<span style="color:#006600; font-weight:bold;">/</span>views<span style="color:#006600; font-weight:bold;">/</span><span style="color:#008000; font-style:italic;">#{path}_spec.rb})</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>I hope that helps someone. <img src='http://pillageandplunder.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2008/12/view-spec-names-and-autotest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bandwagon jumping in the Rails community</title>
		<link>http://pillageandplunder.net/2008/11/bandwagon-jumping-in-the-rails-community/</link>
		<comments>http://pillageandplunder.net/2008/11/bandwagon-jumping-in-the-rails-community/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 20:59:35 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[community]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=15</guid>
		<description><![CDATA[Ever since I started using Rails two and a half years ago, there&#8217;s been something that&#8217;s nagged me about the Rails community.  Only recently have I been able to put my finger on it.  I&#8217;m not sure if this applies to all OSS communities or just Rails&#8217;, but it really bugs me.
Everyone&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I started using Rails two and a half years ago, there&#8217;s been something that&#8217;s nagged me about the Rails community.  Only recently have I been able to put my finger on it.  I&#8217;m not sure if this applies to all <acronym title="Open Source Software">OSS</acronym> communities or just Rails&#8217;, but it really bugs me.</p>
<p>Everyone&#8217;s a bandwagon jumper.</p>
<p>Take the whole TextMate movement, for example.  Two years ago, TextMate was <b>the</b> editor for Rails developers.  All of a sudden though, Vim is the new hotness.  Apparently the exodus from TextMate became full blown after Jamis Buck <a href="http://weblog.jamisbuck.org/2008/10/10/coming-home-to-vim">switched back to Vim</a>.  And, poof!  Hard-core TextMaters are suddenly hard-core Vimmers.  Some of them are switching back to Vim, but others are first time Vim users and now think it&#8217;s all the rage.  It bothers me.</p>
<p>The same thing happened with the testing movement.  Rails developers are known for their outspoken opinions about testing.  &#8220;You should test all the effing time.&#8221;  Everyone seemed to latch onto this idea without even thinking about it.  I agree, testing <i>is</i> good, and it helps you write very stable code, but the blind acceptance of things just seems to happen a lot in this community.</p>
<p>Both Vim and unit testing have been around for a while.  It takes a big name in the community to bring them to attention, and then everyone and their mother&#8217;s dog starts doing it.</p>
<p>And then there&#8217;s Git.  Until a year ago, pretty much everyone used Subversion, and then Git comes out of nowhere.  All it takes is a Google video of Linus Torvalds calling Subversion users idiots, and pretty soon after that, you&#8217;re behind the times if you&#8217;re still using SVN for your revision control.  Github has exploded as the place to have your code if you&#8217;re somebody.</p>
<p>It seems like everyone&#8217;s racing to come up with the next big idea that will be adopted by the entire community.  And if someone beats them to it, the next best thing is to latch onto an idea while it&#8217;s young so that they can be one of the few riding the crest of the wave that&#8217;s about to break onto unsuspecting John Q. Programmer.</p>
<p>To be honest, it&#8217;s like high school all over again.  It&#8217;s the rush to be popular.  The only difference now is that the stage is bigger and money is involved.  If some new way of doing things comes up, consider it, and make up your own mind about it.  Don&#8217;t switch just so you can be one of the first to do so.  The tides change so drastically so often it&#8217;s staggering.  If you don&#8217;t keep up, you might be not be in the <i>in crowd</i> anymore, oh noez!1!one!</p>
<p>Of course, everyone is entitled to their own opinion.  This is just the way I view it.</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2008/11/bandwagon-jumping-in-the-rails-community/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using autotest to test Ruby C extensions</title>
		<link>http://pillageandplunder.net/2008/11/using-autotest-to-test-ruby-c-extensions/</link>
		<comments>http://pillageandplunder.net/2008/11/using-autotest-to-test-ruby-c-extensions/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 23:45:02 +0000</pubDate>
		<dc:creator>viking</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[autotest]]></category>
		<category><![CDATA[rtp]]></category>

		<guid isPermaLink="false">http://pillageandplunder.net/?p=7</guid>
		<description><![CDATA[I recently decided to write a Ruby wrapper for the oRTP library so I can eventually implement a little RTSP server in Ruby.  I wanted to use autotest for my testing, but it didn&#8217;t work out of the box since I&#8217;m testing code that lives in the ext/ directory.  I wanted autotest to [...]]]></description>
			<content:encoded><![CDATA[<p>I recently decided to write a Ruby wrapper for the <a href="http://www.linphone.org/index.php/eng/code_review/ortp">oRTP</a> library so I can eventually implement a little <a href="http://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol">RTSP</a> server in Ruby.  I wanted to use autotest for my testing, but it didn&#8217;t work out of the box since I&#8217;m testing code that lives in the <code>ext/</code> directory.  I wanted autotest to rebuild my extension after each change to the source file.  So I came up with an <code>.autotest</code> file that looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">Autotest.<span style="color:#9900CC;">add_hook</span> <span style="color:#ff3333; font-weight:bold;">:run_command</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>at<span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Re-building extensions...&quot;</span>
  <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">chdir</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;/ext&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#996600;">`make`</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
Autotest.<span style="color:#9900CC;">add_hook</span> <span style="color:#ff3333; font-weight:bold;">:initialize</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>at<span style="color:#006600; font-weight:bold;">|</span>
  at.<span style="color:#9900CC;">add_mapping</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">%</span>r<span style="color:#006600; font-weight:bold;">&#123;</span>^ext<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>\w<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span>\.<span style="color:#9900CC;">c</span>$<span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>f, md<span style="color:#006600; font-weight:bold;">|</span>
    at.<span style="color:#9900CC;">files_matching</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">%</span>r<span style="color:#006600; font-weight:bold;">&#123;</span>test<span style="color:#006600; font-weight:bold;">/</span>test_<span style="color:#008000; font-style:italic;">#{md[1]}.rb})</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The beginnings of my code for this project is on <a href="http://github.com/viking/ruby-rtp">teh Githubz</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pillageandplunder.net/2008/11/using-autotest-to-test-ruby-c-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
