<?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>Jetpack Flight Log &#187; bash</title>
	<atom:link href="http://jetpackweb.com/blog/topics/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://jetpackweb.com/blog</link>
	<description>Rock{et}ing the interweb</description>
	<lastBuildDate>Sun, 12 Jun 2011 17:51:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Installing the Io Language in Ubuntu</title>
		<link>http://jetpackweb.com/blog/2011/02/05/installing-the-io-language-in-ubuntu/</link>
		<comments>http://jetpackweb.com/blog/2011/02/05/installing-the-io-language-in-ubuntu/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 17:30:32 +0000</pubDate>
		<dc:creator>Brian Racer</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[io-language]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://jetpackweb.com/blog/?p=884</guid>
		<description><![CDATA[I have recently begun reading through Bruce Tate&#8217;s fun Seven Languages In Seven Weeks book. One of the chapters focuses the Io language and it&#8217;s installation can be a little bit non-standard to get it to my liking. Generally on my development machine when I compile from source I like to install locally to my [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently begun reading through <a href="http://twitter.com/#!/redrapids" target="_blank">Bruce Tate&#8217;s</a> fun <a href="http://www.pragprog.com/titles/btlang/seven-languages-in-seven-weeks" target="_blank">Seven Languages In Seven Weeks</a> book. One of the chapters focuses the <a href="http://iolanguage.com/" target="_blank">Io language</a> and it&#8217;s installation can be a little bit non-standard to get it to my liking.</p>
<p>Generally on my development machine when I compile from source I like to install locally to my home directory rather than system wide. This way sudo privileges are not needed plus I just like the idea of keeping these items close to home.</p>
<p>First <strong>Io</strong> requires the cmake build system so make sure that is available.</p>

<div class="wp_syntax"><div class="code"><pre class="bash">$ <span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> cmake</pre></div></div>

<p>Next download and extract the source code.</p>

<div class="wp_syntax"><div class="code"><pre class="bash">$ <span class="kw2">wget</span> <span class="re5">--no-check-certificate</span> http:<span class="sy0">//</span>github.com<span class="sy0">/</span>stevedekorte<span class="sy0">/</span>io<span class="sy0">/</span>zipball<span class="sy0">/</span>master <span class="re5">-O</span> io-lang.zip
$ <span class="kw2">unzip</span> io-lang.zip
$ <span class="kw3">cd</span> stevedekorte-io-<span class="br0">&#91;</span><span class="kw3">hash</span><span class="br0">&#93;</span></pre></div></div>

<p>Io provides a build script, however it is setup to install the language to /usr/local. Since I want it to go in $HOME/local you just need to modify that file. Here is a quick one liner:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">$ <span class="kw2">sed</span> <span class="re5">-i</span> <span class="re5">-e</span> <span class="st_h">'s/^INSTALL_PREFIX=&quot;\/usr\/local/INSTALL_PREFIX=&quot;$HOME\/local/'</span> build.sh</pre></div></div>

<p>Now build and install.</p>

<div class="wp_syntax"><div class="code"><pre class="bash">$ .<span class="sy0">/</span>build.sh
$ .<span class="sy0">/</span>build.sh <span class="kw2">install</span></pre></div></div>

<p>Since we are installing into a location our OS doesn&#8217;t really know about, we need to configure a few paths.</p>

<div class="wp_syntax"><div class="code"><pre class="bash">$ <span class="kw2">vim</span> ~<span class="sy0">/</span>.bashrc
<span class="kw3">export</span> <span class="re2">PATH</span>=<span class="st0">&quot;<span class="es3">${HOME}</span>/local/bin:<span class="es3">${PATH}</span>&quot;</span>
<span class="kw3">export</span> <span class="re2">LD_LIBRARY_PATH</span>=<span class="st0">&quot;<span class="es3">${HOME}</span>/local/lib:<span class="es3">${LD_LIBRARY_PATH}</span>&quot;</span>
&nbsp;
<span class="co0"># You might want these too</span>
<span class="kw3">export</span> <span class="re2">LD_RUN_PATH</span>=<span class="re1">$LD_LIBRARY_PATH</span>
<span class="kw3">export</span> <span class="re2">CPPFLAGS</span>=<span class="st0">&quot;-I<span class="es3">${HOME}</span>/local/include&quot;</span>
<span class="kw3">export</span> <span class="re2">CXXFLAGS</span>=<span class="re1">$CPPFLAGS</span>
<span class="kw3">export</span> <span class="re2">CFLAGS</span>=<span class="re1">$CPPFLAGS</span>
<span class="kw3">export</span> <span class="re2">MANPATH</span>=<span class="st0">&quot;<span class="es3">${HOME}</span>/local/share/man:<span class="es3">${MANPATH}</span>&quot;</span></pre></div></div>

<p>Lastly restart your shell and type &#8216;io&#8217; and you should be dropped into Io&#8217;s REPL!</p>
<p>A side benefit to this method is you can install anything you build into <strong>$HOME/local</strong>. Usually you just need to pass the <i>&#8211;prefix=$HOME/local</i> parameter when you run a <i>./configure</i> script.</p>
]]></content:encoded>
			<wfw:commentRss>http://jetpackweb.com/blog/2011/02/05/installing-the-io-language-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Pretty Paging in Rails Console</title>
		<link>http://jetpackweb.com/blog/2011/01/20/pretty-paging-in-rails-console/</link>
		<comments>http://jetpackweb.com/blog/2011/01/20/pretty-paging-in-rails-console/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 22:07:44 +0000</pubDate>
		<dc:creator>Brian Racer</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://jetpackweb.com/blog/?p=859</guid>
		<description><![CDATA[When using irb or Rails console I use the awesome_print gem to get nicer colorized output. I also like to use looksee to examine method lookup paths which the gem colorizes nicely. For large objects looksee can produce a lot of output and if there is more output than your terminal can display at once [...]]]></description>
			<content:encoded><![CDATA[<p>When using irb or Rails console I use the <a href="https://github.com/michaeldv/awesome_print" target="_blank">awesome_print</a> gem to get nicer colorized output. I also like to use <a href="https://github.com/oggy/looksee">looksee</a> to examine method lookup paths which the gem colorizes nicely. For large objects looksee can produce a lot of output and if there is more output than your terminal can display at once it will get handed off to your system&#8217;s pager (probably <a href="http://en.wikipedia.org/wiki/Less_(Unix)">less</a>). I was having an issue while in Rails console when the output got paged it would show the ANSI color escape codes rather than colorized text (this didn&#8217;t happen in irb for whatever reason).</p>
<p>Luckily <em>less</em> has a flag that will repaint the screen when paging. To make it a default you need to export a LESS variable to your shell&#8217;s environment. Something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="kw3">export</span> <span class="re2">LESS</span>=<span class="st0">&quot;-R&quot;</span></pre></div></div>

<p>Just throw that in your ~/.bashrc or <a href="https://github.com/anveo/dotfiles/commit/db1f89cd9b8e50525bca3901bcf7f121cab41ce8#L0R3" target="_blank">dotfiles</a> and you&#8217;re all set!</p>
<p><img class="aligncenter size-large wp-image-868" title="Screenshot-Terminal" src="http://jetpackweb.com/blog/wp-content/uploads/2011/01/Screenshot-Terminal-1024x550.png" alt="" width="950" height="525" /></p>
]]></content:encoded>
			<wfw:commentRss>http://jetpackweb.com/blog/2011/01/20/pretty-paging-in-rails-console/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pimp your $PS1 with source control information</title>
		<link>http://jetpackweb.com/blog/2010/01/08/pimp-your-ps1-with-source-control-information/</link>
		<comments>http://jetpackweb.com/blog/2010/01/08/pimp-your-ps1-with-source-control-information/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 02:17:09 +0000</pubDate>
		<dc:creator>Brian Racer</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://jetpackweb.com/blog/?p=623</guid>
		<description><![CDATA[I recently found a useful tip of appending source control information of the current working directory to your shell&#8217;s $PS1 line. It might look something like the following image: The method I saw suggested using vcprompt, a small program that outputs a short string basic version control info. Although it worked well, there were a [...]]]></description>
			<content:encoded><![CDATA[<p>I recently found a useful tip of appending source control information of the current working directory to your shell&#8217;s $PS1 line. It might look something like the following image:</p>
<p><img src="http://jetpackweb.com/blog/wp-content/uploads/2010/01/Screenshot-Terminal.png" /></p>
<p> The method I saw suggested using <a href="http://vc.gerg.ca/hg/vcprompt/" target="_blank">vcprompt</a>, a small program that outputs a short string basic version control info. Although it worked well, there were a couple issues I had with it. First, it&#8217;s subversion support was somewhat lacking. Second, it was written in C which made it more of a pain to modify, and I wasn&#8217;t a huge fan of keeping the binary in version control. </p>
<p>After a little searching I stumbled across <a href="http://github.com/xvzf/vcprompt">vcprompt.py</a>, a python script that did the same thing. This version also had wider support for source control systems, and being a standard python text script it was something I could easily modify and put into my <a href="http://github.com/anveo/dotfiles" target="_blank">dotfiles</a> git repo. I wasn&#8217;t happy with how this one displayed subversion information either(just a revision number which I didn&#8217;t find very helpful), so I <a href="http://github.com/anveo/dotfiles/blob/master/scripts/vcprompt.py" target="_blank"><strong>made my own modification</strong></a> to display the branch you are in. Please pardon my lacking Python skills. </p>
<p>Anyway, on to pimping your prompt. Before we modify the PS1 variable, we need to make sure the vcprompt.py is in your $PATH. I like to put scripts like this in a custom  <i>bin</i> directory in my homedir. One way to accomplish that might be the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash">$ <span class="kw2">mkdir</span> <span class="re5">-p</span> ~<span class="sy0">/</span>bin
$ <span class="kw3">cd</span> ~<span class="sy0">/</span>bin
$ <span class="kw2">wget</span> http:<span class="sy0">//</span>github.com<span class="sy0">/</span>anveo<span class="sy0">/</span>dotfiles<span class="sy0">/</span>raw<span class="sy0">/</span>master<span class="sy0">/</span>scripts<span class="sy0">/</span>vcprompt.py
$ <span class="kw2">chmod</span> +x vcprompt.py
$ <span class="kw3">export</span> <span class="re2">PATH</span>=~<span class="sy0">/</span>bin:<span class="re1">$PATH</span></pre></div></div>

<p>Displayed next is the PS1 line I use &#8211; it takes up two lines: the first line contains the current user, hostname,  current working directory, and possibly version control info, and the second is just a nice looking arrow for my input. Your terminal will need to support Unicode if you want to use that symbol.</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span class="co0"># .bashrc</span>
<span class="re2">PS1</span>=<span class="st0">&quot;<span class="es1">\n</span>\u@\h:\w \[\e[1;30m\]<span class="es4">$(vcprompt)</span>\[\e[0m\] <span class="es1">\n</span>→&quot;</span>
&nbsp;
<span class="co0"># If you are using zsh you may also need the following in .zshrc</span>
setopt prompt_subst</pre></div></div>

<p><small>If you use the colors specified, you may need to <a href="http://github.com/anveo/dotfiles/blob/master/bash/config" target="_blank">define those too</a>.</small></p>
<p>You should now have a prompt similar to the image above! For more shell customizations checkout the rest of my <a href="http://github.com/anveo/dotfiles" target="_blank">dotfiles</a>, and consider buying Peepcode&#8217;s <a href="http://peepcode.com/products/advanced-command-line" target="_blank">Advanced Command Line screencasts</a> for more productive tips!</p>
]]></content:encoded>
			<wfw:commentRss>http://jetpackweb.com/blog/2010/01/08/pimp-your-ps1-with-source-control-information/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

