<?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>Hi, Rahim &#187; how-to&#8217;s</title>
	<atom:link href="http://www.hirahim.com/blog/category/how-tos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hirahim.com/blog</link>
	<description>Displayed on 100% recycled pixels.</description>
	<lastBuildDate>Thu, 04 Aug 2011 04:38:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>SSH tunneling with Tomato</title>
		<link>http://www.hirahim.com/blog/2010/10/25/ssh-tunneling-with-tomato/</link>
		<comments>http://www.hirahim.com/blog/2010/10/25/ssh-tunneling-with-tomato/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 05:28:24 +0000</pubDate>
		<dc:creator>Rahim Sonawalla</dc:creator>
				<category><![CDATA[how-to's]]></category>
		<category><![CDATA[Firesheep]]></category>
		<category><![CDATA[SSH tunnel]]></category>
		<category><![CDATA[Tomato]]></category>

		<guid isPermaLink="false">http://www.hirahim.com/blog/?p=318</guid>
		<description><![CDATA[Eric Butler released Firesheep yesterday and the Internet forums have already started debating the ethics of it. I&#8217;m not sure what kind of impact it&#8217;ll have on other people, but it convinced me to take action and secure my computers. There are a few ways to secure your computers, but after reviewing the HN thread, [...]]]></description>
			<content:encoded><![CDATA[<p>Eric Butler released <a class="external" href="http://codebutler.com/firesheep">Firesheep</a> yesterday and the Internet forums have already started <a class="external" href="http://news.ycombinator.com/item?id=1828955">debating the ethics</a> of it. I&#8217;m not sure what kind of impact it&#8217;ll have on other people, but it convinced me to take action and secure my computers.</p>
<p>There are a few ways to secure your computers, but after reviewing the <a class="external" href="http://news.ycombinator.com/item?id=1827928">HN thread</a>, it looks like the quickest and cheapest (free) way is to set up an SSH tunnel and route all wireless traffic through it.</p>
<p>These instructions assume you&#8217;re moderately tech savvy (find a nerdy friend), and that your home router runs <a class="external" href="http://www.polarcloud.com/tomato">Tomato</a>.</p>
<h3>Set up the SSH daemon</h3>
<p>The first thing you&#8217;ll need to do is turn on Tomato&#8217;s built-in SSH daemon.</p>
<p><a href="http://www.hirahim.com/blog/wp-content/tomato_preferences.png"><img class="figure-c" src="http://www.hirahim.com/blog/wp-content/tomato_preferences-267x300.png" alt="" title="Tomato Administration Preferences" width="267" height="300"></a></p>
<ol>
<li>Open up a web browser and navigate to http://192.168.1.1</li>
<li>Type in your router&#8217;s username and password</li>
<li>Click on the &#8220;Administration&#8221; link in the lefthand menu</li>
<li>Check &#8220;Enable at Startup&#8221; and &#8220;Remote Access&#8221; (so that you can create an SSH tunnel to your router even when you&#8217;re out and about)</li>
<li>Enter &#8220;2222&#8243; for the remote port. (Pick another port number if you like.)</li>
<li>Uncheck &#8220;Allow Password Login.&#8221; (We&#8217;ll enter in authorized keys in the next section.)</li>
</ol>
<h3>Set up each computer</h3>
<p>Next, you&#8217;ll need to create SSH keys for each of the computers you plan on using.</p>
<ol>
<li>Open up Terminal and type <code>ssh-keygen -d</code> to create a new key</li>
<li>Accept all the defaults</li>
<li>Type in a passphrase of your choosing</li>
<li>Using a text editor, open up the newly created &#8220;id_dsa.pub&#8221; file. (Found under ~/.ssh/id_dsa.pub by default.)</li>
<li>Copy and paste the contents of the file into the &#8220;Authorized keys&#8221; section in Tomato. (Add multiple keys by pasting them one after the other in the &#8220;Authorized keys&#8221; section.)</li>
</ol>
<h3>Connecting securely</h3>
<ol>
<li>Create a new text file and paste in the following:</li>
<blockquote><p>
<code>#!/bin/sh</code></p>
<p><code>ssh -fND 8887 -p 2222 root@[router's external IP address]</code>
</p></blockquote>
<li>Save the file as &#8220;setup_tunnel.sh&#8221;</li>
<li>Make the file executable by running <code>chmod +x setup_tunnel.sh</code> in Terminal</li>
</ol>
<p>Now whenever you want to create an SSH tunnel to your router, just open up Terminal and run <code>./setup_tunnel.sh</code>.</p>
<h3>Route traffic through the tunnel</h3>
<p>Once you&#8217;ve got a secure tunnel running on your computer, you&#8217;ll need to route traffic through it.</p>
<h4>OS X</h4>
<p><a href="http://www.hirahim.com/blog/wp-content/osx_network_preferences.png"><img class="figure-c" src="http://www.hirahim.com/blog/wp-content/osx_network_preferences-300x260.png" alt="" title="Proxy Configuration for OS X" width="300" height="260"></a></p>
<ol>
<li>System Preferences &#8594; Network</li>
<li>Select &#8220;AirPort&#8221; in the lefthand list</li>
<li>Click on the &#8220;Advanced&#8221; button</li>
<li>Click on the &#8220;Proxies&#8221; tab</li>
<li>Check &#8220;SOCKS Proxy&#8221; and enter &#8220;localhost&#8221; for the host and &#8220;8887&#8243; for the port</li>
</ol>
<h4>Ubuntu</h4>
<p><a href="http://www.hirahim.com/blog/wp-content/ubuntu_network_preferences.png"><img class="figure-c" src="http://www.hirahim.com/blog/wp-content/ubuntu_network_preferences-300x271.png" alt="" title="Proxy Configuration in Ubuntu" width="300" height="271"></a></p>
<ol>
<li>System &#8594; Preferences &#8594; Network Proxy</li>
<li>Check &#8220;Manual proxy configuration&#8221;</li>
<li>Under &#8220;Socks host&#8221; type &#8220;localhost&#8221; and &#8220;8887&#8243; for the port</li>
<li>Click &#8220;Apply System-Wide&#8230;&#8221;</li>
</ol>
<h3>Secure Firefox</h3>
<p>By default, Firefox doesn&#8217;t route DNS through the proxy, so do the following to fix that.</p>
<ol>
<li>Open up Firefox and type &#8220;about:config&#8221; in the address bar</li>
<li>Click &#8220;I&#8217;ll be careful, I promise&#8221;</li>
<li>Type &#8220;network.proxy.socks_remote_dns&#8221; in the filter.</li>
<li>Toggle the value to &#8220;true&#8221; by double clicking on it</li>
</ol>
<p>And that&#8217;s it, a free way to secure your computers&#8217; Wi-Fi connections!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hirahim.com/blog/2010/10/25/ssh-tunneling-with-tomato/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Git + Dropbox: the workflow of champions</title>
		<link>http://www.hirahim.com/blog/2010/08/04/git-dropbox-the-workflow-of-champions/</link>
		<comments>http://www.hirahim.com/blog/2010/08/04/git-dropbox-the-workflow-of-champions/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 07:35:45 +0000</pubDate>
		<dc:creator>Rahim Sonawalla</dc:creator>
				<category><![CDATA[how-to's]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.hirahim.com/blog/?p=229</guid>
		<description><![CDATA[I&#8217;ve been using this setup for some time now and it&#8217;s so insanely useful it&#8217;d be a shame if I didn&#8217;t share it. (Note: this isn&#8217;t new.) Basically, I use Git for my source control and Dropbox as my online repository&#8212;and it&#8217;s a snap to set up. Create a directory in your Dropbox folder for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using this setup for some time now and it&#8217;s so insanely useful it&#8217;d be a shame if I didn&#8217;t share it. (Note: <a class="external" href="http://solutions.treypiepmeier.com/2010/02/22/using-dropbox-to-share-git-repositories/">this</a> <a class="external" href="http://www.cimgf.com/2008/06/03/version-control-makes-you-a-better-programmer/">isn&#8217;t</a> <a class="external" href="http://stackoverflow.com/questions/1960799/using-gitdropbox-together-effectively">new</a>.) Basically, I use <a class="external" href="http://git-scm.com/">Git</a> for my source control and <a class="external" href="http://www.dropbox.com/">Dropbox</a> as my online repository&#8212;and it&#8217;s a snap to set up.</p>
<ol>
<li>Create a directory in your Dropbox folder for your projects. Mine&#8217;s called &#8220;Projects.&#8221;</li>
<li>Open up a terminal and go to the directory of the project you&#8217;d like to host on Dropbox.</li>
<li>In the terminal type: <code>git clone --bare . ~/Dropbox/[projects folder]/[project name].git</code></li>
<li>Then type: <code>git remote add [project name] ~/Dropbox/[projects folder]/[project name].git</code></li>
</ol>
<p>That&#8217;s it! Now after every local commit, you can push your changes to Dropbox by doing <code>git push [project name] master</code>.</p>
<p>When I want to work on a project on my laptop, I run <code>git clone ~/Dropbox/[projects folder]/[project name].git</code> once to grab the initial code and <code>git pull origin master</code> everytime I want to pull new changes in.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hirahim.com/blog/2010/08/04/git-dropbox-the-workflow-of-champions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with the Netflix API in PHP</title>
		<link>http://www.hirahim.com/blog/2010/04/14/working-with-the-netflix-api-in-php/</link>
		<comments>http://www.hirahim.com/blog/2010/04/14/working-with-the-netflix-api-in-php/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 20:04:29 +0000</pubDate>
		<dc:creator>Rahim Sonawalla</dc:creator>
				<category><![CDATA[how-to's]]></category>
		<category><![CDATA[Netflix API]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hirahim.com/blog/?p=178</guid>
		<description><![CDATA[Introduction I spent part of last week working on an entry for the Boxee/Twilio developer contest. A few days before the deadline, I decided it&#8217;d be really slick if I added Netflix into the mix, so I started digging through the documentation. I think Twilio&#8217;s simple API and awesome debugging tools spoiled me because figuring [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>I spent part of last week working on an entry for the <a class="external" href="http://contests.twilio.com/2009/11/developer-contest.html">Boxee/Twilio developer contest</a>. A few days before the deadline, I decided it&#8217;d be really slick if I added Netflix into the mix, so I started digging through the <a class="external" href="http://developer.netflix.com/docs">documentation</a>. I think Twilio&#8217;s simple API and awesome debugging tools spoiled me because figuring out Netflix&#8217;s API was a pain. A lot of this had to do with there not being a really good PHP library to take care of authorization and making signed calls to the API. I went with <a class="external" href="http://github.com/jrconlin/oauthsimple/">OAuthSimple</a> and ran into a lot of &#8220;invalid signature&#8221; errors and other little gotchas along the way. Hopefully, this write-up and sample code will save you guys some time.</p>
<h3>Before You Begin</h3>
<p>In order to get started, you&#8217;ll need to <a class="external" href="http://developer.netflix.com/member/register">sign up for a Netflix developer account</a> and apply for an API key. (This is separate from your normal Netflix account.) After you&#8217;ve been approved (as far as I can tell, approval is instant), you&#8217;ll receive a &#8220;key&#8221; and a &#8220;shared secret.&#8221; From here on out, we&#8217;ll call them the &#8220;consumer key&#8221; and &#8220;consumer secret.&#8221;</p>
<p><img src="http://www.hirahim.com/blog/wp-content/netflix_keys.png" alt="Screenshot of the Netflix API key management page." title="netflix_keys" width="700" height="209" class="alignnone size-full wp-image-202" /></p>
<p>Write both of those down, because we&#8217;ll be using them often. You&#8217;ll also want to get yourself a copy of <a class="external" href="http://github.com/jrconlin/oauthsimple/">the OAuthSimple library</a>.</p>
<h3>Getting Authorized</h3>
<p>Netflix uses <a class="external" href="http://oauth.net/">OAuth</a>, so you&#8217;ll need to have users authorize your application before you can work with their data. In order to do this, we&#8217;ll create a link that takes them to the authorization page.</p>
<p><script src="http://gist.github.com/366207.js?file=link_netflix.php"></script></p>
<p>If all goes well and the user authorizes the application, Netflix will call the page you specified in the link above and pass it the user&#8217;s OAuth token. You can then exchange that temporary token for a permanent OAuth token, OAuth token secret, and user ID. You&#8217;ll want to save this information in your database (or however you&#8217;re storing data) since you&#8217;ll be using it to make calls to the Netflix API.</p>
<p><script src="http://gist.github.com/366207.js?file=callback.php"></script></p>
<h3>Making Calls to the API</h3>
<p>Now that the user has authorized your application, you&#8217;re ready to actually start working with the API [<a href="#note-1">1</a>]. The API is <a class="external" href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a> based, so it&#8217;s as simple as specifying a URL, passing in the proper parameters, and parsing the data returned.</p>
<p>For example, here&#8217;s how to get a list of the movies in the user&#8217;s Instant Watch queue:</p>
<p><script src="http://gist.github.com/366207.js?file=list_queue.php"></script></p>
<p>Adding movies to a user&#8217;s queue is similar&#8212;just specify the URL (http://api.netflix.com/users/[netflix_user_id]/queues/instant/disc), pass in the proper parameters, and parse the data returned. Also, remember that when writing data, set cURL to POST the data (<code>curl_setopt($curl, CURLOPT_POST, true)</code> and <code>curl_setopt($curl, CURLOPT_POSTFIELDS, [parameters to pass])</code>) and set the action to POST in the OAuthSimple library (<code>$oauth->setAction('POST')</code>).</p>
<p>Check out Netflix&#8217;s documentation for other <a class="external" href="http://developer.netflix.com/docs/Common_Tasks#0_51188">examples of common tasks</a>.</p>
<h3>Notes</h3>
<ol>
<li id="note-1">You can work with some parts of the Netflix API without being authorized by the user, but nothing too interesting&#8212;just searching the Netflix catalog for movies/TV shows.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.hirahim.com/blog/2010/04/14/working-with-the-netflix-api-in-php/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Installing older add-ons in Firefox</title>
		<link>http://www.hirahim.com/blog/2009/12/23/installing-older-add-ons-in-firefox/</link>
		<comments>http://www.hirahim.com/blog/2009/12/23/installing-older-add-ons-in-firefox/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 07:21:07 +0000</pubDate>
		<dc:creator>Rahim Sonawalla</dc:creator>
				<category><![CDATA[how-to's]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://www.hirahim.com/blog/?p=134</guid>
		<description><![CDATA[If Firefox is preventing you from installing an add-on because it says the add-on isn&#8217;t compatible with your version of Firefox, but you think it might be, you can disable Firefox&#8217;s compatibility check with these simple steps: Type &#8220;about:config&#8221; in the URL bar and hit enter. Click &#8220;I&#8217;ll be careful, I promise.&#8221; Right-click anywhere on [...]]]></description>
			<content:encoded><![CDATA[<p>If Firefox is preventing you from installing an add-on because it says the add-on isn&#8217;t compatible with your version of Firefox, but you think it might be, you can disable Firefox&#8217;s compatibility check with these simple steps:</p>
<ol>
<li>Type &#8220;about:config&#8221; in the URL bar and hit enter.</li>
<li>Click &#8220;I&#8217;ll be careful, I promise.&#8221;</li>
<li>Right-click anywhere on the page and choose New&rarr;Boolean.</li>
<ul>
<li>If you&#8217;re running Firefox 3.5 or lower, type &#8220;extensions.checkCompatibility&#8221;</li>
<li>If you&#8217;re running Firefox 3.6, type &#8220;extensions.checkCompatibility.3.6&#8243;</li>
<li>If you&#8217;re running an alpha of Firefox 3.7, type &#8220;extensions.checkCompatibility.3.7a&#8221;</li>
</ul>
<li>Set the value to false.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.hirahim.com/blog/2009/12/23/installing-older-add-ons-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up EZ Flash V</title>
		<link>http://www.hirahim.com/blog/2007/09/21/setting-up-ez-flash-v/</link>
		<comments>http://www.hirahim.com/blog/2007/09/21/setting-up-ez-flash-v/#comments</comments>
		<pubDate>Fri, 21 Sep 2007 18:37:26 +0000</pubDate>
		<dc:creator>Rahim Sonawalla</dc:creator>
				<category><![CDATA[how-to's]]></category>

		<guid isPermaLink="false">http://www.hirahim.com/blog/2007/09/21/setting-up-ez-flash-v/</guid>
		<description><![CDATA[My sister recently purchased an onyx black Nintendo DS lite and immediately saw the need to run homebrew programs. I have the EZ Flash IV lite for my DS, and it works perfectly, so I decided to stick with the EZ Flash series of flash cards. I bought the latest iteration, the EZ Flash V, [...]]]></description>
			<content:encoded><![CDATA[<p>My sister recently purchased an <a class="external" href="http://www.amazon.com/Nintendo-DS-Lite-Onyx-Black/dp/B000I10PY2">onyx black Nintendo DS lite</a> and immediately saw the need to run homebrew programs. I have the EZ Flash IV lite for my DS, and it works perfectly, so I decided to stick with the EZ Flash series of flash cards. I bought the latest iteration, the EZ Flash V, from <a class="external" href="http://www.winsunx.com">winsunx</a> for $29 plus $18 shipping. (Don&#8217;t let the specious web site detract you, I&#8217;ve used them before and they are legit.)</p>
<p>Although a good product, the makers clearly didn&#8217;t spend much time on documentation. The package contains the flash card and nothing more. No manual, not even a CD with the needed software. Not to worry, I&#8217;m here to walk you through it.</p>
<p>Start by formatting your microSD card to FAT32. This is a straight-forward Windows operation. Just connect the card to your computer, open up My Computer, right click on the newly detected drive, select &#8220;FAT32&#8243; from the &#8220;File System&#8221; drop down, check the &#8220;Quick Format&#8221; checkbox, and hit &#8220;Start.&#8221;</p>
<p>Now it&#8217;s time to download some files. The first being the &#8220;shell.&#8221; I downloaded my copy from <a class="external" href="http://www.totalgba.com/download/ez5shell070328.zip" title="Download the EZ Flash 5 shell">TotalGBA</a>, but you can probably find it on a few <a class="external" href="http://ezflash.sosuke.com/" title="EZ Flash software at the unofficial USA forum">other</a> <a class="external" href="http://www.ezflash.cn/en/default.asp?cat=2" title="EZ Flash software at the official EZ Flash web site">sites</a> as well. You&#8217;ll also need to <a class="external" href="http://www.totalgba.com/download/ez5kernel070323.rar" title="Download the EZ Flash 5 kernel">download</a> a &#8220;kernel.&#8221;</p>
<p>Unzip everything to your microSD card. After doing so, there should be an &#8220;ez5upldr.bin&#8221; file and a &#8220;shell&#8221; folder on the card. Remove the microSD card from your computer, insert it into the EZ Flash V flash card, and insert that into your DS. Turn on your DS while holding down the &#8220;R&#8221; button. (If you&#8217;re DS isn&#8217;t configured to autoboot DS games, load &#8220;EZ Flash V&#8221; from the DS menu while holding down the &#8220;R&#8221; button.) The program will load and display some instructional information. Press the &#8220;R&#8221; button again. The program will continue running. After it has finished running, it will prompt you to press the &#8220;A&#8221; button.</p>
<p>You&#8217;re all set! Turn off the DS, remove the microSD card and put it back in your computer. Delete the &#8220;ez5upldr.bin&#8221; file, but keep the &#8220;shell&#8221; folder (EZ Flash V needs it to run properly). Load up your favorite homebrew programs and enjoy.</p>
<p><em><strong>Update</strong></em>: If you&#8217;re having problems with some programs not running (they load but never go any further), you may need to change the microSD card speed setting. (Different microSD cards have different speeds. PNY being the fastest, Kingston a bit slower, and so on.) Start up EZ Flash V, and while in the menu screen (where you see the list of everything that&#8217;s on your microSD card), hold down the &#8220;L&#8221; button and tap &#8220;R.&#8221; This will bring up the settings. From there change the speed to a higher number. Try 12 to start with; if the program works, lower the number and try again. Keep doing this until you find the speed setting where things start to break. Then just increase the speed by one and you&#8217;ve got the right speed setting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hirahim.com/blog/2007/09/21/setting-up-ez-flash-v/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
