<?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>ijonas.com &#187; Software Development</title>
	<atom:link href="http://ijonas.com/category/software-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://ijonas.com</link>
	<description>Habitual Ramblings of an Indiginous Ijonous</description>
	<lastBuildDate>Mon, 02 Jan 2012 15:12:55 +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>Configuring Spree Commerce to use the British Pound currency</title>
		<link>http://ijonas.com/software-development/ruby/2019/</link>
		<comments>http://ijonas.com/software-development/ruby/2019/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 01:34:55 +0000</pubDate>
		<dc:creator>ijonas</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[British]]></category>
		<category><![CDATA[eCommerce]]></category>
		<category><![CDATA[GBP]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[pound sterling]]></category>
		<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[Spree]]></category>

		<guid isPermaLink="false">http://ijonas.com/?p=2019</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fruby%2F2019%2F&title=Configuring+Spree+Commerce+to+use+the+British+Pound+currency&desc=I%27ve+been+playing+around+with+Spree+for+a+couple+of+weeks+and+ran+into+a+slightly+confusing+issue+wrt.+using+a+non-US+Dollar+currency%2C+in+my+case+British+Pounds.%0D%0A%0D%0AAt+the+time+of+this+writing%2C+using+&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>I&#8217;ve been playing around with Spree for a couple of weeks and ran into a slightly confusing issue wrt. using a non-US Dollar currency, in my case British Pounds. At the time of this writing, using Rails 3.1.x and Spree &#8230; <a href="http://ijonas.com/software-development/ruby/2019/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fruby%2F2019%2F&title=Configuring+Spree+Commerce+to+use+the+British+Pound+currency&desc=I%27ve+been+playing+around+with+Spree+for+a+couple+of+weeks+and+ran+into+a+slightly+confusing+issue+wrt.+using+a+non-US+Dollar+currency%2C+in+my+case+British+Pounds.%0D%0A%0D%0AAt+the+time+of+this+writing%2C+using+&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>I&#8217;ve been playing around with <a href="http://spreecommerce.com/">Spree</a> for a couple of weeks and ran into a slightly confusing issue wrt. using a non-US Dollar currency, in my case British Pounds.</p>
<p>At the time of this writing, using Rails 3.1.x and Spree 0.70, the following steps will enable a &#8216;£&#8217; (a pound sterling) sign to be displayed.</p>
<p>Add the I18n gem to your Gemfile and run bundle install:</p>
<p><code>gem 'rails-i18n'</code></p>
<p>Open a shell and cd into the config/locales folder of your Spree/Rails project. Download the British locale file:</p>
<p><code>wget https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/en-GB.yml</code></p>
<p>You&#8217;ll also need <em>copy the contents</em> of <a href="https://raw.github.com/spree/spree_i18n/master/config/locales/en-GB.yml">Spree&#8217;s British I18n file</a> into the bottom of of your <code>config/locales/en-GB.yml</code> file.</p>
<p>Edit your <code>config/application.rb</code> and set your default locale to &#8216;British&#8217;:</p>
<p><code>config.i18n.default_locale = :"en-GB"</code></p>
<p>Create a new file in <code>config/locales/en-GB_numbers.yml</code> with the following contents:</p>
<p><code>---<br />
en-GB:<br />
number:<br />
currency:<br />
format:<br />
format: "%u%n"<br />
unit: "£"<br />
precision: 2<br />
separator: '.'<br />
delimiter: ','</code></p>
<p>Spree uses the above file to set the currency settings. Be aware that Spree is currently a single currency application.</p>
]]></content:encoded>
			<wfw:commentRss>http://ijonas.com/software-development/ruby/2019/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Redis 2.2.4 on Ubuntu 10.10 &amp; 11.04 and running with an &#8216;init&#8217; script.</title>
		<link>http://ijonas.com/software-development/nosql/412/</link>
		<comments>http://ijonas.com/software-development/nosql/412/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 12:42:36 +0000</pubDate>
		<dc:creator>ijonas</dc:creator>
				<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[2.2.4]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[maverick meerkat]]></category>
		<category><![CDATA[nosql]]></category>
		<category><![CDATA[redis]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ubuntu 10.10]]></category>
		<category><![CDATA[ubuntu 11.04]]></category>

		<guid isPermaLink="false">http://www.denofubiquity.com/?p=412</guid>
		<description><![CDATA[Following on from <a href="http://www.denofubiquity.com/nosql/398/">previous post on installing MongoDB 1.8.1</a>, here are similar steps to getting Redis 2.2.4 running on Ubuntu 10.10 using an init script. The setup is intended to be used on developer desktop/laptop rather than production infrastructure.
 <a href="http://ijonas.com/software-development/nosql/412/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fnosql%2F412%2F&title=Installing+Redis+2.2.4+on+Ubuntu+10.10+%26+11.04+and+running+with+an+%27init%27+script.&desc=Following+on+from+previous+post+on+installing+MongoDB+1.8.1%2C+here+are+similar+steps+to+getting+Redis+2.2.4+running+on+Ubuntu+10.10+using+an+init+script.+The+setup+is+intended+to+be+used+on+developer+d&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>Following on from <a href="http://www.denofubiquity.com/nosql/398/">previous post on installing MongoDB 1.8.1</a>, here are similar steps to getting Redis 2.2.4 running on Ubuntu 10.10 using an init script. The setup is intended to be used on developer desktop/laptop rather than production infrastructure.</p>
<p>As ever, first download and unzip Redis from <a href="http://redis.io/download">here</a>.</p>
<pre>cd /tmp
wget http://redis.googlecode.com/files/redis-2.2.4.tar.gz
tar -zxf redis-2.2.4.tar.gz
cd redis-2.2.4
make
sudo make install</pre>
<p>Your Redis binaries should now be located in /usr/local/bin.</p>
<p>To get an init script and Redis config working cleanly with this setup, download my init and config files from <a href="https://github.com/ijonas/dotfiles/">my Github ‘dotfiles’ repo</a>. My init script is pretty standard. However my redis.conf sets Redis up with 1Gb of virtual memory and 20Gb of swap space &#8211; intended for general development purposes.</p>
<pre>wget https://github.com/ijonas/dotfiles/raw/master/etc/init.d/redis-server
wget https://github.com/ijonas/dotfiles/raw/master/etc/redis.conf
sudo mv redis-server /etc/init.d/redis-server
sudo chmod +x /etc/init.d/redis-server
sudo mv redis.conf /etc/redis.conf</pre>
<p>Before you can fire up the Redis server for the first time, you&#8217;ll need add a redis user and prep a data and logging folder.</p>
<pre>
sudo mkdir -p /var/lib/redis
sudo mkdir -p /var/log/redis
sudo useradd --system --home-dir /var/lib/redis redis
sudo chown redis.redis /var/lib/redis
sudo chown redis.redis /var/log/redis</pre>
<p>Also, you need to activate your Redis services init script by adding it to your system&#8217;s run-level configuration. That way the service will startup during the boot sequence and stop nicely during the OS&#8217; shutdown procedure.</p>
<pre>sudo update-rc.d redis-server defaults</pre>
<p>You&#8217;re now ready to launch Redis server with</p>
<pre>sudo /etc/init.d/redis-server start</pre>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://ijonas.com/software-development/nosql/412/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Installing MongoDB 1.8.1 on Ubuntu 10.10 &amp; 11.04 and running with an &#8216;init&#8217; script.</title>
		<link>http://ijonas.com/software-development/nosql/398/</link>
		<comments>http://ijonas.com/software-development/nosql/398/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 11:37:17 +0000</pubDate>
		<dc:creator>ijonas</dc:creator>
				<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[1.8]]></category>
		<category><![CDATA[10Gen]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[init script]]></category>
		<category><![CDATA[init.d]]></category>
		<category><![CDATA[journal]]></category>
		<category><![CDATA[journaling]]></category>
		<category><![CDATA[maverick meerkat]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ubuntu 10.10]]></category>
		<category><![CDATA[ubuntu 11.04]]></category>

		<guid isPermaLink="false">http://www.denofubiquity.com/?p=398</guid>
		<description><![CDATA[Installing MongoDB 1.8.1, in my case as a developer database, is easy. This blog post just itemises all the steps so that you can pretty blindly follow allong. I'll probably use these steps myself as I seem to be doing this regurlarly ;-)
 <a href="http://ijonas.com/software-development/nosql/398/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fnosql%2F398%2F&title=Installing+MongoDB+1.8.1+on+Ubuntu+10.10+%26+11.04+and+running+with+an+%27init%27+script.&desc=Installing+MongoDB+1.8.1%2C+in+my+case+as+a+developer+database%2C+is+easy.+This+blog+post+just+itemises+all+the+steps+so+that+you+can+pretty+much+blindly+follow+along.+I%27ll+probably+use+these+steps+myself&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>Installing MongoDB 1.8.1, in my case as a developer database, is easy. This blog post just itemises all the steps so that you can pretty much blindly follow along. I&#8217;ll probably use these steps myself as I seem to be doing this regurlarly <img src='http://ijonas.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Download the 64bit Linux binaries from <a title="MongoDB binaries download page" href="http://www.mongodb.org/downloads">here</a> and unzip the contents to /usr/local.</p>
<pre language="bash">cd /tmp
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.8.1.tgz
sudo tar -zxf /tmp/mongodb-linux-x86_64-1.8.1.tgz -C /usr/local</pre>
<p>Setup some symbolic links.</p>
<pre language="bash">sudo ln -s /usr/local/mongodb-linux-x86_64-1.8.1 /usr/local/mongodb
sudo ln -s /usr/local/mongodb/bin/bsondump /usr/local/bin/bsondump
sudo ln -s /usr/local/mongodb/bin/mongo /usr/local/bin/mongo
sudo ln -s /usr/local/mongodb/bin/mongod /usr/local/bin/mongod
sudo ln -s /usr/local/mongodb/bin/mongodump /usr/local/bin/mongodump
sudo ln -s /usr/local/mongodb/bin/mongoexport /usr/local/bin/mongoexport
sudo ln -s /usr/local/mongodb/bin/mongofiles /usr/local/bin/mongofiles
sudo ln -s /usr/local/mongodb/bin/mongoimport /usr/local/bin/mongoimport
sudo ln -s /usr/local/mongodb/bin/mongorestore /usr/local/bin/mongorestore
sudo ln -s /usr/local/mongodb/bin/mongos /usr/local/bin/mongos
sudo ln -s /usr/local/mongodb/bin/mongosniff /usr/local/bin/mongosniff
sudo ln -s /usr/local/mongodb/bin/mongostat /usr/local/bin/mongostat</pre>
<p>The first &#8220;ln -s&#8221; above sets up a handy symbolic link between the versioned mongodb folder and its unversioned counterpart. When 10Gen release updates, say version 1.8.2, all you need to do is download, unzip, and link the &#8217;1.8.2 mongodb folder&#8217; to the unversioned folder and &#8216;hey presto&#8217; everything should just work.</p>
<p>To get an init script working cleanly with this setup, download mine from <a title="Ijonas' dotfiles repo" href="https://github.com/ijonas/dotfiles">my Github &#8216;dotfiles&#8217; repo</a>. Please note &#8211; my init script enables journaling and the REST interface (on line 51).</p>
<pre language="bash">wget https://github.com/ijonas/dotfiles/raw/master/etc/init.d/mongod
sudo mv mongod /etc/init.d/mongod
sudo chmod +x /etc/init.d/mongod
</pre>
<p>You&#8217;ll need to add a mongodb user and prep some folders</p>
<pre language="bash">sudo useradd mongodb
sudo mkdir -p /var/lib/mongodb
sudo mkdir -p /var/log/mongodb
sudo chown mongodb.mongodb /var/lib/mongodb
sudo chown mongodb.mongodb /var/log/mongodb</pre>
<p>Also, you need to activate your MongoDB service&#8217;s init script by adding it to your system&#8217;s run-level configuration. That way the service will startup during the boot sequence and stop nicely during the OS&#8217; shutdown procedure.</p>
<pre>
sudo update-rc.d mongod defaults
</pre>
<p>Lastly to launch MongoDB</p>
<pre language="bash">/etc/init.d/mongod start</pre>
<p>Good luck!</p>
<p><strong>UPDATE:</strong> Since April 6 Ubuntu now has prefabbed packages containing MongoDB 1.8.1, maintained by 10Gen. See the instruction below.</p>
]]></content:encoded>
			<wfw:commentRss>http://ijonas.com/software-development/nosql/398/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Multi-system Development Environment</title>
		<link>http://ijonas.com/software-development/344/</link>
		<comments>http://ijonas.com/software-development/344/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 22:39:48 +0000</pubDate>
		<dc:creator>ijonas</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[gvim]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[macvim]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.denofubiquity.com/?p=344</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2F344%2F&title=Multi-system+Development+Environment&desc=I+develop+on+numerous+systems+every+day%2C+specifically+a+MacBook+Pro+running+Snow+Leopard%2C+a+Dell+laptop+running+a+Ubuntu+VM+and+a+shedload+of+cloud-based+Ubuntu+servers.+I+want+to+be+able+to+develop+a&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>I develop on numerous systems every day, specifically a MacBook Pro running Snow Leopard, a Dell laptop running a Ubuntu VM and a shedload of cloud-based Ubuntu servers. I want to be able to develop across all those systems using &#8230; <a href="http://ijonas.com/software-development/344/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2F344%2F&title=Multi-system+Development+Environment&desc=I+develop+on+numerous+systems+every+day%2C+specifically+a+MacBook+Pro+running+Snow+Leopard%2C+a+Dell+laptop+running+a+Ubuntu+VM+and+a+shedload+of+cloud-based+Ubuntu+servers.+I+want+to+be+able+to+develop+a&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>I develop on numerous systems every day, specifically a MacBook Pro running Snow Leopard, a Dell laptop running a Ubuntu VM and a shedload of cloud-based Ubuntu servers. I want to be able to develop across all those systems using the same setup.</p>
<p>Now for years I&#8217;ve been a TextMate junkie. Its an amazing editor, &#8217;nuff said, but it only runs on one of the systems I work on daily and I&#8217;m done with Java-based IDEs. I know that there&#8217;s enough people out there getting similar productivity out of a highly-customised Vim-based setup.  So today I decided to switch to Vim.</p>
<p>I want the same keystroke-commands, shortcuts, aliases, and environment wherever I might wander. I want to log on to a new machine and configure my environment on the new machine by typing one or two commands at the shell prompt.</p>
<p>Here&#8217;s how its done.</p>
<h3>Github Magic</h3>
<p>The configuration settings are tracked and shared via a public repo on Github. Here&#8217;s my <a href="http://github.com/ijonas/dotfiles">ijonas/dotfiles</a> repo. So whenever I get access to a new system I simply type the following:</p>
<pre>git clone http://github.com/ijonas/dotfiles.git</pre>
<p>which will create a dotfiles folder in the home directory.</p>
<p>The dotfiles folder contains copies of all the important &#8216;shell&#8217; rc-files that setup paths, aliases, and environment variables:</p>
<p>The dotfiles folder contains</p>
<ul>
<li><strong>bashrc</strong> &#8211; which is pretty skinny and only loads the contents of the three files in the bash/ subfolder.</li>
<li><strong>gemrc</strong> &#8211; contains  some defaults for the Ruby gem package manager.</li>
<li><strong>gvimrc</strong> &#8211; contains graphical vim defaults, currently empty.</li>
<li><strong>rvmrc</strong> &#8211; defaults for the Ruby VM manager.</li>
<li><strong>ssh/config</strong> &#8211; host config for ssh, shortening those pesky ec2 hostnames etc.</li>
<li><strong>vim</strong> &#8211; the plugins folder for Vim.</li>
<li><strong>vimrc</strong> &#8211; default properties used by Vim, GVim, and MacVim alike.</li>
</ul>
<p>So the trick now</p>
<p><img class="size-full wp-image-348 alignleft" title="Dotfiles" src="http://ijonas.com/wp-content/uploads/2010/10/dotfiles1.jpg" alt="Dotfiles" width="210" height="306" /></p>
<p>is to have the system recognise these files and use their contents. Here&#8217;s how from your $HOME folder:</p>
<pre>ln -s $HOME/dotfiles/bashrc $HOME/.bashrc</pre>
<pre>ln -s $HOME/dotfiles/gemrc $HOME/.gemrc</pre>
<pre>ln -s $HOME/dotfiles/gvimrc $HOME/.gvimrc</pre>
<pre>ln -s $HOME/dotfiles/rvmrc $HOME/.rvmrc</pre>
<pre>ln -s $HOME/dotfiles/vimrc $HOME/.vimrc</pre>
<pre>ln -s $HOME/dotfiles/vim $HOME/.vim</pre>
<pre>ln -s $HOME/dotfiles/ssh/config $HOME/.ssh/config</pre>
<p>So you see, simple&#8230; fetch a repo from Github, and create a whole bunch of symbolic links. So when you make changes on any of your systems you can push those changes to Github and pull them down to others. One caveat, you need to make the repo public, otherwise you&#8217;re going to have to copy your SSH keys all over the place.</p>
<h3>Next stop: Vim !</h3>
<p>Vanilla Vim is hard work. You need to customise it for your own nefarious needs. Install GVim on Linux and MacVim on SnowLeopard. I use Homebrew package manager on the Mac, and so should you. Installing MacVim is easy</p>
<pre>brew install macvim</pre>
<p>After installing MacVim, you&#8217;ll find it hard to find. Typing &#8220;macvim&#8221; on the shell prompt results in &#8220;command not found&#8221; messages. The best solution I found was to setup a bash function. Its a one-line found in my dotfiles/bash/aliases file and looks like this:</p>
<pre>function mvim { /usr/local/Cellar/macvim/HEAD/MacVim.app/Contents/MacOS/Vim -g $*; }</pre>
<p>This results in a &#8220;mvim&#8221; alias being available on the shell prompt, i.e. you can type &#8216;mvim README&#8217; to edit a file in MacVim.<br />
We&#8217;re almost done&#8230; Before you start customising Vim, you need to prepare your Vim environment in a similar Git-based fashion. In particular you need to install the pathogen plugin for Vim. You&#8217;re best best is to watch the <a href="http://vimcasts.org/episodes/synchronizing-plugins-with-git-submodules-and-pathogen/">&#8220;synchronizing plugins&#8221; vimcast</a> and follow its guidelines.</p>
<p>Now go cherry pick from the other excellent screencasts available on Drew Neil&#8217;s excellent Vimcasts.org site.<br />
Also: If I&#8217;ve missed anything out, please post a comment and I&#8217;ll expand on anything that needs expanding.</p>
]]></content:encoded>
			<wfw:commentRss>http://ijonas.com/software-development/344/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barbler: Integrating JRuby Warbler into Apache Builder</title>
		<link>http://ijonas.com/software-development/ruby/319/</link>
		<comments>http://ijonas.com/software-development/ruby/319/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 21:54:14 +0000</pubDate>
		<dc:creator>ijonas</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[buildr]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[war]]></category>
		<category><![CDATA[warbler]]></category>

		<guid isPermaLink="false">http://www.denofubiquity.com/?p=319</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fruby%2F319%2F&title=Barbler%3A+Integrating+JRuby+Warbler+into+Apache+Builder&desc=After+having+used+Apache+Builder+for+a+week+and+extracted+our+Warbler-code+into+a+bonafide+extension%2C+I%27m+sharing+it+with+the+community+under+the+fetching+name+Barbler.%0A%0ABarbler+integrates+itself+betw&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>After having used Apache Builder for a week and extracted our Warbler-code into a bonafide extension, I&#8217;m sharing it with the community under the fetching name Barbler. Barbler integrates itself between the build and packaging stages of the Apache Builder &#8230; <a href="http://ijonas.com/software-development/ruby/319/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fruby%2F319%2F&title=Barbler%3A+Integrating+JRuby+Warbler+into+Apache+Builder&desc=After+having+used+Apache+Builder+for+a+week+and+extracted+our+Warbler-code+into+a+bonafide+extension%2C+I%27m+sharing+it+with+the+community+under+the+fetching+name+Barbler.%0A%0ABarbler+integrates+itself+betw&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>After having used Apache Builder for a week and extracted our Warbler-code into a bonafide extension, I&#8217;m sharing it with the community under the fetching name <strong>Barbler</strong>.</p>
<p>Barbler integrates itself between the build and packaging stages of the Apache Builder lifecycle and makes calls into Warbler to automate WAR-file creation. Now Warbler does a really good job for packaging standalone Rails apps. Unfortunately I needed something more integrated into our application build process, that pulls in our Spring Framework-based Java code, Scala code, and Rails application and produces a single WAR-file containing all dependent libraries, Rails code, XML deployment descriptors and Java class files. Apache Builder does everything other than the Rails-packaging. Barbler steps to provide that missing step.</p>
<p>Create a barbler.rb file in your project folder, which also contains your buildfile and copy the following contents into it:</p>
<pre lang="ruby"># Barbler
# is an Apache Builder extension to integrate the JRuby Warbler gem.
# For tips on how to use Barbler checkout http://www.denofubiquity.com/ruby/barbler/
#
# This code is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt)
# Please distribute Barbler code with this code intact.
# (c) Ijonas Kisselbach 2009

require 'warbler'

module Barbler
  include Extension

  first_time do
    # Define task not specific to any projet.
    desc 'Warbles Rails sourcecode tree into a staging folder'
    Project.local_task('warble' => 'build') { |name| "Warbling #{name}" }
  end

  before_define do |project|
    project.task('warble'=>project.task('build'))
    project.group ||= project.parent &#038;&#038; project.parent.group || project.name
    project.version ||= project.parent &#038;&#038; project.parent.version
  end

  # To use this method in your project:
  #   warble(:rails => path_to(:rails), :tasks => [:app, :public])
  def warble(*args)
    options = args.pop
    rails_path = options[:rails]
    warble_tasks = options[:tasks]

    # Define the warble task for this particular project.
    Rake::Task.define_task 'warble' do |task|
      # get all the important components from the Rails GUI into the staging directory
      puts "Warbling #{rails_path}"
      Dir.chdir(rails_path) do
        warble_cfg = eval(File.open("config/warble.rb") {|f| f.read})
        Warbler::Task.new(:war, warble_cfg)
        warble_tasks.each {|task| Rake::Task["war:#{task}"].invoke}
      end
    end
  end

end

class Buildr::Project
  include Barbler
end</pre>
<p>Add the folllowing line to the top of your buildfile:</p>
<pre lang="ruby">warble(:rails => path_to(:rails), :tasks => [:app, :public])</pre>
<p>You can then define your warble task using the following line</p>
<pre lang="ruby">warble(:rails => path_to(:rails), :tasks => [:app, :public])</pre>
<p> whereby the first parameter is a path string to where your Rails code is located. You may locate your code in src/main/rails in which case you&#8217;d use</p>
<pre lang="ruby">warble(:rails => path_to(:source, :main, :rails), :tasks => [:app, :public])</pre>
<p>The second parameter is the list of Warbler tasks that you&#8217;d like to have executed. See the Warbler documentation for more help, or check out the Warbler source code &#8211; it&#8217;s very readable.</p>
]]></content:encoded>
			<wfw:commentRss>http://ijonas.com/software-development/ruby/319/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Integrating Warbler and Buildr into Scala, JRuby, Java and Rails bliss</title>
		<link>http://ijonas.com/software-development/ruby/297/</link>
		<comments>http://ijonas.com/software-development/ruby/297/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 14:24:25 +0000</pubDate>
		<dc:creator>ijonas</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[apache buildr]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[buildr]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[jruby warbler scala java build apache buildr maven ant]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[warbler]]></category>

		<guid isPermaLink="false">http://www.denofubiquity.com/?p=297</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fruby%2F297%2F&title=Integrating+Warbler+and+Buildr+into+Scala%2C+JRuby%2C+Java+and+Rails+bliss&desc=At+Vamosa+we%27re+big+fans+of+the+Java+Virtual+Machine.+It+allows+us+to+use+the+right+tool+for+the+job+and+deliver+a+high-quality+consistent+product+for+our+end-users%2C+whilst+still+getting+the+most+of+o&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>At Vamosa we&#8217;re big fans of the Java Virtual Machine. It allows us to use the right tool for the job and deliver a high-quality consistent product for our end-users, whilst still getting the most of our developers. For years &#8230; <a href="http://ijonas.com/software-development/ruby/297/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fruby%2F297%2F&title=Integrating+Warbler+and+Buildr+into+Scala%2C+JRuby%2C+Java+and+Rails+bliss&desc=At+Vamosa+we%27re+big+fans+of+the+Java+Virtual+Machine.+It+allows+us+to+use+the+right+tool+for+the+job+and+deliver+a+high-quality+consistent+product+for+our+end-users%2C+whilst+still+getting+the+most+of+o&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>At <a href="http://www.vamosa.com">Vamosa</a> we&#8217;re big fans of the Java Virtual Machine. It allows us to use the right tool for the job and deliver a high-quality consistent product for our end-users, whilst still getting the most of our developers. For years we were a .NET and Java shop. Our GUI developers would work in Visual Studio writing a C# application that via SOAP webservices would talk to the Java-backend. In June 2008 we decided to abandon our .NET Desktop GUI and redevelop and expand its functionality, delivered to the end-user&#8217;s browser using HTML+CSS+JavaScript from our Java-backend.</p>
<p>We spend 7months hacking away trying to get Google Web Toolkit to behave before abandoning ship a month ago and switching to Rails. We already had some success building a MRI-based RubyOnRails application called <a href="http://www.vamosa.com/vamosa-check-and-fix-a315">Vamosa Check and Fix</a>. Our GUI developer pool was loving the ease of web development that comes with Rails, and really hated the total lack of productivity from GWT (worthy of a separate post).</p>
<p>Meanwhile I was experimenting with Scala &#8211; IMO the Java language reinvented for the 21st century. So there we were steaming ahead with JRubyOnRails, old-skool Java Spring-based code, and sexy-new Scala code. Three languages, one set of JVM byte code. So how do you build and package all this code ???</p>
<p>Your options are:</p>
<ul>
<li> Apache Maven &#8211; horrible for legacy projects that don&#8217;t build according to Maven doctrine.</li>
<li> Apache Ant + Ivy &#8211; might be an option to you.</li>
<li> Apache Buildr &#8211; JRuby-based build system</li>
</ul>
<p>For us, Apache Buildr had the best fit because its a DSL based-on Rake, which happily runs on JRuby. It provided the dependency management that kept us coming back to Maven (and quickly running away again). It&#8217;s JRuby/Rake-based allowing for tight integration with Warbler, the JRubyOnRails WAR-packaging gem. And lastly there&#8217;s not a shred of XML in sight. Its a DSL, so the buildfile has a nice declarative feel to it, yet can be modified quickly using some standard Ruby-syntax to provide branching and looping. All the other build systems use XML, and then try and retrofit branching and looping, eg. using  elements.</p>
<p>Today we have all our source code in the following folder structure:</p>
<pre>project
src
|-- main
|   |-- java
|   |-- resources
|   |-- scala
|   `-- webapp
`-- test
|-- java
|-- resources
`-- scala

rails
|-- app
|-- config
|-- db
|-- doc
|-- lib
|-- log
|-- nbproject
|-- public
|-- script
|-- test
|-- tmp
`-- vendor</pre>
<p>and our Apache Buildr buildfile in the root of the project tree looks like this:</p>
<pre lang="ruby">require 'buildr'
require 'buildr/scala'
require 'rubygems'
require 'warbler'

# define the version of the Vamosa product
VERSION_NUMBER = '3.0.0'

# define repositories from which artifacts can be downloaded
repositories.remote &lt;&lt; 'http://www.ibiblio.org/maven2/'
repositories.remote &lt;&lt; 'http://scala-tools.org/repo-releases'  # define artifacts that are not available from remote repositories  artifact("javax.jms:jms:jar:1.1").from(file("libs/javax.jms.jar"))  # define the artifacts that the project depends on  SCALA         = group('scala-library', 'scala-compiler', 'axiom-dom', :under=&gt;'org.scala-lang', :version=&gt;'2.7.5')
SCALATEST     = [ 'org.scala-tools.testing:specs:jar:1.5.0','org.scalatest:scalatest:jar:0.9.5']
XUNIT         = ["junit:junit:jar:4.4", "org.dbunit:dbunit:jar:2.2.3", "org.mockito:mockito-all:jar:1.7" ]
JDBC_DRIVERS  = ["mysql:mysql-connector-java:jar:5.1.6"]
HIBERNATE     = [ "org.hibernate:hibernate-core:jar:3.3.2.GA",
  "org.hibernate:hibernate-annotations:jar:3.4.0.GA",
  "org.hibernate:hibernate-commons-annotations:jar:3.3.0.ga",
  "org.hibernate:hibernate-search:jar:3.1.0.GA",
  "org.hibernate:hibernate-ehcache:jar:3.3.2.GA",
  "org.hibernate:jtidy-r8:jar:20060801",
  'c3p0:c3p0:jar:0.9.1.2',
  'commons-collections:commons-collections:jar:3.2.1',
  'commons-lang:commons-lang:jar:2.4',
  'net.sf.ehcache:ehcache:jar:1.6.2',
'javax.persistence:persistence-api:jar:1.0']
# DELETED FURTHER ARTIFACTS FOR SAKE OF BREVITY...

# now lets do some work
platforms = ["mysql", "oracle", "mssql", "db2"]
platform = "mysql"
desc 'Enterprise Content Governance Platform'
define 'ContentMigrator' do
  project.version = VERSION_NUMBER
  project.group = 'com.vamosa'
  manifest['Copyright'] = 'Vamosa Ltd. (C) 2003-2009'
  compile.options.target = '1.5'

  compile.with HIBERNATE, SPRING, COMMONS, LOGGING, CONTENT_PARSER, QUARTZ, J2EE_API, SCRIPTING, SOAP, JFREE_CHART, JAVASSIST, LUCENE, XALAN
  test.with XUNIT, SCALATEST
  test.using :scalatest

  # get all the important components from the Rails GUI into the staging directory
  Dir.chdir("rails") do
    puts "Changed current directory to: #{Dir.pwd}"
    warble_cfg = eval(File.open("config/warble.rb") {|f| f.read})
    Warbler::Task.new(:war, warble_cfg)
    Rake::Task['war:app'].invoke
    Rake::Task['war:public'].invoke
  end
  puts "Changed current directory to: #{Dir.pwd}"

  # package it up
  package(:war, :file =&gt; _("target/#{id}-#{VERSION_NUMBER}-#{platform}.war")).tap do |task|
    task.include 'war/*'
    task.include "src/main/resources/#{platform}.session-factory.xml", :as=&gt;'WEB-INF/session-factory.xml'
    task.include 'src/main/resources/jboss.jms-context.xml', :as=&gt;'WEB-INF/jms-context.xml'
  end
end</pre>
<p>The key things we like about this setup are:</p>
<ol>
<li> Easily handling dependency artifacts like the Sun API jars locally. For example we store javax.jms.jar in our Git source repo, in the projects libs/ folder and then point to it using artifact(&#8220;javax.jms:jms:jar:1.1&#8243;).from(file(&#8220;libs/javax.jms.jar&#8221;)).</li>
<li> Integrate Warbler tasks and cherry-pick the ones you want to run, such as in our case just war:app &amp; war:public but e.g. not war:xml because our web.xml is stored in src/main/webapp/WEB-INF instead.</li>
<li> Its Ruby so we can use loops &amp; branching such as:</li>
</ol>
<pre lang="ruby">%w(mssql mysql oracle db2).each do |platform|
  package(:war, :file =&gt; _("target/#{id}-#{VERSION_NUMBER}-#{platform}.war")).tap do |task|
    task.include 'war/*'
    task.include "src/main/resources/#{platform}.session-factory.xml", :as=&gt;'WEB-INF/session-factory.xml'
    task.include 'src/main/resources/jboss.jms-context.xml', :as=&gt;'WEB-INF/jms-context.xml'
  end
end</pre>
<p>Apache Buildr isn&#8217;t perfect. There are still some weird annoyances around resolving transitive dependencies, i.e. when hibernate.jar in turn depends on commons-logging.jar. But if you find yourself missing commons-logging.jar its easily added.<br />
If something doesn&#8217;t work they way you think it ought to, you can easily dig into Buildr&#8217;s very readable Ruby code, something I couldn&#8217;t do with either Maven or Ant, and either customise it or find a quick workaround. You don&#8217;t have this black-box barrier between your buildscript and its output.</p>
<p>UPDATE: A nicer way of integrating Warbler and Buildr can be achieved using my Buildr extension, <a href="http://www.denofubiquity.com/ruby/barbler/">Barbler</a>. <a href="http://www.vamosa.com"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ijonas.com/software-development/ruby/297/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JRuby-based Chat Server using Terracotta</title>
		<link>http://ijonas.com/software-development/ruby/261/</link>
		<comments>http://ijonas.com/software-development/ruby/261/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 05:59:24 +0000</pubDate>
		<dc:creator>ijonas</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[clustering]]></category>
		<category><![CDATA[dso]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[terracotta]]></category>

		<guid isPermaLink="false">http://www.denofubiquity.com/?p=261</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fruby%2F261%2F&title=JRuby-based+Chat+Server+using+Terracotta+&desc=Two+technologies+are+currently+capturing+my+imagination%2C+JRuby+and+Terracotta.+JRuby+is+simply+for+my+purposes+the+most+effective+language+to+tackle+most+of+my+computing+challenges.+Terracotta+allows+&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>Two technologies are currently capturing my imagination, JRuby and Terracotta. JRuby is simply for my purposes the most effective language to tackle most of my computing challenges. Terracotta allows me to take those problems and solve them on large clusters &#8230; <a href="http://ijonas.com/software-development/ruby/261/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fruby%2F261%2F&title=JRuby-based+Chat+Server+using+Terracotta+&desc=Two+technologies+are+currently+capturing+my+imagination%2C+JRuby+and+Terracotta.+JRuby+is+simply+for+my+purposes+the+most+effective+language+to+tackle+most+of+my+computing+challenges.+Terracotta+allows+&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>Two technologies are currently capturing my imagination, <a href="http://kenai.com/projects/jruby/pages/Home">JRuby</a> and <a href="http://www.terracotta.org/">Terracotta</a>. JRuby is simply for my purposes the most effective language to tackle most of my computing challenges. Terracotta allows me to take those problems and solve them on large clusters of cheap servers in clouds such as those provided by Amazon EC2.</p>
<p>Getting started with JRuby+Terracotta requires a bit of trial and error as its not as well documented as good old Java+Terracotta. The only post you’re likely to find is one by Jonas Boner (see below). During subsequent revisions of both Terracotta as well as JRuby, the example had stopped working. These files bring that example update to date for JRuby 1.3.1 and Terracotta 3.0.1.</p>
<p>You can download the revised source code from <a href="http://github.com/ijonas/terracotta-jruby-chat/tree/master">my github account</a>. You will need installs of both JRuby and Terracotta with JRUBY_HOME and TC_HOME pointing to the base folders of both products respectively, e.g.</p>
<pre lang="bash">export JRUBY_HOME=$HOME/java/jruby-1.3.1
export TC_HOME=$HOME/java/terracotta-3.0.1</pre>
<p>Once these environment variables have been setup you can start a Terracotta server, followed launching multiple clients by typing:</p>
<pre lang="bash">./chat.sh</pre>
<p><strong>Background</strong></p>
<p>The key to fixing the example was fixing the java.lang.NoClassDefFoundError: com/tc/object/event/DmiManager, caused by the references to com.tc.object.bytecode.Manager in the terracotta.rb file:</p>
<pre lang="ruby">WRITE_LOCK = com.tc.object.bytecode.Manager::LOCK_TYPE_WRITE
READ_LOCK = com.tc.object.bytecode.Manager::LOCK_TYPE_READ
CONCURRENT_LOCK = com.tc.object.bytecode.Manager::LOCK_TYPE_CONCURRENT</pre>
<p>Replacing the above fragment with:</p>
<pre lang="ruby">WRITE_LOCK = 2
READ_LOCK = 1
CONCURRENT_LOCK = 4</pre>
<p>and the whole example springs to life. My next problem to solve is that of Rubifying the Workmanager examples from chapter 11 of the &#8220;Definitive Guide to Terracotta&#8221; book.</p>
<p><strong>Useful Links</strong></p>
<ul>
<li><a href="http://jonasboner.com/2007/02/05/clustering-jruby-with-open-terracotta.html">Clustering JRuby with Terracotta</a></li>
<li><a href="http://weblambdazero.blogspot.com/2009/03/incoming-revolution-clojure-terracotta.html">Incoming Revolution: Clojure + Terracotta</a></li>
<li><a href="https://github.com/ijonas/">My github pages</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ijonas.com/software-development/ruby/261/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TechMeetup Glasgow #2</title>
		<link>http://ijonas.com/media-technology/231/</link>
		<comments>http://ijonas.com/media-technology/231/#comments</comments>
		<pubDate>Tue, 26 May 2009 05:16:19 +0000</pubDate>
		<dc:creator>ijonas</dc:creator>
				<category><![CDATA[Media & Technology]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.denofubiquity.com/?p=231</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fmedia-technology%2F231%2F&title=TechMeetup+Glasgow+%232&desc=TechMeetup+Glasgow+%232+is+taking+place+on+June+3rd.%0A%0AThe+first+TechMeetup+exceeded+our+expectations.+Three+great+speakers+created+some+vigorous+debates.+When+we+asked+you+to+%22bring+yourself%2C+your+exper&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>TechMeetup Glasgow #2 is taking place on June 3rd. The first TechMeetup exceeded our expectations. Three great speakers created some vigorous debates. When we asked you to &#8220;bring yourself, your experiences, and your opinions&#8221;, you certainly heeded our call. We &#8230; <a href="http://ijonas.com/media-technology/231/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fmedia-technology%2F231%2F&title=TechMeetup+Glasgow+%232&desc=TechMeetup+Glasgow+%232+is+taking+place+on+June+3rd.%0A%0AThe+first+TechMeetup+exceeded+our+expectations.+Three+great+speakers+created+some+vigorous+debates.+When+we+asked+you+to+%22bring+yourself%2C+your+exper&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><div><strong>TechMeetup Glasgow #2 is taking place on June 3rd.</strong></p>
<p>The first TechMeetup exceeded our expectations. Three great speakers created some vigorous debates. When we asked you to &#8220;bring yourself, your experiences, and your opinions&#8221;, you certainly heeded our call.</p>
<p>We also got some great feedback and with that in mind we&#8217;re making some small changes. We&#8217;re going to have one less speaker, allowing for more debate and more informal chat in between speaker presentations. We&#8217;ll also have more bottles of water available.</p>
<p><strong></strong></p>
<p><img class="alignright size-full wp-image-223" style="margin: 10px;" title="TechMeetup" src="http://ijonas.com/wp-content/uploads/2009/04/logo1.gif" alt="TechMeetup" width="177" height="165" />This month&#8217;s speaker&#8217;s topics are as follows:</p>
<p><strong>Dave Sapien - New challenges in UI</strong>. A look at new technologies, the User Interfaces that control them and what challenges we can face with new thinking.</p>
<p><strong>John Gallagher - Smarter than the Average Application. </strong>Users aren&#8217;t stupid and lazy, but much modern software is. That&#8217;s John&#8217;s opinion. He&#8217;ll be telling us why and the AI techniques he&#8217;s using to make Lapsus, his time tracker, smarter than the average application.</p>
<p>Like last month, we&#8217;re holding this month&#8217;s meetup in room M329 of James Weir Building at Strathclyde Uni. So bring yourself, your experiences, and your opinions. We&#8217;ll bring the drinks, the pizza, and the speakers.</p>
<p>See you then &amp; there,</p>
<p>Sam, Ijonas &amp; Heidi.</p>
<address></address>
<address></address>
<address style="padding-left: 30px;">Event: TechMeetup Glasgow<br />
Date &amp; Time: 3rd June 2009 &#8211; 7pm (the pizza is delivered then)<br />
Directions: (lift to 3rd floor) Room M329, James Weir Building, Strathclyde Campus, 75 Montrose Street, Glasgow.</address>
<address style="padding-left: 30px;">Here&#8217;s the <a id="a1ol" title="Google Streetview" href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=james+weir+building,+glasgow&amp;sll=55.877982,-4.288263&amp;sspn=0.015744,0.043216&amp;ie=UTF8&amp;ll=55.861766,-4.245186&amp;spn=0.007875,0.021608&amp;z=16&amp;iwloc=A&amp;layer=c&amp;cbll=55.861857,-4.245153&amp;panoid=l0DtlqmN9fAn-UhQ99_mAA&amp;cbp=12,323.17145145811696,,0,-12.33862959285007">Google Streetview</a><br />
And here&#8217;s the <a id="zqo:" title="Google Maps view" href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=james+weir+building,+glasgow&amp;sll=55.861766,-4.245186&amp;sspn=0.007875,0.021608&amp;ie=UTF8&amp;ll=55.861874,-4.245679&amp;spn=0.007586,0.021608&amp;z=16&amp;iwloc=A">Google Maps view</a>.</address>
<address style="padding-left: 30px;">And here&#8217;s the  <a href="http://ijonas.com/wp-content/uploads/2009/05/techmeetup-glasgow-21.ics">iCal Entry</a> to stick in your calendar.</address>
<address style="padding-left: 30px;"></address>
<address style="padding-left: 30px;"></address>
<address style="padding-left: 30px;"><strong>Contact:</strong></address>
<address style="padding-left: 30px;"><a id="q151" title="o.s.collins@gmail.com" href="mailto:o.s.collins@gmail.com">o.s.collins@gmail.com</a></address>
<address style="padding-left: 30px;"><a id="plfv" title="ijonas.kisselbach@gmail.com" href="mailto:ijonas.kisselbach@gmail.com">ijonas.kisselbach@gmail.com</a></address>
<address style="padding-left: 30px;"><a id="ov13" title="heidi@sauceandvinegar.com" href="mailto:heidi@sauceandvinegar.com">heidi@sauceandvinegar.com</a></address>
<address style="padding-left: 30px;">or twitter: <a id="si4g" title="@techmeetup" href="http://twitter.com/techmeetup">@techmeetup</a></address>
<address style="padding-left: 30px;"></address>
<address>Visit our site <a id="xdgt" title="http://www.techmeetup.co.uk" href="http://www.techmeetup.co.uk/">http://www.techmeetup.co.uk</a> for a backgrounder on TechMeetup including past talks.</address>
<address></address>
<address>
</address>
<address><span style="font-style: normal;"><strong>And a big thanks to <a href="http://www.innovationcentre.org/hillington/">Hillington Innovation</a> who are sponsoring TechMeetup<br />
Glasgow.</strong></span></address>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ijonas.com/media-technology/231/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing TechMeetup Glasgow</title>
		<link>http://ijonas.com/media-technology/218/</link>
		<comments>http://ijonas.com/media-technology/218/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 18:02:35 +0000</pubDate>
		<dc:creator>ijonas</dc:creator>
				<category><![CDATA[Media & Technology]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[glasgow]]></category>
		<category><![CDATA[startup]]></category>
		<category><![CDATA[Strathclyde University]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[techmeetup]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.denofubiquity.com/?p=218</guid>
		<description><![CDATA[On the 22nd April, Tech Meetup Glasgow will start and it'd be great to have you along.  Three excellent speakers are lined up, covering a variety of topics - from running a ticketing startup, to an introduction to developing for Android. Kick-off is at 7pm in Room M329 of the James Weir building on Stratchlyde University's campus.   

 <a href="http://ijonas.com/media-technology/218/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fmedia-technology%2F218%2F&title=Announcing+TechMeetup+Glasgow&desc=Tech+Meetup+is+coming+to+Glasgow+on+April+22nd.%0A%0AThere+are+a+ton+of+events+for+entrepreneurs+to+meet+investors+and+bankers+and+VC%E2%80%99s+but+let%E2%80%99s+face+it%2C+we%E2%80%99re+tech%2C+so+let%E2%80%99s+talk+about+tech.+No+&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p><strong>Tech Meetup is coming to Glasgow on April 22nd.</strong></p>
<p><img class="alignright size-full wp-image-223" style="margin: 10px;" title="TechMeetup" src="http://ijonas.com/wp-content/uploads/2009/04/logo1.gif" alt="TechMeetup" width="177" height="165" />There are a ton of events for entrepreneurs to meet investors and bankers and VC’s but let’s face it, we’re tech, so let’s talk about tech. No name badges, no business models, just the growth of our eco-system and the advance of our tech – be it web apps, software, mobile apps, hardware, games… There’s an overlap across many of these and it’s always interesting to hear what people are hacking together, know about or have worked on before.</p>
<p>TechMeetup is just that &#8211; a space for everyone to meet up, talk about some of the cool stuff we’re doing, or get help on our projects from others.  It&#8217;s been running in Edinburgh for several months, with a good turn out, nice folks and great speakers – held together with the magic of pizza and beer.</p>
<p>On the 22nd April, Tech Meetup Glasgow will start and it&#8217;d be great to have you along.  Three excellent speakers are lined up, covering a variety of topics &#8211; from running a ticketing startup, to an introduction to developing for Android. Kick-off is at 7pm in Room M329 of the James Weir building on Stratchlyde University&#8217;s campus.</p>
<p>With your help and feedback, we are going to work hard to make this functional for everyone around us – a monthly event to allow you to share news, demo the technologies and projects that excite you, meet people with complimentary skillsets that may want to help out, and generally get to know others in the tech community.</p>
<p>So if that sounds good to you, be great to see you there.  Bring yourself, your experiences and your opinions with you.</p>
<p>Sam, Ijonas &amp; Heidi.</p>
<p>Lastly, visit our site <a id="xdgt" title="http://www.techmeetup.co.uk" href="http://www.techmeetup.co.uk/">http://www.techmeetup.co.uk</a> for a backgrounder on TechMeetup including past talks.</p>
<address> </address>
<address> </address>
<address style="padding-left: 30px;">Event: TechMeetup Glasgow<br />
Date &amp; Time: 22nd April 2009 &#8211; 7pm (the pizza is delivered then)<br />
Directions: (lift to 3rd floor) Room M329, James Weir Building, Strathclyde Campus, 75 Montrose Street, Glasgow.</address>
<address style="padding-left: 30px;">Here&#8217;s the <a id="a1ol" title="Google Streetview" href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=james+weir+building,+glasgow&amp;sll=55.877982,-4.288263&amp;sspn=0.015744,0.043216&amp;ie=UTF8&amp;ll=55.861766,-4.245186&amp;spn=0.007875,0.021608&amp;z=16&amp;iwloc=A&amp;layer=c&amp;cbll=55.861857,-4.245153&amp;panoid=l0DtlqmN9fAn-UhQ99_mAA&amp;cbp=12,323.17145145811696,,0,-12.33862959285007">Google Streetview</a><br />
And here&#8217;s the <a id="zqo:" title="Google Maps view" href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=james+weir+building,+glasgow&amp;sll=55.861766,-4.245186&amp;sspn=0.007875,0.021608&amp;ie=UTF8&amp;ll=55.861874,-4.245679&amp;spn=0.007586,0.021608&amp;z=16&amp;iwloc=A">Google Maps view</a>.</address>
<address style="padding-left: 30px;">And here&#8217;s the <a title="TechMeetup Glasgow iCal Entry" href="http://ijonas.com/wp-content/uploads/2009/04/techmeetup-glasgow1.ics">iCal entry</a> to stick in your calendar.<br />
</address>
<address style="padding-left: 30px;"> </address>
<address style="padding-left: 30px;"> </address>
<address style="padding-left: 30px;"><strong>Contact:</strong></address>
<address style="padding-left: 30px;"><a id="q151" title="o.s.collins@gmail.com" href="mailto:o.s.collins@gmail.com">o.s.collins@gmail.com</a></address>
<address style="padding-left: 30px;"><a id="plfv" title="ijonas.kisselbach@gmail.com" href="mailto:ijonas.kisselbach@gmail.com">ijonas.kisselbach@gmail.com</a></address>
<address style="padding-left: 30px;"><a id="ov13" title="heidi@sauceandvinegar.com" href="mailto:heidi@sauceandvinegar.com">heidi@sauceandvinegar.com</a></address>
<address style="padding-left: 30px;">or twitter: <a id="si4g" title="@techmeetup" href="http://twitter.com/techmeetup">@techmeetup</a></address>
]]></content:encoded>
			<wfw:commentRss>http://ijonas.com/media-technology/218/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bootstrapping a &#8216;deploy&#8217; user with Capistrano on EC2</title>
		<link>http://ijonas.com/software-development/ruby/173/</link>
		<comments>http://ijonas.com/software-development/ruby/173/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 08:38:17 +0000</pubDate>
		<dc:creator>ijonas</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[RubyOnRails]]></category>

		<guid isPermaLink="false">http://www.denofubiquity.com/?p=173</guid>
		<description><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fruby%2F173%2F&title=Bootstrapping+a+%27deploy%27+user+with+Capistrano+on+EC2&desc=Amazon%27s+EC2+is+rightly+so+the+best+thing+since+sliced+bread.+All+of+our+hosted+services+at+Vamosa+run+off+EC2.+Getting+our+Ubuntu+instances+provisioned+these+days+is+easily+achieved+using+Capistrano%2C&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div>Amazon&#8217;s EC2 is rightly so the best thing since sliced bread. All of our hosted services at Vamosa run off EC2. Getting our Ubuntu instances provisioned these days is easily achieved using Capistrano, but when we were still get familiar &#8230; <a href="http://ijonas.com/software-development/ruby/173/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
											<iframe
												style="height:25px !important; border:0px solid gray !important; overflow:hidden !important; width:460px !important;" frameborder="0" scrolling="no" allowTransparency="true"
												src="http://www.linksalpha.com/social?blog=ijonas.com&link=http%3A%2F%2Fijonas.com%2Fsoftware-development%2Fruby%2F173%2F&title=Bootstrapping+a+%27deploy%27+user+with+Capistrano+on+EC2&desc=Amazon%27s+EC2+is+rightly+so+the+best+thing+since+sliced+bread.+All+of+our+hosted+services+at+Vamosa+run+off+EC2.+Getting+our+Ubuntu+instances+provisioned+these+days+is+easily+achieved+using+Capistrano%2C&fc=333333&fs=arial&fblname=like&fblref=facebook&fbllang=en_US&fblshow=1&fbsbutton=0&fbsctr=1&fbslang=en&fbsendbutton=0&twbutton=1&twlang=en&twmention=ijonas&twrelated1=&twrelated2=&twctr=1&lnkdshow=noshow&lnkdctr=1&buzzbutton=0&buzzlang=en&buzzctr=1&diggbutton=1&diggctr=1&stblbutton=1&stblctr=1&g1button=1&g1ctr=1&g1lang=en-US">
											</iframe>
										</div><p>Amazon&#8217;s EC2 is rightly so the best thing since sliced bread. All of our hosted services at Vamosa run off EC2. Getting our Ubuntu instances provisioned these days is easily achieved using Capistrano, but when we were still get familiar with &#8216;cap&#8217; it wasn&#8217;t always the case.  </p>
<p>Amazon EC2 uses private/public keys files for root user authentication but you want to use those credentials as infrequently as possible. As RubyOnRails users, we are used to setting up a <code>deploy</code> user which we use to run Apache 2 and Phusion Passenger under. We use that same deploy user to connect to our github repositories and pull in code updates. All pretty much standard stuff.</p>
<p>When we using off-the-shelf Ubuntu 8.0.4 AMIs we couldn&#8217;t find any nice Capistrano recipes to setup that initial <code>deploy</code> user and enabling key-based login to that <code>deploy</code> user using our own personal keys.</p>
<p>The following recipe does just that:</p>
<pre lang="ruby" line="1">  desc "uploads id_rsa.pub to the EC2 instance's deploy users authorized_keys2 file"
  task :bootstrap_deploy_user do
    system "ssh -i #{aws_private_key_path} root@#{domain} "groupadd admin""
    system "ssh -i #{aws_private_key_path} root@#{domain} "useradd -d /home/#{user} -s /bin/bash -m #{user}""
    system "ssh -i #{aws_private_key_path} root@#{domain} "echo #{user}:#{password} | chpasswd""
    system "ssh -i #{aws_private_key_path} root@#{domain} "usermod -a -G admin deploy""
    system "ssh -i #{aws_private_key_path} root@#{domain} "mkdir /home/#{user}/.ssh""
    for key in ssh_options[:keys]
      system "cat  #{key}.pub | ssh -i #{aws_private_key_path} root@#{domain} "cat &gt;&gt; /home/#{user}/.ssh/authorized_keys2""
    end
    system "ssh -i #{aws_private_key_path} root@#{domain} "chown -R #{user}:#{user} /home/#{user}/.ssh""
    system "scp -i #{aws_private_key_path} config/deploy_sudoers root@#{domain}:/etc/sudoers"
  end</pre>
<p>You&#8217;ll need to setup Capistrano variables as you can see to make this work. My .caprc file contains the following definition:</p>
<pre lang="ruby" >set :aws_private_key_path, "/Users/ijonas/.ec2/ec2keypair.pem"</pre>
<p>Our config/deploy.rb contains the following variables:</p>
<pre lang="ruby">set :use_sudo, false
set :user, 'deploy'
set :password, 'xxxxx'
set :application, "yyyyy.vamosa.com"
set :domain, "yyyyy.vamosa.com"
set :deploy_to, "/var/www/apps/#{application}"</pre>
<p>The approach is a little bit &#8216;hackish&#8217; but it works for EC2, and keeps your Capistrano setup as close as possible to the best-practice.</p>
]]></content:encoded>
			<wfw:commentRss>http://ijonas.com/software-development/ruby/173/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

