<?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>S Anand &#187; Coding</title>
	<atom:link href="http://www.s-anand.net/blog/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.s-anand.net/blog</link>
	<description>Technology, business and fun</description>
	<lastBuildDate>Sat, 17 Jul 2010 06:31:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Make backgrounds transparent</title>
		<link>http://www.s-anand.net/blog/make-backgrounds-transparent/</link>
		<comments>http://www.s-anand.net/blog/make-backgrounds-transparent/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 06:57:37 +0000</pubDate>
		<dc:creator>S Anand</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[How I do things]]></category>

		<guid isPermaLink="false">http://www.s-anand.net/blog/make-backgrounds-transparent/</guid>
		<description><![CDATA[This is the simplest way that I’ve found to make the background colour of an image transparent. Download GIMP Open your image. I’ll pick this one: Optional: Select Image – Mode – RGB if it’s not RGB. Select Colors – Colors to Alpha… Click on the white button next to “From” and select the eye-dropper. [...]]]></description>
			<content:encoded><![CDATA[<p>This is the simplest way that I’ve found to make the background colour of an image transparent.</p>
<ol>
<li><a href="http://portableapps.com/apps/graphics_pictures/gimp_portable">Download GIMP</a>
<li>Open your image. I’ll pick this one:<br /><a href="http://www.s-anand.net/blog/wp-content/uploads/killme1.png"><img alt="" src="http://www.s-anand.net/blog/wp-content/uploads/killme1_thumb.png" width="275" height="58"></a>
<li>Optional: Select Image – Mode – RGB if it’s not RGB.
<li>Select Colors – Colors to Alpha…<br /><a href="http://www.s-anand.net/blog/wp-content/uploads/killme2.png"><img alt="" src="http://www.s-anand.net/blog/wp-content/uploads/killme2_thumb.png" width="299" height="254"></a>
<li>Click on the white button next to “From” and select the eye-dropper.<a href="http://www.s-anand.net/blog/wp-content/uploads/killme3.png"><img title="" alt="" src="http://www.s-anand.net/blog/wp-content/uploads/killme3_thumb.png" width="478" height="318"></a>
<li>Pick the green colour on the image, and click OK<br /><a href="http://www.s-anand.net/blog/wp-content/uploads/killme4.png"><img title="" alt="" src="http://www.s-anand.net/blog/wp-content/uploads/killme4_thumb.png" width="275" height="58"></a> </li>
</ol>
<p>The anti-aliasing is preserved as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.s-anand.net/blog/make-backgrounds-transparent/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Shopping with Cooliris</title>
		<link>http://www.s-anand.net/blog/shopping-with-cooliris/</link>
		<comments>http://www.s-anand.net/blog/shopping-with-cooliris/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 21:36:32 +0000</pubDate>
		<dc:creator>S Anand</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[How I do things]]></category>

		<guid isPermaLink="false">http://www.s-anand.net/blog/shopping-with-cooliris/</guid>
		<description><![CDATA[I just put together this little demo that scrapes John Lewis’ site and creates a MediaRSS file out of it. CoolIris has got to be the best way to shop. Apart from being really pretty, it’s quite useful when you know what something looks like, but don’t quite know how to search for it. For [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.s-anand.net/blog/wp-content/uploads/johnlewis1.jpg"><img title="John Lewis jackets scrolling on CoolIris plugin" alt="John Lewis jackets scrolling on CoolIris plugin" src="http://www.s-anand.net/blog/wp-content/uploads/johnlewis1_thumb.jpg" width="600" height="375"></a></p>
<p><a href="http://www.s-anand.net/blog/wp-content/uploads/johnlewis2.jpg"><img style="display: inline" title="Zoom-in view of a jacket at John Lewis" alt="Zoom-in view of a jacket at John Lewis" src="http://www.s-anand.net/blog/wp-content/uploads/johnlewis2_thumb.jpg" width="600" height="375"></a></p>
<p>I just put together this <a href="http://www.s-anand.net/johnlewis">little demo</a> that scrapes <a href="http://www.johnlewis.com/">John Lewis</a>’ site and creates a <a href="http://en.wikipedia.org/wiki/Media_RSS">MediaRSS</a> file out of it.</p>
<p><a href="http://www.cooliris.com/">CoolIris</a> has got to be the best way to shop. Apart from being really pretty, it’s quite useful when you know what something looks like, but don’t quite know how to search for it. For example, I was trying to look for a headphone-microphone (you know, the ones that connect into an iPhone or a Blackberry). I didn’t have a clue what it’s called. (<a href="http://en.wikipedia.org/wiki/TRS_connector">TRRS</a>, if you’re interested. I found out later.) The only way I could get it was to browse the wall…</p>
<p><a href="http://www.s-anand.net/blog/wp-content/uploads/amazoncooliris.jpg"><img style="display: inline" title="Amazon search for ear microphones on CoolIris" alt="Amazon search for ear microphones on CoolIris" src="http://www.s-anand.net/blog/wp-content/uploads/amazoncooliris_thumb.jpg" width="600" height="375"></a></p>
<p>For the curious, here’s the 50-line <a href="http://gist.github.com/330477">source code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.s-anand.net/blog/shopping-with-cooliris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ImportHtml doesn&#8217;t auto-refresh</title>
		<link>http://www.s-anand.net/blog/importhtml-doesnt-auto-refresh/</link>
		<comments>http://www.s-anand.net/blog/importhtml-doesnt-auto-refresh/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 09:54:26 +0000</pubDate>
		<dc:creator>S Anand</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.s-anand.net/blog/?p=2487</guid>
		<description><![CDATA[A cool thing about Google Spreadsheets is that you can scrape websites using external data functions like importHtml. It’s really easy to use. The formula: =importHtml("http://www.imdb.com/chart/top", "table", 1) imports the Internet Movie Database top 250 table on to Google Spreadsheets. Since you can publish these as RSS feeds, it ought to, in theory, be a [...]]]></description>
			<content:encoded><![CDATA[<p>A cool thing about <a href="http://docs.google.com/">Google Spreadsheets</a> is that you can scrape websites using <a href="http://docs.google.com/support/bin/answer.py?hl=en&amp;answer=75507">external data functions</a> like importHtml. It’s really easy to use. The formula:</p>
<pre>=importHtml("http://www.imdb.com/chart/top", "table", 1)</pre>
<p>imports the <a href="http://www.imdb.com/chart/top">Internet Movie Database top 250</a> table on to Google Spreadsheets.</p>
<p>Since you can <a href="http://www.mmmeeja.com/blog/web-development/google-spreadsheets-rss.html">publish these as RSS feeds</a>, it ought to, in theory, be a great way of generating RSS feeds out of arbitrary content.</p>
<p>There’s just one problem: <a href="http://www.google.com/support/forum/p/Google%20Docs/thread?tid=46676d88b38e0c50&amp;hl=en">it doesn’t auto update</a>.</p>
<p>There are claims that it does <a href="http://www.google.com/support/forum/p/Google%20Docs/thread?tid=061199840171feea&amp;hl=en">every</a> <a href="https://docs.google.com/View?docID=dhrr6ms2_523cs7274fv&amp;pageview=1&amp;hgd=1">hour</a>. Maybe it does <em>when the sheet is open</em>. I don’t know. But it definitely does not when the sheet is closed. I wrote a simple script that logs the time at which the script was accessed, and prints the log every time it is accessed.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">datetime</span>, <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Content-Type: text/plain; charset=utf-8'</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">''</span>
&nbsp;
logfile = <span style="color: #483d8b;">'timenow.log'</span>
<span style="color: #ff7700;font-weight:bold;">try</span>:    timelog = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>logfile<span style="color: black;">&#41;</span>.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">except</span>: timelog = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
timelog.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">datetime</span>.<span style="color: #dc143c;">datetime</span>.<span style="color: black;">now</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> + <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
<span style="color: #008000;">open</span><span style="color: black;">&#40;</span>logfile, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span>.<span style="color: black;">writelines</span><span style="color: black;">&#40;</span>timelog<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">''</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>timelog<span style="color: black;">&#41;</span></pre></div></div>

<p>Then I importHtml’ed it into Google spreadsheets, and left it on for the night. Result: absolutely no hits when the document is closed.</p>
<p>Pity. Guess <a href="http://developer.yahoo.com/yql/">YQL</a> is still the best option.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.s-anand.net/blog/importhtml-doesnt-auto-refresh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Command line alarm</title>
		<link>http://www.s-anand.net/blog/command-line-alarm/</link>
		<comments>http://www.s-anand.net/blog/command-line-alarm/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 04:37:24 +0000</pubDate>
		<dc:creator>S Anand</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[How I do things]]></category>

		<guid isPermaLink="false">http://www.s-anand.net/blog/command-line-alarm/</guid>
		<description><![CDATA[When I’m in front of my laptop, I usually forget the world around. Sadly, the world around has important things that need to get done on time. Like eating medicines, turning off the washing machine or the hob, etc. The one thing I’ve been lacking on my machine was a simple alarm system. I’d like [...]]]></description>
			<content:encoded><![CDATA[<p>When I’m in front of my laptop, I usually forget the world around. Sadly, the world around has important things that need to get done on time. Like eating medicines, turning off the washing machine or the hob, etc.</p>
<p>The one thing I’ve been lacking on my machine was a simple alarm system. I’d like to set an alarm to remind me to do something in 5 minutes, for example. And it should be dead simple to set up.</p>
<p>After hunting around a fair for freeware to do this, I’ve finally settled on writing this tiny piece of Visual Basic code.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Set</span> WshShell = CreateObject(<span style="color: #800000;">&quot;WScript.Shell&quot;</span>)
<span style="color: #000080;">If</span> WScript.Arguments.length &amp;lt; 2 <span style="color: #000080;">Then</span>
  WScript.Echo <span style="color: #800000;">&quot;Usage: alarm &lt;time-in-minutes&gt; &lt;message&gt;&quot;</span>
<span style="color: #000080;">Else</span>
  WScript.Sleep WScript.Arguments.Item(0) * 60 * 1000
  msg = <span style="color: #800000;">&quot;&quot;</span>
  <span style="color: #000080;">For</span> i = 1 <span style="color: #000080;">to</span> WScript.Arguments.Count - 1
      msg = msg + WScript.Arguments.Item(i) + <span style="color: #800000;">&quot; &quot;</span>
  <span style="color: #000080;">Next</span>
  WshShell.Popup msg, -1, <span style="color: #800000;">&quot;Alarm&quot;</span>, 64
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span></pre></div></div>

<p>I’ve saved this as “alarm.vbs” somewhere in my path. When I need to set an alarm, I just type</p>
<pre>alarm 5 Turn off the hob</pre>
<p>This pops up a window in 5 minutes with the alarm:</p>
<p><a href="http://www.s-anand.net/blog/wp-content/uploads/alarm.png"><img alt="An informational popup window saying Turn off the hob" src="http://www.s-anand.net/blog/wp-content/uploads/alarm_thumb.png" width="158" height="119"></a></p>
<p>This turned out to be a life-saver yesterday. I had to catch a flight at the Bangalore airport, and traffic is notoriously bad. To be on the safe side, I set up the following:</p>
<pre>alarm 25 Catch the flight
alarm 30 You really need to go now
alarm 35 You've missed the flight</pre>
<p>Turned out to be a wise thing. I ignored the first alarm. On the second, I said “OK, OK, just 1 minute…” and it really took the third alarm to get me going. Just barely made it to the flight.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.s-anand.net/blog/command-line-alarm/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>SSH Tunneling through web filters</title>
		<link>http://www.s-anand.net/blog/ssh-tunneling-through-web-filters/</link>
		<comments>http://www.s-anand.net/blog/ssh-tunneling-through-web-filters/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 19:46:39 +0000</pubDate>
		<dc:creator>S Anand</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[How I do things]]></category>

		<guid isPermaLink="false">http://www.s-anand.net/blog/ssh-tunneling-through-web-filters/</guid>
		<description><![CDATA[You can defeat most web filters by spending around 8 cents/hr on Amazon EC2. (It’s usually worth the money. It’s a fraction of the cost a phone call or a sandwich. And I usually end up wasting that money anyway on calling someone or eating my way out of the misery of corporate proxies.) Most [...]]]></description>
			<content:encoded><![CDATA[<p>You can defeat most <a href="http://www.google.co.in/search?q=web+filter">web filters</a> by spending <a href="http://aws.amazon.com/ec2/#pricing">around 8 cents/hr on Amazon EC2</a>. (It’s usually worth the money. It’s a fraction of the cost a phone call or a sandwich. And I usually end up wasting that money anyway on calling someone or eating my way out of the misery of corporate proxies.)</p>
<p>Most web filters and proxies block all ports except the <a href="http://en.wikipedia.org/wiki/Http">HTTP port (80)</a> and the <a href="http://en.wikipedia.org/wiki/Https">HTTPS port (443)</a>. But it’s used to carry encrypted traffic, and, <a href="http://proxytunnel.sourceforge.net/paper.php">as Mark explains</a>:</p>
<blockquote><p>since all the traffic that passed through the tunnel is supposed to be SSL encrypted (so as to form an unhindered SSL session between the browser and the HTTPS server), there are little or no access controls possible on such a tunnel</p></blockquote>
<p>That means web filters can’t really block HTTPS traffic. So we can redirect web traffic to a local HTTPS server, and set up a server outside the firewall that redirects them back to the regular servers.</p>
<p><a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">Putty</a> will be our local HTTPS server. <a href="http://aws.amazon.com/ec2/">Amazon EC2</a> gives us a server outside the firewall.</p>
<p>So here’s a 16-step recipe to bypass your web filter. (This is the simplest I could make it.)</p>
<p>In Steps 1-7, we’ll launch a server on Amazon EC2 with 2 tweaks. Step 1 enables Port 443, and step 6 re-configures SSH to run on Port 443 instead of on Port 22. (Remember: most proxies block all ports other than 80 and 443). <a href="http://alestic.com/">Alestic</a>’s article on how to <a href="http://alestic.com/2009/06/ec2-user-data-scripts">Automate EC2 Instance Setup with user-data Scripts</a> and this thread on <a href="http://developer.amazonwebservices.com/connect/thread.jspa?messageID=126265&amp;#126265">running SSH on port 443</a> are invaluable.</p>
<p>In Steps 8-13, we’ll set up Putty as our local HTTPS server. Read how to set up <a href="http://digitalpbk.blogspot.com/2009/05/ssh-proxy-windows-linux-orkut-bypass.html">Putty as a SOCKS server</a> and how to use <a href="http://meinit.nl/using-putty-and-an-http-proxy-to-ssh-anywhere-through-firewalls">Putty with a HTTP proxy</a>. All I did was to combine the two.</p>
<p>In steps 14-16, we’ll configure the browser to use the Putty as the SOCKS server.</p>
<p><strong>Ingredients</strong></p>
<ol>
<li><a href="http://aws.amazon.com/">Amazon AWS account</a> (sign up for free – you won’t be charged until you use it)</li>
<li><a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">Putty</a> (which may be available on your Intranet, if you’re lucky)</li>
</ol>
<p><strong>Directions</strong></p>
<ol>
<li>On the <a href="https://console.aws.amazon.com/ec2/">AWS EC2 Console</a>, click on <strong>Security Groups</strong> and select the <strong>default</strong> security group. At the bottom, select <strong>HTTPS</strong> as the connection method, and save it.<br />
<a href="http://www.s-anand.net/blog/wp-content/uploads/ec2security.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/ec2security_thumb.png" alt="" width="500" height="288" /></a></li>
<li>Click on <strong>Key Pairs</strong>, select <strong>Create Key Pair</strong> and type in some name. Click on the <strong>Create</strong> button and you’ll be asked to download a key file. Save it somewhere safe.<a href="http://www.s-anand.net/blog/wp-content/uploads/ec2keypair.png"><br />
<img src="http://www.s-anand.net/blog/wp-content/uploads/ec2keypair_thumb.png" alt="" width="500" height="288" /></a></li>
<li>Run PuttyGen (it comes with Putty), click <strong>Load</strong> and select the key file you just saved. Now click on <strong>Save private key</strong> and save it as <strong>privatekey.ppk</strong>.</li>
<li>Back on the <a href="https://console.aws.amazon.com/ec2/">AWS EC2 Console</a>, click on <strong>Launch Instance</strong>.<br />
<a href="http://www.s-anand.net/blog/wp-content/uploads/ec20.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/ec20_thumb.png" alt="" width="500" height="288" /></a></li>
<li>Select <strong>Community AMIs</strong> and find <strong>ami-ccf615a5</strong>. It’s a Ubunty Jaunty 9.04 instance that&#8217;s been customised to run scripts passed as user-data. You may pick any other alestic instance. (The screenshot below picks a different instance. Ignore that.)<br />
<a href="http://www.s-anand.net/blog/wp-content/uploads/ec2launch.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/ec2launch_thumb.png" alt="" width="500" height="288" /></a></li>
<li>Continue until you get to <strong>Advanced Instance Options</strong>. Here, copy and paste the following under <strong>User Data</strong>. <em>Do not make a mistake here!</em>
<pre>#!/bin/bash
mv /etc/ssh/sshd_config /etc/ssh/x
sed "s/^#\?Port.*/Port 443/" /etc/ssh/x &gt; /etc/ssh/sshd_config
/etc/init.d/ssh restart</pre>
<p><a href="http://www.s-anand.net/blog/wp-content/uploads/ec2userdata.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/ec2userdata_thumb.png" alt="" width="500" height="288" /></a></li>
<li>Keep pressing <strong>Continue</strong> and <strong>Launch</strong> the instance. Once launched, click on “Instances” on the left, and keep refreshing the page until the status turns green (running). Now, copy the <strong>Public DNS</strong> of the instance.<br />
<a href="http://www.s-anand.net/blog/wp-content/uploads/ec2instancerunning.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/ec2instancerunning_thumb.png" alt="" width="500" height="273" /></a></li>
<li>Run Putty. Type in <strong>root@</strong><em>&lt;the-public-DNS-you-just-copied&gt;</em> as the host name, and <strong>443</strong> as the port<br />
<a href="http://www.s-anand.net/blog/wp-content/uploads/putty1.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/putty1_thumb.png" alt="" width="456" height="435" /></a></li>
<li>Under <strong>Connection &gt; Proxy</strong>, set <strong>HTTP</strong> as the proxy type. Type in the <strong>Proxy hostname</strong> and <strong>Port</strong> you normally use to access the Internet. Select <strong>Yes</strong> for <strong>Do DNS name lookup at proxy end</strong>. Type in your Windows login ID and password.<br />
<a href="http://www.s-anand.net/blog/wp-content/uploads/putty2.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/putty2_thumb.png" alt="" width="456" height="435" /></a></li>
<li>Under <strong>Connection &gt; SSH</strong>, select <strong>Enable Compression</strong>.<br />
<a href="http://www.s-anand.net/blog/wp-content/uploads/putty5.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/putty5_thumb.png" alt="" width="456" height="435" /></a></li>
<li>Under <strong>Connection &gt; SSH &gt; Auth</strong>, click <strong>Browse</strong> and select the <strong>privatekey.ppk</strong> file you’d saved earlier.<br />
<a href="http://www.s-anand.net/blog/wp-content/uploads/putty3.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/putty3_thumb.png" alt="" width="456" height="435" /></a></li>
<li>Under <strong>Connection &gt; SSH &gt; Tunnels</strong>, type <strong>9090</strong> as the <strong>Source port</strong>, <strong>Dynamic</strong> as the <strong>Destination</strong>, and click <strong>Add</strong>.<br />
<a href="http://www.s-anand.net/blog/wp-content/uploads/putty4.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/putty4_thumb.png" alt="" width="456" height="435" /></a></li>
<li>Now click <strong>Open</strong>. You should get a terminal into your Amazon EC2 instance.</li>
<li>Open your Browser, and set the SOCKS server to localhost:9090. For Internet Explorer, go to <strong>Tools – Options – Connections – LAN Settings</strong>, select <strong>Use a proxy &#8230;</strong>, click on <strong>Advanced</strong>, and type <strong>localhost</strong>:<strong>9090</strong> as the <strong>Socks</strong> server. Leave all other fields blank.<br />
<a href="http://www.s-anand.net/blog/wp-content/uploads/ieconfig.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/ieconfig_thumb.png" alt="" width="500" height="362" /></a></li>
<li>For Firefox, go to <strong>Tools – Options – Advanced – Network – Settings</strong> and select <strong>Manual proxy configuration</strong>. Set the Socks Host to <strong>localhost</strong>:<strong>9090</strong> and leave all other fields blank.<br />
<a href="http://www.s-anand.net/blog/wp-content/uploads/ffconfig.png"><img src="http://www.s-anand.net/blog/wp-content/uploads/ffconfig_thumb.png" alt="" width="500" height="254" /></a></li>
<li>Also, go to URL <strong>about:config</strong>, and make sure that <strong>network.proxy.socks_remote_dns</strong> is set to <strong>true</strong>.</li>
</ol>
<p>That’s it. You should now be able to check <a href="http://www.moon-blog.com/2009/02/top-ten-most-blocked-websites.html">most blocked sites</a> like <a href="http://www.facebook.com/">Facebook</a> and <a href="http://www.youtube.com/">YouTube</a>.</p>
<p>Those who favour the command line may want to automate Steps 1-7 by downloading Amazon’s <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351">EC2 API tools</a>. <a href="http://developer.amazonwebservices.com/connect/message.jspa?messageID=52178">EC2 API tools work from behind a proxy too</a>. The commands you’ll need to use to setup are:</p>
<p><code>set EC2_HOME=<em>your-ec2-home-directory</em><br />
set EC2_CERT=<em>your-ec2-certificate</em><br />
set EC2_PRIVATE_KEY=<em>your-ec2-private-key</em><br />
ec2-add-keypair mykeypair<br />
ec2-authorize default -p 443<br />
set EC2_JVM_ARGS=-DproxySet=true -DproxyHost=<em>yourproxy</em> \<br />
-DproxyPort=<em>yourport</em> -Dhttps.proxySet=true \<br />
-Dhttps.proxyHost=<em>yourproxy</em> -Dhttps.proxyPort=<em>yourport</em> \<br />
-Dhttp.proxyUser=<em>yourusername</em> -Dhttps.proxyUser=<em>yourusername</em> \<br />
-Dhttp.proxyPass=<em>yourpassword</em> -Dhttps.proxyPass=<em>yourpassword</em><br />
ec2-run-instances ami-ccf615a5 --key mykeypair --user-data-file <em>your-startup-file-containing-lines-in-step-6</em></code></p>
<p>You can go further and use any software (such as Skype) if you install <a href="http://www.freecap.ru/eng/">FreeCap</a>. More details are in this article on <a href="http://thinkhole.org/wp/2006/05/10/howto-secure-firefox-and-im-with-putty/">Secure Firefox and IM with Putty</a>.</p>
<p>Linux users may want to check out <a href="http://proxytunnel.sourceforge.net/">ProxyTunnel</a> and this article on <a href="http://dag.wieers.com/howto/ssh-http-tunneling/">Tunneling SSH over HTTP(S)</a>.</p>
<p><strong>Update</strong>: Follow-ups on <a href="http://news.ycombinator.com/item?id=1043413">hacker news comments</a>, <a href="http://tweetmeme.com/story/427812352/ssh-tunneling-through-web-filters-s-anandnet">twitter</a>, <a href="http://delicious.com/url/0a6b39e211f481515ae02cab92cec1e7">delicious</a> and <a href="http://digg.com/security/SSH_Tunneling_through_web_filters_s_anand_net">digg</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.s-anand.net/blog/ssh-tunneling-through-web-filters/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>
