<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>codehunk</title>
	<atom:link href="http://codehunk.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codehunk.wordpress.com</link>
	<description>the way i see it.......</description>
	<lastBuildDate>Sat, 21 Jan 2012 04:26:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='codehunk.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>codehunk</title>
		<link>http://codehunk.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://codehunk.wordpress.com/osd.xml" title="codehunk" />
	<atom:link rel='hub' href='http://codehunk.wordpress.com/?pushpress=hub'/>
		<item>
		<title>TLB: Rocket boosters for your build</title>
		<link>http://codehunk.wordpress.com/2011/03/30/tlb-rocket-boosters-for-your-build/</link>
		<comments>http://codehunk.wordpress.com/2011/03/30/tlb-rocket-boosters-for-your-build/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 01:16:34 +0000</pubDate>
		<dc:creator>janmejay</dc:creator>
				<category><![CDATA[customiation]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[TLB]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[build-tools]]></category>
		<category><![CDATA[buildr]]></category>
		<category><![CDATA[continious integration]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[load balancing]]></category>
		<category><![CDATA[parallelization]]></category>
		<category><![CDATA[rake]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[test load balancer]]></category>
		<category><![CDATA[test time reduction]]></category>
		<category><![CDATA[tests]]></category>
		<category><![CDATA[testunit]]></category>

		<guid isPermaLink="false">http://codehunk.wordpress.com/?p=373</guid>
		<description><![CDATA[Most software developers and testers would agree that keeping code well covered with automated tests(programmed tests that run without manual intervention) is an essential recipe to driving a software project to success. Such a test-suite prevents software regression, helps flush out the design, allows collective ownership of complex and logic-heavy code, acts as a functional [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=373&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Most software developers and testers would agree that keeping code well covered with automated tests(programmed tests that run without manual intervention) is an essential recipe to driving a software project to success. Such a test-suite prevents software regression, helps flush out the design, allows collective ownership of complex and logic-heavy code, acts as a functional and executable documentation for new project members, allows easy code refactoring and clean-up, allows frequent releases and the list could just go on and on. However, the number of tests a project has is usually directly proportional its features, complexity and maturity and the numbers for these quantifiers are always headed up. Obviously, as tests increase, the time it takes to execute the suite goes up too. This is especially true for <i>Integration</i> and <i>Functional</i> tests because these typically take longer to execute than <i>Unit</i> tests. At some point, teams decide not to run these tests for every commit because running the whole suite starts to take way too long and this is about the time in the life of most projects when things start rolling downhill. I haven&#8217;t really set out to enumerate bad things that can happen to your project once it starts slipping down that slope, so lets step back and consider a better alternative.</p>
<p>So you have a big test suite that takes over 10 minutes to execute and you wonder if there is anything you can do to help make it faster? Here is something we have been working on for over an year now and we call it <a href="http://test-load-balancer.github.com"><strong>TLB</strong></a>. <strong>TLB</strong> is actually an acronym for <a href="http://test-load-balancer.github.com"><strong>Test Load Balancer</strong></a>, but we like to use TLB for convinience and carbon footprint reasons. It is an <i>open-source, BSD licensed</i> tool that splits the load of test execution to make several chunks(that we call partitions), hence allowing your tests to execute parallely, across several physical machines or VMs, with each one executing only one small chunk(one partition). </p>
<p><i>In short, here is what the tool can do for you:</i><br />
Say, you have a project with 1000 test-suites, that takes about 10 minutes to execute. With a few lines worth of changes in your build script, and 4 more computers to deploy for the job, TLB can help you bring total time down to 2 minutes. We call this time-balancing. It partitions your test in such a way that all partitions have equal amount of load in terms of time. This implies all partitions take almost the same time to complete, and given that each partition only runs 1/5(one fifth) of the whole, it takes only 1/5th the time, thats 10 minutes/5, which brings us to the 2 minutes number. Similarly if you have a test-suite that takes 5 hours, it can be cut down to just 20 minutes with 15 machines to parallelize it.</p>
<p><i>Alright, thats exciting, how do I use this thing</i>, you ask? Lets first understand what TLB does not do. TLB does not launch multiple processes across machines, it does not invoke your build task nor does it manage machines for you to run your build on. There are very good tools around that can help you do all of that. You use the tool of your choice to invoke build task, i.e. &#8216;ant test&#8217;, &#8216;rake spec&#8217; or &#8216;buildr test&#8217; etc. For instance, the launching of processes across different physical machines at the same time can be offloaded to CI server(like Hudson or Go) or a command-line driven tool like Capistrano or Cluster-SSH. Once the build task(ant or rake invocation for example) is triggered on multiple machines, each one of these processes executes only a part of the whole set of tests. By design, TLB is really non-intrusive, all that changes is a few lines in the project&#8217;s build script. </p>
<p>The only other piece that you need in addition to invoking your build task is a daemon we call <i>TLB Server</i>. This is a repository where data captured while running tests(for instance, running time, result etc) is stored. Some algorithms(eg. time-based partitioning or failed-first orderer etc) depend on such data. TLB can either work against an instance of <i>TLB Server</i> or <i>Go Server</i>. TLB server is a part of the TLB project and is available as download(you want to check tlb-server or tlb-complete archive). <a href="http://www.thoughtworks-studios.com/go-agile-release-management">Go</a> is a ThoughtWorks Studios product and it is a continious integration and release management application. You can use the utility script that server archive bundles to manage the TLB server process. Please check <a href="http://test-load-balancer.github.com/doc-0_3_0/documentation.html">documentation page</a>(this is a release specific link, points to 0.3) for details on both configurations.</p>
<p>Multiple partitions of a build obviously need to use the same TLB server instance, which means TLB server must be reachable over the network from all machines that are to execute partitions of a project&#8217;s test suite. One TLB Server instance can be shared by several projects or multiple builds of the same project. This means all projects and builds can share a single organization-wide/office-wide TLB server. TLB server binds to port 7019(unless overridden), so you&#8217;d want to unblock that port for inbound traffic on any firewalls/filters on the server machine(similarly you&#8217;d want to unblock it for outbound traffic on machines that are going to execute the partitions). I emphasize this here because sometimes firewalls can be really nasty and confusing. </p>
<p>The Java support library in the latest release of TLB(version 0.3) supports popular Java build tools Apache Ant and Apache Buildr. The Ruby library bundles support for Rake. On the testing framework side, TLB has support for widely used Java testing tools named JUnit and Twist and the Ruby library bundles support for two most popular testing frameworks named Test::Unit and RSpec(both 1.x and 2.x). The next TLB release(0.4) will include support for Maven(a Java build tool) and Cucumber(a Ruby testing tool) among other features. </p>
<p>You can download the latest TLB distribution from <a href="http://code.google.com/p/tlb/downloads/list">http://code.google.com/p/tlb/downloads/list</a>. Ruby support is available as rubygems(namely tlb-testunit, tlb-rspec2 and tlb-rspec1). The archive named <i>setup-examples</i> bundles tiny projects we use for demonstration purpose. Each project is a unique language, testing-framework and build-framework combination and has a shell-script named run_balanced.sh that can be executed to have TLB make partitions of test-suite and execute them serially, one after another. The shell script, in short, just starts the TLB server and executes test-task with the appropriate environment variables set. In a real world situation, each one of these partitions would be executed on different machines/process-trees, parallely. To have ant-junit example run for instance, you&#8217;d want to:</p>
<pre>
$ wget http://tlb.googlecode.com/files/setup-examples-g0.3.0.tar.gz
$ tar -zxvf setup-examples-g0.3.0.tar.gz
$ cd setup-examples-g0.3.0/examples/ant_junit
$ ./run_balanced.sh #count balances due to lack of data
$ ./run_balanced.sh #time balances (has data from the previous run)
</pre>
<p>The last(and of-course second-last) step should make two partitions and execute them one after another. While executing tests, the script also prints messages to help user understand major life-cycle events.<br />
To try out rspec2 integration, you&#8217;d want to do something similar to:</p>
<pre>
$ gem install tlb-rspec2
$ cd setup-examples-g0.3.0/examples/rspec2_example #assuming you already unarchived
$ ./run_balanced.sh #will count balance
$ ./run_balanced.sh #will time balance
</pre>
<p>Note: Because TLB does not have the necessary data to partition tests accurately(use time-balancing algorithm) when the very first invocation is made, it uses count-balancing algorithm, you need to run the script twice to actually see it time balance. Expect this behavior on your actual project as well, as in, the very first time you execute your build against a new TLB Server, balancing will not be as accurate. Second time onwards it will do a much better job.</p>
<p>The distribution archive named <i>tlb-complete</i> bundles all TLB artifacts(java support library, TLB server, alien support library(only developers adding support for new non-jvm languages would be interested in alien library), setup-examples etc). Other archives bundle subset of complete. Please check the README file on <a href="http://code.google.com/p/tlb/downloads/list">downloads page</a> for details.</p>
<p><i>Quick Start</i> on the <a href="http://test-load-balancer.github.com/"><strong>TLB website</strong></a> is usually a good place to get started in just a few minutes. However, we highly recomend going through the <i>Concepts</i> and <i>Configuration</i> pages as well, which explain details that will allow you to tweek your TLB configuration to suit your project, tool-set and environment and zero out any potential impedance mismatch. <i>Concepts</i> documentation is also the first step to enhancing TLB. For instance, if you come up with an algorithm that suites your project better, you can implement it in Java and have TLB use that insteed of the canned ones. <a href="http://test-load-balancer.github.com/doc-0_3_0/documentation.html">Detailed documentation</a>(this is a release specific link, points to 0.3) covers all knobs you can tweak and explains the effect and implication of choices you make.</p>
<p>The setup-examples also come in handy while setting-up TLB on a new project. We recomend borrowing build script snippts from the corresponding dummy-projects(in setup-examples or tlb-complete archive) while trying to wire TLB up for your project(s). Once you are done configuring your project(you have imported the libraries and tweaked the build script) to use TLB, you&#8217;d want to refer to <a href="http://test-load-balancer.github.com/doc-0_3_0/configuration.html">Configuration Section</a>(release specific link, points to 0.3), which enumerates and documents configuration parameters.</p>
<p>Here is the <a href='http://codehunk.files.wordpress.com/2011/03/tlb-intro.pdf'>slide-deck</a> we use to drive TLB talks. This gets into a little bit of TLB internals, and should help you understand TLB better. This post is only meant to be a quick introduction to TLB and is not exhaustive, please refer to <a href="http://test-load-balancer.github.com">TLB website</a> for exhaustive documentation and other details. Should you have any questions/queries, feature-requests, feedback or suggestions related to TLB, feel free to reach us at <strong>test-load-balancer@googlegroups.com</strong>.</p>
<p>So go ahead give your test-suite rocket boosters and watch it fly by. Happy TDDing!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codehunk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codehunk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codehunk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codehunk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codehunk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codehunk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codehunk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codehunk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codehunk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codehunk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codehunk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codehunk.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codehunk.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codehunk.wordpress.com/373/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=373&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codehunk.wordpress.com/2011/03/30/tlb-rocket-boosters-for-your-build/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2cf57e4c0ab471f97fe202d4b98e96e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janmejay</media:title>
		</media:content>
	</item>
		<item>
		<title>RSA SecurID Token on GNU/Linux</title>
		<link>http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/</link>
		<comments>http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/#comments</comments>
		<pubDate>Tue, 11 May 2010 15:17:52 +0000</pubDate>
		<dc:creator>janmejay</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[j2me]]></category>
		<category><![CDATA[RSA]]></category>
		<category><![CDATA[SecurID]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://codehunk.wordpress.com/?p=349</guid>
		<description><![CDATA[If you have ended up on this page trying to search ways to get Cisco VPN SecurID software token working on GNU/Linux, i can safely assume you are extremely frustrated by now. I have tried installing it atop Wine which in-spite of my best efforts didn&#8217;t work, so its not worth wasting your time with Windows version. On [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=349&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you have ended up on this page trying to search ways to get Cisco VPN SecurID software token working on GNU/Linux, i can safely assume you are extremely frustrated by now.</p>
<p>I have tried installing it atop <a href="http://www.winehq.org/" target="_blank">Wine</a> which in-spite of my best efforts didn&#8217;t work, so its not worth wasting your time with Windows version. On the RSA website i came across this J2ME version(the one thats supposed to work on java enabled mobile phones). I came across this project called <a href="http://microemu.org/" target="_blank">MicroEmulator</a> which emulates java enabled phone like environment and allows development and testing of J2ME applications. This is what it took me to get it working on GNU/Linux.</p>
<p><code> $ java -version<br />
java version "1.6.0_20"<br />
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)<br />
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)</p>
<p>$ wget http://microemu.googlecode.com/files/microemulator-2.0.4.zip</p>
<p>$ wget ftp://ftp.rsa.com/pub/agents/j2me/JME23.zip</p>
<p>$ wget ftp://ftp.rsasecurity.com/pub/agents/TokenConverter.tar.gz</p>
<p>$ mkdir securId</p>
<p>$ unzip microemulator-2.0.4.zip -d securId/</p>
<p>$ unzip JME23.zip -d securId/</p>
<p>$ tar -C securId -zxvf TokenConverter.tar.gz</p>
<p>$ cd securId</p>
<p>$ cp some_directory/token_file.sdtid .</p>
<p>$ chmod +x TokenConverter</p>
<p>$ ./TokenConverter token_file.sdtid -p 'password_you_got_from_admin' -o num_out</p>
<p>$ split num_out -b 5</p>
<p>$ for i in `ls x*`; do echo -\&gt; `cat $i`; done | nl &gt; /tmp/17_parts</p>
<p>$ cat /tmp/17_parts # you want to refer this list when filling up numbers in the SecurID app<br />
... truncated...<br />
13  -&gt; 32323<br />
14  -&gt; 43434<br />
15  -&gt; 54545<br />
16  -&gt; 67676<br />
17  -&gt; 0</p>
<p>$ java -cp microemulator-2.0.4/microemulator.jar:SecurID.jar org.microemu.app.Main com.rsa.swtoken.j2me.client.SecurID<br />
</code></p>
<p>This should bring up the emulator X window. Lets drive the process further using screenshots, as its GUI intensive hence harder to communicate and understand.
<a href='http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/blog-1/' title='blog-1'><img data-attachment-id='350' data-orig-size='800,431' data-liked='0'width="150" height="80" src="http://codehunk.files.wordpress.com/2010/05/blog-1.png?w=150&#038;h=80" class="attachment-thumbnail" alt="blog-1" title="blog-1" /></a>
<a href='http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/blog-2/' title='blog-2'><img data-attachment-id='352' data-orig-size='225,495' data-liked='0'width="68" height="150" src="http://codehunk.files.wordpress.com/2010/05/blog-2.png?w=68&#038;h=150" class="attachment-thumbnail" alt="blog-2" title="blog-2" /></a>
<a href='http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/blog-2-5/' title='blog-2.5'><img data-attachment-id='351' data-orig-size='665,557' data-liked='0'width="150" height="125" src="http://codehunk.files.wordpress.com/2010/05/blog-2-5.png?w=150&#038;h=125" class="attachment-thumbnail" alt="blog-2.5" title="blog-2.5" /></a>
<a href='http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/blog-3/' title='blog-3'><img data-attachment-id='353' data-orig-size='379,490' data-liked='0'width="116" height="150" src="http://codehunk.files.wordpress.com/2010/05/blog-3.png?w=116&#038;h=150" class="attachment-thumbnail" alt="blog-3" title="blog-3" /></a>
<a href='http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/blog-4/' title='blog-4'><img data-attachment-id='354' data-orig-size='378,490' data-liked='0'width="115" height="150" src="http://codehunk.files.wordpress.com/2010/05/blog-4.png?w=115&#038;h=150" class="attachment-thumbnail" alt="blog-4" title="blog-4" /></a>
<a href='http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/blog-5/' title='blog-5'><img data-attachment-id='355' data-orig-size='374,483' data-liked='0'width="116" height="150" src="http://codehunk.files.wordpress.com/2010/05/blog-5.png?w=116&#038;h=150" class="attachment-thumbnail" alt="blog-5" title="blog-5" /></a>
<a href='http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/blog-6/' title='blog-6'><img data-attachment-id='360' data-orig-size='376,486' data-liked='0'width="116" height="150" src="http://codehunk.files.wordpress.com/2010/05/blog-6.png?w=116&#038;h=150" class="attachment-thumbnail" alt="blog-6" title="blog-6" /></a>
<a href='http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/blog-7/' title='blog-7'><img data-attachment-id='361' data-orig-size='376,486' data-liked='0'width="116" height="150" src="http://codehunk.files.wordpress.com/2010/05/blog-7.png?w=116&#038;h=150" class="attachment-thumbnail" alt="blog-7" title="blog-7" /></a>
<a href='http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/blog-8/' title='blog-8'><img data-attachment-id='362' data-orig-size='377,488' data-liked='0'width="115" height="150" src="http://codehunk.files.wordpress.com/2010/05/blog-8.png?w=115&#038;h=150" class="attachment-thumbnail" alt="blog-8" title="blog-8" /></a>
<a href='http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/blog-9/' title='blog-9'><img data-attachment-id='363' data-orig-size='377,490' data-liked='0'width="115" height="150" src="http://codehunk.files.wordpress.com/2010/05/blog-9.png?w=115&#038;h=150" class="attachment-thumbnail" alt="blog-9" title="blog-9" /></a>
</p>
<p>Image 1: Emulator launched with SecurID Token application<br />
Image 2: Shows welcome screen after accepting license.<br />
Image 3: Chooses a more comfortable layout from Options -&gt; Select Device as default device.<br />
Image 4: Chooses &#8216;Numeric Input&#8217; over &#8216;Web Download&#8217;(which i couldn&#8217;t get to work).<br />
Image 5: Shows screen prompting for Numeric Input.<br />
Image 6: Shows screen Numeric Input prompt filled with numbers we captured in /tmp/17_parts.<br />
Image 7: Shows the screen post entering Numeric Input (with password &#8216;password_you_got_from_admin&#8217; populated)<br />
Image 8: Finally, token added successfully.<br />
Image 9: Prompts for pin (this was a 4 digit number in my case)<br />
Image 10: Displays the 8 digit number you need to use as password to vpnc(or Cisco VPN Client/nm-applet vpnc plugin etc) to connect to vpn.</p>
<p>This pain and aggravation we just went through is one time only(what we just did was import the token, and we don&#8217;t need to do this every day). You will however need to type the &#8216;password_you_got_from_admin&#8217; every time, in order to get it to prompt for the 4 digit pin. Quit the emulator at this point and relaunch it(using command <i>$ java -cp</i>&#8230;) to see what i mean.</p>
<p>Unlike every other post i wouldn&#8217;t end this one with &#8220;Happy VPNing&#8221; because i know VPNing can never make you happy(or at-least not if you are like me). However this should help make the procedure to connect to VPN shorter for you. In my case it reduced from <i>&#8220;requesting <a href="http://www.google.com/profiles/sweta.jsingh" target="_blank">Sweta</a>(my wife) to launch the SecurID app on her laptop(which has OS X) and dictate me the number(which obviously wasn&#8217;t as easy when she was not around)&#8221;</i> to invoking <i>&#8220;java -cp &#8230;&#8221;</i>.</p>
<p>Its funny that Proprietary software makers go this length to make life difficult for Free Software users(and we still get around it). In this case it so happens that RSA has SecurID app for Windows, OS X, Blackberry, Symbian(which doesn&#8217;t work BTW&#8230;) and J2ME platform but not for GNU/Linux or BSDs. They support all operating systems but the best!</p>
<p>I have tried this setup on my laptop which runs 32 bit Gentoo, but these steps should work on any other *nix flavor that has sun jvm installed. I tried the web-download method for adding token as well, but couldn&#8217;t get it to work and didn&#8217;t know what the problem was. Will post what i did for web-download as a comment on this page sometime soon(and hope someone helps us by hacking it and getting it to work). I don&#8217;t know about you, but keying-in the 17 sets of wierd numbers was the most painful part of this whole exercise for me.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codehunk.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codehunk.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codehunk.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codehunk.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codehunk.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codehunk.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codehunk.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codehunk.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codehunk.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codehunk.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codehunk.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codehunk.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codehunk.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codehunk.wordpress.com/349/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=349&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codehunk.wordpress.com/2010/05/11/rsa-securid-token-on-gnulinux/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2cf57e4c0ab471f97fe202d4b98e96e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janmejay</media:title>
		</media:content>

		<media:content url="http://codehunk.files.wordpress.com/2010/05/blog-1.png?w=150" medium="image">
			<media:title type="html">blog-1</media:title>
		</media:content>

		<media:content url="http://codehunk.files.wordpress.com/2010/05/blog-2.png?w=68" medium="image">
			<media:title type="html">blog-2</media:title>
		</media:content>

		<media:content url="http://codehunk.files.wordpress.com/2010/05/blog-2-5.png?w=150" medium="image">
			<media:title type="html">blog-2.5</media:title>
		</media:content>

		<media:content url="http://codehunk.files.wordpress.com/2010/05/blog-3.png?w=116" medium="image">
			<media:title type="html">blog-3</media:title>
		</media:content>

		<media:content url="http://codehunk.files.wordpress.com/2010/05/blog-4.png?w=115" medium="image">
			<media:title type="html">blog-4</media:title>
		</media:content>

		<media:content url="http://codehunk.files.wordpress.com/2010/05/blog-5.png?w=116" medium="image">
			<media:title type="html">blog-5</media:title>
		</media:content>

		<media:content url="http://codehunk.files.wordpress.com/2010/05/blog-6.png?w=116" medium="image">
			<media:title type="html">blog-6</media:title>
		</media:content>

		<media:content url="http://codehunk.files.wordpress.com/2010/05/blog-7.png?w=116" medium="image">
			<media:title type="html">blog-7</media:title>
		</media:content>

		<media:content url="http://codehunk.files.wordpress.com/2010/05/blog-8.png?w=115" medium="image">
			<media:title type="html">blog-8</media:title>
		</media:content>

		<media:content url="http://codehunk.files.wordpress.com/2010/05/blog-9.png?w=115" medium="image">
			<media:title type="html">blog-9</media:title>
		</media:content>
	</item>
		<item>
		<title>tmux, the latest addition to my toolset</title>
		<link>http://codehunk.wordpress.com/2010/04/10/tmux-the-latest-addition-to-my-toolset/</link>
		<comments>http://codehunk.wordpress.com/2010/04/10/tmux-the-latest-addition-to-my-toolset/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 16:22:25 +0000</pubDate>
		<dc:creator>janmejay</dc:creator>
				<category><![CDATA[customiation]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[terminal multiplexer]]></category>
		<category><![CDATA[terminal splitting]]></category>
		<category><![CDATA[tmux]]></category>

		<guid isPermaLink="false">http://codehunk.wordpress.com/?p=326</guid>
		<description><![CDATA[I happen to have this little collection of favorite tools(emacs, zsh etc) that help me use my computer better, and make me productive. For a long time i was screen user. Screen is really productive with escape sequence mapped to Ctrl+j(default is Ctrl+a which conflicts with emacs mode binding to jump to beginning of line). While screen is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=326&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I happen to have this little collection of favorite tools(emacs, zsh etc) that help me use my computer better, and make me productive. For a long time i was <a title="Screen" href="http://www.gnu.org/software/screen/">screen</a> user. Screen is really productive with escape sequence mapped to <em>Ctrl+j</em>(default is <em>Ctrl+a</em> which conflicts with emacs mode binding to jump to beginning of line). While screen is a great multiplexer and terrific tool for detaching and maintaining shared sessions(say fronting long running processes on remote machine etc), it doesn&#8217;t do vertical splitting which can be an important productivity boost for people using multiplexer to manage local terminal emulator sessions. Terminator is a terminal emulator thats capable of splitting both ways, but its not as powerful and usable because it doesn&#8217;t separate the concept of buffer(the text you exchange with shell bound processes and prompt) and the pane (visual real estate itself), which means it doesn&#8217;t support backgrounding(or whatever you like calling it) and doesn&#8217;t have other goodies like copy mode either(afaik).</p>
<p>Recently my colleague(<a href="http://twitter.com/bestfriendchris">Chris Turner</a>) introduced me to <a href="http://tmux.sourceforge.net/">tmux</a> which happens to be the best terminal multiplexer i have seen till date. It not only supports vertical splitting in addition to everything else that i love screen for, but has inbuilt emacs and vi style keymaps, which means i can use emacs like shortcuts while in copy mode. In addition to that, it remembers window layout across multiple panes, even for detached sessions and that is a big advantage over screen for managing sessions on remote machine. Tmux comes with quite bare-bone default setup, but its power must not be underestimated. Here is a screenshot of what my tmux(running within gnome-terminal) looks like. I find this setup way more productive compared to its powerful predecessor screen, let alone terminal emulators like Terminator.</p>
<p><a href="http://codehunk.files.wordpress.com/2010/04/tmux-screenshot.png"><img class="alignnone size-large wp-image-328" title="tmux-screenshot" src="http://codehunk.files.wordpress.com/2010/04/tmux-screenshot.png?w=819&#038;h=512" alt="" width="819" height="512" /></a></p>
<p>Here is my <a title="tmux configuration" href="http://gist.github.com/361482">.tmux.conf</a>. Feel free to use it if you like my setup(gentoo portage tree had tmux 1.1 at the time of writing this post, so this config may require some tweaking to work with older releases). I use <em>Ctrl+j</em> as escape sequence, as both keys are on the home row its really convenient(if you are like me, i can safely assume you have <em>Caps lock</em> swapped with <em>Ctrl</em>). Besides, it doesn&#8217;t conflict with any of the shell shortcuts that i use. As the screenshot shows, tmux is capable of being screen and a whole lot more.</p>
<p>I have a little function named &#8216;x&#8217; added to .zshrc which helps me transfer text selected from copy mode to X session clipboard(however, you need xclip installed to use it).</p>
<p><code> x() { echo $1 | xclip -selection c. }<br />
</code></p>
<p>It took me only a few hours to configure it to my taste and discover the wonderful features that it comes packed with, thanks to the brilliant manpage entry and online help (&lt;Excape seq&gt; + ?). So what are you waiting for? Its time your package manager did the hard work <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . Give it a few hours, its well worth it. Happy TMUXing!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codehunk.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codehunk.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codehunk.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codehunk.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codehunk.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codehunk.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codehunk.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codehunk.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codehunk.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codehunk.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codehunk.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codehunk.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codehunk.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codehunk.wordpress.com/326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=326&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codehunk.wordpress.com/2010/04/10/tmux-the-latest-addition-to-my-toolset/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2cf57e4c0ab471f97fe202d4b98e96e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janmejay</media:title>
		</media:content>

		<media:content url="http://codehunk.files.wordpress.com/2010/04/tmux-screenshot.png?w=1024" medium="image">
			<media:title type="html">tmux-screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix: cannot open display: :0.0</title>
		<link>http://codehunk.wordpress.com/2009/11/28/fix-cannot-open-display-0-0/</link>
		<comments>http://codehunk.wordpress.com/2009/11/28/fix-cannot-open-display-0-0/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 03:09:10 +0000</pubDate>
		<dc:creator>janmejay</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[upgrade-problems]]></category>
		<category><![CDATA[MIT-MAGIC-COOKIE-1]]></category>
		<category><![CDATA[NetworkManager]]></category>
		<category><![CDATA[Xauthority]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://codehunk.wordpress.com/?p=318</guid>
		<description><![CDATA[Off late I noticed X applications on my Gentoo installation failing to launch in gnome sessions unless launched within first few seconds. It didn&#8217;t seem easily reproducible so it took me a few xdm and os restarts to nail the actual problem. Problem: NetworkManager changes the hostname after connecting to wireless network. However, it doesn&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=318&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Off late I noticed X applications on my Gentoo installation failing to launch in gnome sessions unless launched within first few seconds. It didn&#8217;t seem easily reproducible so it took me a few xdm and os restarts to nail the actual problem.</p>
<p><strong>Problem:</strong><br />
NetworkManager changes the hostname after connecting to wireless network. However, it doesn&#8217;t update xauth with the new hostname, which means .Xauthority file is no longer valid once the hostname is changed, and attempts to launch applications fail with &#8216;no protocol specified/cannot open display&#8217; messages.</p>
<p><strong>Fix:</strong><br />
In my case, i believe, &#8216;etc-update&#8217; was the culprit. Fix is to update /etc/conf.d/hostname with the desired hostname, which is apparently honored by NetworkManager. Once HOSTNAME is set in the conf-file, and OS is rebooted, &#8216;xhost list&#8217; can be used to validate the .Xauthority contents and hostname can be matched. X applications should start without any trouble.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codehunk.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codehunk.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codehunk.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codehunk.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codehunk.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codehunk.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codehunk.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codehunk.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codehunk.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codehunk.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codehunk.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codehunk.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codehunk.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codehunk.wordpress.com/318/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=318&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codehunk.wordpress.com/2009/11/28/fix-cannot-open-display-0-0/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2cf57e4c0ab471f97fe202d4b98e96e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janmejay</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix: &#8216;xdm&#8217; launch making laptop fans roar</title>
		<link>http://codehunk.wordpress.com/2009/11/25/fix-xdm-launch-making-laptop-fans-roar/</link>
		<comments>http://codehunk.wordpress.com/2009/11/25/fix-xdm-launch-making-laptop-fans-roar/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 06:04:21 +0000</pubDate>
		<dc:creator>janmejay</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[upgrade-problems]]></category>
		<category><![CDATA[bios upgrade]]></category>
		<category><![CDATA[Dell]]></category>
		<category><![CDATA[fan speed]]></category>
		<category><![CDATA[gdm]]></category>
		<category><![CDATA[noisy fans]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[x session start]]></category>
		<category><![CDATA[xdm]]></category>

		<guid isPermaLink="false">http://codehunk.wordpress.com/?p=310</guid>
		<description><![CDATA[Problem: Recently Gentoo x86 profile 10.0 pushed x11-drivers/nvidia-drivers version 185.18.36, which made &#8216;xdm&#8217; launch on my laptop(Dell D630 Latitude) really noisy. First few minutes of X session on my box started to push fan to the limit making it unbearable. Fix: Some digging up on the web revealed it is a known Dell bios bug, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=310&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong><br />
Recently Gentoo x86 profile 10.0 pushed x11-drivers/nvidia-drivers version 185.18.36, which made &#8216;xdm&#8217; launch on my laptop(Dell D630 Latitude) really noisy. First few minutes of X session on my box started to push fan to the limit making it unbearable.</p>
<p><strong>Fix:</strong><br />
Some digging up on the web revealed it is a known Dell bios bug, and has been fixed in upstream.  So, the solution is to upgrade bios to latest available version.</p>
<p><strong>Steps to upgrade:</strong><br />
Install &#8216;libsmbios&#8217;:<br />
<code><br />
sudo emerge --sync<br />
sudo emerge libsmbios<br />
</code><br />
&#8230;and follow further instructions here: <a href="http://linux.dell.com/wiki/index.php/Tech/libsmbios_dellBiosUpdate">http://linux.dell.com/wiki/index.php/Tech/libsmbios_dellBiosUpdate</a> (this page has steps to download updated bios and install it using dellBiosUpdate (a15 is the latest available release at the time of writing, and fixed the problem for me))(Ignore distribution specific instructions).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codehunk.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codehunk.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codehunk.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codehunk.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codehunk.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codehunk.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codehunk.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codehunk.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codehunk.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codehunk.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codehunk.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codehunk.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codehunk.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codehunk.wordpress.com/310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=310&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codehunk.wordpress.com/2009/11/25/fix-xdm-launch-making-laptop-fans-roar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2cf57e4c0ab471f97fe202d4b98e96e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janmejay</media:title>
		</media:content>
	</item>
		<item>
		<title>Propritory software&#8230; such a pain</title>
		<link>http://codehunk.wordpress.com/2009/10/19/propritory-software-such-a-pain/</link>
		<comments>http://codehunk.wordpress.com/2009/10/19/propritory-software-such-a-pain/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 07:03:38 +0000</pubDate>
		<dc:creator>janmejay</dc:creator>
				<category><![CDATA[customiation]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[data sharing]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[GNU]]></category>
		<category><![CDATA[interoperatability]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[shared media]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://codehunk.wordpress.com/?p=284</guid>
		<description><![CDATA[I recently got my 1.5 TB external storage(usb) unit, which i had planed to use as a shared datastore, between: my laptop(Dell D630)(usually runs Gentoo, sometimes Debian-Lenny) Sweta(my wife)&#8217;s laptop(MacBook Black running OS X Snow Leopard) our desktop at home (runs Ubuntu(as of now), which im planning to move to Lenny too, as Ubuntu is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=284&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently got my 1.5 TB external storage(usb) unit, which i had planed to use as a shared datastore, between:</p>
<ul>
<li> my laptop(Dell D630)(usually runs <strong>Gentoo</strong>, sometimes <strong>Debian-Lenny</strong>)</li>
<li> Sweta(my wife)&#8217;s laptop(MacBook Black running <strong>OS X Snow Leopard</strong>)</li>
<li> our desktop at home (runs <strong>Ubuntu</strong>(as of now), which im planning to move to Lenny too, as Ubuntu is obnoxiously irritating)(this one was supposed to be the permanent docking station for the unit as well)</li>
</ul>
<p>So given the situation, the disk was obviously going to live most of its life flirting with GNU/Linux<strong> </strong>setups, so it made sense to have it  on ext3 (or ext2/jfs/xfs etc?). So, i did the partition tables then mkfs.ext3, some spicing up with tune2fs and after e2labeling it, with some amount of satisfaction mounted the partitions to verify i had done them right.<br />
Having verified disk&#8217;s working state, i unmounted and jacked the disk into the MacBook(OS X) which decided not to mount it. dmesg showed kernel figured the disk was there, which indicated to me the reason for it not being mounted(it probably didn&#8217;t know what ext3 was). Some reading on internet revealed i needed ext2fsx to save the day. My attempt to install it however, was thwarted with a not so intuitive error message(which gave me no clue as to what the fuck was wrong with my installation). With some frustration, i accepted that user friendly softwares are supposed to obfuscate the error messages/stack traces, so that user gets no fucking clue about failure and has no way to fix it(not quite what i call &#8216;user friendly&#8217;, but whatever). Some more reading indicated i needed MacFUSE and FuseExt2 to do userspace shit since my kernel didn&#8217;t think i as someone who paid for the piece of shit(OS X) deserved the right to use other filesystems than HFS+ and crappy windows file systems(like NTFS and FAT32).<br />
FuseExt2 made it work alright, but automount was not writable and doing writable mount required &#8216;-o force&#8217; option, which essentially meant Sweta had to hit the terminal every time she jacked the disk in, but that was no more than tip of the iceberg. Actually mounting the ext3 volume, as we figured, was a fourty minute process, as you are forced to wait after the mount command returns, for Finder to unfreeze and mounted volume to appear. User friendly, isn&#8217;t it?<br />
Having it mounted was however, not the end of my miseries. We tried to transfer a movie(700 odd MBs worth of data i believe), which took forever to get to 33%, not cool by any standards. I finally had to give up and cancel the transfer, and then uninstalled FuseExt2.<br />
Irritated, i popped the Disk Utility app, and started my hunt for options. It seemed to have Ext2 as one of the items in filesystem selection box on the repartition tab, which i decided to go with, only to find it harassing my new disk for one and a half hour without moving the progress bar beyond 50%. I finally ran out of patience and unplugged it. On jacking it into my Dell, fdisk revealed the state of affairs. Mac had made an ass of my disk, the partition table was total mess(and by the way, it hadn&#8217;t even begun creating the second partition(i had requested two ext2 partitions to start with). I don&#8217;t know what world OS X team lives in, but in the world that i know, it usually doesn&#8217;t make sense to write the partition table after formatting the filesystem unless you enjoy doing the same thing over and over. Anyways, i finally had to redo the partition cutting exercise and decided to go with ext2 this time, as it seemed like mac would read that. But guess what?, i jacked the disk into mac only to find out it does not read ext2 either. Fuck! Why does disk utility have an option to create partition using format the OS can&#8217;t read?<br />
Annoyed and frustrated, i gave up and decided to have it the Mac way. Once again i resorted to disk utility in order to create 2 Mac Extended(HFS+ partitions). Surprisingly, the partitioning tool that took one and a fucking half hour without completing even one of the two ext2 volumes i requested, managed to finish HFS+ on a 1.5 TB disk under 2 minutes flat.<br />
Those who compile the Linux kernel for themselves know that HFS+ support(under file systems -&gt; miscellaneous&#8230;) is not default. You have to enable it and recompile. I had to go back to menuconfig, do the hunting, enable it as a module, make it, modules_install and modprobe it before i could use the fucked up proprietory filesystem the jack-ass created. All because OS X doesn&#8217;t know one of the most widely used filesystems in GNU/Linux world(i failed to get any reasons for it supporting NTFS and FAT filesystems inspite of it being a flavour of a very respected Unix distribution, such a bad ass child). Even though i had to compile the module to get things flying, it took me no more than 3 minutes. Thats usability for you.<br />
End of the day, it worked! But i had to compromise. I had to do it the proprietory way, the mac way. You pay for the software and get your license, but even after you own it, you pay every single day, not in terms of money but freedom. You just don&#8217;t have a choice. The software decides what you can and can&#8217;t do on the hardware you own, and fighting your way through is insanely difficult and grossly unproductive excercise. A good software should always help the user and never come in the way. I don&#8217;t know about you, but i do not remember anything ever coming anywhere close to GNU/Linux when it comes to usability.<br />
Software being a dumb-ass tantamounts to it being unusable and un-userfriendly. I can only hope propritory software makers will someday figure what a pain in the butt products they create are, and will start to work towards making user&#8217;s life easy and the softwares usable. I really feel sorry for users that have to put up with this kinda shit everyday.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codehunk.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codehunk.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codehunk.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codehunk.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codehunk.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codehunk.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codehunk.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codehunk.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codehunk.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codehunk.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codehunk.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codehunk.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codehunk.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codehunk.wordpress.com/284/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=284&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codehunk.wordpress.com/2009/10/19/propritory-software-such-a-pain/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2cf57e4c0ab471f97fe202d4b98e96e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janmejay</media:title>
		</media:content>
	</item>
		<item>
		<title>Headless X setup with Debian(Lenny)</title>
		<link>http://codehunk.wordpress.com/2009/08/23/headless-x-setup-with-debianlenny/</link>
		<comments>http://codehunk.wordpress.com/2009/08/23/headless-x-setup-with-debianlenny/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 07:24:38 +0000</pubDate>
		<dc:creator>janmejay</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[debian lenny]]></category>
		<category><![CDATA[headless X]]></category>
		<category><![CDATA[virtual X]]></category>
		<category><![CDATA[vnc]]></category>
		<category><![CDATA[X]]></category>

		<guid isPermaLink="false">http://codehunk.wordpress.com/?p=255</guid>
		<description><![CDATA[I recently did X on a headless Debian blade. This post is about the setup that worked for me. I used Xvfb to setup the virtual X frame-buffer. The usual choice for accessing virtual display is vnc, so i decided to go with x11vnc. Used blackbox as window manager for the setup(because it is believed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=255&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently did X on a headless Debian blade. This post is about the setup that worked for me. I used <strong>Xvfb</strong> to setup the virtual X frame-buffer. The usual choice for accessing virtual display is vnc, so i decided to go with <strong>x11vnc</strong>. Used <strong>blackbox</strong> as window manager for the setup(because it is believed to be pretty light weight).<br />
However, this setup has a problem. x11vnc doesn&#8217;t handle key modifiers(Shift/Ctrl/Alt) too well, it aborts when key combinations involving Shift key are used in vnc session with the setup. Since there was not much help available around x11vnc and the bug, i decided to give <strong>tightvnc</strong> a shot which worked really well.<br />
Here is how the setup be repeated:</p>
<hr />
<code><br />
$ sudo aptitude install xvfb tightvncserver blackbox<br />
$ Xvfb :1 -screen 1 1300x700x16 &amp; # starts X (display=:1) (set width, height and depth for screen 1)<br />
$ DISPLAY=:1 blackbox &amp; # start the window manager<br />
$ DISPLAY=:1 vncserver -depth 16 -geometry 1300x700 -alwaysshared # to startup vnc server (it prints port that vnc listens to).<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codehunk.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codehunk.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codehunk.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codehunk.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codehunk.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codehunk.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codehunk.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codehunk.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codehunk.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codehunk.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codehunk.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codehunk.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codehunk.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codehunk.wordpress.com/255/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=255&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codehunk.wordpress.com/2009/08/23/headless-x-setup-with-debianlenny/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2cf57e4c0ab471f97fe202d4b98e96e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janmejay</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix for &#8220;Pidgin not connecting to Yahoo on Lenny&#8221;</title>
		<link>http://codehunk.wordpress.com/2009/07/18/fix-for-pidgin-not-connecting-to-yahoo-on-lenny/</link>
		<comments>http://codehunk.wordpress.com/2009/07/18/fix-for-pidgin-not-connecting-to-yahoo-on-lenny/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 07:28:39 +0000</pubDate>
		<dc:creator>janmejay</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[connectivity problem]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[debian lenny]]></category>
		<category><![CDATA[pidgin]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://codehunk.wordpress.com/?p=257</guid>
		<description><![CDATA[For last few weeks Pidgin(from lenny stable repo) was failing to enable my Yahoo account. I tried reading up on the internet and changing hostname etc, but none of that worked. Upgrade to pidgin/testing or unstable looked like too disruptive and could have made my installation unstable. So i decided to compile it from source, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=257&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For last few weeks Pidgin(from lenny stable repo) was failing to enable my Yahoo account. I tried reading up on the internet and changing hostname etc, but none of that worked. Upgrade to pidgin/testing or unstable looked like too disruptive and could have made my installation unstable. So i decided to compile it from source, which worked, but with a few quirks. So here is what you need to do:<br />
Get the source from <a title="Pidgin" href="http://www.pidgin.im/download/source/" target="_blank">http://www.pidgin.im/download/source/</a></p>
<p><hr />
<code><br />
$ sudo apt-get build-dep pidgin<br />
$ sudo apt-get install network-manager-dev<br />
$ tar -jxvf pidgin-2.5.8.tar.bz2 #extract source from downloaded archive<br />
$ sudo mv pidgin-2.5.8 /usr/local/ #hack: when you 'make install' pidgin it doesn't work(reports some smiley missing or something), so we will invoke it directly from the built-source directory<br />
$ cd /usr/local/pidgin-2.5.8<br />
$ ./configure<br />
$ make<br />
$ sudo make install<br />
$ pidgin # and watch it fail, with some file missing problem<br />
$ sudo chown -R root:root . # as we are going to use this as install location<br />
$ /usr/local/pidgin-2.5.8/pidgin/pidgin #execute pidgin, add your account, and watch it connect to Yahoo<br />
</code></p>
<hr />
<p>
The same executable can be added to session preferences to start pidgin on session load.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codehunk.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codehunk.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codehunk.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codehunk.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codehunk.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codehunk.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codehunk.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codehunk.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codehunk.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codehunk.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codehunk.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codehunk.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codehunk.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codehunk.wordpress.com/257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=257&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codehunk.wordpress.com/2009/07/18/fix-for-pidgin-not-connecting-to-yahoo-on-lenny/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2cf57e4c0ab471f97fe202d4b98e96e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janmejay</media:title>
		</media:content>
	</item>
		<item>
		<title>Booting &#8216;Debian Lenny&#8217; into widescreen framebuffer</title>
		<link>http://codehunk.wordpress.com/2009/07/02/booting-debian-lenny-into-widescreen-framebuffer/</link>
		<comments>http://codehunk.wordpress.com/2009/07/02/booting-debian-lenny-into-widescreen-framebuffer/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 20:06:39 +0000</pubDate>
		<dc:creator>janmejay</dc:creator>
				<category><![CDATA[customiation]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[debian lenny]]></category>
		<category><![CDATA[framebuffer]]></category>
		<category><![CDATA[widescreen]]></category>

		<guid isPermaLink="false">http://codehunk.wordpress.com/?p=249</guid>
		<description><![CDATA[I have a Dell D630 Latitude(running Lenny) that i use at work. While trying to push the framebuffer size, i had to experiment a bit with numbers, because i couldn&#8217;t get ready to use values off google for widescreen framebuffers. &#8216;865&#8216; is what worked for me(it gives me 1280&#215;800). If you got a widescreen laptop(i [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=249&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a Dell D630 Latitude(running Lenny) that i use at work. While trying to push the framebuffer size, i had to experiment a bit with numbers, because i couldn&#8217;t get ready to use values off google for widescreen framebuffers. &#8216;<strong>865</strong>&#8216; is what worked for me(it gives me <strong>1280&#215;800</strong>). If you got a widescreen laptop(i guess most laptops these days are), appending &#8216;<strong>vga=856</strong>&#8216; to grub boot line should make it come up in <strong>1280&#215;800</strong> mode. For example, your kernel&#8217;s <strong>menu.lst</strong>(<em>/boot/grub/menu.lst</em>) entry should look like&#8230;</p>
<pre>...
title           Debian GNU/Linux, kernel 2.6.26-2-686
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-686 root=/dev/sda1 vga=865 ro quiet
initrd          /boot/initrd.img-2.6.26-2-686
...</pre>
<p>Hope this helps someone. <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codehunk.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codehunk.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codehunk.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codehunk.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codehunk.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codehunk.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codehunk.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codehunk.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codehunk.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codehunk.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codehunk.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codehunk.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codehunk.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codehunk.wordpress.com/249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=249&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codehunk.wordpress.com/2009/07/02/booting-debian-lenny-into-widescreen-framebuffer/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2cf57e4c0ab471f97fe202d4b98e96e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janmejay</media:title>
		</media:content>
	</item>
		<item>
		<title>Emacs: setup geared towards doing `Ruby based Web-Applications`</title>
		<link>http://codehunk.wordpress.com/2009/06/27/emacs-repo-for-ruby-webapps/</link>
		<comments>http://codehunk.wordpress.com/2009/06/27/emacs-repo-for-ruby-webapps/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 13:58:43 +0000</pubDate>
		<dc:creator>janmejay</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[Editor]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[RubyMine]]></category>
		<category><![CDATA[TextMate]]></category>

		<guid isPermaLink="false">http://codehunk.wordpress.com/?p=231</guid>
		<description><![CDATA[For me to call an editor decent(for Ruby based WebApps), it must have: A good Ruby editor Good Haml editor Good rhtml/html+erb editor Good JavaScript editor Terrific auto-completion Decent ruby debugging support Decent tag navigation(eg. navigating from method/class/module/variable usage to definition) Ability run Test::Unit/Rspec tests from the editor Ability to show multiple files at the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=231&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For me to call an editor <span style="text-decoration:underline;"><strong>decent</strong></span>(for Ruby based WebApps), it must have:</p>
<ul>
<li>A good Ruby editor</li>
<li>Good Haml editor</li>
<li>Good rhtml/html+erb editor</li>
<li>Good JavaScript editor</li>
<li>Terrific auto-completion</li>
<li>Decent ruby debugging support</li>
<li>Decent tag navigation(eg. navigating from method/class/module/variable usage to definition)</li>
<li>Ability run Test::Unit/Rspec tests from the editor</li>
<li>Ability to show multiple files at the same time(by splitting windows)</li>
<li>Ability to jump between related files(controller &#8211; model &#8211; view &#8211; spec/test etc)</li>
<li>Ability to run an interactive ruby console within the editor</li>
<li>Auto-generatable snippets (some call this one LiveTemplates)</li>
</ul>
<p><strong>RubyMine</strong> has support for certain things like decent ruby editor, showing multiple files at a time(i am assuming it works well, because this was supported in IntelliJ Idea when i used it last), ruby debugging and auto-generatable snippets, but it lacks on certain other fronts. For example, it does not have Haml editor and no key-binding to jump between related entities(controller, model, view, spec, helper etc). However, the major drawback with RubyMine is its resource footprint. I have seen developers force shutdown their OS X (running on MacBook Pro) because RubyMine decided to go unresponsive and `kill -9 &lt;pid&gt;` failed to get rid of it. Even GNU/Linux users are forced to kill it sometimes because it freezes too often(however `kill -9 &lt;pid&gt;` does work reliably on Linux, hence no operating system restart required <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ). JavaScript support is dumb and doesn&#8217;t highlight errors too well. I do give it some points for navigation and searching though.</p>
<p><strong>TextMate</strong> unlike RubyMine is light on resource footprint. But unfortunately, it also is low on features. Ruby editor is decent, but auto-completion is retard(it completes words from the current buffer(file) only).  Besides, key binding for auto-complete(which is such a common operation) is Esc(no touch-typist in the sane world would like that). It has no debugging support at all, and running rspec needs a plugin which in turn needs rspec installed as a gem, and if you have a frozen version of rspec/rspec-rails in your application codebase, then tough luck(there is no easy way to configure it to pick things up on a per project basis, you need to roll your sleeves up and dig into /Application/TextMate.app, to modify some badly written ruby/shell-script mess). Navigation and searching is horrible(slow and unintuitive). Command-T has no notion of priority, and brings up all the wrong files first. Haml support has to be installed seperately as a plugin, and is terrible(be it indentation, or syntax hilight). There is no interactive console and no spliting of windows supported.</p>
<p>There is more that i expect from an editor before i call it a <strong><span style="text-decoration:underline;">good programming environment</span></strong>. Here is what I think my definition of good programming tool looks like(in addition to the features in the bulleted list above):</p>
<ul>
<li>Ablity to run multiple terminals within the editor</li>
<li>Ability to open directories as buffer(allowing easy selection of files)</li>
<li>Ability to run IRC client(i like to be on IRC channels all the time, helping people and seeking help is a great way to learn)</li>
<li>Snappy frontend and sensible keystrokes(close to the host row, not forcing user to get out of touchtyping mode too often)</li>
<li>Straightforward key-bindings for macro record and play.(Both TextMate and RubyMine claim to have Macro support, but its hidden somewhere under the MenuBar-Submenu(s))</li>
<li>Ability to run commands without leaving the editor or creating a terminal within it.</li>
</ul>
<p><strong>Emacs</strong> is a pretty powerful and mature editor which has passed the test of time and has got several refinements and enhancements over the years it has lived. Most of the major things that i want in my development environment are bundled with Emacs out of the box(and the once that aren&#8217;t, are available as plug-ins). I believe the best thing about <strong>Emacs</strong> is its written in <strong>lisp</strong>, which means you can change things very easily and cleanly. I do <strong>Ruby/Rails</strong> development in my day job, and have been customizing my <strong>Emacs</strong> repository for some time now. Over a period of time, i have accumulated/tweaked some emacs goodies which have not only made<strong> Emacs</strong> a better <strong>Ruby</strong>, <strong>JavaScript</strong>, <strong>Lisp</strong>, <strong>C++</strong> editor, but a better <strong>IRC</strong>, <strong>Mail</strong>, <strong>RSS</strong>, <strong>Atom</strong> and <strong>News</strong> client. I keep my add-ons and customizations on <strong>github.com</strong> as a public repository, which helps me share it with other developers, and also gives me protection against disk failures and other bad things.<br />
So here is what my setup looks like.</p>
<ul>
<li><strong>Ruby</strong>: <em>ruby-mode</em>(written by Matz) + <em>ruby-electric</em>(minor mode)</li>
<li><strong>Haml</strong>: <em>haml-mode</em>(Nathan Weizenbaum) (by far the best support for HAML syntax highlight and marvelous indentation strictness, people who write haml know how painful it can get in TextMate/RubyMine to hunt bad indentation and fix it, but not with <strong>Emacs</strong>)</li>
<li><strong>Rhtml/Erb</strong>:<em> rhtml/rhtml-erb</em> (Paul Nathan Stickney) Great syntax highlighting and indentation support.</li>
<li><strong>JavaScript</strong>: I was waiting to come to this one. <em>js2</em>(Steve Yegge) has the best JavaScript editing support I have ever seen. <em>js2</em> has remarkable indentation, very good syntax highlighting and terrific error detection(warns you even about missing var and semicolons, let alone the more obvious errors).</li>
<li><strong>Auto completion</strong>: Of course. This one works across buffers, across modes and unlike TextMate&#8217;s `Esc` the key binding(M-/) is quite sane. You don&#8217;t have to go out of touch-typing mode, and the same shortcut can be used to browse through other possible completions.</li>
<li><strong>Ruby Debugging</strong>: <em>rubydb3x</em> to rescue (<em>rubydb2x</em> for Emacs 19.2 and older). Just fire <em>rubydb</em> and get rolling. It uses <em>GUD</em> (Grand Unified Debugger), and has sensible(easy to remember) shortcuts(unlike F7, F8, F9 that most IDE(s) have). Some common key bindings are C-n for next line C-s to step in, C-f to finish function, C-r to resume and &lt;, &gt; to roll stack frames up and down(the name-space used is C-c, so it doesn&#8217;t override any of the usual actions that those shortcuts are supposed to perform).</li>
<li><strong>Tag navigation</strong>: Navigation is a breeze. M-. to get to the implementation, M-* to pop out of it. I enhanced it to make it a look recursively up the directory hierarchy to find the tags file(a file named TAGS) and load it up and navigate seamlessly, all by itself. (<em>etags</em> doesn&#8217;t have ruby support, so use <em>exuberant-ctags</em>)(<em>&#8220;/usr/bin/ctags -e -a &#8211;Ruby-kinds=-cmfF -o TAGS -R &lt;dir_name&gt;&#8221;</em> can be used to generate a file named TAGS which emacs will read to navigate ruby code).</li>
<li><strong>Test::Unit/Rspec tests</strong>: <em>test-runner</em>(a tiny add-on) runs your test as you load a test file, and then autoruns it every time the test file is saved. It supports Test::Unit by itself, I added support for Rspec(even running single spec) to it. Works like a charm, and is very easy to tweak.</li>
<li><strong>Ability to show multiple files by splitting windows up</strong>: Do i need to say anything about windows support? <strong>Emacs</strong> is loved for this capability. However, navigation between windows was a bit painful before i added<em> window-numbering.el</em> (Nikolaj Schumacher), which made it sweet.</li>
<li><strong>Ability to jump between related files</strong>: <em>Rinari</em>(Phil Hagelberg, Eric Schulte) uses <em>jump</em>(Eric Schulte) to make jumping between controller-model-view-helper-spec-test on a<strong> Rails</strong> project seamless and quick.</li>
<li><strong>Runing interactive console</strong>: <em>ruby-mode</em> has a this hook called <em>run-ruby</em>(bound to C-c C-s), which can be used to start an interactive ruby session.While in a <em>Rails</em> project C-c M-s can be used to load script/console (<em>irb</em> with the project environment loaded).</li>
<li><strong>Auto-generatable snippets</strong>: <em>YASnippet</em>(pluskid) has this awesome snippet support which can be used to selectively load snippets for a particular mode. Snippets can be overridden by adding a custom location to pick snippets from after loading the default snippets(no need to dive into library code base to make changes)</li>
<li><strong>Ability to run multiple terminals</strong>: Not just one, there are multiple flavors of terminal supported within <strong>Emacs</strong>(<em>ansi-term</em>, <em>shell</em> and <em>eshell </em>to name a few). Each one has its own strong points, but they are all great.</li>
<li><strong>Ability to open directory within a buffer</strong>: <em>dired</em> is your friend (its a full blown file manager).</li>
<li><strong>IRC client</strong>: <em>rcirc</em> can be used to keep in touch with IRC channels. A line or two of lisp can be dropped in to change its default behavior(such as what channels to join, on which servers, using what alias&#8230; etc).</li>
<li><strong>Snappy frontend and sensible keystrokes</strong>: Its has lower footprint than most other editors, TextMate and RubyMine are no match. I can not say it has not frozen ever, it does(but very occasionally). Even when it is frozen, 3 Esc hits or C-g can be used to abort the activity causing it to freeze. I don&#8217;t remember killing it(have been using it for more than a few months now). It just never gets that bad.</li>
<li><strong>Straightforward key-bindings</strong>: I feel key-bindings are very carefully chosen. More common the key, closer it it to the home row index finger positions(f and j). Macro record/play is bound to C-x ( &lt;definition&gt; C-x ) (parenthesis make sense to developers at once, and i believe its quite intuitive a binding to define something. C-e can be used subsequently to play the macro(macros can be stored by numbers and names too). Even complicated keyboard shortcuts like <em>kill-rectangle</em> have sensible C-x r k (r -&gt; rectangle, k-&gt; kill), paste rectangle similarly is C-x r y (y -&gt; yank). Navigation keys are C-n (n -&gt; next), C-p (p -&gt; previous), C-f (f -&gt; forward), C-b (b -&gt; backward). Sensible key bindings are much easier to remember. Orthogonality is maintained across actions C-u &lt;x&gt; &lt;action&gt; does something <em>x</em> number of times and works across different types of actions.</li>
<li><strong>Running single commands</strong>: M-! can be used to run commands from within emacs(output is captured in a buffer and shown to the user).</li>
</ul>
<p>In addition to these emacs comes with some not so well-known features(which need a little exploration), for example <em>make-frame-on-display</em> can create frames on other hosts(making pair-programming really simple). It has terrific <strong>Mail/News/Feed</strong> reader called <strong>Gnus</strong>, a beautiful mode for organizing yourself up called <strong>Org-mode</strong> and a host of other great things like <strong>TRAMP</strong>(Transparent Remote (file) Access, Multiple Protocol) which lets you edit remote files over a whole bunch of protocols(including <em>ssh, smb, rcp</em> etc) and also allows editing of local files as root(using <em>su</em>). It can open compressed archives(and edit files in place), java jars, PDF files, images&#8230;. you name it. Combined with <strong>dired</strong>, these capabilities make it a great tool. This post has only tried to explain what <strong>Emacs</strong> is capable of with respect to other editors, and trust me, I haven&#8217;t even skimmed the surface of it. One really needs to use it to find out what a brilliant tool it is.</p>
<p>It can be a little daunting for a beginner to set <strong>Emacs</strong> up from scratch(it is not difficult; its just takes some time and patience). I have spent time setting it up for myself, and I think it is a good setup to start with for people doing <strong>Ruby(Rails)</strong>/<strong>JavaScript </strong>and <strong>Lisp</strong> in general. My repository is available at <a title="github emacs customization repository" href="http://github.com/janmejay/emacs" target="_blank"><strong>http://github.com/janmejay/emacs</strong></a>. One of my motivations to put it out is to help other developers(especially people starting out with Emacs), so feel free to pull it up and take it for a ride.</p>
<p>Like every other powerful tool, <strong>Emacs</strong> has bit of a learning curve, but i believe it pays off, and it pays off pretty well. To a programmer, its not just an editor, it is a <strong>&#8220;friend for life&#8221;</strong>.</p>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:943px;width:1px;height:1px;">
<pre class="prettyprint lang-el"><span class="com">pluskid</span></pre>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codehunk.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codehunk.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codehunk.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codehunk.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codehunk.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codehunk.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codehunk.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codehunk.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codehunk.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codehunk.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codehunk.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codehunk.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codehunk.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codehunk.wordpress.com/231/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codehunk.wordpress.com&amp;blog=1587745&amp;post=231&amp;subd=codehunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codehunk.wordpress.com/2009/06/27/emacs-repo-for-ruby-webapps/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a2cf57e4c0ab471f97fe202d4b98e96e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janmejay</media:title>
		</media:content>
	</item>
	</channel>
</rss>
