<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>code monkeying</title>
	<atom:link href="http://www.ashokgelal.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ashokgelal.com</link>
	<description>Coding in a silly or playful way</description>
	<lastBuildDate>Tue, 08 Nov 2011 04:00:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Running SublimeText 2 from Terminal on Mac OSX</title>
		<link>http://www.ashokgelal.com/2011/11/running-sublimetext-2-from-terminal-on-mac-osx/</link>
		<comments>http://www.ashokgelal.com/2011/11/running-sublimetext-2-from-terminal-on-mac-osx/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 04:00:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[quicktweaks]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sublimetext]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.ashokgelal.com/?p=98</guid>
		<description><![CDATA[Invoke the following command: $ sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/bin/subl Now, you can use something like: $ subl . to open up current folder with SublimeText]]></description>
			<content:encoded><![CDATA[<p>Invoke the following command:</p>
<p><code>$ sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/bin/subl<br />
</code><br />
Now, you can use something like:</p>
<p><code>$ subl .<br />
</code><br />
to open up current folder with SublimeText</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ashokgelal.com/2011/11/running-sublimetext-2-from-terminal-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically Setting Terminal&#8217;s Window Title to Current Path</title>
		<link>http://www.ashokgelal.com/2011/11/automatically-setting-terminals-window-title-to-current-path/</link>
		<comments>http://www.ashokgelal.com/2011/11/automatically-setting-terminals-window-title-to-current-path/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 18:19:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[scripting]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.ashokgelal.com/?p=89</guid>
		<description><![CDATA[While in hacking mood (read Terminal mode), I often end up using multiple terminal tabs. Switching between the tabs are a little pain as every terminal (at least, those I know of) set their title to some non-sense static text. (&#8230;)</p><p><a href="http://www.ashokgelal.com/2011/11/automatically-setting-terminals-window-title-to-current-path/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>While in hacking mood (read Terminal mode), I often end up using multiple terminal tabs. Switching between the tabs are a little pain as every terminal (at least, those I know of) set their title to some non-sense static text. I wanted to have the title showing the current path so that I don&#8217;t have to switch between all of them to find the tab I&#8217;m looking for. After spending an hour or so, I came up with something as simple as this. Google wasn&#8217;t that much helpful to find this out easily.</p>
<p>Append the following lines to your ~/.bashrc or ~/.bash_profile or whatever your are using for dumping your bash configs.</p>
<pre> --- &gt;8 --- &gt;8 --- &gt;8 CUT HERE ... &gt;8 --- &gt;8 --- &gt;8</pre>
<pre></pre>
<pre><code>settitle () </code></pre>
<pre><code>{ </code></pre>
<pre><code> echo -ne "\033]0;${PWD/$HOME/~}\007" </code></pre>
<pre><code>} </code></pre>
<pre></pre>
<pre><code>PROMPT_COMMAND=settitle</code></pre>
<pre><code>export PROMPT_COMMAND</code>

--- &gt;8 --- &gt;8 --- &gt;8 ... TO HERE &gt;8 --- &gt;8 --- &gt;8</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ashokgelal.com/2011/11/automatically-setting-terminals-window-title-to-current-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up ssh public keys and adding an alias</title>
		<link>http://www.ashokgelal.com/2011/09/setting-up-ssh-public-keys-and-adding-an-alias/</link>
		<comments>http://www.ashokgelal.com/2011/09/setting-up-ssh-public-keys-and-adding-an-alias/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 05:48:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[scripting]]></category>
		<category><![CDATA[remote server]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.ashokgelal.com/?p=79</guid>
		<description><![CDATA[This post is sort of a &#8216;note-to-myself&#8217; post. For my Computer Science class, I have to do a lots of ssh-ing into remote host &#8211; my university server . I got tired of typing username and password every time I (&#8230;)</p><p><a href="http://www.ashokgelal.com/2011/09/setting-up-ssh-public-keys-and-adding-an-alias/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>This post is sort of a &#8216;note-to-myself&#8217; post. For my Computer Science class, I have to do a lots of ssh-ing into remote host &#8211; my university server . I got tired of typing username and password every time I try to connect from home (using my MacBook Pro). I&#8217;ve seen people using an alias without even typing a username, password, and a hostname. I&#8217;ve once set up the ssh keys on my HP laptop but after I sold the laptop (I wiped out everything before selling <img src='http://www.ashokgelal.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ,  I&#8217;ve been lazy setting up a keys; no more.</p>
<p>Here are the steps I did.</p>
<p>Let suppose our remote server (in my case, university computer) is called <strong><em>server.universityname.edu</em></strong>, your usual username is <strong><em>foouser</em></strong>, and you want to give an alias <strong><em>sshserv </em></strong>to connect to the remote server using ssh.</p>
<p>1. Create a local ssh key on your local computer</p>
<p><code>$ ssh-keygen -t -rsa<br />
</code><br />
There are other algorithms you can use to create your ssh key. I&#8217;m using <em>rsa</em> for this tutorial. ssh key algorithms and secure algorithms are too broad to be covered in this tutorial.</p>
<p>Anyway, you should have a <em>id_rsa.pub</em> file inside <em>~/.ssh</em> folder. Do</p>
<p><code>$ ls ~/.ssh/<br />
</code><br />
and make sure you have a <em>id_rs.pub</em> file</p>
<p>2. Copy the public file to your remote server:</p>
<p><code>$ scp ~/.ssh/id_rsa.pub foouser@server.universityname.edu:.ssh/authorized_key_local<br />
</code><br />
You will be prompted for password. Use your usual <em>ssh</em> password.</p>
<p>3. Log in to your remote server to manage the key:</p>
<p><code>$ ssh foouser@server.universityname.edu<br />
</code><br />
Again, you will be prompted for a password.</p>
<p>4. Concatenate the contents of <em>~/.ssh/authorized_key_local</em> to <em>~/.ssh/authorized_keys</em>:</p>
<p><code>$ cat ~/.ssh/authorized_key_local &gt;&gt; ~/.ssh/authorized_keys<br />
</code><br />
5. Remove the <em>~/.ssh/authorized_key_local file</em> which is not required anymore:</p>
<p><code>$ rm ~/.ssh/authorized_key_local<br />
</code><br />
6. Logout from the remote server:</p>
<p><code>$ exit<br />
</code><br />
7. You are now set so that you don&#8217;t need the password every time you ssh into your remote server. Verify this by:</p>
<p><code>$ ssh foouser@server.universityname.edu<br />
</code><br />
At this point, you shouldn&#8217;t be asked for any password. If you are prompted for a password, please make sure your properly followed this tutorial up to this point.</p>
<p>8. If you are in your remote server, exit so that you are on local computer:</p>
<p><code>$ exit<br />
</code><br />
Now, let&#8217;s setup an alias.</p>
<p>1. Edit your <em>~/.ssh/config</em> file to add the following. If the file doesn&#8217;t exist, create it first.</p>
<p><span style="color: #808080;"><em>#The Host is the alias that you want to use</em></span></p>
<p><em>Host=myremoteserv</em></p>
<p><span style="color: #808080;"><em>#The Hostname is the real hostname of the remote server</em></span></p>
<p><em>Hostname=server.universityname.edu</em></p>
<p><span style="color: #808080;"><em>#The user is your username</em></span></p>
<p><em>User=foouser</em></p>
<p>&nbsp;</p>
<p>2. Save the file and try:</p>
<p><code>$ ssh myremoteserv<br />
</code><br />
You should be able to login to your remote server.</p>
<p>3. If you want to save 3 keystrokes every time you ssh using above command, you can add an alias for the whole command in your <em>~/.bash_profile</em> file:</p>
<p><code>alias sshserv="ssh myremoteserv"<br />
</code><br />
4. To use the alias &#8216;sshserv&#8217;, either restart the terminal or update your bash profile:</p>
<p><code>$ source ~/.bash_profile<br />
</code><br />
5. Now, you can login to your remote server by just using:</p>
<p><code>$ sshserv<br />
</code><br />
Happy ssh-ing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ashokgelal.com/2011/09/setting-up-ssh-public-keys-and-adding-an-alias/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CoreWLANWirelessManager Porting Completed</title>
		<link>http://www.ashokgelal.com/2011/02/corewlanwirelessmanager-porting-completed/</link>
		<comments>http://www.ashokgelal.com/2011/02/corewlanwirelessmanager-porting-completed/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 06:30:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[monotouch]]></category>

		<guid isPermaLink="false">http://www.ashokgelal.com/?p=73</guid>
		<description><![CDATA[Yay! After working my ass off for two days, I finally finished porting CoreWLANWirelessManager sample from Apple&#8217;s Official Reference Library (http://developer.apple.com/library/mac/#samplecode/CoreWLANWirelessManager/History/History.html) to MonoMac. This was my first time working with Cocoa+MonoMac, and the experience wasn&#8217;t that bad. As I was (&#8230;)</p><p><a href="http://www.ashokgelal.com/2011/02/corewlanwirelessmanager-porting-completed/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Yay!<br />
After working my ass off for two days, I finally finished porting CoreWLANWirelessManager sample from Apple&#8217;s Official Reference Library (http://developer.apple.com/library/mac/#samplecode/CoreWLANWirelessManager/History/History.html) to MonoMac. This was my first time working with Cocoa+MonoMac, and the experience wasn&#8217;t that bad. As I was trying to mimic the behavior, naming convention, and style of the official sample, it took me more time than expected. Nevertheless, the coding was a breeze &#8211; only couple of times I got stuck. During this time, I was also able to find a bug in MonoMac related to some threading issue (my guess).<br />
Anyways, it feels super awesome to finish a Mac Application in a language that I love (C#) and then distribute the source code for the open source lovers to play, and learn from it. The source code is hosted on github: <a title="CoreWLANWirelessManager on Github" href="https://github.com/ashokgelal/CoreWLANWirelessManager">https://github.com/ashokgelal/CoreWLANWirelessManager</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ashokgelal.com/2011/02/corewlanwirelessmanager-porting-completed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Get your namespace right at first place</title>
		<link>http://www.ashokgelal.com/2011/02/get-your-namespace-right-at-first-place/</link>
		<comments>http://www.ashokgelal.com/2011/02/get-your-namespace-right-at-first-place/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 07:59:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[gtk#]]></category>
		<category><![CDATA[MonoDevelop]]></category>
		<category><![CDATA[pain]]></category>

		<guid isPermaLink="false">http://www.ashokgelal.com/?p=71</guid>
		<description><![CDATA[Esp. if you are working with MonoDevelop+Gtk#. Believe me it is more painful than getting your balls pinched by someone. I never had this experience (getting the balls pinched) but yes couple of times I&#8217;ve been hit with cricket balls, (&#8230;)</p><p><a href="http://www.ashokgelal.com/2011/02/get-your-namespace-right-at-first-place/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Esp. if you are working with MonoDevelop+Gtk#. Believe me it is more painful than getting your balls pinched by someone. I never had this experience (getting the balls pinched) but yes couple of times I&#8217;ve been hit with cricket balls, and today&#8217;s experience with refactoring/ renaming namespaces was more painful than those hits.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ashokgelal.com/2011/02/get-your-namespace-right-at-first-place/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Python Script: Header Appender</title>
		<link>http://www.ashokgelal.com/2011/01/first-python-script-header-appender/</link>
		<comments>http://www.ashokgelal.com/2011/01/first-python-script-header-appender/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 07:52:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.ashokgelal.com/?p=65</guid>
		<description><![CDATA[I started learning Python just yesterday and I&#8217;m not only making some good progress but also just finished writing my first ever Python script that processes a bunch of *.cs files and appends a header to each files (basically a (&#8230;)</p><p><a href="http://www.ashokgelal.com/2011/01/first-python-script-header-appender/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I started learning Python just yesterday and I&#8217;m not only making some good progress but also just finished writing my first ever Python script that processes a bunch of *.cs files and appends a header to each files (basically a copyright notice, and a license &#8211; Apache 2.0 License in this case).</p>
<p>So, this turned out to be pretty good and pretty productive. I needed a similar kind of script for processing my C# files that I&#8217;ve written for my <a title="NetFilterFramework on GitHub" href="https://github.com/ashokgelal/NetFilterFramework" target="_blank">NetFilterFramework</a>. This framework basically allows you to filter a list based on some binary expressions criteria. You just have to create a string expression such off a public property of a class e.g. Name property of a Student class.</p>
<p>Writing this first ever Python Script was fun. I starting was very rough and edgy. I used IDLE at first to see how it goes and then ran a number of tests on some dummy files to see the results. All went fine with some minor problems. The big stumbling block was command line parsing. Although Python&#8217;s inbuilt command line parsing (using OptParse) is super awesome, <a title="OptParse on Python doc" href="http://wiki.python.org/moin/OptParse" target="_blank">the manual on their site</a> was not that help and too verbose. So, I needed to take the help of some external sites. So was for recursively traversing a folder to read all the files. Following sites turned out to be very helpful while writing this script:</p>
<p><a href="http://www.alexonlinux.com/pythons-optparse-for-human-beings  " target="_blank">http://www.alexonlinux.com/pythons-optparse-for-human-beings</a></p>
<p><a href="http://code.activestate.com/recipes/499305/  " target="_blank">http://code.activestate.com/recipes/499305/</a></p>
<p><a href="http://stefaanlippens.net/getcwd  " target="_blank">http://stefaanlippens.net/getcwd</a></p>
<p>And of course stackoverflow.com is always there. Thanks to heavens for this internet thing.<br />
<span id="more-65"></span><br />
Here is the my first ever Python Script in its entirety:<br />
<script src="https://gist.github.com/828833.js?file=header_appender.py"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ashokgelal.com/2011/01/first-python-script-header-appender/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Greatest Excuse!</title>
		<link>http://www.ashokgelal.com/2011/01/the-greatest-excuse/</link>
		<comments>http://www.ashokgelal.com/2011/01/the-greatest-excuse/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 04:08:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[photo]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[code monkey]]></category>
		<category><![CDATA[fun]]></category>

		<guid isPermaLink="false">http://www.ashokgelal.com/?p=55</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ashokgelal.com/wp-content/uploads/2011/01/the-real-codemonkey.jpg"><img class="aligncenter size-medium wp-image-56" title="the-real-codemonkey" src="http://www.ashokgelal.com/wp-content/uploads/2011/01/the-real-codemonkey-212x300.jpg" alt="" width="212" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ashokgelal.com/2011/01/the-greatest-excuse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

