<?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>X-Combinator &#187; sysadmin</title>
	<atom:link href="http://www.xcombinator.com/category/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xcombinator.com</link>
	<description>making the human scalable</description>
	<lastBuildDate>Mon, 06 Sep 2010 20:18:14 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>install enchant dictionaries</title>
		<link>http://www.xcombinator.com/2009/11/11/install-enchant-dictionaries/</link>
		<comments>http://www.xcombinator.com/2009/11/11/install-enchant-dictionaries/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 22:29:57 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://xcombinator.local/?p=133</guid>
		<description><![CDATA[I had a bit of a hard time getting enchant installed with dictionaries on Mac OS X. Here&#8217;s how to do it:

sudo port install enchant # you'll need MacPorts 1.8.* for this

Then download the dictionaries from the OpenOffice wiki.
Next, place the files in ~/.enchant like so:


$ tree .enchant/
.enchant/
`-- myspell
    &#124;-- en_US.aff
  [...]]]></description>
			<content:encoded><![CDATA[<p>I had a bit of a hard time getting enchant installed with dictionaries on Mac OS X. Here&#8217;s how to do it:</p>
<p><code><br />
sudo port install enchant # you'll need MacPorts 1.8.* for this<br />
</code></p>
<p>Then download the dictionaries from the <a href="http://wiki.services.openoffice.org/wiki/Dictionaries">OpenOffice wiki</a>.</p>
<p>Next, place the files in <code>~/.enchant</code> like so:</p>
<p><code></p>
<pre>
$ tree .enchant/
.enchant/
`-- myspell
    |-- en_US.aff
    `-- en_US.dic
</pre>
<p></code></p>
<p><b>UPDATE</b><br />
You can also set the path to where you want to keep the dictionaries when you compile <code>enchant</code> by passing the <code>--with-myspell-dir</code> option to <code>configure</code> (or <code>aspell</code>, <code>hspell</code> etc).</p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F11%2F11%2Finstall-enchant-dictionaries%2F&amp;title=install%20enchant%20dictionaries&amp;notes=I%20had%20a%20bit%20of%20a%20hard%20time%20getting%20enchant%20installed%20with%20dictionaries%20on%20Mac%20OS%20X.%20Here%27s%20how%20to%20do%20it%3A%0D%0A%0D%0A%0D%0Asudo%20port%20install%20enchant%20%23%20you%27ll%20need%20MacPorts%201.8.%2A%20for%20this%0D%0A%0D%0A%0D%0AThen%20download%20the%20dictionaries%20from%20the%20OpenOffice%20wiki.%0D%0A%0D%0ANext%2C%20place" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F11%2F11%2Finstall-enchant-dictionaries%2F&amp;title=install%20enchant%20dictionaries" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F11%2F11%2Finstall-enchant-dictionaries%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=install%20enchant%20dictionaries%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2009%2F11%2F11%2Finstall-enchant-dictionaries%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F11%2F11%2Finstall-enchant-dictionaries%2F&amp;t=install%20enchant%20dictionaries" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F11%2F11%2Finstall-enchant-dictionaries%2F&amp;title=install%20enchant%20dictionaries&amp;annotation=I%20had%20a%20bit%20of%20a%20hard%20time%20getting%20enchant%20installed%20with%20dictionaries%20on%20Mac%20OS%20X.%20Here%27s%20how%20to%20do%20it%3A%0D%0A%0D%0A%0D%0Asudo%20port%20install%20enchant%20%23%20you%27ll%20need%20MacPorts%201.8.%2A%20for%20this%0D%0A%0D%0A%0D%0AThen%20download%20the%20dictionaries%20from%20the%20OpenOffice%20wiki.%0D%0A%0D%0ANext%2C%20place" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F11%2F11%2Finstall-enchant-dictionaries%2F&amp;t=install%20enchant%20dictionaries" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F11%2F11%2Finstall-enchant-dictionaries%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2009/11/11/install-enchant-dictionaries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fixing the disabled snapshot button in vmware fusion</title>
		<link>http://www.xcombinator.com/2009/07/17/fixing-the-disabled-snapshot-button-in-vmware-fusion/</link>
		<comments>http://www.xcombinator.com/2009/07/17/fixing-the-disabled-snapshot-button-in-vmware-fusion/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 18:22:55 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2009/07/17/fixing-the-disabled-snapshot-button-in-vmware-fusion/</guid>
		<description><![CDATA[I recently created a new CentOS 5 vmware image. Unfortunately the &#8220;Take Snapshot&#8221; button was disabled while the system was running. After searching around I found this post.
What you need to do is open up your vmx file and comment out (disable) the following line:

scsi0:0.mode = &#34;independent-persistent&#34;

Others have also reported finding the following line in [...]]]></description>
			<content:encoded><![CDATA[<p>I recently created a new CentOS 5 vmware image. Unfortunately the &#8220;Take Snapshot&#8221; button was disabled while the system was running. After searching around I found <a href="http://communities.vmware.com/message/589046#589046">this post</a>.</p>
<p>What you need to do is open up your <code>vmx</code> file and comment out (disable) the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">scsi0:0.mode = <span style="color: #ff0000;">&quot;independent-persistent&quot;</span></pre></div></div>

<p>Others have also reported finding the following line in their <code>vmx</code> file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">snapshot.disabled = <span style="color: #ff0000;">&quot;TRUE&quot;</span></pre></div></div>

<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F17%2Ffixing-the-disabled-snapshot-button-in-vmware-fusion%2F&amp;title=fixing%20the%20disabled%20snapshot%20button%20in%20vmware%20fusion&amp;notes=I%20recently%20created%20a%20new%20CentOS%205%20vmware%20image.%20Unfortunately%20the%20%22Take%20Snapshot%22%20button%20was%20disabled%20while%20the%20system%20was%20running.%20After%20searching%20around%20I%20found%20this%20post.%0D%0A%0D%0AWhat%20you%20need%20to%20do%20is%20open%20up%20your%20vmx%20file%20and%20comment%20out%20%28disable%29%20th" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F17%2Ffixing-the-disabled-snapshot-button-in-vmware-fusion%2F&amp;title=fixing%20the%20disabled%20snapshot%20button%20in%20vmware%20fusion" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F17%2Ffixing-the-disabled-snapshot-button-in-vmware-fusion%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=fixing%20the%20disabled%20snapshot%20button%20in%20vmware%20fusion%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F17%2Ffixing-the-disabled-snapshot-button-in-vmware-fusion%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F17%2Ffixing-the-disabled-snapshot-button-in-vmware-fusion%2F&amp;t=fixing%20the%20disabled%20snapshot%20button%20in%20vmware%20fusion" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F17%2Ffixing-the-disabled-snapshot-button-in-vmware-fusion%2F&amp;title=fixing%20the%20disabled%20snapshot%20button%20in%20vmware%20fusion&amp;annotation=I%20recently%20created%20a%20new%20CentOS%205%20vmware%20image.%20Unfortunately%20the%20%22Take%20Snapshot%22%20button%20was%20disabled%20while%20the%20system%20was%20running.%20After%20searching%20around%20I%20found%20this%20post.%0D%0A%0D%0AWhat%20you%20need%20to%20do%20is%20open%20up%20your%20vmx%20file%20and%20comment%20out%20%28disable%29%20th" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F17%2Ffixing-the-disabled-snapshot-button-in-vmware-fusion%2F&amp;t=fixing%20the%20disabled%20snapshot%20button%20in%20vmware%20fusion" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F17%2Ffixing-the-disabled-snapshot-button-in-vmware-fusion%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2009/07/17/fixing-the-disabled-snapshot-button-in-vmware-fusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>automate installing tripwire using expect</title>
		<link>http://www.xcombinator.com/2009/07/10/automate-installing-tripwire-using-expect/</link>
		<comments>http://www.xcombinator.com/2009/07/10/automate-installing-tripwire-using-expect/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 21:48:06 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[deployment]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2009/07/10/automate-installing-tripwire-using-expect/</guid>
		<description><![CDATA[tripwire is a handy part of an intrusion detection system. It&#8217;s a nice piece of software but the installer is interactive which makes it a pain to install automatically (e.g. when using PoolParty/EC2). Below is a simple expect script I whipped up to solve the make install problem. Hopefully this will save someone two or [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sourceforge.net/projects/tripwire/"><tt>tripwire</tt></a> is a handy part of an intrusion detection system. It&#8217;s a nice piece of software but the installer is interactive which makes it a pain to install automatically (e.g. when using PoolParty/EC2). Below is a simple <tt>expect</tt> script I whipped up to solve the <tt>make install</tt> problem. Hopefully this will save someone two or three minutes.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;"># Usage: expect install-tripwire.tcl pass1 pass2 
set PASS1 [lindex $argv 0]
set PASS2 [lindex $argv 1]
&nbsp;
spawn make install
&nbsp;
expect &quot;Press ENTER to view the License Agreement.&quot;
send &quot;\r&quot;
send &quot;q&quot;
expect &quot;license agreement. \[do not accept\]&quot;
send &quot;accept\r&quot;
expect &quot;Continue with installation? \[y/n\]&quot;
send &quot;y\r&quot;
&nbsp;
expect &quot;Enter the site keyfile passphrase:&quot;
send &quot;$PASS1\r&quot;
expect &quot;Verify the site keyfile passphrase:&quot;
send &quot;$PASS1\r&quot;
&nbsp;
expect &quot;Enter the local keyfile passphrase:&quot;
send &quot;$PASS2\r&quot;
expect &quot;Verify the local keyfile passphrase:&quot;
send &quot;$PASS2\r&quot;
&nbsp;
expect &quot;Please enter your site passphrase:&quot;
send &quot;$PASS1\r&quot;
&nbsp;
expect &quot;Please enter your site passphrase:&quot;
send &quot;$PASS1\r&quot;</pre></div></div>

<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F10%2Fautomate-installing-tripwire-using-expect%2F&amp;title=automate%20installing%20tripwire%20using%20expect&amp;notes=tripwire%20is%20a%20handy%20part%20of%20an%20intrusion%20detection%20system.%20It%27s%20a%20nice%20piece%20of%20software%20but%20the%20installer%20is%20interactive%20which%20makes%20it%20a%20pain%20to%20install%20automatically%20%28e.g.%20when%20using%20PoolParty%2FEC2%29.%20Below%20is%20a%20simple%20expect%20script%20I%20whipped%20up%20to%20" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F10%2Fautomate-installing-tripwire-using-expect%2F&amp;title=automate%20installing%20tripwire%20using%20expect" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F10%2Fautomate-installing-tripwire-using-expect%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=automate%20installing%20tripwire%20using%20expect%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F10%2Fautomate-installing-tripwire-using-expect%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F10%2Fautomate-installing-tripwire-using-expect%2F&amp;t=automate%20installing%20tripwire%20using%20expect" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F10%2Fautomate-installing-tripwire-using-expect%2F&amp;title=automate%20installing%20tripwire%20using%20expect&amp;annotation=tripwire%20is%20a%20handy%20part%20of%20an%20intrusion%20detection%20system.%20It%27s%20a%20nice%20piece%20of%20software%20but%20the%20installer%20is%20interactive%20which%20makes%20it%20a%20pain%20to%20install%20automatically%20%28e.g.%20when%20using%20PoolParty%2FEC2%29.%20Below%20is%20a%20simple%20expect%20script%20I%20whipped%20up%20to%20" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F10%2Fautomate-installing-tripwire-using-expect%2F&amp;t=automate%20installing%20tripwire%20using%20expect" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F07%2F10%2Fautomate-installing-tripwire-using-expect%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2009/07/10/automate-installing-tripwire-using-expect/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PoolParty MRTG Plugin</title>
		<link>http://www.xcombinator.com/2009/02/03/poolparty-mrtg-plugin/</link>
		<comments>http://www.xcombinator.com/2009/02/03/poolparty-mrtg-plugin/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 04:28:06 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[poolparty]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2009/02/03/poolparty-mrtg-plugin/</guid>
		<description><![CDATA[I&#8217;ve created a PoolParty plugin that makes it dead-simple to install ]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created a <a href="http://www.poolpartyrb.com">PoolParty</a> plugin that makes it dead-simple to install <a href="http://oss.oetiker.ch/mrtg/>MRTG</a> on the nodes in your cloud</p>
<p>The <a href="http://github.com/jashmenn/poolparty-mrtg-plugin/tree/master">GitHub Repo is here</a>.</p>
<p>or <tt>git clone git://github.com/jashmenn/poolparty-mrtg-plugin.git</tt></p>
<p>Usage:</p>
<p>Declare <tt>mrtg</tt> in your <tt>cloud</tt> block</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">mrtg <span style="color:#9966CC; font-weight:bold;">do</span>
   monitor <span style="color:#ff3333; font-weight:bold;">:cpu</span>, <span style="color:#ff3333; font-weight:bold;">:uptime</span>, <span style="color:#ff3333; font-weight:bold;">:memory</span>, <span style="color:#ff3333; font-weight:bold;">:open_files</span>, <span style="color:#ff3333; font-weight:bold;">:processes</span>, <span style="color:#ff3333; font-weight:bold;">:apache</span>, <span style="color:#ff3333; font-weight:bold;">:network_interfaces</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

</p>
<p><img src='http://www.xcombinator.com/wp-content/uploads/2009/02/picture-11.png' alt='picture-11.png' /></p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F03%2Fpoolparty-mrtg-plugin%2F&amp;title=PoolParty%20MRTG%20Plugin&amp;notes=I%27ve%20created%20a%20PoolParty%20plugin%20that%20makes%20it%20dead-simple%20to%20install%20" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F03%2Fpoolparty-mrtg-plugin%2F&amp;title=PoolParty%20MRTG%20Plugin" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F03%2Fpoolparty-mrtg-plugin%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=PoolParty%20MRTG%20Plugin%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F03%2Fpoolparty-mrtg-plugin%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F03%2Fpoolparty-mrtg-plugin%2F&amp;t=PoolParty%20MRTG%20Plugin" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F03%2Fpoolparty-mrtg-plugin%2F&amp;title=PoolParty%20MRTG%20Plugin&amp;annotation=I%27ve%20created%20a%20PoolParty%20plugin%20that%20makes%20it%20dead-simple%20to%20install%20" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F03%2Fpoolparty-mrtg-plugin%2F&amp;t=PoolParty%20MRTG%20Plugin" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F02%2F03%2Fpoolparty-mrtg-plugin%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2009/02/03/poolparty-mrtg-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cp a symlink to multiple directories</title>
		<link>http://www.xcombinator.com/2009/01/14/cp-a-symlink-to-multiple-directories/</link>
		<comments>http://www.xcombinator.com/2009/01/14/cp-a-symlink-to-multiple-directories/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 17:18:01 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[osx]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2009/01/14/cp-a-symlink-to-multiple-directories/</guid>
		<description><![CDATA[Today I wanted to copy a symlink to many different directories. So I tried the following:

for f in `find . -regex ''.*cp.*snippets''` ; do cp bbb.html $f/ ; done

Which returned:

cp: cannot stat `bbb.html': No such file or directory

bbb.html is a symlink and the default behavior of cp (I think) is to try and copy the [...]]]></description>
			<content:encoded><![CDATA[<p>Today I wanted to copy a symlink to many different directories. So I tried the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> f <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-regex</span> <span style="color: #ff0000;">''</span>.<span style="color: #000000; font-weight: bold;">*</span>cp.<span style="color: #000000; font-weight: bold;">*</span>snippets<span style="color: #ff0000;">''</span><span style="color: #000000; font-weight: bold;">`</span> ; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> bbb.html <span style="color: #007800;">$f</span><span style="color: #000000; font-weight: bold;">/</span> ; <span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>Which returned:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span>: cannot <span style="color: #c20cb9; font-weight: bold;">stat</span> <span style="color: #000000; font-weight: bold;">`</span>bbb.html<span style="color: #ff0000;">': No such file or directory</span></pre></div></div>

<p>bbb.html is a symlink and the default behavior of cp (I think) is to try and copy the actual file, which didn&#8217;t exist from the current directory. So just adding the <strong>-R</strong> made cp copy it as a symlink with the final command being:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> f <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-regex</span> <span style="color: #ff0000;">''</span>.<span style="color: #000000; font-weight: bold;">*</span>cp.<span style="color: #000000; font-weight: bold;">*</span>snippets<span style="color: #ff0000;">''</span><span style="color: #000000; font-weight: bold;">`</span> ; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-R</span> bbb.html <span style="color: #007800;">$f</span><span style="color: #000000; font-weight: bold;">/</span> ; <span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F01%2F14%2Fcp-a-symlink-to-multiple-directories%2F&amp;title=cp%20a%20symlink%20to%20multiple%20directories&amp;notes=Today%20I%20wanted%20to%20copy%20a%20symlink%20to%20many%20different%20directories.%20So%20I%20tried%20the%20following%3A%0D%0A%0D%0Afor%20f%20in%20%60find%20.%20-regex%20%27%27.%2Acp.%2Asnippets%27%27%60%20%3B%20do%20cp%20bbb.html%20%24f%2F%20%3B%20done%0D%0AWhich%20returned%3A%0D%0A%0D%0Acp%3A%20cannot%20stat%20%60bbb.html%27%3A%20No%20such%20file%20or%20directory%0D%0Abbb.html%20i" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F01%2F14%2Fcp-a-symlink-to-multiple-directories%2F&amp;title=cp%20a%20symlink%20to%20multiple%20directories" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F01%2F14%2Fcp-a-symlink-to-multiple-directories%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=cp%20a%20symlink%20to%20multiple%20directories%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2009%2F01%2F14%2Fcp-a-symlink-to-multiple-directories%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F01%2F14%2Fcp-a-symlink-to-multiple-directories%2F&amp;t=cp%20a%20symlink%20to%20multiple%20directories" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F01%2F14%2Fcp-a-symlink-to-multiple-directories%2F&amp;title=cp%20a%20symlink%20to%20multiple%20directories&amp;annotation=Today%20I%20wanted%20to%20copy%20a%20symlink%20to%20many%20different%20directories.%20So%20I%20tried%20the%20following%3A%0D%0A%0D%0Afor%20f%20in%20%60find%20.%20-regex%20%27%27.%2Acp.%2Asnippets%27%27%60%20%3B%20do%20cp%20bbb.html%20%24f%2F%20%3B%20done%0D%0AWhich%20returned%3A%0D%0A%0D%0Acp%3A%20cannot%20stat%20%60bbb.html%27%3A%20No%20such%20file%20or%20directory%0D%0Abbb.html%20i" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F01%2F14%2Fcp-a-symlink-to-multiple-directories%2F&amp;t=cp%20a%20symlink%20to%20multiple%20directories" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2009%2F01%2F14%2Fcp-a-symlink-to-multiple-directories%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2009/01/14/cp-a-symlink-to-multiple-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sake task for remote git repo init</title>
		<link>http://www.xcombinator.com/2008/11/07/sake-task-for-remote-git-repo-init/</link>
		<comments>http://www.xcombinator.com/2008/11/07/sake-task-for-remote-git-repo-init/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 16:52:50 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2008/11/07/sake-task-for-remote-git-repo-init/</guid>
		<description><![CDATA[sake advantages

  sake is a tool for system-wide rake tasks. It was created by Chris Wanstrath and is now maintained by postmodern.  It provides a handy way to distribute generally-useful rake tasks. The advantage of sake over, say, a script in ~/bin is that 1) you have a predictable interface and 2) its [...]]]></description>
			<content:encoded><![CDATA[<h1><tt>sake</tt> advantages</h1>
<p>
  <a href="http://www.rubyinside.com/sake-system-wide-rake-tasks-543.html"><tt>sake</tt></a> is a tool for system-wide rake tasks. It was created by <a href="http://ozmm.org/">Chris Wanstrath</a> and is now maintained by <a href="http://github.com/postmodern">postmodern</a>.  It provides a handy way to distribute generally-useful rake tasks. The advantage of <tt>sake</tt> over, say, a script in <tt>~/bin</tt> is that 1) you have a predictable interface and 2) its easy to distribute tasks with <tt>sake -i http://any-url</tt> (in theory).
  </p>
<h1>Examples</h1>
<p>
  Ben Schwarz has written a great <a href="http://github.com/benschwarz/sake-tasks/tree/master/ssh/ssh.sake"><tt>sake</tt> task for installing a ssh-public-key on a remote server</a>. You can install it with <tt>sake -i http://github.com/benschwarz/sake-tasks/tree/master%2Fssh%2Fssh.sake?raw=true</tt> . (If you haven&#8217;t seen <a href="http://highline.rubyforge.org/">highline</a> before, check it out. It&#8217;s a nice abstraction and clean alternative to using <tt>gets</tt> and <tt>puts</tt>.)
  </p>
<h1>A <tt>sake</tt> task for installing remote git repos</h1>
<p>
    Based on Ben&#8217;s task I&#8217;ve created a task for installing remote git repos.
  </p>
<p>  <script src="http://gist.github.com/22673.js"></script></p>
<p>
  The above task will do two things:
  </p>
<ul>
<ol>Create the bare repository on a foreign server</ol>
<ol>Optionally create a local working copy</ol>
</ul>
<p>
  There&#8217;s a bug in the above authentication code, did you catch it?  For authentication, it will use your ssh keys if it finds it otherwise it will ask you for a password. However, if your ssh keys aren&#8217;t <i>valid</i> then it simply fails. Ideally it would ask you for a password and retry in this case.
  </p>
<p>
  I&#8217;m not too concerned about this however; if you&#8217;re creating a git repo remotely, you probably want to clone it and you also probably have your ssh keys setup to do so. (I probably shouldn&#8217;t be checking for a password at all.)
  </p>
<h1><tt>sake</tt> disadvantages</h1>
<p>
  I believe <tt>sake</tt> is a great idea, but there is some rough edges in the current implementation.
  </p>
<h2>Current Gem has a bug</h2>
<p>
  Today, if you <tt>gem install sake</tt> there is a bug such that sake wont even run. Your best bet is to clone <a href="http://github.com/drnic/sake/tree/master">drnic&#8217;s repo</a> <tt>sake >= 1.0.16</tt> and install from there.
  </p>
<p>
  My guess is that this is because sake&#8217;s creator recently <a href="http://ozmm.org/posts/good_homes_wanted.html">put out a request</a> for someone to take over the project and the person who took it over hasn&#8217;t upgraded the rubyforge gem.
  </p>
<h2>Task installation</h2>
<p>
  Another bug that seems to be specific to this version of <tt>sake</tt>, when I run <tt>sake -i</tt> the task names and namespaces are created but the <tt>~/.sake</tt> file contains no code.</p>
<p>
  Again, this just seems to be a minor bug with the current version and as such I see it as temporary. I&#8217;m planning on working on a patch on for this, though I&#8217;m not sure I&#8217;ll fix it before someone else.
  </p>
<h2>Task development</h2>
<p>
  The built-in way to do sake task development is to write a little bit, then <tt>sake -i</tt> your file, then write a little bit more etc. This gets old fast.  Because of that drnic has written <a href="http://github.com/drnic/sake-tasks/tree/master">a great project</a> for sake task development. In that project you run <tt>sake testrun <i>taskname</i></tt>.
  </p>
<p>  drnic&#8217;s project is handy and makes sake task development a snap. However, I think this fact could slow the adoption of sake; it&#8217;s a barrier to entry if you have to install a second project just to develop the first.</p>
<h1>Even so &#8230;</h1>
<p>
  I still think that the <i>idea</i> of <tt>sake</tt> is solid. There is definitely a need for easily distributable, reusable, system-wide rake tasks. Despite its current shortcomings, <tt>sake</tt> is definitely worth a look.</p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F11%2F07%2Fsake-task-for-remote-git-repo-init%2F&amp;title=%3Ctt%3Esake%3C%2Ftt%3E%20task%20for%20remote%20git%20repo%20init&amp;notes=%20%20sake%20advantages%0D%0A%0D%0A%20%20%0D%0A%20%20sake%20is%20a%20tool%20for%20system-wide%20rake%20tasks.%20It%20was%20created%20by%20Chris%20Wanstrath%20and%20is%20now%20maintained%20by%20postmodern.%20%20It%20provides%20a%20handy%20way%20to%20distribute%20generally-useful%20rake%20tasks.%20The%20advantage%20of%20sake%20over%2C%20say%2C%20a%20script" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F11%2F07%2Fsake-task-for-remote-git-repo-init%2F&amp;title=%3Ctt%3Esake%3C%2Ftt%3E%20task%20for%20remote%20git%20repo%20init" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F11%2F07%2Fsake-task-for-remote-git-repo-init%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=%3Ctt%3Esake%3C%2Ftt%3E%20task%20for%20remote%20git%20repo%20init%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2008%2F11%2F07%2Fsake-task-for-remote-git-repo-init%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F11%2F07%2Fsake-task-for-remote-git-repo-init%2F&amp;t=%3Ctt%3Esake%3C%2Ftt%3E%20task%20for%20remote%20git%20repo%20init" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F11%2F07%2Fsake-task-for-remote-git-repo-init%2F&amp;title=%3Ctt%3Esake%3C%2Ftt%3E%20task%20for%20remote%20git%20repo%20init&amp;annotation=%20%20sake%20advantages%0D%0A%0D%0A%20%20%0D%0A%20%20sake%20is%20a%20tool%20for%20system-wide%20rake%20tasks.%20It%20was%20created%20by%20Chris%20Wanstrath%20and%20is%20now%20maintained%20by%20postmodern.%20%20It%20provides%20a%20handy%20way%20to%20distribute%20generally-useful%20rake%20tasks.%20The%20advantage%20of%20sake%20over%2C%20say%2C%20a%20script" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F11%2F07%2Fsake-task-for-remote-git-repo-init%2F&amp;t=%3Ctt%3Esake%3C%2Ftt%3E%20task%20for%20remote%20git%20repo%20init" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F11%2F07%2Fsake-task-for-remote-git-repo-init%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2008/11/07/sake-task-for-remote-git-repo-init/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a simple script to organize downloads</title>
		<link>http://www.xcombinator.com/2008/09/04/a-simple-script-to-organize-downloads/</link>
		<comments>http://www.xcombinator.com/2008/09/04/a-simple-script-to-organize-downloads/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 23:04:22 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2008/09/04/a-simple-script-to-organize-downloads/</guid>
		<description><![CDATA[Description
Organize all files in a given folder by date.  This is commonly used to organize a &#8220;Downloads&#8221; folder. Currently this script will only move files more than 24 hours old. This is to protect against moving a file as it is downloaded.
Motivation
I love SafariStand. One of the features that I love is the sort-downloads-by-date [...]]]></description>
			<content:encoded><![CDATA[<h2>Description</h2>
<p>Organize all files in a given folder by date.  This is commonly used to organize a &#8220;Downloads&#8221; folder. Currently this script will only move files more than 24 hours old. This is to protect against moving a file as it is downloaded.</p>
<h2>Motivation</h2>
<p>I love <a href="http://hetima.com/safari/stand-e.html">SafariStand</a>. One of the features that I love is the sort-downloads-by-date feature. Now that I have moved to Firefox I really miss this feature. I been unable to find a good extension that will sort my downloads in a similar way.  This script was written as an simple way to fill that gap.</p>
<h2>Setup</h2>
<p>I keep a ~/bin directory where I keep simple scripts such as this. Then setup a crontab such as the following:</p>
<pre>
*/10 * * * * /usr/local/bin/ruby /Users/nathan/bin/organize_folder_by_date.rb /Users/nathan/Desktop/Downloads
</pre>
<h2>Acquiring</h2>
<p>It is available on github:  <a href="http://github.com/jashmenn/download_sort/tree/master/organize_folder_by_date.rb">here</a> <a href="http://github.com/jashmenn/download_sort/tree/master%2Forganize_folder_by_date.rb?raw=true">(raw)</a>.<br />
or</p>
<pre>
git clone git://github.com/jashmenn/download_sort.git
</pre>
</p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F09%2F04%2Fa-simple-script-to-organize-downloads%2F&amp;title=a%20simple%20script%20to%20organize%20downloads&amp;notes=Description%0D%0AOrganize%20all%20files%20in%20a%20given%20folder%20by%20date.%20%20This%20is%20commonly%20used%20to%20organize%20a%20%22Downloads%22%20folder.%20Currently%20this%20script%20will%20only%20move%20files%20more%20than%2024%20hours%20old.%20This%20is%20to%20protect%20against%20moving%20a%20file%20as%20it%20is%20downloaded.%0D%0A%0D%0AMo" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F09%2F04%2Fa-simple-script-to-organize-downloads%2F&amp;title=a%20simple%20script%20to%20organize%20downloads" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F09%2F04%2Fa-simple-script-to-organize-downloads%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=a%20simple%20script%20to%20organize%20downloads%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2008%2F09%2F04%2Fa-simple-script-to-organize-downloads%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F09%2F04%2Fa-simple-script-to-organize-downloads%2F&amp;t=a%20simple%20script%20to%20organize%20downloads" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F09%2F04%2Fa-simple-script-to-organize-downloads%2F&amp;title=a%20simple%20script%20to%20organize%20downloads&amp;annotation=Description%0D%0AOrganize%20all%20files%20in%20a%20given%20folder%20by%20date.%20%20This%20is%20commonly%20used%20to%20organize%20a%20%22Downloads%22%20folder.%20Currently%20this%20script%20will%20only%20move%20files%20more%20than%2024%20hours%20old.%20This%20is%20to%20protect%20against%20moving%20a%20file%20as%20it%20is%20downloaded.%0D%0A%0D%0AMo" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F09%2F04%2Fa-simple-script-to-organize-downloads%2F&amp;t=a%20simple%20script%20to%20organize%20downloads" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F09%2F04%2Fa-simple-script-to-organize-downloads%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2008/09/04/a-simple-script-to-organize-downloads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>use Quick Look as a Firefox application handler</title>
		<link>http://www.xcombinator.com/2008/08/26/use-quick-look-as-a-firefox-application-handler/</link>
		<comments>http://www.xcombinator.com/2008/08/26/use-quick-look-as-a-firefox-application-handler/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 20:51:45 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2008/08/26/use-quick-look-as-a-firefox-application-handler/</guid>
		<description><![CDATA[I really dislike getting screen-shots in the format of power-point files. Thankfully, 10.5&#8217;s Quick Look can help me preview power-point files. What I needed was a way to have Firefox automatically Quick Look all power-point files that I downloaded. Here&#8217;s how to do it:
Open up Script Editor and paste this:

on open filelist
	repeat with i in [...]]]></description>
			<content:encoded><![CDATA[<p>I really dislike getting screen-shots in the format of power-point files. Thankfully, 10.5&#8217;s Quick Look can help me preview power-point files. What I needed was a way to have Firefox automatically Quick Look all power-point files that I downloaded. Here&#8217;s how to do it:</p>
<p>Open up Script Editor and paste this:</p>

<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">on</span> <span style="color: #0066ff;">open</span> filelist
	<span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">with</span> i <span style="color: #ff0033; font-weight: bold;">in</span> filelist
		<span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;qlmanage -p '&quot;</span> <span style="color: #000000;">&amp;</span> <span style="color: #0066ff;">POSIX path</span> <span style="color: #ff0033; font-weight: bold;">of</span> i <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;' &gt;&amp; /dev/null &amp;&quot;</span>
	<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #0066ff;">open</span></pre></div></div>

<p><a href='http://www.xcombinator.com/wp-content/uploads/2008/08/picture-2.png' title='picture-2.png'><img src='http://www.xcombinator.com/wp-content/uploads/2008/08/picture-2.thumbnail.png' alt='picture-2.png' /></a></p>
<p><b>File > Save As&#8230;</b>. Choose &#8220;Application&#8221; and save it somewhere it won&#8217;t move. I choose <tt>/Applications/ql.app</tt>.</p>
<p>Now simply choose <tt>ql.app</tt> next time you download a power-point file or set it up in Firefox&#8217;s <b>Preferences > Applications</b>.</p>
<p><a href='http://www.xcombinator.com/wp-content/uploads/2008/08/picture-3.png' title='picture-3.png'><img src='http://www.xcombinator.com/wp-content/uploads/2008/08/picture-3.thumbnail.png' alt='picture-3.png' /></a></p>
<p><tt>qlmanage</tt> is the command-line tool to open files in Quick Look. By using AppleScript you are able to create this thin &#8220;application&#8221; that Firefox will trust and give a downloaded file (As opposed to a shell script, which Firefox will not let you choose as a file handler).</p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F26%2Fuse-quick-look-as-a-firefox-application-handler%2F&amp;title=use%20Quick%20Look%20as%20a%20Firefox%20application%20handler&amp;notes=I%20really%20dislike%20getting%20screen-shots%20in%20the%20format%20of%20power-point%20files.%20Thankfully%2C%2010.5%27s%20Quick%20Look%20can%20help%20me%20preview%20power-point%20files.%20What%20I%20needed%20was%20a%20way%20to%20have%20Firefox%20automatically%20Quick%20Look%20all%20power-point%20files%20that%20I%20downloaded.%20H" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F26%2Fuse-quick-look-as-a-firefox-application-handler%2F&amp;title=use%20Quick%20Look%20as%20a%20Firefox%20application%20handler" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F26%2Fuse-quick-look-as-a-firefox-application-handler%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=use%20Quick%20Look%20as%20a%20Firefox%20application%20handler%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F26%2Fuse-quick-look-as-a-firefox-application-handler%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F26%2Fuse-quick-look-as-a-firefox-application-handler%2F&amp;t=use%20Quick%20Look%20as%20a%20Firefox%20application%20handler" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F26%2Fuse-quick-look-as-a-firefox-application-handler%2F&amp;title=use%20Quick%20Look%20as%20a%20Firefox%20application%20handler&amp;annotation=I%20really%20dislike%20getting%20screen-shots%20in%20the%20format%20of%20power-point%20files.%20Thankfully%2C%2010.5%27s%20Quick%20Look%20can%20help%20me%20preview%20power-point%20files.%20What%20I%20needed%20was%20a%20way%20to%20have%20Firefox%20automatically%20Quick%20Look%20all%20power-point%20files%20that%20I%20downloaded.%20H" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F26%2Fuse-quick-look-as-a-firefox-application-handler%2F&amp;t=use%20Quick%20Look%20as%20a%20Firefox%20application%20handler" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F26%2Fuse-quick-look-as-a-firefox-application-handler%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2008/08/26/use-quick-look-as-a-firefox-application-handler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lftp has an option mirror:order</title>
		<link>http://www.xcombinator.com/2008/08/25/lftp-has-an-option-mirrororder/</link>
		<comments>http://www.xcombinator.com/2008/08/25/lftp-has-an-option-mirrororder/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 17:41:17 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[deployment]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2008/08/25/lftp-has-an-option-mirrororder/</guid>
		<description><![CDATA[We&#8217;ve been using lftp for years here. It&#8217;s stable and has a volume of options. I just found out today that lftp has an option to set the order in which files are uploaded if you are using the mirror command. You can set it like so:
set mirror:order '*.jpg *.gif *.png *.js *.css * */'
This [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been using <a href="http://lftp.yar.ru/">lftp</a> for years here. It&#8217;s stable and has a volume of options. I just found out today that lftp has an option to set the order in which files are uploaded if you are using the <tt>mirror</tt> command. You can set it like so:</p>
<p><tt>set mirror:order '*.jpg *.gif *.png *.js *.css * */'</tt></p>
<p>This will send first jpg, then gif, then png files etc. This is very handy if you are mirroring an entire website and you want the images to go live before the html does. </p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F25%2Flftp-has-an-option-mirrororder%2F&amp;title=lftp%20has%20an%20option%20%3Ctt%3Emirror%3Aorder%3C%2Ftt%3E&amp;notes=We%27ve%20been%20using%20lftp%20for%20years%20here.%20It%27s%20stable%20and%20has%20a%20volume%20of%20options.%20I%20just%20found%20out%20today%20that%20lftp%20has%20an%20option%20to%20set%20the%20order%20in%20which%20files%20are%20uploaded%20if%20you%20are%20using%20the%20mirror%20command.%20You%20can%20set%20it%20like%20so%3A%0D%0A%0D%0Aset%20mirror%3Aorde" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F25%2Flftp-has-an-option-mirrororder%2F&amp;title=lftp%20has%20an%20option%20%3Ctt%3Emirror%3Aorder%3C%2Ftt%3E" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F25%2Flftp-has-an-option-mirrororder%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=lftp%20has%20an%20option%20%3Ctt%3Emirror%3Aorder%3C%2Ftt%3E%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F25%2Flftp-has-an-option-mirrororder%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F25%2Flftp-has-an-option-mirrororder%2F&amp;t=lftp%20has%20an%20option%20%3Ctt%3Emirror%3Aorder%3C%2Ftt%3E" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F25%2Flftp-has-an-option-mirrororder%2F&amp;title=lftp%20has%20an%20option%20%3Ctt%3Emirror%3Aorder%3C%2Ftt%3E&amp;annotation=We%27ve%20been%20using%20lftp%20for%20years%20here.%20It%27s%20stable%20and%20has%20a%20volume%20of%20options.%20I%20just%20found%20out%20today%20that%20lftp%20has%20an%20option%20to%20set%20the%20order%20in%20which%20files%20are%20uploaded%20if%20you%20are%20using%20the%20mirror%20command.%20You%20can%20set%20it%20like%20so%3A%0D%0A%0D%0Aset%20mirror%3Aorde" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F25%2Flftp-has-an-option-mirrororder%2F&amp;t=lftp%20has%20an%20option%20%3Ctt%3Emirror%3Aorder%3C%2Ftt%3E" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F08%2F25%2Flftp-has-an-option-mirrororder%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2008/08/25/lftp-has-an-option-mirrororder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Repairing your MySQL database</title>
		<link>http://www.xcombinator.com/2008/05/09/repairing-your-mysql-database/</link>
		<comments>http://www.xcombinator.com/2008/05/09/repairing-your-mysql-database/#comments</comments>
		<pubDate>Fri, 09 May 2008 14:55:13 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[repair]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2008/05/09/repairing-your-mysql-database/</guid>
		<description><![CDATA[Today one of our computer&#8217;s /usr partition filled up and caused data corruption in the database. After space was freed up on the partition, we (Moises and I) ran some commands to repair the database. Here is what we did:

cd into your directory where your db files are stored. In our case it was in [...]]]></description>
			<content:encoded><![CDATA[<p>Today one of our computer&#8217;s /usr partition filled up and caused data corruption in the database. After space was freed up on the partition, we (Moises and I) ran some commands to repair the database. Here is what we did:</p>
<ol>
<li>cd into your directory where your db files are stored. In our case it was in the /usr&#8230;/data/mysql/ folder.</li>
<li>We then run the command:<br />
<strong> myisamchk *.MYI | grep -3 &#8211;color corrupted</strong></li>
<li>This should give you some output on the current state of your files and indicate which files are corrupted and needing repair. It also gives you the next command to run on the line that reads:<br />
<strong> Fix it using switch &#8220;-r&#8221; or &#8220;-o&#8221;</strong></li>
<li>So that is just what we did<br />
<strong> myisamchk -r file.MYI</strong></li>
<li>Voila, your db should be repaired</li>
</ol>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F05%2F09%2Frepairing-your-mysql-database%2F&amp;title=Repairing%20your%20MySQL%20database&amp;notes=Today%20one%20of%20our%20computer%27s%20%2Fusr%20partition%20filled%20up%20and%20caused%20data%20corruption%20in%20the%20database.%20After%20space%20was%20freed%20up%20on%20the%20partition%2C%20we%20%28Moises%20and%20I%29%20ran%20some%20commands%20to%20repair%20the%20database.%20Here%20is%20what%20we%20did%3A%0D%0A%0D%0A%09cd%20into%20your%20directory%20wh" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F05%2F09%2Frepairing-your-mysql-database%2F&amp;title=Repairing%20your%20MySQL%20database" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F05%2F09%2Frepairing-your-mysql-database%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=Repairing%20your%20MySQL%20database%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2008%2F05%2F09%2Frepairing-your-mysql-database%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F05%2F09%2Frepairing-your-mysql-database%2F&amp;t=Repairing%20your%20MySQL%20database" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F05%2F09%2Frepairing-your-mysql-database%2F&amp;title=Repairing%20your%20MySQL%20database&amp;annotation=Today%20one%20of%20our%20computer%27s%20%2Fusr%20partition%20filled%20up%20and%20caused%20data%20corruption%20in%20the%20database.%20After%20space%20was%20freed%20up%20on%20the%20partition%2C%20we%20%28Moises%20and%20I%29%20ran%20some%20commands%20to%20repair%20the%20database.%20Here%20is%20what%20we%20did%3A%0D%0A%0D%0A%09cd%20into%20your%20directory%20wh" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F05%2F09%2Frepairing-your-mysql-database%2F&amp;t=Repairing%20your%20MySQL%20database" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F05%2F09%2Frepairing-your-mysql-database%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2008/05/09/repairing-your-mysql-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Backspace in Screen</title>
		<link>http://www.xcombinator.com/2008/04/04/backspace-in-screen/</link>
		<comments>http://www.xcombinator.com/2008/04/04/backspace-in-screen/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 16:43:36 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2008/04/04/backspace-in-screen/</guid>
		<description><![CDATA[I finally got sick of hitting Ctrl-H to backspace while in a screen session today, so I found a way around it:
Try editing
~/.bashrc
And adding:
alias screen='TERM=screen screen'
Not sure if this has adverse effects and there might be a better way to do it, but hey, it works!
Share:
	
	
	
	
	
	
	
	
	

]]></description>
			<content:encoded><![CDATA[<p>I finally got sick of hitting Ctrl-H to backspace while in a screen session today, so I found a way around it:</p>
<p>Try editing</p>
<pre>~/.bashrc</pre>
<p>And adding:</p>
<pre>alias screen='TERM=screen screen'</pre>
<p>Not sure if this has adverse effects and there might be a better way to do it, but hey, it works!</p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F04%2F04%2Fbackspace-in-screen%2F&amp;title=Backspace%20in%20Screen&amp;notes=I%20finally%20got%20sick%20of%20hitting%20Ctrl-H%20to%20backspace%20while%20in%20a%20screen%20session%20today%2C%20so%20I%20found%20a%20way%20around%20it%3A%0D%0A%0D%0ATry%20editing%0D%0A%7E%2F.bashrc%0D%0AAnd%20adding%3A%0D%0Aalias%20screen%3D%27TERM%3Dscreen%20screen%27%0D%0ANot%20sure%20if%20this%20has%20adverse%20effects%20and%20there%20might%20be%20a%20better" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F04%2F04%2Fbackspace-in-screen%2F&amp;title=Backspace%20in%20Screen" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F04%2F04%2Fbackspace-in-screen%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=Backspace%20in%20Screen%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2008%2F04%2F04%2Fbackspace-in-screen%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F04%2F04%2Fbackspace-in-screen%2F&amp;t=Backspace%20in%20Screen" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F04%2F04%2Fbackspace-in-screen%2F&amp;title=Backspace%20in%20Screen&amp;annotation=I%20finally%20got%20sick%20of%20hitting%20Ctrl-H%20to%20backspace%20while%20in%20a%20screen%20session%20today%2C%20so%20I%20found%20a%20way%20around%20it%3A%0D%0A%0D%0ATry%20editing%0D%0A%7E%2F.bashrc%0D%0AAnd%20adding%3A%0D%0Aalias%20screen%3D%27TERM%3Dscreen%20screen%27%0D%0ANot%20sure%20if%20this%20has%20adverse%20effects%20and%20there%20might%20be%20a%20better" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F04%2F04%2Fbackspace-in-screen%2F&amp;t=Backspace%20in%20Screen" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F04%2F04%2Fbackspace-in-screen%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2008/04/04/backspace-in-screen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>another reason to love vim</title>
		<link>http://www.xcombinator.com/2008/03/26/another-reason-to-love-vim/</link>
		<comments>http://www.xcombinator.com/2008/03/26/another-reason-to-love-vim/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 00:06:55 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2008/03/26/another-reason-to-love-vim/</guid>
		<description><![CDATA[In vim 7.0 try the following:

:tabnew http://www.google.com
:e # to reload

Very handy to quickly view source, or edit any remote HTML/CSS, etc. 
Share:
	
	
	
	
	
	
	
	
	

]]></description>
			<content:encoded><![CDATA[<p>In vim 7.0 try the following:<br />
<code><br />
:tabnew http://www.google.com<br />
:e # to reload<br />
</code></p>
<p>Very handy to quickly view source, or edit any remote HTML/CSS, etc. </p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F03%2F26%2Fanother-reason-to-love-vim%2F&amp;title=another%20reason%20to%20love%20vim&amp;notes=In%20vim%207.0%20try%20the%20following%3A%0D%0A%0D%0A%3Atabnew%20http%3A%2F%2Fwww.google.com%0D%0A%3Ae%20%23%20to%20reload%0D%0A%0D%0A%0D%0AVery%20handy%20to%20quickly%20view%20source%2C%20or%20edit%20any%20remote%20HTML%2FCSS%2C%20etc.%20" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F03%2F26%2Fanother-reason-to-love-vim%2F&amp;title=another%20reason%20to%20love%20vim" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F03%2F26%2Fanother-reason-to-love-vim%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=another%20reason%20to%20love%20vim%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2008%2F03%2F26%2Fanother-reason-to-love-vim%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F03%2F26%2Fanother-reason-to-love-vim%2F&amp;t=another%20reason%20to%20love%20vim" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F03%2F26%2Fanother-reason-to-love-vim%2F&amp;title=another%20reason%20to%20love%20vim&amp;annotation=In%20vim%207.0%20try%20the%20following%3A%0D%0A%0D%0A%3Atabnew%20http%3A%2F%2Fwww.google.com%0D%0A%3Ae%20%23%20to%20reload%0D%0A%0D%0A%0D%0AVery%20handy%20to%20quickly%20view%20source%2C%20or%20edit%20any%20remote%20HTML%2FCSS%2C%20etc.%20" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F03%2F26%2Fanother-reason-to-love-vim%2F&amp;t=another%20reason%20to%20love%20vim" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F03%2F26%2Fanother-reason-to-love-vim%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2008/03/26/another-reason-to-love-vim/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>zero-width negative look-ahead assertion</title>
		<link>http://www.xcombinator.com/2008/02/28/zero-width-negative-look-ahead-assertion/</link>
		<comments>http://www.xcombinator.com/2008/02/28/zero-width-negative-look-ahead-assertion/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 22:45:26 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2008/02/28/zero-width-negative-look-ahead-assertion/</guid>
		<description><![CDATA[Currently I need to do some bulk transformation of some file names.
I have, say, 3 file names: 2.640-849.0.jpg, g2650ohr.jpg, and k2.26mr.jpg (so these are treated as three separate strings)
I want a (hopefully) single regex to substitute all of the . (periods) with - (dashes) except for the .jpg extension.
A first draft would be

  s/\./-/g

but [...]]]></description>
			<content:encoded><![CDATA[<p>Currently I need to do some bulk transformation of some file names.<br />
I have, say, 3 file names: <tt>2.640-849.0.jpg</tt>, <tt>g2650ohr.jpg</tt>, and <tt>k2.26mr.jpg</tt> (so these are treated as three separate strings)<br />
I want a (hopefully) single regex to substitute all of the <tt>.</tt> (periods) with <tt>-</tt> (dashes) except for the <tt>.jpg</tt> extension.</p>
<p>A first draft would be<br />
<code><br />
  s/\./-/g<br />
</code></p>
<p>but that gives you <tt>2-640-849-0-jpg</tt>. Note the extension is transformed as well.</p>
<p>I could then do a second regex like <tt>s/-jpg/.jpg/</tt> but that feels less than optimal.</p>
<p>The solution is a <b>zero-width negative look-ahead assertion</b><br />
<tt>man perlre</tt> for more information on this, but the basic idea is that<br />
you match occurances of the preceeding expression that ate <i>not</i> followed by the zwnla.<br />
For example <tt>/foo(?!bar)/</tt> matches any occurrence of <tt>foo</tt> that isn&#8217;t followed by <tt>bar</tt>.   </p>
<p>Combine this with the common perl utility <tt><a href="/scripts/rename">rename</a></tt> and we get the following:<br />
<code><br />
 rename -n 's/\.(?!jpg)/-/g' *<br />
</code></p>
<p>Note that Matz has decided not to include the zero-width negative look-ahead assertion to Ruby.</p>
<p><b>UPDATE</b><br />
Thanks goes out to Matt Pulver for submitting these improvements to the above regex:</p>
<p>This will handles cases like <tt>test.jpg.jpg</tt><br />
<code><br />
  s/\.+(?!jpg$)/-/g<br />
</code></p>
<p>If you want to substitute all non-alpha-numeric characters and support other file extensions try:<br />
<code><br />
  s/[^0-9a-z](?!\w+$)/-/g<br />
</code></p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fzero-width-negative-look-ahead-assertion%2F&amp;title=zero-width%20negative%20look-ahead%20assertion&amp;notes=Currently%20I%20need%20to%20do%20some%20bulk%20transformation%20of%20some%20file%20names.%0D%0AI%20have%2C%20say%2C%203%20file%20names%3A%202.640-849.0.jpg%2C%20g2650ohr.jpg%2C%20and%20k2.26mr.jpg%20%28so%20these%20are%20treated%20as%20three%20separate%20strings%29%0D%0AI%20want%20a%20%28hopefully%29%20single%20regex%20to%20substitute%20all%20of%20th" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fzero-width-negative-look-ahead-assertion%2F&amp;title=zero-width%20negative%20look-ahead%20assertion" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fzero-width-negative-look-ahead-assertion%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=zero-width%20negative%20look-ahead%20assertion%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fzero-width-negative-look-ahead-assertion%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fzero-width-negative-look-ahead-assertion%2F&amp;t=zero-width%20negative%20look-ahead%20assertion" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fzero-width-negative-look-ahead-assertion%2F&amp;title=zero-width%20negative%20look-ahead%20assertion&amp;annotation=Currently%20I%20need%20to%20do%20some%20bulk%20transformation%20of%20some%20file%20names.%0D%0AI%20have%2C%20say%2C%203%20file%20names%3A%202.640-849.0.jpg%2C%20g2650ohr.jpg%2C%20and%20k2.26mr.jpg%20%28so%20these%20are%20treated%20as%20three%20separate%20strings%29%0D%0AI%20want%20a%20%28hopefully%29%20single%20regex%20to%20substitute%20all%20of%20th" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fzero-width-negative-look-ahead-assertion%2F&amp;t=zero-width%20negative%20look-ahead%20assertion" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fzero-width-negative-look-ahead-assertion%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2008/02/28/zero-width-negative-look-ahead-assertion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>use env to test scripts for cron and monit</title>
		<link>http://www.xcombinator.com/2008/02/28/use-env-to-test-scripts-for-cron-and-monit/</link>
		<comments>http://www.xcombinator.com/2008/02/28/use-env-to-test-scripts-for-cron-and-monit/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 16:46:33 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2008/02/28/use-env-to-test-scripts-for-cron-and-monit/</guid>
		<description><![CDATA[I&#8217;ve used /usr/bin/env for years but I just realized today that it can be very useful for testing processes that are run with cron or monit.
env has a nice option for clearing out all of the environment variables:

   -i, --ignore-environment - start with an empty environment

Now you can try to run your script [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve used <tt>/usr/bin/env</tt> for years but I just realized today that it can be very useful for testing processes that are run with <tt>cron</tt> or <tt><a href="http://www.tildeslash.com/monit/">monit</a></tt>.</p>
<p><tt>env</tt> has a nice option for clearing out all of the environment variables:<br />
<code><br />
   -i, --ignore-environment - start with an empty environment<br />
</code></p>
<p>Now you can try to run your script in an environment very similar to <tt>cron</tt> or <tt>monit</tt>. Note that this option even clears the <tt>PATH</tt> so you need to specify full paths or specify a <tt>PATH</tt> variable.<br />
<code><br />
  /usr/bin/env -i HOME=/path/to/my/home /path/to/do_script.sh<br />
</code></p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fuse-env-to-test-scripts-for-cron-and-monit%2F&amp;title=use%20env%20to%20test%20scripts%20for%20cron%20and%20monit&amp;notes=I%27ve%20used%20%2Fusr%2Fbin%2Fenv%20for%20years%20but%20I%20just%20realized%20today%20that%20it%20can%20be%20very%20useful%20for%20testing%20processes%20that%20are%20run%20with%20cron%20or%20monit.%0D%0A%0D%0Aenv%20has%20a%20nice%20option%20for%20clearing%20out%20all%20of%20the%20environment%20variables%3A%0D%0A%0D%0A%20%20%20-i%2C%20--ignore-environment%20-%20" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fuse-env-to-test-scripts-for-cron-and-monit%2F&amp;title=use%20env%20to%20test%20scripts%20for%20cron%20and%20monit" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fuse-env-to-test-scripts-for-cron-and-monit%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=use%20env%20to%20test%20scripts%20for%20cron%20and%20monit%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fuse-env-to-test-scripts-for-cron-and-monit%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fuse-env-to-test-scripts-for-cron-and-monit%2F&amp;t=use%20env%20to%20test%20scripts%20for%20cron%20and%20monit" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fuse-env-to-test-scripts-for-cron-and-monit%2F&amp;title=use%20env%20to%20test%20scripts%20for%20cron%20and%20monit&amp;annotation=I%27ve%20used%20%2Fusr%2Fbin%2Fenv%20for%20years%20but%20I%20just%20realized%20today%20that%20it%20can%20be%20very%20useful%20for%20testing%20processes%20that%20are%20run%20with%20cron%20or%20monit.%0D%0A%0D%0Aenv%20has%20a%20nice%20option%20for%20clearing%20out%20all%20of%20the%20environment%20variables%3A%0D%0A%0D%0A%20%20%20-i%2C%20--ignore-environment%20-%20" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fuse-env-to-test-scripts-for-cron-and-monit%2F&amp;t=use%20env%20to%20test%20scripts%20for%20cron%20and%20monit" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F28%2Fuse-env-to-test-scripts-for-cron-and-monit%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2008/02/28/use-env-to-test-scripts-for-cron-and-monit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>increment the number in a file</title>
		<link>http://www.xcombinator.com/2008/02/26/increment-the-number-in-a-file/</link>
		<comments>http://www.xcombinator.com/2008/02/26/increment-the-number-in-a-file/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 19:45:38 +0000</pubDate>
		<dc:creator>Nate Murray</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2008/02/26/increment-the-number-in-a-file/</guid>
		<description><![CDATA[Lets say you have a file called REVISION which contains a single number. If you want to increment the number in that file you could run the following command:

let rev=`cat REVISION`+1 &#38;&#38; echo $rev &#62; REVISION

Wrap that up as a nice shell script and you get a nice increment command:

#!/bin/bash
let rev=`cat $1`+1 &#38;&#38; echo $rev [...]]]></description>
			<content:encoded><![CDATA[<p>Lets say you have a file called <tt>REVISION</tt> which contains a single number. If you want to increment the number in that file you could run the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">let rev=<span style="color:#996600;">`cat REVISION`</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> echo <span style="color:#ff6633; font-weight:bold;">$rev</span> <span style="color:#006600; font-weight:bold;">&gt;</span> REVISION</pre></div></div>

<p>Wrap that up as a nice shell script and you get a nice <tt>increment</tt> command:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/bin/bash</span>
let rev=<span style="color:#996600;">`cat $1`</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#006666;">1</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> echo <span style="color:#ff6633; font-weight:bold;">$rev</span> <span style="color:#006600; font-weight:bold;">&gt;</span> $<span style="color:#006666;">1</span></pre></div></div>

<p><code><br />
[nathan@nate ~]$ cat REVISION<br />
1<br />
[nathan@nate ~]$ increment REVISION<br />
[nathan@nate ~]$ cat REVISION<br />
2<br />
</code></p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F26%2Fincrement-the-number-in-a-file%2F&amp;title=increment%20the%20number%20in%20a%20file&amp;notes=Lets%20say%20you%20have%20a%20file%20called%20REVISION%20which%20contains%20a%20single%20number.%20If%20you%20want%20to%20increment%20the%20number%20in%20that%20file%20you%20could%20run%20the%20following%20command%3A%0D%0A%0D%0A%0D%0Alet%20rev%3D%60cat%20REVISION%60%2B1%20%26%26%20echo%20%24rev%20%3E%20REVISION%0D%0A%0D%0A%0D%0AWrap%20that%20up%20as%20a%20nice%20shell%20scr" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F26%2Fincrement-the-number-in-a-file%2F&amp;title=increment%20the%20number%20in%20a%20file" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F26%2Fincrement-the-number-in-a-file%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=increment%20the%20number%20in%20a%20file%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F26%2Fincrement-the-number-in-a-file%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F26%2Fincrement-the-number-in-a-file%2F&amp;t=increment%20the%20number%20in%20a%20file" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F26%2Fincrement-the-number-in-a-file%2F&amp;title=increment%20the%20number%20in%20a%20file&amp;annotation=Lets%20say%20you%20have%20a%20file%20called%20REVISION%20which%20contains%20a%20single%20number.%20If%20you%20want%20to%20increment%20the%20number%20in%20that%20file%20you%20could%20run%20the%20following%20command%3A%0D%0A%0D%0A%0D%0Alet%20rev%3D%60cat%20REVISION%60%2B1%20%26%26%20echo%20%24rev%20%3E%20REVISION%0D%0A%0D%0A%0D%0AWrap%20that%20up%20as%20a%20nice%20shell%20scr" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F26%2Fincrement-the-number-in-a-file%2F&amp;t=increment%20the%20number%20in%20a%20file" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F26%2Fincrement-the-number-in-a-file%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2008/02/26/increment-the-number-in-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>djb daemontools with Ubuntu&#8217;s upstart</title>
		<link>http://www.xcombinator.com/2008/02/15/djb-daemontools-with-ubuntus-upstart/</link>
		<comments>http://www.xcombinator.com/2008/02/15/djb-daemontools-with-ubuntus-upstart/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 23:48:02 +0000</pubDate>
		<dc:creator>Matt Pulver</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[daemontools]]></category>
		<category><![CDATA[djb]]></category>
		<category><![CDATA[upstart]]></category>

		<guid isPermaLink="false">http://www.xcombinator.com/2008/02/15/djb-daemontools-with-ubuntus-upstart/</guid>
		<description><![CDATA[In case anyone wants to get djb&#8217;s daemontools up and running quickly on an OS that uses Ubuntu&#8217;s System V init-replacement upstart, here&#8217;s what works for me:
Create a 3-line file /etc/event.d/svscanboot :

start on runlevel &#91;123456&#93;
respawn
exec /command/svscanboot

That should start svscanboot with each system bootup. To have init start svscanboot without rebooting, do

start svscanboot

as root after creating [...]]]></description>
			<content:encoded><![CDATA[<p>In case anyone wants to get djb&#8217;s <a href="http://cr.yp.to/daemontools.html" title="daemontools" target="_blank">daemontools</a> up and running quickly on an OS that uses Ubuntu&#8217;s System V init-replacement <a href="http://upstart.ubuntu.com/" title="upstart" target="_blank">upstart</a>, here&#8217;s what works for me:</p>
<p>Create a 3-line file /etc/event.d/svscanboot :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">start on runlevel <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">123456</span><span style="color:#006600; font-weight:bold;">&#93;</span>
respawn
<span style="color:#CC0066; font-weight:bold;">exec</span> <span style="color:#006600; font-weight:bold;">/</span>command<span style="color:#006600; font-weight:bold;">/</span>svscanboot</pre></div></div>

<p>That should start svscanboot with each system bootup. To have init start svscanboot without rebooting, do</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">start svscanboot</pre></div></div>

<p>as root after creating the above file.<br />
~                                       </p>
<p>Share:</p>
<p>	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F15%2Fdjb-daemontools-with-ubuntus-upstart%2F&amp;title=djb%20daemontools%20with%20Ubuntu%27s%20upstart&amp;notes=In%20case%20anyone%20wants%20to%20get%20djb%27s%20daemontools%20up%20and%20running%20quickly%20on%20an%20OS%20that%20uses%20Ubuntu%27s%20System%20V%20init-replacement%20upstart%2C%20here%27s%20what%20works%20for%20me%3A%0D%0A%0D%0ACreate%20a%203-line%20file%20%2Fetc%2Fevent.d%2Fsvscanboot%20%3A%0D%0A%0D%0A%0D%0Astart%20on%20runlevel%20%5B123456%5D%0D%0Arespawn%0D%0A" title="del.icio.us"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F15%2Fdjb-daemontools-with-ubuntus-upstart%2F&amp;title=djb%20daemontools%20with%20Ubuntu%27s%20upstart" title="Reddit"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F15%2Fdjb-daemontools-with-ubuntus-upstart%2F" title="Technorati"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://twitter.com/home?status=djb%20daemontools%20with%20Ubuntu%27s%20upstart%20-%20http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F15%2Fdjb-daemontools-with-ubuntus-upstart%2F" title="Twitter"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F15%2Fdjb-daemontools-with-ubuntus-upstart%2F&amp;t=djb%20daemontools%20with%20Ubuntu%27s%20upstart" title="Facebook"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F15%2Fdjb-daemontools-with-ubuntus-upstart%2F&amp;title=djb%20daemontools%20with%20Ubuntu%27s%20upstart&amp;annotation=In%20case%20anyone%20wants%20to%20get%20djb%27s%20daemontools%20up%20and%20running%20quickly%20on%20an%20OS%20that%20uses%20Ubuntu%27s%20System%20V%20init-replacement%20upstart%2C%20here%27s%20what%20works%20for%20me%3A%0D%0A%0D%0ACreate%20a%203-line%20file%20%2Fetc%2Fevent.d%2Fsvscanboot%20%3A%0D%0A%0D%0A%0D%0Astart%20on%20runlevel%20%5B123456%5D%0D%0Arespawn%0D%0A" title="Google Bookmarks"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F15%2Fdjb-daemontools-with-ubuntus-upstart%2F&amp;t=djb%20daemontools%20with%20Ubuntu%27s%20upstart" title="HackerNews"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.xcombinator.com%2F2008%2F02%2F15%2Fdjb-daemontools-with-ubuntus-upstart%2F&amp;partner=sociable" title="PDF"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.xcombinator.com/feed/" title="RSS"><img src="http://www.xcombinator.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcombinator.com/2008/02/15/djb-daemontools-with-ubuntus-upstart/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.210 seconds -->
