<?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>kb.hurricane-ridge.com &#187; Scripting</title>
	<atom:link href="http://kb.hurricane-ridge.com/category/scripting/feed" rel="self" type="application/rss+xml" />
	<link>http://kb.hurricane-ridge.com</link>
	<description>My personal - but public - knowledge base</description>
	<lastBuildDate>Mon, 09 Jan 2012 14:49:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>virtualenv-burrito example bootstrap</title>
		<link>http://kb.hurricane-ridge.com/scripting/python/virtualenv-burrito-example-bootstrap</link>
		<comments>http://kb.hurricane-ridge.com/scripting/python/virtualenv-burrito-example-bootstrap#comments</comments>
		<pubDate>Thu, 08 Sep 2011 15:32:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[fabric]]></category>
		<category><![CDATA[virtualenv]]></category>
		<category><![CDATA[virtualenvwrapper]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=1086</guid>
		<description><![CDATA[You will likely want the python-dev .deb installed before starting this process. When you want to switch back to your system python installation:]]></description>
			<content:encoded><![CDATA[<pre class="brush: plain; light: true; title: ; notranslate">
curl -s https://raw.github.com/brainsik/virtualenv-burrito/master/virtualenv-burrito.sh | bash
source ~/.venvburrito/startup.sh
mkvirtualenv --no-site-packages fabric
pip install Fabric
</pre>
<p>You will likely want the python-dev .deb installed before starting this process.</p>
<p>When you want to switch back to your system python installation:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
deactivate
</pre>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/scripting/python/virtualenv-burrito-example-bootstrap/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Two-Liner to Convert from a Unix Time Stamp</title>
		<link>http://kb.hurricane-ridge.com/scripting/python/python-two-liner-to-convert-from-a-unix-time-stamp</link>
		<comments>http://kb.hurricane-ridge.com/scripting/python/python-two-liner-to-convert-from-a-unix-time-stamp#comments</comments>
		<pubDate>Thu, 10 Dec 2009 22:03:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=749</guid>
		<description><![CDATA[&#62;&#62;&#62; import time &#62;&#62;&#62; time.gmtime(1253548874) (2009, 9, 21, 16, 1, 14, 0, 264, 0)]]></description>
			<content:encoded><![CDATA[<p><code>&gt;&gt;&gt; import time<br />
&gt;&gt;&gt; time.gmtime(1253548874)<br />
(2009, 9, 21, 16, 1, 14, 0, 264, 0)</code></p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/scripting/python/python-two-liner-to-convert-from-a-unix-time-stamp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl installation &#8220;best&#8221; practices</title>
		<link>http://kb.hurricane-ridge.com/scripting/perl/perl-installation-best-practices</link>
		<comments>http://kb.hurricane-ridge.com/scripting/perl/perl-installation-best-practices#comments</comments>
		<pubDate>Tue, 30 Dec 2008 20:36:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=64</guid>
		<description><![CDATA[An old post, but one whose recommendations seem to work well &#8211; especially the part about installing as a non-root user &#8211; if you&#8217;re faced with an inflexible packaging of a system Perl that you don&#8217;t want to touch, like an RPM install. (Not needing to worry about things like this most of the time [...]]]></description>
			<content:encoded><![CDATA[<p>An old post, but one whose recommendations seem to work well &#8211; especially the part about installing as a non-root user &#8211; if you&#8217;re faced with an inflexible packaging of a system Perl that you don&#8217;t want to touch, like an RPM install. (Not needing to worry about things like this most of the time is one of the greatest strengths of FreeBSD&#8217;s ports system.) From the Journal of jdavidb: <a href="http://use.perl.org/~jdavidb/journal/6477">Perl installation &#8220;best&#8221; practices</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/scripting/perl/perl-installation-best-practices/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash Programming Cheat Sheet</title>
		<link>http://kb.hurricane-ridge.com/scripting/bash/bash-programming-cheat-sheet</link>
		<comments>http://kb.hurricane-ridge.com/scripting/bash/bash-programming-cheat-sheet#comments</comments>
		<pubDate>Tue, 30 Dec 2008 20:28:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=54</guid>
		<description><![CDATA[A quick overview of Bash shell syntax: JustLinux&#8217;s Bash Programming Cheat Sheet.]]></description>
			<content:encoded><![CDATA[<p>A quick overview of Bash shell syntax: <a href="http://www.justlinux.com/nhf/Programming/Bash_Programming_Cheat_Sheet.html">JustLinux&#8217;s Bash Programming Cheat Sheet</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/scripting/bash/bash-programming-cheat-sheet/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading Perl 5.6 to Perl 5.8 Using Portupgrade and perl-after-upgrade</title>
		<link>http://kb.hurricane-ridge.com/scripting/perl/upgrading-perl-56-to-perl-58-using-portupgrade-and-perl-after-upgrade</link>
		<comments>http://kb.hurricane-ridge.com/scripting/perl/upgrading-perl-56-to-perl-58-using-portupgrade-and-perl-after-upgrade#comments</comments>
		<pubDate>Mon, 29 Dec 2008 18:36:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[ports]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=36</guid>
		<description><![CDATA[Use the -o flag to portupgrade to replace the perl5 port with a the perl5.8 port: # portupgrade -rR -o lang/perl5.8 lang/perl5 After the upgrade (this is applicable after any Perl ports upgrade, such as 5.8.8 to 5.8.9), run the perl-after-upgrade script, first in test mode, then in fix mode: # perl-after-upgrade # perl-after-upgrade -f Fix any errors highlighted by perl-after-upgrade, and [...]]]></description>
			<content:encoded><![CDATA[<p>Use the <code>-o</code> flag to <code>portupgrade</code> to replace the perl5 port with a the perl5.8 port:</p>
<p><code># portupgrade -rR -o lang/perl5.8 lang/perl5</code></p>
<p>After the upgrade (this is applicable after <em>any</em> Perl ports upgrade, such as 5.8.8 to 5.8.9), run the <code>perl-after-upgrade</code> script, first in test mode, then in fix mode:</p>
<p><code># perl-after-upgrade<br />
# perl-after-upgrade -f</code></p>
<p>Fix any errors highlighted by <code>perl-after-upgrade</code>, and reinstall any required packages.  Review files left behind from the older Perl installation (typically <code>/usr/local/lib/perl5/site_perl/5.X.Y/</code>).  After verifying that the upgraded Perl works as expected, remove <code>+CONTENTS.bak</code> files from subdirectories under <code>/var/db/pkg</code>.</p>
<p>See the <code>perl-after-upgrade</code> man page for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/scripting/perl/upgrading-perl-56-to-perl-58-using-portupgrade-and-perl-after-upgrade/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loop Over Each Line in a File using Bash</title>
		<link>http://kb.hurricane-ridge.com/scripting/bash/loop-over-each-line-in-a-file-using-bash</link>
		<comments>http://kb.hurricane-ridge.com/scripting/bash/loop-over-each-line-in-a-file-using-bash#comments</comments>
		<pubDate>Sun, 28 Dec 2008 23:40:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://kb.hurricane-ridge.com/?p=8</guid>
		<description><![CDATA[Use exec as below, for example: exec &#60; $PASSWORD_FILE while read LINE; do user=`echo $LINE &#124; cut -d: -f1` uid=`echo $LINE &#124; cut -d: -f3` pgroup=`echo $LINE &#124; cut -d: -f4` homedir=`echo $LINE &#124; cut -d: -f6` shell=`echo $LINE &#124; cut -d: -f7` gecos=`echo $LINE &#124; cut -d: -f5` cmd="/usr/sbin/useradd -u $uid -g $pgroup -d [...]]]></description>
			<content:encoded><![CDATA[<p>Use exec as below, for example:</p>
<pre><code>exec &lt; $PASSWORD_FILE
while read LINE; do
  user=`echo $LINE | cut -d: -f1`
  uid=`echo $LINE | cut -d: -f3`
  pgroup=`echo $LINE | cut -d: -f4`
  homedir=`echo $LINE | cut -d: -f6`
  shell=`echo $LINE | cut -d: -f7`
  gecos=`echo $LINE | cut -d: -f5`
  cmd="/usr/sbin/useradd -u $uid -g $pgroup -d $homedir -s $shell -c $gecos $user"
done</code></pre>
<p>You may need to store stdin within another file descriptor if you need your script to receive input from stdin after the loop runs.</p>
]]></content:encoded>
			<wfw:commentRss>http://kb.hurricane-ridge.com/scripting/bash/loop-over-each-line-in-a-file-using-bash/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

