<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>crashingdaily</title>
	<atom:link href="http://crashingdaily.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://crashingdaily.wordpress.com</link>
	<description>life in shell</description>
	<pubDate>Sat, 30 Aug 2008 01:43:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dashing internet host names</title>
		<link>http://crashingdaily.wordpress.com/2008/08/30/dashing-internet-host-names/</link>
		<comments>http://crashingdaily.wordpress.com/2008/08/30/dashing-internet-host-names/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 01:42:38 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
		
		<category><![CDATA[Apache HTTP Server]]></category>

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

		<category><![CDATA[apache DNS configuration]]></category>

		<category><![CDATA[http cookies]]></category>

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

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

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=66</guid>
		<description><![CDATA[I ran into a fun problem today. The HTTP session cookie for one of my websites was not being retained in the Safari web browser. Packet sniffing clearly showed the server was sending a &#8216;Set-Cookie&#8217; in the HTTP header. Safari accepted the cookie just fine with other virtual hosts having identical code base and similar [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I ran into a fun problem today. The HTTP session cookie for one of my websites was not being retained in the Safari web browser. Packet sniffing clearly showed the server was sending a &#8216;Set-Cookie&#8217; in the HTTP header. Safari accepted the cookie just fine with other virtual hosts having identical code base and similar configurations for Apache webserver and Tomcat. FireFox 3 accepted the cookie from all the virtual hosts. It was quite a perplexing issue.</p>
<p>It turns out that Safari, Version 3.1.1 at least, does not retain cookies from hosts with an underscore (_) in its name and my troubled website host did indeed have one in its name. I changed the underscore to a dash (-) and Safari was happy.</p>
<p>Who woulda thunk?</p>
<h4>Related:</h4>
<p><a href="http://www.ruby-forum.com/topic/151965">Discussion of the issue</a> from the Ruby Forum<br />
<a href="http://www-01.ibm.com/support/docview.wss?uid=swg21112062">Internet Explorer probably would have given me the same behaviour</a>, but I didn&#8217;t test it.<br />
Host name specifications are documented in <a href="http://www.ietf.org/rfc/rfc952.txt">RFC 952</a> and <a href="http://www.ietf.org/rfc/rfc1035.txt">RFC 1035</a>. The underscore is not among valid characters.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crashingdaily.wordpress.com/66/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crashingdaily.wordpress.com/66/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&blog=744507&post=66&subd=crashingdaily&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2008/08/30/dashing-internet-host-names/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/crashingdaily-128.jpg" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Grepping nonprinting characters</title>
		<link>http://crashingdaily.wordpress.com/2008/07/26/grepping-nonprinting-characters/</link>
		<comments>http://crashingdaily.wordpress.com/2008/07/26/grepping-nonprinting-characters/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 18:59:09 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
		
		<category><![CDATA[Linux]]></category>

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

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

		<category><![CDATA[grep ascii shell bash linux]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=62</guid>
		<description><![CDATA[Here is a tip summarized from comp.unix.shell
The problem:

&#62; For the following TAB-delimited records, I want to count number of
&#62; records with column-2 == -1   (should be 2)
&#62; ===== file.txt ======
&#62; AAA    -1    2008-07-14
&#62; BBB    -14   2008-07-15
&#62; CCC    -20  [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here is a <a href="http://groups.google.com/group/comp.unix.shell/browse_thread/thread/cdf52f9d96a06c3e/70e630c80798a057?show_docid=70e630c80798a057">tip summarized</a> from comp.unix.shell</p>
<p>The problem:</p>
<pre>
&gt; For the following TAB-delimited records, I want to count number of
&gt; records with column-2 == -1   (should be 2)
&gt; ===== file.txt ======
&gt; AAA    -1    2008-07-14
&gt; BBB    -14   2008-07-15
&gt; CCC    -20   2008-07-16
&gt; DDD    -1    2008-07-16
&gt; ===========
&gt; I tried:
&gt;   grep -c -- "-1\t" file.txt
&gt; which is not working
</pre>
<p>A solution offered for ksh93/zsh/bash shells:</p>
<pre>
grep -c -- $'-1\t' file.txt
</pre>
<p>I will add another alternative</p>
<pre>
grep -c '-1^V^I' file.txt
</pre>
<p>Where <code>^V^I</code> means type <code>ctrl-v</code> and <code>ctrl-i</code> to enter a tab character.</p>
<h4>Related:</h4>
<p>Advanced Bash-Scripting Guide  <a href="http://tldp.org/LDP/abs/html/bashver2.html#EX77">Example 34-1</a><br />
<a href="http://www.bo.infn.it/alice/alice-doc/mll-doc/linux/vi-ex/node15.html">Insert ASCII Control Characters in Text</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crashingdaily.wordpress.com/62/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crashingdaily.wordpress.com/62/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&blog=744507&post=62&subd=crashingdaily&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2008/07/26/grepping-nonprinting-characters/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/crashingdaily-128.jpg" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Hanging Oracle dbca</title>
		<link>http://crashingdaily.wordpress.com/2008/07/13/hanging-oracle-dbca/</link>
		<comments>http://crashingdaily.wordpress.com/2008/07/13/hanging-oracle-dbca/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 00:17:38 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

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

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

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=61</guid>
		<description><![CDATA[Oracle is today&#8217;s new toy for me. And by toy I mean frequent source of frustration. One issue I battled this morning was getting dbca to start. It would just hang at the command line prompt with no feedback about what it was or wasn&#8217;t doing. netca and oem would launch just fine so it [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Oracle is today&#8217;s new toy for me. And by toy I mean frequent source of frustration. One issue I battled this morning was getting dbca to start. It would just hang at the command line prompt with no feedback about what it was or wasn&#8217;t doing. netca and oem would launch just fine so it didn&#8217;t seem to be a Java or X11 configuration issue.</p>
<p>The Oracle forums were of no help but I did find a workaround here. <a href="http://journeymanjournal.blogspot.com/2005/07/what-to-do-when-dbca-does-not-start.html">What to do when dbca does not start? </a></p>
<p>So, I yanked my cable a bit, then, remembering I&#8217;m on a wireless Linux laptop, shutdown the network service. Then dbca launched. Of course then dbca couldn&#8217;t connect to the databases so I had to start the network again. Good times.</p>
<p>This doesn&#8217;t solve the fundamental problem - I certainly couldn&#8217;t shutdown the network in a production environment and I doubt it would fly on an Oracle certification exam but at least I&#8217;m able to continue with my Oracle adventures.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crashingdaily.wordpress.com/61/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crashingdaily.wordpress.com/61/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&blog=744507&post=61&subd=crashingdaily&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2008/07/13/hanging-oracle-dbca/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/crashingdaily-128.jpg" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>perl pie in your face</title>
		<link>http://crashingdaily.wordpress.com/2008/07/11/perl-pie-in-your-face/</link>
		<comments>http://crashingdaily.wordpress.com/2008/07/11/perl-pie-in-your-face/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 03:20:53 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
		
		<category><![CDATA[Linux]]></category>

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

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

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

		<category><![CDATA[perl ed sed one-liner]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=60</guid>
		<description><![CDATA[I frequently use Perl&#8217;s in place file editing from the command line. What I didn&#8217;t consider until it bit me today is that the file ownership can change using this method.
Here&#8217;s the original file, owned by tomcat_6 and only readable by user and group.

$ ls -l web.xml
-rw-rw----  1 tomcat_6 tomcat 49384 Jul 10 11:38 [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I frequently use Perl&#8217;s in place file editing<a href="http://www.sns.ias.edu/~jns/wp/2006/02/15/how-to-perform-in-place-editing-of-a-file-using-perl/"></a> from the command line. What I didn&#8217;t consider until it bit me today is that the file ownership can change using this method.</p>
<p>Here&#8217;s the original file, owned by tomcat_6 and only readable by user and group.</p>
<pre>
$ ls -l web.xml
-rw-rw----  1 tomcat_6 tomcat 49384 Jul 10 11:38 web.xml
</pre>
<p>I belong to the tomcat group, so have write permissions to the file. The enclosing directory is also tomcat group writable. The importance of this is noted below.</p>
<p>Using the &#8216;perl pie&#8217; one-liner to make an in place edit if the file:</p>
<pre>
$ perl -p -i -e &#39;s;&lt;session-timeout&gt;\d+&lt;/session-timeout&gt;;\
&lt;session-timeout&gt;1440&lt;/session-timeout&gt;;&#39; web.xml
</pre>
<p>Now the file is owned by me and my default group. </p>
<pre>
$ ls -l web.xml
-rw-rw----  1 crashing  daily 49384 Jul 10 21:55 web.xml
</pre>
<p>Most critically, now the file is no longer readable by the tomcat processes. This little change prevented my Tomcat server from starting. Ouch.</p>
<p>sed is a little nicer. It changes the owner but not the group.</p>
<pre>
$ sed -i &#39;s;&lt;session-timeout&gt;.*&lt;/session-timeout&gt;;\
&lt;session-timeout&gt;1445&lt;/session-timeout&gt;;g&#39; web.xml
</pre>
<pre>
$ ls -l web.xml 
-rw-rw----  1 crash tomcat 49385 Jul 10 22:44 web.xml
</pre>
<p>Neither the Perl nor the sed one-liners work if the directory is not writable because Perl and sed require unlinking the original file and replacing it with a new version.</p>
<p>The winner for both maintaining file ownership and working if the directory is not writable is <a href="http://en.wikipedia.org/wiki/Ed_(text_editor)"><code>ed</code></a>.</p>
<pre>
$ ed - &quot;web.xml&quot; &lt;&lt;EOF
,s;&lt;session-timeout&gt;[[:digit:]]*&lt;/session-timeout&gt;;\
&lt;session-timeout&gt;1440&lt;/session-timeout&gt;;
w
EOF
</pre>
<p>ed truly does an in place edit. Nice. If only I could remember the syntax.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crashingdaily.wordpress.com/60/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crashingdaily.wordpress.com/60/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&blog=744507&post=60&subd=crashingdaily&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2008/07/11/perl-pie-in-your-face/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/crashingdaily-128.jpg" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Shaping the http connection</title>
		<link>http://crashingdaily.wordpress.com/2008/04/21/shaping-the-http-connection/</link>
		<comments>http://crashingdaily.wordpress.com/2008/04/21/shaping-the-http-connection/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 15:01:59 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
		
		<category><![CDATA[Apache HTTP Server]]></category>

		<category><![CDATA[Mac OS X]]></category>

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

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

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

		<category><![CDATA[MacOS X]]></category>

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

		<category><![CDATA[traffic shapping]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=59</guid>
		<description><![CDATA[The Tiger and Leopard releases of MacOS X include an implementation of BSD&#8217;s dummynet. Dummynet is &#8220;a system facility that permits the control of traffic going through the various network interfaces&#8220;.
There are many uses for this feature. I use it as part of my website development to simulate a slow network connection. Many of the [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The Tiger and Leopard releases of MacOS X include an implementation of BSD&#8217;s <code>dummynet</code>. Dummynet is &#8220;<a href="http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man4/dummynet.4.html">a system facility that permits the control of traffic going through the various network interfaces</a>&#8220;.</p>
<p>There are many uses for this feature. I use it as part of my website development to simulate a slow network connection. Many of the users of our websites are in developing countries with slow, dialup-speed, network connections. By using a couple of quick commands I can throttle my connection to the webserver down to similar speeds. As such, I can feel their pain even though I&#8217;m on a snazzy gigabit connection, two hops away from the webserver.</p>
<p>The following series of commands will slow my communications to and from the webserver down to 56K modem speeds. It only affects http connections (to any web server, not just mine). My other network connections - ssh, for example - operate with native network performance.</p>
<pre>
$ sudo ipfw add pipe 1 src-port http
$ sudo ipfw add pipe 1 dst-port http
$ sudo ipfw pipe 1 config bw 56kbit/s
</pre>
<p>Adam Knight&#8217;s <em><a href="http://www.macgeekery.com/hacks/software/traffic_shaping_in_mac_os_x">Traffic Shaping in Mac OS X</a></em> is a good starter tutorial.</p>
<p><a href="http://del.icio.us/crashingdaily/dummynet">Additional articles and documentation.</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crashingdaily.wordpress.com/59/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crashingdaily.wordpress.com/59/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&blog=744507&post=59&subd=crashingdaily&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2008/04/21/shaping-the-http-connection/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/crashingdaily-128.jpg" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Hashing the executables - a look at hash and type</title>
		<link>http://crashingdaily.wordpress.com/2008/04/21/hashing-the-executables-a-look-at-hash-and-type/</link>
		<comments>http://crashingdaily.wordpress.com/2008/04/21/hashing-the-executables-a-look-at-hash-and-type/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 01:59:37 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
		
		<category><![CDATA[Linux]]></category>

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

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

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

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

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=58</guid>
		<description><![CDATA[Here is a brief look at the Linux commands, type and hash.
To start, I open a new terminal and check for the location of the foo executable using the which command. (foo is a trivial shell script I concocted for illustrative examples in this posting.)

$ which foo
/usr/local/bin/foo

which tells me the location of the executable file [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here is a brief look at the Linux commands, <code>type</code> and <code>hash</code>.</p>
<p>To start, I open a new terminal and check for the location of the <code>foo</code> executable using the <code>which</code> command. (<code>foo</code> is a trivial shell script I concocted for illustrative examples in this posting.)</p>
<pre>
$ which foo
/usr/local/bin/foo
</pre>
<p><code>which</code> tells me the location of the executable file in my <code>$PATH</code> but that is not necessarily what will be executed when I call <code>foo</code> on the command line. To learn that, I use the <code>type</code> command.</p>
<pre>
$ type foo
foo is /usr/local/bin/foo
</pre>
<p><code>type</code> reports how a word will be interpreted if used as command name. In this case, it is telling me that using <code>foo</code> as a command will execute the file <code>/usr/local/bin/foo</code>. That happens to be what <code>which</code> also reported, but, as we will see in the following examples, that will not always be the case.</p>
<p>I can run the <code>foo</code> command to print its release version.</p>
<pre>
$ foo --version
foo release 1.0
</pre>
<p>Consider if I install a new foo, version 2.0, in my <code>~/bin</code> directory, leaving the 1.0 version in <code>/usr/local/bin/foo</code>. I have positioned <code>~/bin</code> ahead of <code>/usr/local/bin</code> in my <code>$PATH</code> and the <code>which</code> command confirms the new 2.0 version is found first.</p>
<pre>
$ which foo
/home/crashingdaily/bin/foo
</pre>
<p>However, when I call for <code>foo</code> to be executed it still executes the old 1.0 version.</p>
<pre>
$ foo --version
foo release 1.0
</pre>
<p>Hmm, what&#8217;s going on? The <code>which</code> command reported the first executable found in my path but <code>type</code> will be more informative. It will tell us precisely what file, function, builtin, keyword or alias is associated with a given command name.</p>
<pre>
$ type foo
foo is hashed (/usr/local/bin/foo)
</pre>
<p>This is reporting that the shell has saved the meaning of <code>foo</code> in a hash table as <code>/usr/local/bin/foo</code> (the 1.0 version). Caching the command in a hash table is an optimization that saves the shell from having to search $PATH every time. A given shell does this the first time a command is run in that shell instance. The hashed values survive for the life of the shell instance. Start a new shell, e.g. by opening a new terminal or invoking a subshell, and you start a new hash table for that shell process. </p>
<p>The hash table can also be manually manipulated to clear or set values.  Enter the <code>hash</code> command. This command is used to print and edit the shell&#8217;s command hash table.</p>
<p>The entire hash table can be cleared</p>
<pre>
$ hash -r
</pre>
<p>or you can delete a specific entry</p>
<pre>
$ hash -d foo
</pre>
<p>Having cleared the hash table, invoking <code>foo</code> now calls the first in my path.</p>
<pre>
$ foo --version
foo release 2.0
</pre>
<p>And this copy is now placed in the hash table.</p>
<pre>
$ type foo
foo is hashed (/home/crashingdaily/foo)
</pre>
<p>I can also print that entry of the hash table to get its value. However, do not use this as a substitute for <code>type</code> as it only deals with files. More on that shortly.</p>
<pre>
$ hash -t foo
/home/crashingdaily/foo
</pre>
<p>As you might imagine, if I delete the executable whose value has been hashed,</p>
<pre>
$ rm /home/crashingdaily/foo
</pre>
<p>the command is not found when I attempt to use it,</p>
<pre>
$ foo --version
-bash: /home/crashingdaily/bin/foo: No such file or directory
</pre>
<p>until I update the hash. I can clear the hash as before or I can explictly set the value like so</p>
<pre>
$ hash -p /usr/local/bin/foo foo
</pre>
<pre>
$ type foo
foo is hashed (/usr/local/bin/foo)
</pre>
<pre>
$ foo --version
foo release 1.0
</pre>
<p>Keep in mind that the hash table caches (and the <code>hash</code> command reports) file and path names. It does not deal with keywords, functions, builtins or aliases which may be invoked by a command name. So, <code>type</code> is the utility to use for learning what will execute when a command name is invoked. </p>
<p>To further illustrate <code>type</code> usage, I will define a function named <code>foo</code>.</p>
<pre>
$ function foo { echo 'hello world'; }
</pre>
<p>Because function names take precedence over file executables having the same name, invoking <code>foo</code> executes the function instead of the shell script. Now, <code>type</code> reports</p>
<pre>
$ type foo
foo is a function
foo ()
{
    echo 'hello world'
}
</pre>
<p>and invoking the name gives us the expected function output.</p>
<pre>
$ foo
hello world
</pre>
<p>Using <code>type</code> with the <code>-a</code> option reports all the known values of <code>foo</code></p>
<pre>
$ type -a foo
foo is a function
foo ()
{
    echo 'hello world'
}
foo is /home/crashingdaily/bin/foo
foo is /usr/local/bin/foo
</pre>
<p>In summary, use <code>type</code> to learn what a given command name currently means to the shell - there could be more than one meaning. Use <code>hash</code> to manipulate cached associations of command names with files (and be aware that the command name may be associated with a non-file that takes precedence). </p>
<p>Additional documentation for <code>type</code> and <code>hash</code> is availble via the <code>help</code> command.</p>
<pre>
$ help type
type: type [-afptP] name [name ...]
    For each NAME, indicate how it would be interpreted if used as a
    command name...
</pre>
<pre>
$ help hash
hash: hash [-lr] [-p pathname] [-dt] [name ...]
    For each NAME, the full pathname of the command is determined and
    remembered....
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crashingdaily.wordpress.com/58/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crashingdaily.wordpress.com/58/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&blog=744507&post=58&subd=crashingdaily&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2008/04/21/hashing-the-executables-a-look-at-hash-and-type/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/crashingdaily-128.jpg" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>History meme</title>
		<link>http://crashingdaily.wordpress.com/2008/04/20/history-meme/</link>
		<comments>http://crashingdaily.wordpress.com/2008/04/20/history-meme/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 03:36:50 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=57</guid>
		<description><![CDATA[History Meme

$ history&#124;awk &#39;{a[$2]++} END{for(i in a){printf &#34;%5d\t%s\n&#34;,a[i],i}}&#39;&#124;sort -rn&#124;head
  77  whoami
  74  tic
  72  gawk
  70  od
  70  bash
  69  shred
  66  killall
  58  sleep
  55  id
  55  play

       [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.google.com/search?&amp;q=%22history+meme%22">History Meme</a></p>
<pre>
$ history|awk &#39;{a[$2]++} END{for(i in a){printf &quot;%5d\t%s\n&quot;,a[i],i}}&#39;|sort -rn|head
  77  whoami
  74  tic
  72  gawk
  70  od
  70  bash
  69  shred
  66  killall
  58  sleep
  55  id
  55  play
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crashingdaily.wordpress.com/57/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crashingdaily.wordpress.com/57/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&blog=744507&post=57&subd=crashingdaily&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2008/04/20/history-meme/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/crashingdaily-128.jpg" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Crashing Windows XP install in a Parallels virtual machine</title>
		<link>http://crashingdaily.wordpress.com/2008/04/08/crashing-windows-xp-install-in-a-parallels-virtual-machine/</link>
		<comments>http://crashingdaily.wordpress.com/2008/04/08/crashing-windows-xp-install-in-a-parallels-virtual-machine/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 19:02:55 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
		
		<category><![CDATA[Mac OS X]]></category>

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

		<category><![CDATA[OS X]]></category>

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

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=52</guid>
		<description><![CDATA[Wake the media, alert the dog. I installed Windows XP Pro into a Parallels virtual machine (VM) today.
Disabling &#8216;Acceleration&#8217; in the VM was required for successful installation. With Acceleration enabled, the installation kept hanging at the &#8220;installing devices&#8221; stage (this could be progressed sometimes by forced restarting of the VM) and spontaneously rebooting.
From Problems with [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Wake the media, alert the dog. I installed Windows XP Pro into a Parallels virtual machine (VM) today.</p>
<p>Disabling &#8216;Acceleration&#8217; in the VM was required for successful installation. With Acceleration enabled, the installation kept hanging at the &#8220;installing devices&#8221; stage (this could be progressed sometimes by forced restarting of the VM) and spontaneously rebooting.</p>
<p>From <i><a href="http://kb.parallels.com/entry/31/280/">Problems with installing Windows XP SP0 in VM</a></i> in Parallels&#8217; knowledge base:</p>
<pre>
1. Change the acceleration mode of the VM:
2. Open the VM's configuration page.
3. In the Resources list select Options.
4. Click the Advanced tab.
5. Set the Acceleration level to Normal or Disabled.
After installing Windows XP in the VM, you can change the Acceleration level back to High.
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crashingdaily.wordpress.com/52/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crashingdaily.wordpress.com/52/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&blog=744507&post=52&subd=crashingdaily&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2008/04/08/crashing-windows-xp-install-in-a-parallels-virtual-machine/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/crashingdaily-128.jpg" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Steering users away from nonexistent Apache virtual hosts</title>
		<link>http://crashingdaily.wordpress.com/2008/03/31/steering-users-away-from-nonexistent-apache-virtual-hosts/</link>
		<comments>http://crashingdaily.wordpress.com/2008/03/31/steering-users-away-from-nonexistent-apache-virtual-hosts/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:14:03 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
		
		<category><![CDATA[Apache HTTP Server]]></category>

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

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=51</guid>
		<description><![CDATA[The group I work with publishes web sites that front relational databases. Our core system infrastructure includes a custom Tomcat/Struts-based web application proxied through an Apache web server. Development of our software involves software engineers working on the web application, web design gurus focused on the web interface, programmers writing CGI scripts and beta testers [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The group I work with publishes web sites that front relational databases. Our core system infrastructure includes a custom Tomcat/Struts-based web application proxied through an Apache web server. Development of our software involves software engineers working on the web application, web design gurus focused on the web interface, programmers writing CGI scripts and beta testers poking at our progress. </p>
<p>To facilitate individualized development, we have a model whereby everyone on the project gets a personal Apache virtual host in which to install the web application and its sundry bits. Some people need more than one virtually hosted web site and sometimes a web site needs to be thrown up for a quick isolated test and then thrown away. </p>
<p>To ease the ups and downs of the virtual hosts, I use wildcard A records in the DNS for our domains. This allows me to quickly configure (and un-configure) an Apache virtual host without having to formally register (and un-register) the host name in the nameserver. So I can configure a name-based virtual host for the Apache web server:</p>
<pre>
&lt;VirtualHost *:80&gt;
    ServerAlias vh1.crashingdaily.com
    DocumentRoot /var/www/vh1.crashingdaily.com/html
&lt;/VirtualHost&gt;
</pre>
<p>and instantly <code>http://vh1.crashingdaily.com/</code> is a valid URL. Of course a real virtual host configuration would be more involved and the development files need to be installed to <code>/var/www/vh1.crashingdaily.com/html</code> but hopefully you get the idea. </p>
<p>Now, what happens if someone attempts to use host name for which there is no configured virtual host - say, they mistype the public production site as, ww.crashingdaily.com? Well, the wildcard A-record will send the user to our development server at IP address of the DNS wildcard and the Apache web server, not finding a virtual host configured for &#8216;ww.crashingdaily.com&#8217;, will use its default virtual host to answer the request. </p>
<p>For name-based virtual hosting, the first virtual host defined during Apache&#8217;s configuration phase catches any request to an unknown server name. This is a problem when an end user trying for our production site mistypes the host - they end up at a password protected development site and, depending on our ever changing vhost configurations, possibly a site unrelated to our project.</p>
<p>To get our production users back on track when they are using a malformed host name, I set up a wildcard Apache virtual host that answers for all host names not explicitly configured.</p>
<pre>
&lt;VirtualHost *:80&gt;
    ServerAlias *.crashingdaily.com
    Redirect 301 / http://www.crashingdaily.com/
&lt;/VirtualHost&gt;
</pre>
<p>This configuration goes on our development server to which wildcard DNS records resolve. Our production sites are on a separate machine so we can&#8217;t just add the ServerAlias to the configuration for the &#8216;www&#8217; virtual host.</p>
<p>This was a successful solution for our public users, they were redirected to the public site, but caused confusion for our developers when they mistyped a host name for a development site or, more commonly, when the host name is typed correctly but the site was not a successfully configured virtual host in Apache. Like our public users, the developers would get redirected to the public production site but, in this case, that is not the desired action. And because the production site frequently looks like the development site, it is not immediately clear what has happened.</p>
<p>I needed to make the wildcard virtual host return a real message to all users, developer or public. I wanted to keep the host exclusively virtual with no physical files on the server. I came up with the following.</p>
<pre>
&lt;VirtualHost *:80&gt;
    ServerAlias *.crashingdaily.com
    Redirect 404 /
    ErrorDocument 404 &quot;No such site. Check the URL speling. Our main site is \
                       &lt;a href=&#39;http://crashingdaily.com/&#39;&gt;http://crashingdaily.com/&lt;/a&gt;&quot;
&lt;/VirtualHost&gt;
</pre>
<p>With this configuration all requests to the wildcard virtual hosts are remapped by the <code>Redirect</code> rule to trigger a HTTP response of <code>404 Not Found</code>. The configuration also specifies the custom <code>ErrorDocument</code> to return to the client when a 404 error is encountered.</p>
<p>Now when a developer or public user accesses a non-existent website within our domain they get a clear indication of the problem rather than being transparently redirected to another, possibly unintended, site.</p>
<h4>Related:</h4>
<p><a href="http://httpd.apache.org/docs/2.0/mod/mod_alias.html">Apache mod_alias</a> - provides the Redirect rule.<br />
<a href="http://www.iab.org/documents/docs/2003-09-20-dns-wildcards.html">Architectural Concerns on the use of DNS Wildcards</a></p>
<hr />
<i>(Our real hosts and IP addresses have been changed for this posting to protect my ass.)</i></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crashingdaily.wordpress.com/51/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crashingdaily.wordpress.com/51/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&blog=744507&post=51&subd=crashingdaily&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2008/03/31/steering-users-away-from-nonexistent-apache-virtual-hosts/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/crashingdaily-128.jpg" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
		<item>
		<title>Rude awakening</title>
		<link>http://crashingdaily.wordpress.com/2008/03/21/rude-awakening/</link>
		<comments>http://crashingdaily.wordpress.com/2008/03/21/rude-awakening/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 21:07:18 +0000</pubDate>
		<dc:creator>crashingdaily</dc:creator>
		
		<category><![CDATA[Linux]]></category>

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

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

		<guid isPermaLink="false">http://crashingdaily.wordpress.com/?p=50</guid>
		<description><![CDATA[BASH Cures Cancer has yet another interesting post this week. This one, entitled &#8220;Command Substitution and Exit Status&#8220;, leverages the exit status returned from a BASH sub-shell. That alone is a useful tip but what tickled me was the author&#8217;s trick of shortening the delay in a running loop by starting a newer, shorter sleep [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://bashcurescancer.com">BASH Cures Cancer</a> has yet another interesting post this week. This one, entitled &#8220;<i><a href="http://bashcurescancer.com/command-substitution-and-exit-status.html">Command Substitution and Exit Status</a></i>&#8220;, leverages the exit status returned from a BASH sub-shell. That alone is a useful tip but what tickled me was the author&#8217;s trick of shortening the delay in a running loop by starting a newer, shorter sleep loop that kills off the longer-running sleep process. Clever. The thought of dueling shell processes - &#8220;I&#8217;m going to sleep for a minute.&#8221;, &#8220;Oh, no you&#8217;re not!&#8221; - makes me chuckle. Sigh. I am easily amused.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/crashingdaily.wordpress.com/50/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/crashingdaily.wordpress.com/50/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/crashingdaily.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/crashingdaily.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/crashingdaily.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/crashingdaily.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/crashingdaily.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/crashingdaily.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/crashingdaily.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/crashingdaily.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/crashingdaily.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/crashingdaily.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=crashingdaily.wordpress.com&blog=744507&post=50&subd=crashingdaily&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://crashingdaily.wordpress.com/2008/03/21/rude-awakening/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/crashingdaily-128.jpg" medium="image">
			<media:title type="html">crashingdaily</media:title>
		</media:content>
	</item>
	</channel>
</rss>