<?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>Nuclear Rooster</title>
	<atom:link href="http://dev.nuclearrooster.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.nuclearrooster.com</link>
	<description></description>
	<lastBuildDate>Wed, 03 Mar 2010 07:03:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>&#8220;Easy Product Slideshows&#8221; Shopify app</title>
		<link>http://dev.nuclearrooster.com/2010/03/02/easy-product-slideshows-shopify-app/</link>
		<comments>http://dev.nuclearrooster.com/2010/03/02/easy-product-slideshows-shopify-app/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 07:31:57 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=249</guid>
		<description><![CDATA[While working on RaRu Design&#8217;s website, we wanted a simple Flash slideshow that would rotate through certain product images.  I whipped one up in Flex that suited our needs.  It was a little wonky, using a alternate Liquid template to render the Product objects in JSON, which could then be read by the [...]]]></description>
			<content:encoded><![CDATA[<p>While working on <a href="http://www.rarudesign.com">RaRu Design&#8217;s website</a>, we wanted a simple Flash slideshow that would rotate through certain product images.  I whipped one up in Flex that suited our needs.  It was a little wonky, using a alternate Liquid template to render the Product objects in JSON, which could then be read by the Flash.  Looking around at Shopify&#8217;s API, I decided to attempt a quick app to streamline the slideshow.</p>
<p><a href="http://shopify-slideshows.heroku.com/">This</a> is what I came up with.  It&#8217;s simple to use, inexpensive, and flexible enough to work for different clients.  You can customize the slideshow, changing the slide duration, transition effects, tooltips and more.</p>
<div align="center">
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"    id="Main2" width="200px" height="200px"    codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="http://shopify-slideshows.heroku.com/slideshow.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="flashvar" value="url=http://shopify-slideshows.heroku.com/slideshows/example.json&#038;debug=false" /><param name="allowScriptAccess" value="always" /><embed src="http://shopify-slideshows.heroku.com/slideshow.swf" id="Main" quality="high" bgcolor="#ffffff"      width="200px" height="200px" name="Main" align="middle"      play="true"      loop="false"      quality="high"      flashvars="url=http://shopify-slideshows.heroku.com/slideshows/example.json&#038;debug=false"      allowScriptAccess="always"      type="application/x-shockwave-flash"      pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object>
</div>
<h3>Development</h3>
<p>The development process was pretty smooth, owing a lot to Shopify&#8217;s <a href="http://github.com/shopify/shopify_app">rails app generator</a>.  I was a little dubious of their <a href="http://www.youtube.com/watch?v=OvzmAi3VhDQ">&#8220;Build a Shopify app in 8 minutes&#8221;</a> video, but after I actually followed the directions it went speedily.</p>
<p>In addition to the generator, there is <a href="http://github.com/Shopify/shopify_api/"> the Shopify API client for ruby</a> and a nice set of <a href="http://api.shopify.com/>documentation</a>.</p>
<p>While I was trying new things, I decided to use the MongoDB NOSQL datastore for the application.  I was lucky enough to get a beta invite from <a href="http://mongohq.com">MongoHQ</a>, who run a hosted MongoDB platform.  I wanna write up the whole MongoDB bit, but suffice it to say that it went well, and MongoHQ was great to work with when I has support issues.</p>
<h3>Shopify Application Approval Process</h3>
<p>There has been plenty of <a href="http://www.google.com/search?q=apple+app+store+approval+sucks">negative buzz</a> about Apple&#8217;s AppStore, basically coming down to longer release cycles and finicky reviewers, so I was interested to see how Shopify handled this.  The slidehow app is pretty tiny, and very different than most of the other existing apps in the Shopify app inventory.  There are many integrated shipping solutions, order fulfillment services, accounting platforms, and that sort of thing.  There are very few UI apps.</p>
<p> My app, to my surprise, was approved in under 24 hours.  The Shopify team pointed out two bugs to fix, and after those were done, the app was approved.  I was so excited I tried the app out on the RaRu Design site immediately, only to find a few show-stopper bugs.  After fixing those, and getting some good customer feedback, I was off to the races.</p>
<p>I thought I would be a hundredaire within the month, but it took about 5 product installs to realize that I actually had to code the billing charges.  Once I realized my mistake, I added the necessary snippets of code to actually charge my customers.  </p>
<h3>Bad Review</h3>
<p>Within a day of publishing the app, I received a rock-bottom 1-star review. Ugg.  The reviewer didn&#8217;t find fault with the slideshow app; they were more concerned with that Shopify had let through an app that was &#8216;faceless&#8217; and didn&#8217;t really seem to have anyone or any company behind it.  It is a little scary; giving API access in Shopify is currently all-or-nothing (read or read-write actually).  Even if an app only needs read access to product images, it is given read access to customers and orders.  I worked with the reviewer to provide some feedback to Shopify that would keep both customers and developers happy with the platform.</p>
<h3>Stricter App Guidelines</h3>
<p>A few days ago, I received an email from the same fellow who approved my app in the beginning.  He asked me to remove all references to Shopify from the branding of my app.  This makes sense.  I unimaginatively named my app &#8216;Shopify Product Slideshows&#8217; at first (to be migrated to an equally unimaginative &#8216;Easy Product Slideshows&#8217;).  Even the Shopify rails generator includes Shopify branding (at the time of writing), which will not pass the approval process.  I understand that they may not have thought of everything up front, but it would be nice if the requirements were spelled out somewhere. </p>
<h3>Overview</h3>
<p>I dig Shopify&#8217;s API, their open-source mindset, and their quick+painless approval process.  For the sake of the customers and developers, however, they could step back and think it through a little bit more.  Specifically, more thorough QA, thinking through the branding requirements ahead of time, and more granular API access would be nice. </p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2010/03/02/easy-product-slideshows-shopify-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending Munin Alerts to Jabber/XMPP</title>
		<link>http://dev.nuclearrooster.com/2010/01/08/hooking-up-munin-alerts-to-jabberxmpp/</link>
		<comments>http://dev.nuclearrooster.com/2010/01/08/hooking-up-munin-alerts-to-jabberxmpp/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 19:22:43 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jabber]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[munin]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[xmpp]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=216</guid>
		<description><![CDATA[What
Have munin send alerts to a Jabber server.

Why
Email is great for interpersonal communication, but it doesn't make sense as the medium for every communication that crosses your path.  It is confusing to interleave emails from people (that need responses) with email alerts sent from servers (which never need an email response).  While both [...]]]></description>
			<content:encoded><![CDATA[<h2>What</h2>
<p>Have <a href="http://munin.projects.linpro.no/">munin</a> send alerts to a Jabber server.<br />
<img src="http://dev.nuclearrooster.com/wp-content/uploads/2010/01/Screen-shot-2010-01-08-at-10.56.10-AM.png" alt="Munin Alerts on Jabber" title="Munin Alerts on Jabber" width="639" height="442" class="aligncenter size-full wp-image-219" /></p>
<h2>Why</h2>
<p>Email is great for interpersonal communication, but it doesn't make sense as the medium for every communication that crosses your path.  It is confusing to interleave emails from people (that need responses) with email alerts sent from servers (which never need an email response).  While both of these messages are important to know about, they are different forms of communication, and should be treated a such.  </p>
<p>An XMPP server is a good way to handle alerts because 1) it is sandboxed from other communication (i.e. email), 2) it integrates easily with human workflows (IM), 3) other people and programs can easily listen in.</p>
<h2>How</h2>
<p>Here's the gameplan:</p>
<ol>
<li><a href="#jabber_server">Setup Jabber server (PartyChatApp)</a></li>
<li><a href="#jabber_client">Setup Jabber client (Gmail)</a></li>
<li><a href="#jabber_script">Create ruby Jabber script</a></li>
<li><a href="#munin_config">Configure Munin</a></li>
<li><a href="#munin_test">Test Munin</a></li>
</ol>
<p><a name="jabber_server"></p>
<h3>1. Setup Jabber server (PartyChatApp)</h3>
<p><img src="http://dev.nuclearrooster.com/wp-content/uploads/2010/01/partychat.png" alt="partychat" title="partychat" height="75" class="alignleft size-full wp-image-222" style="float:left"/></p>
<p>The first step is to setup a Jabber server that you can send messages to.  <a href="http://partychapp.appspot.com/">Party Chat</a> is a simple and free way to create a Jabber enabled chat room.  Party Chat has several <a href="http://partychapp.appspot.com/#nowwhat">cool and silly features</a>.  Most importantly, Party Chat will persist the messages, so even if you log out for the night, the full transcript will be available to you when you log back on.  This is essential for keeping track of whats going on.</p>
<p>Anyway, so create a PartyChat room with a name you'll remember.</p>
<p><br  style="clear:both"/><br />
<a name="jabber_client"></p>
<h3>2. Setup Jabber client (Gmail)</h3>
<p>Next, you need a Jabber account somewhere.  Gmail is easy to setup and free.  All you need is a Gmail username and password.  Check.</p>
<p><a name="jabber_script"></p>
<h3>3. Create ruby Jabber script</h3>
<p>Up next, we'll create a ruby script that will take input from STDIN and send it to a Jabber server.  Using the 'xmpp4r-simple' gem, this is indeed simple.  I'm also going to prepend the timestamp to the message, and strip out newlines so it fits nicely on a single line.  </p>
<div class="igBar"><span id="lcode-4"><a href="#" onclick="javascript:showPlainTxt('code-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-4">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#!/usr/bin/env ruby</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">require <span style="color:#CC0000;">'timeout'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">require <span style="color:#CC0000;">'rubygems'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">require <span style="color:#CC0000;">'xmpp4r-simple'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">message = <span style="color:#CC0000;">""</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># Timeout in case script is called without anything on STDIN</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Timeout::<span style="">timeout</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">5</span><span style="color:#006600; font-weight:bold;">&#41;</span> do</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; STDIN.<span style="">each_line</span> do |line|</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; message &lt;&lt;<span style="color:#CC0000;">"#{line}<span style="color:#000099; font-weight:bold;">\n</span>"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; end</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">end</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">im = Jabber::<span style="">Simple</span>.<span style="">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"some_user@gmail.com"</span>, <span style="color:#CC0000;">"password"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">q = im.<span style="">deliver</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"my_munin_alerts@partychapp.appspotchat.com"</span>, <span style="color:#CC0000;">"#{Time.now}: #{message.gsub("</span>\n<span style="color:#CC0000;">","</span><span style="color:#CC0000;">")}"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># wait a little for relay to complete</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sleep<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<ul>
<li><a href="http://xmpp4r-simple.rubyforge.org/">xmpp4r-simple</a></li>
<li><a href="http://home.gna.org/xmpp4r/">xmpp4r</a></li>
</ul>
<p><a name="munin_config"></p>
<h3>4. Configure Munin</h3>
<p>Configuring Munin is straight-forward.  You can continue to send any email alerts as you are and simply add the Jabber notifications as well.  Edit the Munin config file (/etc/munin/munin.conf) with the following:</p>
<div class="igBar"><span id="lcode-5"><a href="#" onclick="javascript:showPlainTxt('code-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-5">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">contact.<span style="">jabber_alert</span>.<span style="">command</span> /etc/munin/jabber.<span style="">rb</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">contact.<span style="">jabber_alert</span>.<span style="">always_send</span> warning critical </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Here are some additional resources about Munin alerts:</p>
<ul>
<li><a href="http://munin.projects.linpro.no/wiki/HowToContact">Munin - How to Contact</a></li>
<li><a href="http://munin.projects.linpro.no/wiki/MuninAlertVariables">Munin- Alert Variables</a></li>
</ul>
<p><a name="munin_test"></p>
<h3>5. Test Munin</h3>
<p>In order to test munin, you can make a dummy plugin that will always fail.  Put this in with your other plugins at /etc/munin/plugins, or wherever else.  Make sure it is executable, and then restart munin-node with '/etc/init.d/munin-node restart'.</p>
<div class="igBar"><span id="lcode-6"><a href="#" onclick="javascript:showPlainTxt('code-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-6">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#!/usr/bin/ruby</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if ARGV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#CC0000;">'config'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; puts <span style="color:#CC0000;">"value.label Some Label"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; puts <span style="color:#CC0000;">"value.warning 100"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; puts <span style="color:#CC0000;">"value.critical 150"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">else</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; puts <span style="color:#CC0000;">"value.value 200"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">end </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now, wait a few minutes, and you should have those Munin alerts popping up in the PartyChat window. </p>
<h3>Bonus Round</h3>
<p>See how you can use some of PartyChat's features to add some more value to your alert system.  Maybe check the messages for 'Critical' or 'Warning' and use PartyChat's plusplusbot to keep track of how many warnings/criticals have been issued.</p>
<p>Or, pass Munin variables to the ruby script in order to make the message prettier.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2010/01/08/hooking-up-munin-alerts-to-jabberxmpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better know a HTTP Response Code: The Fightin&#8217; 307</title>
		<link>http://dev.nuclearrooster.com/2009/12/11/better-know-a-http-response-code-the-fightin-307/</link>
		<comments>http://dev.nuclearrooster.com/2009/12/11/better-know-a-http-response-code-the-fightin-307/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 08:33:50 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=203</guid>
		<description><![CDATA[In tonight's episode of "Better know a HTTP Response Code" we'll be checking out "307 Temporary Redirect."  This ain't your mother's temporary redirect (assuming she primarily uses the more common "302 Temporary Redirect").  The good ol' w3c has this to say in their HTTP 1.1 spec thingy:

10.3.8 307 Temporary Redirect
The requested resource resides [...]]]></description>
			<content:encoded><![CDATA[<p>In tonight's episode of "Better know a HTTP Response Code" we'll be checking out "307 Temporary Redirect."  This ain't your mother's temporary redirect (assuming she primarily uses the more common "302 Temporary Redirect").  The good ol' w3c has this to say in their <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP 1.1 spec thingy</a>:</p>
<blockquote><p>
10.3.8 307 Temporary Redirect</p>
<p>The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.</p>
<p>The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s) , since many pre-HTTP/1.1 user agents do not understand the 307 status. Therefore, the note SHOULD contain the information necessary for a user to repeat the original request on the new URI.</p>
<p>If the 307 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
</p></blockquote>
<p>Blahdity blah blah.  So while 302's force the redirect location to be requested with a GET, 307's are able to redirect with a POST request.  Buuut, there are a couple of caveats.  1) Redirection of POSTs should not be automatic, due to the security issue, and 2) in real life not everybody actually knows how to handle a 307 *Ahem*, I'm looking at you Internet Explore.   </p>
<h2>Example</h2>
<p>Here's a quick PHP example to get us going.</p>
<div class="igBar"><span id="lcode-8"><a href="#" onclick="javascript:showPlainTxt('code-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-8">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#40;</span>isset<span style="color:#006600; font-weight:bold;">&#40;</span>$_GET<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">'do_a_redirect'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; header<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"HTTP/1.1 307 Temporary Redirect"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; header<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#CC0000;">'Location: http://127.0.0.1:1234/pluggd/upload_redirect/form.php?upload_that_file'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> ;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else if <span style="color:#006600; font-weight:bold;">&#40;</span>isset<span style="color:#006600; font-weight:bold;">&#40;</span>$_GET<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">'upload_that_file'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; if <span style="color:#006600; font-weight:bold;">&#40;</span>$_FILES<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"file"</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"error"</span><span style="color:#006600; font-weight:bold;">&#93;</span>&gt; <span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; echo <span style="color:#CC0000;">"Error: "</span> . $_FILES<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"file"</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"error"</span><span style="color:#006600; font-weight:bold;">&#93;</span> . <span style="color:#CC0000;">"&lt;br /&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; else</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; echo <span style="color:#CC0000;">"Upload: "</span> . $_FILES<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"file"</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"name"</span><span style="color:#006600; font-weight:bold;">&#93;</span> . <span style="color:#CC0000;">"&lt;br /&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; echo <span style="color:#CC0000;">"Type: "</span> . $_FILES<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"file"</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"type"</span><span style="color:#006600; font-weight:bold;">&#93;</span> . <span style="color:#CC0000;">"&lt;br /&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; echo <span style="color:#CC0000;">"Size: "</span> . <span style="color:#006600; font-weight:bold;">&#40;</span>$_FILES<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"file"</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"size"</span><span style="color:#006600; font-weight:bold;">&#93;</span> / <span style="color:#800000;color:#800000;">1024</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#CC0000;">" Kb&lt;br /&gt;<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; echo <span style="color:#CC0000;">"Stored in: "</span> . $_FILES<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"file"</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">"tmp_name"</span><span style="color:#006600; font-weight:bold;">&#93;</span> . <span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> else <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;html&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;body&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;form action=<span style="color:#CC0000;">"form.php?do_a_redirect"</span> method=<span style="color:#CC0000;">"post"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">enctype=<span style="color:#CC0000;">"multipart/form-data"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;label for=<span style="color:#CC0000;">"file"</span>&gt;Filename:&lt;/label&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;input type=<span style="color:#CC0000;">"file"</span> name=<span style="color:#CC0000;">"file"</span> id=<span style="color:#CC0000;">"file"</span> /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;input type=<span style="color:#CC0000;">"submit"</span> name=<span style="color:#CC0000;">"submit"</span> value=<span style="color:#CC0000;">"Submit"</span> /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/form&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/body&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/html&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php <span style="color:#006600; font-weight:bold;">&#125;</span> ?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Rockin' it with CURL:</p>
<pre>
nick-stielaus-computer-3:~ nick$ curl -L -F "file=@Desktop/shortVids/sheep.flv" http://127.0.0.1:1234/pluggd/upload_redirect/form.php?do_a_redirect
Upload: sheep.flv
Type: application/octet-stream
Size: 174.1796875 Kb
Stored in: /private/var/tmp/phpRYQVYc
</pre>
<p>And FireFox's nice message:</p>
<div align="center">
<div id="attachment_204" class="wp-caption aligncenter" style="width: 494px"><img src="http://dev.nuclearrooster.com/wp-content/uploads/2009/12/307_ff.png" alt="How FireFox handles a HTTP 1.1 307 Response" title="307_ff" width="484" height="173" class="size-full wp-image-204" /><p class="wp-caption-text">How FireFox handles a HTTP 1.1 307 Response</p></div>
</div>
<h3>Credits</h3>
<p>A <a href="http://stackoverflow.com">Stack Overflow</a> discussion <a href="http://stackoverflow.com/questions/46582/response-redirect-with-post-instead-of-get">got me going</a> on this.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2009/12/11/better-know-a-http-response-code-the-fightin-307/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick download benchmarks with CURL</title>
		<link>http://dev.nuclearrooster.com/2009/12/07/quick-download-benchmarks-with-curl/</link>
		<comments>http://dev.nuclearrooster.com/2009/12/07/quick-download-benchmarks-with-curl/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 18:50:02 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=199</guid>
		<description><![CDATA[PLAIN TEXT
CODE:




curl --silent -w "Total:&#160; &#160; &#160; &#160; &#160; %{time_total}\nDNS:&#160; &#160; &#160; &#160; &#160; &#160; %{time_namelookup}\nConnect:&#160; &#160; &#160; &#160; %{time_connect}\nPretransfer:&#160; &#160; %{time_pretransfer}\nRedirect:&#160; &#160; &#160; &#160;%{time_redirect}\nStart Transfer: %{time_starttransfer} \n" --output /dev/null google.com 






 That's about all there is to it.  Toss it in your ~/.bash_login thusly:
PLAIN TEXT
CODE:




alias dl='curl --silent -w &#34;Total:&#160; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<div class="igBar"><span id="lcode-12"><a href="#" onclick="javascript:showPlainTxt('code-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-12">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">curl --silent -w <span style="color:#CC0000;">"Total:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; %{time_total}<span style="color:#000099; font-weight:bold;">\n</span>DNS:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; %{time_namelookup}<span style="color:#000099; font-weight:bold;">\n</span>Connect:&nbsp; &nbsp; &nbsp; &nbsp; %{time_connect}<span style="color:#000099; font-weight:bold;">\n</span>Pretransfer:&nbsp; &nbsp; %{time_pretransfer}<span style="color:#000099; font-weight:bold;">\n</span>Redirect:&nbsp; &nbsp; &nbsp; &nbsp;%{time_redirect}<span style="color:#000099; font-weight:bold;">\n</span>Start Transfer: %{time_starttransfer} <span style="color:#000099; font-weight:bold;">\n</span>"</span> --output /dev/null google.<span style="">com</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p> That's about all there is to it.  Toss it in your ~/.bash_login thusly:</p>
<div class="igBar"><span id="lcode-13"><a href="#" onclick="javascript:showPlainTxt('code-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-13">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">alias dl=<span style="color:#CC0000;">'curl --silent -w &quot;Total:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; %{time_total}<span style="color:#000099; font-weight:bold;">\n</span>DNS:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; %{time_namelookup}<span style="color:#000099; font-weight:bold;">\n</span>Connect:&nbsp; &nbsp; &nbsp; &nbsp; %{time_connect}<span style="color:#000099; font-weight:bold;">\n</span>Pretransfer:&nbsp; &nbsp; %{time_pretransfer}<span style="color:#000099; font-weight:bold;">\n</span>Redirect:&nbsp; &nbsp; &nbsp; &nbsp;%{time_redirect}<span style="color:#000099; font-weight:bold;">\n</span>Start Transfer: %{time_starttransfer} <span style="color:#000099; font-weight:bold;">\n</span>&quot; --output /dev/null '</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And you can access it like this:</p>
<div class="igBar"><span id="lcode-14"><a href="#" onclick="javascript:showPlainTxt('code-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-14">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nick-stielaus-computer-<span style="color:#800000;color:#800000;">3</span>:~ nick$ dl google.<span style="">com</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Total:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">205</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">DNS:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">053</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Connect:&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">126</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Pretransfer:&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">126</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Redirect:&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">000</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Start Transfer: <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">205</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nick-stielaus-computer-<span style="color:#800000;color:#800000;">3</span>:~ nick$ dl bbc.<span style="">co</span>.<span style="">uk</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Total:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">614</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">DNS:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">221</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Connect:&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">414</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Pretransfer:&nbsp; &nbsp; <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">414</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Redirect:&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">000</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Start Transfer: <span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">614</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2009/12/07/quick-download-benchmarks-with-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Skipping gem documentation: configure .gemrc to speed up gem installation</title>
		<link>http://dev.nuclearrooster.com/2009/12/06/skipping-gem-documentation-configure-gemrc-to-speed-up-gem-installation/</link>
		<comments>http://dev.nuclearrooster.com/2009/12/06/skipping-gem-documentation-configure-gemrc-to-speed-up-gem-installation/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 19:06:42 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=194</guid>
		<description><![CDATA[The .gemrc file can specify default options for the 'gem' executable, and since I haven't ever looked up ri or rdoc on my local system, I decided to turn these off by default.  I've been adding the '--no-ri' and '--no-rdoc' flags for a while, but my laziness just got the better of me.
Turning of [...]]]></description>
			<content:encoded><![CDATA[<p>The .gemrc file can specify default options for the 'gem' executable, and since I haven't ever looked up ri or rdoc on my local system, I decided to turn these off by default.  I've been adding the '--no-ri' and '--no-rdoc' flags for a while, but my <a href="http://www.hhhh.org/wiml/virtues.html">laziness just got the better of me</a>.</p>
<p>Turning of the RI and Rdoc documentation speeds up gem installs.  Here, installing capistrano without docs takes about 11 seconds, whereas installing the documenation more than doubles the time to about 24 seconds.</p>
<div class="igBar"><span id="lcode-18"><a href="#" onclick="javascript:showPlainTxt('code-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-18">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nicks-computer-<span style="color:#800000;color:#800000;">3</span>:snap nick$ time sudo gem install capistrano --no-ri --no-rdoc</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Successfully installed capistrano-<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">5</span>.<span style="color:#800000;color:#800000;">10</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">1</span> gem installed</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">real&nbsp; &nbsp; 0m11.480s</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">user&nbsp; &nbsp; 0m7.262s</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sys&nbsp;0m0.374s</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nicks-computer-<span style="color:#800000;color:#800000;">3</span>:snap nick$ time sudo gem install capistrano --ri --rdoc</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Successfully installed capistrano-<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">5</span>.<span style="color:#800000;color:#800000;">10</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">1</span> gem installed</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Installing ri documentation for capistrano-<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">5</span>.<span style="color:#800000;color:#800000;">10</span>...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">Installing</span> RDoc documentation for capistrano-<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">5</span>.<span style="color:#800000;color:#800000;">10</span>...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">real</span>&nbsp; &nbsp; 0m23.974s</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">user&nbsp; &nbsp; 0m18.956s</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sys&nbsp;0m0.706s </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If you want to turn off the documentation options, add this line to your ~/.gemrc file:</p>
<div class="igBar"><span id="lcode-19"><a href="#" onclick="javascript:showPlainTxt('code-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-19">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">gem: --no-ri --no-rdoc </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>So that it looks something like this:</p>
<div class="igBar"><span id="lcode-20"><a href="#" onclick="javascript:showPlainTxt('code-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-20">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nicks-computer-<span style="color:#800000;color:#800000;">3</span>:snap nick$ cat ~/.<span style="">gemrc</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">--- </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:bulk_threshold: <span style="color:#800000;color:#800000;">1000</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:backtrace: false</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">gemcutter_key: XXXXX</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">gem: --no-ri --no-rdoc</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:benchmark: false</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:verbose: true</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:update_sources: true</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:sources: </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">- http:<span style="color:#FF9933; font-style:italic;">//gems.rubyforge.org/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">- http:<span style="color:#FF9933; font-style:italic;">//gems.opscode.com </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2009/12/06/skipping-gem-documentation-configure-gemrc-to-speed-up-gem-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking gzip/deflate server responses with CURL</title>
		<link>http://dev.nuclearrooster.com/2009/11/08/checking-gzipdeflate-server-responses-with-curl/</link>
		<comments>http://dev.nuclearrooster.com/2009/11/08/checking-gzipdeflate-server-responses-with-curl/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 01:23:20 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[linux / os x]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=185</guid>
		<description><![CDATA[Nginx and Apache can gzip/deflate content as it is leaving the server, which decreases the amount of data that has to cross the wire and therefor speeds up communication with the server.  This can't be turned on for all requests, however, because not all clients know how to decompress the responses. Most commonly, the [...]]]></description>
			<content:encoded><![CDATA[<p>Nginx and Apache can gzip/deflate content as it is leaving the server, which decreases the amount of data that has to cross the wire and therefor speeds up communication with the server.  This can't be turned on for all requests, however, because not all clients know how to decompress the responses. Most commonly, the 'Accept-Encoding' header of the HTTP 1.1 specification is sent with a value of 'gzip,deflate' to request compressed responses.</p>
<p>Testing this compression can be a little tricky, because often clients handle it so seamlessly you may not know it ever happens.  Additionally, server configuration may further complicate testing, compressing data for some requests and not others, i.e. Nginx's <a href="http://wiki.nginx.org/NginxHttpGzipModule#gzip_http_version">gzip_http_version</a> directive, which may only serve compressed data for HTTP 1.1 requests. </p>
<p>Curl provides a simple tool for checking server responses.</p>
<p>First, a few curl  arguments that will come in handy:</p>
<ul>
<li>"--silent" prevents curl from showing progress meter</li>
<li>"--write-out 'size_download=%{size_download}\n'" instructs curl to print out the download size</li>
<li>"--output" instructs curl to throw away the output, sending it to /dev/null</li>
</ul>
<p>Using these arguments, we can make a simple request for a path on the server:</p>
<div class="igBar"><span id="lcode-24"><a href="#" onclick="javascript:showPlainTxt('code-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-24">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ns:~ nick$ curl http:<span style="color:#FF9933; font-style:italic;">//example.com/Service?wsdl --silent --write-out &quot;size_download=%{size_download}\n&quot; --output /dev/null</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">size_download=<span style="color:#800000;color:#800000;">31032</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Here, you can the response was 31032 bytes.  Next up, lets make the same request, this time adding the Accept-Encoding header to ask for compressed content.</p>
<div class="igBar"><span id="lcode-25"><a href="#" onclick="javascript:showPlainTxt('code-25'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-25">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ns:~ nick$ curl http:<span style="color:#FF9933; font-style:italic;">//example.com/Service?wsdl --silent -H &quot;Accept-Encoding: gzip,deflate&quot; --write-out &quot;size_download=%{size_download}\n&quot; --output /dev/null</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">size_download=<span style="color:#800000;color:#800000;">2553</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nice! This downloaded only 2553 bytes of data, so it the data is definitely being compressed.  Up next, lets try making the request a third time, now making the request a HTTP1.0 request.</p>
<div class="igBar"><span id="lcode-26"><a href="#" onclick="javascript:showPlainTxt('code-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-26">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ns:~ nick$ curl http:<span style="color:#FF9933; font-style:italic;">//example.com/Service?wsdl --silent --http1.0 -H &quot;Accept-Encoding: gzip,deflate&quot; --write-out &quot;size_download=%{size_download}\n&quot; --output /dev/null</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">size_download=<span style="color:#800000;color:#800000;">31032</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This response was not request, which makes sense when using Nginx with the gzip_http_version set to '1.1'.  Additionally, this method can easily be applied to POST requests if you add the appropriate arguments to curl.</p>
<p>References:</p>
<ul>
<li><a href="http://wiki.nginx.org/NginxHttpGzipModule">Nginx Http Gzip Module</a></li>
<li><a href="http://httpd.apache.org/docs/2.2/mod/mod_deflate.html">Apache mod_deflate</a></li>
<li><a href="http://www.howtoforge.com/apache2_mod_deflate">Mod Deflate example/logging</a></li>
<li><a href="http://curl.haxx.se/">Curl homepage</a></li>
<li><a href="http://linux.about.com/od/commands/l/blcmdl1_curl.htm">Curl man page</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2009/11/08/checking-gzipdeflate-server-responses-with-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Murder Turtle</title>
		<link>http://dev.nuclearrooster.com/2009/08/07/murder-turtle/</link>
		<comments>http://dev.nuclearrooster.com/2009/08/07/murder-turtle/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 21:17:42 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=172</guid>
		<description><![CDATA[
Dirty Bird!


]]></description>
			<content:encoded><![CDATA[<div align="center">
<h2>Dirty Bird!</h2>
<p><img src="http://newmedia.funnyjunk.com/pictures/murderturtle.gif">
</div>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2009/08/07/murder-turtle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going to Gem Med School: Open Source ruby projects with Dr. Nic Williams</title>
		<link>http://dev.nuclearrooster.com/2009/08/07/going-to-gem-med-school-open-source-ruby-projects-with-dr-nic-williams/</link>
		<comments>http://dev.nuclearrooster.com/2009/08/07/going-to-gem-med-school-open-source-ruby-projects-with-dr-nic-williams/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 07:11:37 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux / os x]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[runcoderun]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=143</guid>
		<description><![CDATA[Grooving with Dr. Nic, and digging in to some projects
Going with the Flow
Despite my feelings that the title Dr. should be strictly reserved for those that save lives, Dr. Nic Williams does have plenty of good advice to offer (and he offers it in a nice format on his website).  After having made some [...]]]></description>
			<content:encoded><![CDATA[<h1>Grooving with Dr. Nic, and digging in to some projects</h1>
<h2>Going with the Flow</h2>
<p>Despite my feelings that the title Dr. should be strictly reserved for those that save lives, Dr. Nic Williams does have plenty of good advice to offer (and he offers it in a nice format on <a href="http://drnicwilliams.com">his website</a>).  After having made some of the same mistakes and asked the same questions he has, I decided to try out the new and improved open-source project workflow.  There are several things to be achieved from these open-source projects:</p>
<ul>
<li>Have fun</li>
<li>Learn something new</li>
<li>Share code</li>
</ul>
<p>There are also some thing that should be avoided, less favorable outcomes:</p>
<ul>
<li>Write code, but don't go the full 9 yards to distribute + share it</li>
<li>Spend too much time on setup/distribution</li>
<li>Tie yourself down with maintaining your projects (they should set you freeeeee!)</li>
</ul>
<p>Two great presentations can help you achieve these goals, and avoid the pitfalls.  The first is a <a href="http://drnicwilliams.com/2009/07/13/futureruby-talk-living-with-1000-open-source-projects/">a great presentation</a> about what an open-source project should be, what it shouldn't be, and how they can make your life better, not worse.</p>
<p>The next presentation is about how to <a href="http://drnicwilliams.com/2008/12/05/my-rubygems-development-tools-and-workflow/">quickly and effectively distribute and share your projects</a>.</p>
<p>In order to get this all down, the good Dr. describes a workflow and a set of tools for each step.</p>
<ul>
<li>Packaging - <a href="http://rubygems.org">RubyGems</a></li>
<li>SCM - <a href="http://github.com>GitHub</a></li>
<li>Public Repostiroy  -  <a href="http://github.com>GitHub</a></li>
<li>Continuous Integration - <a href="http://runcoderun.com">RunCodeRun</a></li>
<li>Blog/Resume Integration - <a href="http://thinkrelevance.rubyforge.org/runcoderun_badge/">RunCodeRun Sexy Blog Badge</a></li>
</ul>
<h2>The Project</h2>
<p>I decided to write a little ruby wrapper for the 'ddate' command, part of the 'util-linux-ng' package, that convert Georgian dates to Discordian dates.  Why?  Because I like it, and if you are going to pick a project to learn on, it might as well be ridiculous.  I got attached enough as it was to this project, even though I don't think anybody could come up with an excuse to use Discordian dates, let alone happen to be using ruby.</p>
</h2>
<p>Snafoos</h2>
<p>One thing that started to bug my is the gem, class, module, and github repository names.  It seems simple enough, but sometimes you are so excited to get you idea down in code that you rush through this first step.  It will be around for a while, and is kind of a pain to change once you get it all set up.  So take a few minutes and think about a name. One without WeIRd caps or anything that might annoy you in the future.</p>
<p>I also found newgem to be a little wonky.  It a nice tool to have around, but I think (rightly so) it is tailored to Dr. Nic's workflows, and might not work for everybody.  </p>
<p>Lastly, I found myself wresting with Hoe.  The 'rake pacakge' task was failing if I added the Hoe require statement, and runcoderun was failing without the statement.  That brings me to a little tangent.  I didn't really dig into what was going on there, but this is an example of something that is unexpectedly not idempotent; you should be able to require and require and require, then run some code and everything should be fine and dandy.  I'm not sure how or why requiring Hoe (when it is clearly used, anyway) would break anything, and it almost annoys me enough to find out.  Almost.</p>
<h2>Good stuff</h2>
<p>I like <a href="http://www.runcoderun.com">RunCodeRun</a>.  It is simple continuous integration that makes sense.  I also like the <a href="http://thinkrelevance.rubyforge.org/runcoderun_badge/">blog badge</a>, although it currently looks horrible on my blog.</p>
<h2>Stuff I'll add</h2>
<p>Speaking of blog badges, I want to see if I can get the <a href="http://wordpress.org/extend/plugins/github-widget/">github projects</a> blog badge working.  Associating myself with a project is another step for creating a fully-rounded project.  This badge helps integrate that step right into the existing workflow.</p>
<p>For learning projects, I plan on adding some non-standard notes to the README, including sections about what I learned and what would have done differently.  Open source the code, and open source the learning process.  Its not like I have any customers to scare away with honest comments.</p>
<p>As Nic Williams said, "Don't attach your self-worth to your code - your code probably isn't that good."  Its true.  I am a better software developer than I am a coder, and I aim to be.  You can write code quite a few different ways and it all compiles down to the same thing.  To me, nailing the workflow and the tools is the hard part, and the part that deserves the most attention.  </p>
<p>Working with software, your code will always improve and you will keep learning new tricks.  But too many people let their workflow and tool-set become stagnant, which can leave you further behind than knowing a few extra tricks in this language or that one.   </p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2009/08/07/going-to-gem-med-school-open-source-ruby-projects-with-dr-nic-williams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File size discrepency for empty files</title>
		<link>http://dev.nuclearrooster.com/2009/08/06/file-size-discrepency-for-empty-files/</link>
		<comments>http://dev.nuclearrooster.com/2009/08/06/file-size-discrepency-for-empty-files/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 06:28:48 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=162</guid>
		<description><![CDATA[I noticed a peculiar discrepancy between the size of an empty file in different operating systems.  Not sure what is going on yet, but for some reason RHEL 4 boxes seem to think that an empty file is 4 kilobytes, where OS X and Ubuntu think it is 0 bytes.  Hmmm.  
Not [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed a peculiar discrepancy between the size of an empty file in different operating systems.  Not sure what is going on yet, but for some reason RHEL 4 boxes seem to think that an empty file is 4 kilobytes, where OS X and Ubuntu think it is 0 bytes.  Hmmm.  </p>
<p>Not sure why this is, but for me there was a pretty easy work around to checking for a 0 byte file; start reading the lines from the file and break after you read the first line to tell that the file is not empty.</p>
<p>OS X 10.5.7</p>
<div class="igBar"><span id="lcode-30"><a href="#" onclick="javascript:showPlainTxt('code-30'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-30">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nicks-computer-<span style="color:#800000;color:#800000;">3</span>:~ nick$ touch test.<span style="">txt</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nicks-computer-<span style="color:#800000;color:#800000;">3</span>:~ nick$ du test.<span style="">txt</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp;test.<span style="">txt</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ubuntu 8.0.4</p>
<div class="igBar"><span id="lcode-31"><a href="#" onclick="javascript:showPlainTxt('code-31'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-31">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nick@ec2-<span style="color:#800000;color:#800000;">99</span>-<span style="color:#800000;color:#800000;">999</span>-<span style="color:#800000;color:#800000;">99</span>-<span style="color:#800000;color:#800000;">999</span>:~$ touch test.<span style="">txt</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nick@ec2-<span style="color:#800000;color:#800000;">99</span>-<span style="color:#800000;color:#800000;">999</span>-<span style="color:#800000;color:#800000;">99</span>-<span style="color:#800000;color:#800000;">999</span>:~$ du test.<span style="">txt</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">0</span>&nbsp; &nbsp;test.<span style="">txt</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Red Hat Enterprise Linux ES release 4 (Nahant Update 6)</p>
<div class="igBar"><span id="lcode-32"><a href="#" onclick="javascript:showPlainTxt('code-32'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-32">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>nick@chloe ~<span style="color:#006600; font-weight:bold;">&#93;</span>$ touch test.<span style="">txt</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>nick@chloe ~<span style="color:#006600; font-weight:bold;">&#93;</span>$ du test.<span style="">txt</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">4</span>&nbsp; &nbsp;test.<span style="">txt</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2009/08/06/file-size-discrepency-for-empty-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mr T. Pitties the Fool who is still using RHEL 4.</title>
		<link>http://dev.nuclearrooster.com/2009/08/04/mr-t-pitties-the-fool-who-is-still-using-rhel-4/</link>
		<comments>http://dev.nuclearrooster.com/2009/08/04/mr-t-pitties-the-fool-who-is-still-using-rhel-4/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 14:54:37 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=146</guid>
		<description><![CDATA[

Despite the fact that RHEL4 was initially release on the first day of my life I could legally drink a brew, or maybe because of that fact, I am bitter about RHEL 4.  A single dog year is comparable to 7 human years, right?  So what is one linux year?  Should it [...]]]></description>
			<content:encoded><![CDATA[<div align="center">
<div id="attachment_147" class="wp-caption aligncenter" style="width: 310px"><img src="http://dev.nuclearrooster.com/wp-content/uploads/2009/07/pitty_the_fool-300x293.jpg" alt="Mr T Pitties the fool who is still using RHEL4" title="pitty_the_fool" width="300" height="293" class="size-medium wp-image-147" /><p class="wp-caption-text">Mr T Pitties the fool who is still using RHEL4</p></div>
</div>
<p>Despite the fact that RHEL4 was initially release on the first day of my life I could legally drink a brew, or maybe because of that fact, I am bitter about RHEL 4.  A single dog year is comparable to 7 human years, right?  So what is one linux year?  Should it be measured in the man-hours of code committed to the kernel and distribution?  Should it be measured in man-hours of time wasted by the meat-cloud trying to do simple tasks like building and installing libraries?  If you're lucky, you aren't inclined to try to measure it at all.</p>
<div class="igBar"><span id="lcode-34"><a href="#" onclick="javascript:showPlainTxt('code-34'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-34">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>nick@server ~<span style="color:#006600; font-weight:bold;">&#93;</span>$ cat /etc/redhat-release </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Red Hat Enterprise Linux ES release <span style="color:#800000;color:#800000;">4</span> <span style="color:#006600; font-weight:bold;">&#40;</span>Nahant Update <span style="color:#800000;color:#800000;">5</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>nick@server ~<span style="color:#006600; font-weight:bold;">&#93;</span>$ sudo yum install blah</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Password:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo: yum: command not found </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ubuntu? Delcious!  RHEL4? Not so yummy. (but its a date thing, not a distribution thing)</p>
<p>From Wikipedia:</p>
<blockquote><p>
Red Hat Enterprise Linux 4 (Nahant), 2005-02-15. Uses Linux 2.6.9</p>
<p>    * 4.1, also known as Update 1, 9 June 2005[8]<br />
    * 4.2, also known as Update 2, 5 October 2005 (Release Notes)<br />
    * 4.3, also known as Update 3, 7 March 2006 (Release Notes)<br />
    * 4.4, also known as Update 4, 11 August 2006 (Release Notes)<br />
    * 4.5, also known as Update 5, 1 May 2007 (Release Notes)<br />
    * 4.6, also known as Update 6, 15 November 2007 (Release Notes)<br />
    * 4.7, also known as Update 7, 24 July 2008 (Release Notes)<br />
    * 4.8, also known as Update 8, 18 May 2009 (Release Notes)
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2009/08/04/mr-t-pitties-the-fool-who-is-still-using-rhel-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
