<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/1.5.1.3" -->
<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/"
>

<channel>
	<title>chandraonline.net</title>
	<link>http://chandraonline.net/blog</link>
	<description>chandra's personal and professional weblog</description>
	<pubDate>Sun, 07 Mar 2010 06:40:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5.1.3</generator>
	<language>en</language>

		<item>
		<title>OpenVPN on a Jailbroken Iphone</title>
		<link>http://chandraonline.net/blog/?p=22</link>
		<comments>http://chandraonline.net/blog/?p=22#comments</comments>
		<pubDate>Sun, 31 Jan 2010 08:26:32 +0000</pubDate>
		<dc:creator>Chandra</dc:creator>
		
	<category>General</category>
		<guid>http://chandraonline.net/blog/?p=22</guid>
		<description><![CDATA[	OpenVPN support is one of the things sorely missing from the iphone. And there is very little information about how one could go about getting OpenVPN working even on a jailbroken iphone. There is iopenvpn.com if you are running 2.x and it costs $29. This post is my attempt to fill this gap with step-by-step [...]]]></description>
			<content:encoded><![CDATA[	<p>OpenVPN support is one of the things sorely missing from the iphone. And there is very little information about how one could go about getting OpenVPN working even on a jailbroken iphone. There is iopenvpn.com if you are running 2.x and it costs $29. This post is my attempt to fill this gap with step-by-step instructions on how to get openvpn working for free. But please be forewarned that I am not liable for any problems this might cause  your iphone. Having said that, I have followed the instructions given below and have been successful in getting access to resources behind the corporate network using OpenVPN. Before we get started, here are some of the pre-requisites:</p>
	<ul>
	<li>Jailbroken Iphone (I run 3.1.2 jailbroken using Blackrain)</li>
	<li>Putty (<a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html</a>)</li>
	<li>WinSCP (<a href="http://winscp.net/eng/download.php">http://winscp.net/eng/download.php</a> or something similar)</li>
	<li>OpenVPN certificates and openvpn configuration file (.ovpn). The certificate should not be password protected if you want to use this through SBSettings toggle. There is instructions to take the password off below. The .ovpn file should be renamed conf.ovpn and should also be pointing to the certificates without any path.</li>
	</ul>
	<p>Step-by-Step instructions (Please run these as root by doing su root and entering your password)</p>
	<ul>
	<li>In Cydia: Install Openvpn toggle for SBSettings</li>
	<li>In your windows/mac assemble your certificate, .ovpn files etc into a local directory</li>
	<li>rename your .ovpn file to conf.ovpn and add the following two lines to the end of the file. Here is a <a href="http://www.chandraonline.net/files/iphone_vpn/conf.ovpn">sample </a> ovpn file. You need to change the remote host, cert details to yours.</li>
	<p>        <code><br />
up /var/mobile/Library/OpenVpn/update-resolv-conf<br />
down /var/mobile/Library/OpenVpn/update-resolv-conf<br />
        </code></p>
	<li>download the <a href="http://www.chandraonline.net/files/iphone_vpn/update-resolv-conf">update-resolv-conf</a></li>
	<li>Open a WinSCP session and copy all the files you assembled locally to /var/mobile/Library/OpenVpn</li>
	<li>In the winscp session edit the /var/mobile/Library/SBSettings/Commands/com.offinf.openvpnup and change as follows:</li>
	<p>         <code><br />
#!/bin/sh<br />
/bin/rm /var/mobile/Library/SBSettings/Toggles/OpenVpn/OFF<br />
cd /var/mobile/Library/OpenVpn/<br />
"/usr/bin/openvpn-iphone --script-security 2 --config /var/mobile/Library/OpenVpn/conf.ovpn" &#038;<br />
         </code></p>
	<li>Open Putty and login to your iphone as root.</li>
	<p>        <code><br />
                $ cd /var/mobile/Library<br />
                $ chown -R mobile.mobile OpenVpn<br />
                $ cd OpenVpn<br />
                $ chmod +x update-resolv-conf<br />
                #### If you have a key with password. Remove the password with the command below.<br />
                #### You will be asked for the password one last time<br />
                #### Important: Leaving your certificate without a key is a security risk. Please turn on passcode lock in your settings<br />
                #### This will ensure that if your phone does fall into the wrong hands they cant get into your network.<br />
                $ cp my.key my.key.orig<br />
                $ openssl rsa -in my.key.orig -out my.key<br />
                #### Now test your vpn setup by doing the following:<br />
                $ openvpn-iphone --script-security 2 --config conf.ovpn<br />
                #### You should see it connecting to your vpn server and setting up routes. Try to use Safari to look at something<br />
                #### behind the openvpn server.<br />
        </code></p>
	<li>Reboot your phone for the sbsettings toggle changes to take effect</li>
	<li>After reboot, open SBSettings and turn on OpenVpn</li>
	<p>        Note: For trouble shooting install top from cydia and run top to see if the toggle spawns the openvpn-ip process.
</ul>
]]></content:encoded>
			<wfw:commentRSS>http://chandraonline.net/blog/?feed=rss2&amp;p=22</wfw:commentRSS>
	</item>
		<item>
		<title>Web Automated Testing in Ruby (WATIR)</title>
		<link>http://chandraonline.net/blog/?p=20</link>
		<comments>http://chandraonline.net/blog/?p=20#comments</comments>
		<pubDate>Mon, 24 Apr 2006 02:45:16 +0000</pubDate>
		<dc:creator>Chandra</dc:creator>
		
	<category>General</category>
		<guid>http://chandraonline.net/blog/?p=20</guid>
		<description><![CDATA[	I came across a very cool library in Ruby that allows Web UI testing using OLE automation. One of the problems with running automated tests of Web applications like a end user is the effort it takes to use libraries like Http Unit to setup test cases and execute them as part of your build [...]]]></description>
			<content:encoded><![CDATA[	<p>I came across a very cool library in Ruby that allows Web UI testing using OLE automation. One of the problems with running automated tests of Web applications like a end user is the effort it takes to use libraries like Http Unit to setup test cases and execute them as part of your build process. WATIR (pronounced Water) is a ruby library that allows you test you web applications using OLE automation in your windows machine. </p>
	<p>This is how it works: </p>
	<p>You write unit test cases using WATIR and it actually invokes IE and actually does what a end user would do by entering form data, clicking on links, clicking buttons etc. You can then look at the resulting HTML DOM object and check if the web application did what it is supposed to. This is especially useful for testing multi-page wizard like applications where a lot of data entry is involved. </p>
	<p>Here is a Step-by-step on how to install WATIR: </p>
	<p>Install Ruby for Windows:   <a href="http://rubyforge.org/projects/rubyinstaller/">http://rubyforge.org/projects/rubyinstaller/ (Look for download link) </a><br />
Install WATIR: <a href="http://rubyforge.org/frs/?group_id=104 ">http://rubyforge.org/frs/?group_id=104 (Look for watir 1.4.1.exe) </a></p>
	<p>It is pretty straight forward to create WATIR scripts. But, who wants to write these scripts by hand. You are right, I wouldn&#8217;t. Instead you can use WATIR webrecorder, which records all your browser actions as WATIR scripts.  All you need to do is record your testing once and then refactor it into a test script. </p>
	<p>You can also pass -b switch to the WATIR script and it will not open the IE window and will execute the whole test in a headless mode that is ideal for test suites. </p>
	<p>There is also another competing tool called Selenium that uses Javascript to drive tests and works across many browsers. I have not used it. But I have heard more people switch from Selenium to WATIR than the other way around.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://chandraonline.net/blog/?feed=rss2&amp;p=20</wfw:commentRSS>
	</item>
		<item>
		<title>Google does Calendar</title>
		<link>http://chandraonline.net/blog/?p=19</link>
		<comments>http://chandraonline.net/blog/?p=19#comments</comments>
		<pubDate>Thu, 13 Apr 2006 08:05:14 +0000</pubDate>
		<dc:creator>Chandra</dc:creator>
		
	<category>General</category>
		<guid>http://chandraonline.net/blog/?p=19</guid>
		<description><![CDATA[Google has started the long rumored calendar service with a cool AJAX interface]]></description>
			<content:encoded><![CDATA[	<p>It has been long rumored that Google was working on a <a href="http://www.google.com/calendar">Calendar </a>service and its finally online for everyone to try. The UI is similar to anything Google : very clean and intutive.  I use Yahoo Address book and Calendar today and Y!s UI is not as fresh and snappy as Google&#8217;s but it satisfies one of my key requirements :  Being able to Sync-up with my Palm Treo 600.  Until Google adds a way to sync up with PDAs through a PC or over-the-air, there is no big reason to switch to this service.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://chandraonline.net/blog/?feed=rss2&amp;p=19</wfw:commentRSS>
	</item>
		<item>
		<title>Printable:   A Greasemonkey userscript to annotate HTML links in a printed document</title>
		<link>http://chandraonline.net/blog/?p=18</link>
		<comments>http://chandraonline.net/blog/?p=18#comments</comments>
		<pubDate>Sun, 26 Feb 2006 00:30:42 +0000</pubDate>
		<dc:creator>Chandra</dc:creator>
		
	<category>web</category>
		<guid>http://chandraonline.net/blog/?p=18</guid>
		<description><![CDATA[In spite of excellent support for HTML authors to create printer friendly views seamlessly using CSS, many of the documents on the web look horrible when printed.  Even pages that provide a printable view suffer a major flaw. If the documents have links there is no way of knowing where they point to. I wrote a Firefox Greasemonkey userscript that will automatically create references at the end of the document for every link in the page. And to make it really easy, the links are tinyurls that allow for easy typing.]]></description>
			<content:encoded><![CDATA[	<p>In spite of excellent support for HTML authors to create printer friendly version of their documents using CSS, many of the documents on the web today look horrible when printed.  Even pages that provide a printable view suffer a major flaw. If the documents have links there is no way of knowing where they point to from the physical copy. This has always bugged me. When I have things printed out and there are links in the page that I would have liked to read,  going back to the original document and hunting down the links is too much of a hassle. Take this <a href="http://www.nytimes.com/2006/02/26/international/europe/26france.html?ei=5094&#038;en=9d1c2adc0621c2a5&#038;hp=&#038;ex=1140930000&#038;partner=homepage&#038;pagewanted=print">NY Times article </a>in printable view for example,  it would be nice If I could after reading this printed page read the link to the avian flu in the article.</p>
	<p>Since I use firefox,  I wrote a Firefox Greasemonkey userscript that will automatically create references at the end of the printed document for every link in the page. And to make it really easy, the links are tinyurls that allow for easy typing instead of the original long URLs.</p>
	<p>Download <b><a href="http://www.chandraonline.net/projects/Printable/Printable.user.js">Printable.user.js</a> </b> after installing the Greasemonkey plugin in Firefox.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://chandraonline.net/blog/?feed=rss2&amp;p=18</wfw:commentRSS>
	</item>
		<item>
		<title>Installing Trac on a shared server account</title>
		<link>http://chandraonline.net/blog/?p=17</link>
		<comments>http://chandraonline.net/blog/?p=17#comments</comments>
		<pubDate>Mon, 30 Jan 2006 03:57:41 +0000</pubDate>
		<dc:creator>Chandra</dc:creator>
		
	<category>web</category>
		<guid>http://chandraonline.net/blog/?p=17</guid>
		<description><![CDATA[This is a step-by-step guide to installing Trac on a hosted shared server under a user home directory.]]></description>
			<content:encoded><![CDATA[	<p>Trac has a lot of complex dependencies and contrary to what the <a href="http://projects.edgewall.com/trac/wiki/TracInstall">TracInstall </a>page says it is one hell of a painful job installing it in a shared server under one&#8217;s own home directory. This is a step-by-step guide of how I made it work and the mileage will vary greatly on the version you try to use. If this guide was helpful or needs corrections, please let me know.</p>
	<p>Now lets get on with it&#8230;  I found the following pages useful for the install:</p>
	<p><a href="http://projects.edgewall.com/trac/wiki/TracInstall">http://projects.edgewall.com/trac/wiki/TracInstall</a><br />
<a href="http://wiki.dreamhost.com/index.php/Trac">http://wiki.dreamhost.com/index.php/Trac</a></p>
	<p><em>Note:All of my installs follow the same pattern. Untar the distribution into a  [tool]-[version]-dist directory and install to $HOME/[tool]-[version] and create a symlink to $HOME/[tool]. This allows me to easily upgrade individual pieces without breaking others (I simply symlink to the new version when its time to upgrade).</em></p>
	<p><strong>Installing Trac&#8217;s dependencies:</strong></p>
	<p>1. <strong>Python (version 2.4)</strong> : Eventhough you might have Python in your shared server , you need your own version because of ClearSilver. </p>
	<p>$ wget http://www.python.org/ftp/python/2.4.2/Python-2.4.2.tgz<br />
$ gunzip Python-2.4.2.tgz; tar xvf Python-2.4.2.tar;<br />
$ mv python-2.4.2 python-2.4.2-dist<br />
$ cd python-2.4.2-dist<br />
$ ./configure &#8211;prefix=$HOME/python-2.4.2<br />
$ make; make install<br />
$ ln -sf $HOME/python-2.4.2 $HOME/python</p>
	<p>IMPORTANT: Add $HOME/python/bin to the start of your PATH variable and LD_LIBRARY_PATH in your shell. If you use bash, set it in .bashrc as follows:</p>
	<p>export LD_LIBRARY_PATH=$HOME/python/lib/<br />
PATH=<strong>$HOME/python/bin</strong>:$PATH:$HOME/ruby/bin:$HOME/subversion/bin</p>
	<p>2. <strong>Installing ClearSilver </strong>(0.10.2):</p>
	<p>$ wget http://www.clearsilver.net/downloads/clearsilver-0.10.2.tar.gz<br />
$ gunzip clearsilver-0.10.2.tar.gz; tar xvf clearsilver-0.10.2.tar<br />
$ mv clearsilver-0.10.2 clearsilver-0.10.2-dist<br />
$ cd clearsilver-0.10.2-dist<br />
$ ./configure &#8211;prefix=$HOME/clearsilver-0.10.2 &#8211;with-python=$HOME/python/bin/python &#8211;disable-ruby  &#8211;disable-java &#8211;disable-perl &#8211;disable-csharp<br />
$ make ;   make install &#8211;prefix=$HOME/clearsilver-0.10.2</p>
	<p>3. <strong>Install egenix extensions for python </strong>(2.0.6: Trac needs mxDateTime)</p>
	<p>$ wget http://www.egenix.com/files/python/egenix-mx-base-2.0.6.tar.gz<br />
$  gunzip egenix-mx-base-2.0.6.tar.gz<br />
$ tar xvf egenix-mx-base-2.0.6.tar<br />
$ cd egenix-mx-base-2.0.6<br />
$ python setup.py build<br />
$ python setup.py install  &#8212;prefix=$HOME/python</p>
	<p>4. <strong>Install sqlite </strong>(version 3.2.2)</p>
	<p>$  wget http://www.sqlite.org/sqlite-3.2.2.tar.gz<br />
$  gunzip sqlite-3.2.2.tar.gz<br />
$  tar xvf sqlite-3.2.2.tar<br />
$  mv sqlite-3.2.2 sqlite-3.2.2-dist<br />
$ cd sqlite-3.2.2-dist<br />
$ ./configure &#8211;prefix=$HOME/sqlite-3.2.2<br />
$ edit Makefile to remove references to build and install tclsqlite since I did not have TCL installed </p>
	<p>all:    sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la)  -to-<br />
all:    sqlite3.h libsqlite3.la sqlite3$(TEXE) </p>
	<p>-and-</p>
	<p>install:        sqlite3 libsqlite3.la sqlite3.h ${HAVE_TCL:1=tcl_install} -to-<br />
install:        sqlite3 libsqlite3.la sqlite3.h </p>
	<p>$ make ; make install &#8211;prefix=$HOME/sqlite-3.3.2<br />
$ ln -sf $HOME/sqlite-3.3.2 $HOME/sqlite</p>
	<p>4. <strong>Install PySqlite </strong>(version 1.1.6) (I could not get PostgresSQL to work with Trac because my ISP does not start the postgresSQL daemon to accept TCP/IP connections):</p>
	<p>$  wget http://initd.org/pub/software/pysqlite/releases/1.1/1.1.6/pysqlite-1.1.6.tar.gz<br />
$ gunzip pysqlite-1.1.6.tar.gz<br />
$ tar xvf pysqlite-1.1.6.tar<br />
$ mv pysqlite pysqlite-1.1.6<br />
$ cd pysqlite-1.1.6<br />
$ edit setup.py and change the following:</p>
	<p> include_dirs = [&#8217;/usr/include/sqlite&#8217;]<br />
 library_dirs = [&#8217;/usr/lib/&#8217;]  </p>
	<p> -to-</p>
	<p> include_dirs = [&#8217;/path/to/homedir/python/include/sqlite&#8217;]<br />
 library_dirs = [&#8217;/path/to/homedir/python/lib/&#8217;]</p>
	<p>$ python setup.py build<br />
$ python setup.py install </p>
	<p>5. <strong>Install Subversion </strong>(Skipping this section) : See my <a href="http://chandraonline.net/blog/?p=14">previous post </a>on how to install subversion.</p>
	<p>I still had to do the following to get python bindings for SVN in my subversion-1.1.4-dist directory:</p>
	<p>$ ./configure PYTHON=$HOME/python/bin/python &#8211;prefix=$HOME/subversion &#8211;with-swig=$HOME/swig/bin/swig &#8211;without-berkeley-db &#8211;with-ssl &#8211;with-zlib &#8211;disable-shared<br />
$ make<br />
$ make swig-py<br />
$ make install-swig-py</p>
	<p>## HACK WARNING ### I also had copy some of the svn libraries from the original python install at my ISP:<br />
$ cd $HOME/python/lib/python-2.4/site-packages<br />
$ cp -R /usr/lib/python2.3/site-packages/libsvn .<br />
$ cp -R /usr/lib/python2.3/site-packages/svn .</p>
	<p>6. <strong>Install SWIG </strong>(version 1.3.24):</p>
	<p>$ wget http://easynews.dl.sourceforge.net/sourceforge/swig/swig-1.3.24.tar.gz<br />
$ gunzip swig-1.3.24.tar.gz<br />
$ tar xvf swig-1.3.24.tar<br />
$ mv SWIG-1.3.24/ swig-1.3.24-dist<br />
$  cd  swig-1.3.24-dist/<br />
$ ./configure &#8211;prefix=$HOME/swig-1.3.24 &#8211;with-python=$HOME/python/bin/python<br />
$ make; make install<br />
$ ln -sf $HOME/swig-1.3.24/   $HOME/swig</p>
	<p><strong>Installing TRAC</strong></p>
	<p>Now to the real reason we went through all this pain&#8230; installing trac itself</p>
	<p>$ wget http://ftp.edgewall.com/pub/trac/trac-0.9.3.tar.gz<br />
$ gunzip trac-0.9.3.tar.gz<br />
$ tar xvf trac-0.9.3.tar<br />
$ mv trac-0.9.3 trac-0.9.3-dist<br />
$ cd trac-0.9.3-dist<br />
$ python setup.py build<br />
$ python setup.py install &#8211;prefix=$HOME/python</p>
	<p><strong>Create a trac environment and test</strong></p>
	<p>$ trac-admin $HOME/trac-projects initenv</p>
	<p>answer the questions as part of the above command. You will need to pay close attention only to the location of your svn repository , in my case it is $HOME/svn.</p>
	<p>Your Trac install is DONE.</p>
	<p>Now to access this through a browser. Do the following in your public_html directory:</p>
	<p>$ mkdir $HOME/public_html/trac<br />
$ cd trac<br />
# create a projects.cgi with the following content:</p>
	<p>#!/bin/bash<br />
export LD_LIBRARY_PATH=&#8221;/path/to/home/python/lib&#8221;<br />
export TRAC_ENV=&#8221;/path/to/home/trac-projects&#8221;<br />
/path/to/home/python/share/trac/cgi-bin/trac.cgi</p>
	<p>$ chmod +x projects.cgi<br />
# create a .htaccess file:<br />
AuthType Basic<br />
AuthName &#8220;Log in to Trac. guest access use (guest/guest) as userid/password&#8221;</p>
	<limit GET PUT POST>
  require valid-user<br />
</limit>
AuthUserFile /path/to/home/htpassword/file<br />
DirectoryIndex projects.cgi</p>
	<p>$ ln -sf $HOME/python/share/trac/htdocs trac-static<br />
# edit $HOME/trac-projects/conf/trac.ini and add the following under [trac]<br />
htdocs_location = /trac-static</p>
	<p>Now go to http://[your-domain]/trac and you should see something like this (login as guest/guest: <a href="http://trac.chandraonline.net/"> http://trac.chandraonline.net/</a></p>
]]></content:encoded>
			<wfw:commentRSS>http://chandraonline.net/blog/?feed=rss2&amp;p=17</wfw:commentRSS>
	</item>
		<item>
		<title>Trac: Integrated SCM and project management tool</title>
		<link>http://chandraonline.net/blog/?p=16</link>
		<comments>http://chandraonline.net/blog/?p=16#comments</comments>
		<pubDate>Mon, 30 Jan 2006 01:53:25 +0000</pubDate>
		<dc:creator>Chandra</dc:creator>
		
	<category>General</category>
		<guid>http://chandraonline.net/blog/?p=16</guid>
		<description><![CDATA[A new web based project management tool that integrates with subversion.]]></description>
			<content:encoded><![CDATA[	<p>I stumbled on a new we based project management system  called <a href="http://www.edgewall.com/trac/">trac</a> that nicely integrates a bug tracking system, wiki and subversion into one little neat package. Since I have a subverison repository at my ISP, I thought I would give this a try. After following a few <a href="http://wiki.dreamhost.com/index.php/Trac">step-by-step guides</a> and a few thousand lines of shell command line history, I finally had Trac installed and working on <a href="http://trac.chandraonline.net">chandraonline.net</a>.</p>
	<p>Trac has some weird list of dependencies and installing it in a shared server only makes it worse. But hopefully I will put it to good use building some of my hobby projects.</p>
	<p>I deviated quite a bit from the step-by-step guide linked above and hope to document it sometime soon.</p>
]]></content:encoded>
			<wfw:commentRSS>http://chandraonline.net/blog/?feed=rss2&amp;p=16</wfw:commentRSS>
	</item>
		<item>
		<title>Not so lost anymore!</title>
		<link>http://chandraonline.net/blog/?p=15</link>
		<comments>http://chandraonline.net/blog/?p=15#comments</comments>
		<pubDate>Fri, 20 Jan 2006 00:55:55 +0000</pubDate>
		<dc:creator>Chandra</dc:creator>
		
	<category>General</category>
		<guid>http://chandraonline.net/blog/?p=15</guid>
		<description><![CDATA[ABC's Lost won Best drama again at the Golden globe's. ]]></description>
			<content:encoded><![CDATA[	<p>So. I was wrong. I admit it.  I was wrong about ABC&#8217;s Lost. I missed the entire first season and was <a href="http://chandraonline.net/blog/?p=12">pretty mad</a> that it won Best drama over 24 last year at the Emmys. Now I know why this show is so loved. Its an awesome piece of writing. I started watching it this season and I loved it so much that I watched the entire first season of Lost on video IPod in a couple of days (yes&#8230;couple of days&#8230;you have  a problem with that??). I was a big fan of X-files and this show is in some ways very similar to that show. If you have never seen it , you should give it a chance.</p>
	<p>For the lost fans with IPod, checkout Ryan and Jen&#8217;s Lost Transmission podcast at <a href="http://www.hawaiiup.com/lost">http://www.hawaiiup.com/lost</a>. Its very entertaining.</p>
]]></content:encoded>
			<wfw:commentRSS>http://chandraonline.net/blog/?feed=rss2&amp;p=15</wfw:commentRSS>
	</item>
		<item>
		<title>Setting up and connecting to subversion server using svn+ssh://</title>
		<link>http://chandraonline.net/blog/?p=14</link>
		<comments>http://chandraonline.net/blog/?p=14#comments</comments>
		<pubDate>Mon, 26 Dec 2005 09:15:23 +0000</pubDate>
		<dc:creator>Chandra</dc:creator>
		
	<category>General</category>
		<guid>http://chandraonline.net/blog/?p=14</guid>
		<description><![CDATA[A step-by-step HOWTO on running a subversion repository in a shared host account and connecting to it using svn over ssh.]]></description>
			<content:encoded><![CDATA[	<p>For anyone who has not heard of <a href="http://subversion.tigris.org">Subversion</a> , it is an open-source version control system (very much like CVS but much better) to manage your source code. I had started to play with <a href="http://www.rubyonrails.org">Ruby on Rails </a>using the <a href="http://www.radrails.org">RailsIDE </a>and I would hate for my source code to be without version control and much worse just kept in my hard drive. So I wanted to have a version control for my personal projects just like I do at work.  And I didn&#8217;t want to host this subversion repository in my windows box at home, I would rather keep it at the ISP machine where I host my domain.  Sounds simple enough, right?. Wrong!!. I found so little on the net about it that I  was compelled to write this down for others who might want to do this . Here is a step-by-step guide on running and connecting to a subversion repository in an ISP account.</p>
	<p>Before we get started, there are a few assumptions:</p>
	<li>Your ISP provides you with shell access using ssh. You can&#8217;t do what I am describing below using Control Panel. Not all of ISPs allow Shell access and some will do it if you ask them. This is an absolute requirement.</li>
	<li>You have permission to install anything under your user directory. This I know almost all of them allow you to do.</li>
	<p><strong>Step 1: Installing subversion server</strong></p>
	<p>The following instructions are for a linux machine. Surf to <a href="http://subversion.tigris.org">subversion</a> site and look for the latest stable source code package. When I did the install , this is what I ended up using: <a href="http://subversion.tigris.org/tarballs/subversion-1.1.4.tar.gz">http://subversion.tigris.org/tarballs/subversion-1.1.4.tar.gz</a>. Now ssh into your account and do the following:</p>
	<p><code><br />
$ cd $HOME;<br />
$ curl -o subversion-1.1.4.tar.gz http://subversion.tigris.org/tarballs/subversion-1.1.4.tar.gz<br />
$ gunzip subversion-1.1.4.tar.gz; tar xvf subversion-1.1.4.tar<br />
$ mv subversion-1.1.4 subversion-1.1.4-dist<br />
$ cd subversion-1.1.4-dist<br />
$ ./configure --prefix=$HOME/subversion-1.1.4<br />
$ make<br />
$ make install<br />
$ cd $HOME; ln -sf  subversion-1.1.4 subversion<br />
</code></p>
	<p>Thats it. Add  $HOME/subversion/bin to your PATH variable and you are all set. Now its time to create a svn repository. I chose to use $HOME/svn as my svn repository.</p>
	<p>Now test your subversion install by adding a dummy project to the subversion respository:</p>
	<p><code><br />
cd $HOME;<br />
mkdir projects;<br />
cd projects;</p>
	<p># create a dummy project source<br />
mkdir -p dummy-project/src<br />
touch dummy-project/README</p>
	<p># add the project to subversion<br />
svn import -m "Initial Version" dummy-project file://$HOME/svn/dummy-project<br />
</code></p>
	<p>If everything went according to plan, your project is now in subversion. </p>
	<p>There is not much use to a subversion server if it can only be accessed locally. There are three ways to front a subversion server to access the repository remotely: using apache webserver (using http://) , using a custom svnserve daemon (using svn:// url scheme) or by tunnelling svn over ssh (svn+ssh://). The first two options are automatically out for a hosted account and the only option is going svn over ssh. </p>
	<p><strong>Step 2: Connecting to subversion by tunnelling over ssh (svn+ssh) </strong></p>
	<p>This is where I found the least documentation and most difficulty. To connect to the subversion repository you two pieces of software on your client machine : a subversion client (I use <a href="http://tortoisesvn.tigris.org/">tortoise svn</a>) and a ssh client (I recommend <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">Putty</a>) . Install putty and the utilities it comes with preferebly through a windows installer (<a href="http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.58-installer.exe">http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.58-installer.exe</a>). Install Tortoise subversion to c:\TortoiseSVN (The default location in Program Files will create a problem later during ssh configuration). </p>
	<p>In order to tunnel svn commands over ssh , you need to be able to ssh to your ISP account without having to give a userid and password every single time the client wants to talk to the server. There is a way to setup a public-private key pair to enable this dialogue without a need for entering a userid and password. </p>
	<p><code><br />
$ ssh-keygen -t dsa -f mykey<br />
</code></p>
	<p>You will see two files mykey and mykey.pub, the openssh private and public keys. Now add the contents of mykey.pub to the file $HOME/.ssh/authorized_keys in your shell account. Create the directory and file if you don&#8217;t have it already.</p>
	<p>Now add the following to the begining of the line you just added to the authorized_keys file. It should look something like this (replace your-home-dir with the right value):</p>
	<p>command=&#8221;your -home-dir/subversion/bin/svnserve -t -r your -home-dir/svn&#8221; ssh-dss AAAA&#8230;&#8230;&#8230;&#8230;&#8230;</p>
	<p>Now move the private key file mykey to the windows machine that you will be connecting to subversion from.  Run puttygen.exe, and click the button Load and choose the mykey that you just moved from your shell account .  Putty will successfully load it and now you choose the &#8220;Save private key&#8221; button and save the private key in putty format  as mykey.ppl.  Save this to c:\TortoiseSVN\bin.</p>
	<p>Now run Putty.exe and under Session choose ssh , your host name , in Connection->Data enter your login name,  Connection->SSH->Auth section , click the Browse button to choose the private key file. Now choose c:\TortoiseSVN\bin\mykey.ppk. In Session, give it a name like SVNConnection and choose Save. Click the open and you should see the following :</p>
	<p>Using username &#8220;your-user-name&#8221;.<br />
Authenticating with public key &#8220;imported-openssh-key&#8221;<br />
( success ( 1 2 ( ANONYMOUS EXTERNAL ) ( edit-pipeline ) ) )</p>
	<p>This means your ssh connection to subversion is working. Now you just need to get the subversion client (tortoise svn) to use the private key file when connecting to your repository. In the following subversion config file (C:\Documents and Settings\Your-User-Name\Application Data\Subversion\config) look for the section title tunnels:</p>
	<p><code><br />
[tunnels]<br />
### Configure svn protocol tunnel schemes here.  By default, only<br />
### the 'ssh' scheme is defined.  You can define other schemes to<br />
### be used with 'svn+scheme://hostname/path' URLs.  A scheme<br />
### definition is simply a command, optionally prefixed by an<br />
### environment variable name which can override the command if it<br />
### is defined.  The command (or environment variable) may contain<br />
### arguments, using standard shell quoting for arguments with<br />
### spaces.  The command will be invoked as:<br />
###   <command> <hostname> svnserve -t<br />
### (If the URL includes a username, then the hostname will be<br />
### passed to the tunnel agent as <user>@<hostname>.)  If the<br />
### built-in ssh scheme were not predefined, it could be defined<br />
### as:<br />
# ssh = $SVN_SSH ssh<br />
ssh = C:/TortoiseSVN/bin/TortoisePlink.exe -2 -i C:/TortoiseSVN/bin/mykey.ppk<br />
</hostname></user></hostname></command></code></p>
	<p>Now open the Repo-Browser of TortoiseSVN and enter the URL to your dummy project:</p>
	<p>svn+ssh://SVNConnection/dummy-project</p>
	<p>and you should see the files under dummy-project. If you can&#8217;t connect, its probably because you didn&#8217;t setup the puTTY session correctly. Verify that you entered all the required information correctly.</p>
	<p>You can connect to svn repository from inside RADRails using the following URL (this does not work in TortoiseSVN for some reason):</p>
	<p>svn+ssh://your-user-name@your-machine-name/dummy-project</p>
]]></content:encoded>
			<wfw:commentRSS>http://chandraonline.net/blog/?feed=rss2&amp;p=14</wfw:commentRSS>
	</item>
		<item>
		<title>Google Desktop hacks</title>
		<link>http://chandraonline.net/blog/?p=13</link>
		<comments>http://chandraonline.net/blog/?p=13#comments</comments>
		<pubDate>Sun, 25 Dec 2005 18:34:05 +0000</pubDate>
		<dc:creator>Chandra</dc:creator>
		
	<category>General</category>
		<guid>http://chandraonline.net/blog/?p=13</guid>
		<description><![CDATA[Hack to move the Google desktop cache from c: to a location of your choice.]]></description>
			<content:encoded><![CDATA[	<p>Whoa. I haven&#8217;t blogged in a long while now. But since I was off on vacation for a month in November, I have a good excuse. I have some <a href="http://desktop.google.com">Google desktop </a>hacks to share. Actually I have <strong>a</strong> hack to share. But its a useful one. I have been using Google desktop for a while now and I have a lot of emails (in archives of course) and files that it indexes. The cache has been eating away so much of my C:  space where I can&#8217;t do any decent work anymore. So I went registry hunting for a way to move the cache from my c: drive to my external drive (a huge 160 gb). And I actually found a way. Here is how (<strong>This is not for the faint of heart. Doing wrong things to your registry might render your machine useless. Consider yourself warned</strong>): </p>
	<p><code>shutdown google desktop by right clicking on the tray icon and choosing exit.<br />
start->run and type regedit<br />
In regedit go to My Computer->HKEY_CURRENT_USER->Software->Google->Google Desktop<br />
On the right you will see an entry data_dir. Double click it and change the value data to a directory of your choice.<br />
now start google desktop again and you should see your cache in that directory.<br />
</code></p>
	<p>Some words of caution though: </p>
	<li>Don&#8217;t make your cache go to a network directory. You will completely flood the network. Google writes a lot to the cache. </li>
	<li>If you choose an external drive as your cache, turn encryption of index and datafiles on in Google desktop preferences. This might take google desktop longer to index, but it is the wise thing to do because anyone could take off with your external drive more easily than your desktop.</li>
	<li>In my case I reinstalled the google desktop (because I was upgrading to a new version) and removed all the indices and cache and then changed the data_dir fresh after an install. I am not sure if it works as expected if you just changed the registry entry without a reinstall. </li>
]]></content:encoded>
			<wfw:commentRSS>http://chandraonline.net/blog/?feed=rss2&amp;p=13</wfw:commentRSS>
	</item>
		<item>
		<title>Emmy&#8217;s Snubs 24</title>
		<link>http://chandraonline.net/blog/?p=12</link>
		<comments>http://chandraonline.net/blog/?p=12#comments</comments>
		<pubDate>Mon, 19 Sep 2005 07:13:32 +0000</pubDate>
		<dc:creator>Chandra</dc:creator>
		
	<category>General</category>
		<guid>http://chandraonline.net/blog/?p=12</guid>
		<description><![CDATA[	I just finished watching the Emmys. I can&#8217;t believe 24 did not receive the best drama series  award or the best lead actor. The Emmy voters are seriously LOST (get it?).  And to make matters worse they award the best lead actor to James Spader and the best series to Lost. I would [...]]]></description>
			<content:encoded><![CDATA[	<p>I just finished watching the Emmys. I can&#8217;t believe <a href="http://www.fox.com/24">24</a> did not receive the best drama series  award or the best lead actor. The Emmy voters are seriously LOST (get it?).  And to make matters worse they award the best lead actor to James Spader and the best series to Lost. I would have been completely ok with West Wing taking the best drama series if not 24. Since the votes are cast based on one episode of the series , I wonder if a show like 24, which requires you to watch the entire series to appreciate how wonderful it is, will ever win.</p>
	<p>But it does not matter whether the show receives an Emmy or not. We are all on your side Jack, when these jokers in hollywood get kidnapped by terrorists, you look the other way  <img src='http://chandraonline.net/blog/wp-images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .
</p>
]]></content:encoded>
			<wfw:commentRSS>http://chandraonline.net/blog/?feed=rss2&amp;p=12</wfw:commentRSS>
	</item>
	</channel>
</rss>
