<?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>Project Green Duckling</title>
	<atom:link href="http://sysnet1.cs.williams.edu/danny/wp/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://sysnet1.cs.williams.edu/danny/wp</link>
	<description>Gush: A platform for distributed experiments on Planet-Lab</description>
	<lastBuildDate>Fri, 30 Oct 2009 13:02:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>College students&#8217; Chinese cooking show</title>
		<link>http://sysnet1.cs.williams.edu/danny/wp/?p=311</link>
		<comments>http://sysnet1.cs.williams.edu/danny/wp/?p=311#comments</comments>
		<pubDate>Fri, 30 Oct 2009 13:02:06 +0000</pubDate>
		<dc:creator>Danny Y. Huang</dc:creator>
				<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://sysnet1.cs.williams.edu/danny/wp/?p=311</guid>
		<description><![CDATA[Cooking with Steven is a Chinese cooking program for college students by college students. We show you how to make economical, healthy and authentic Chinese dishes that you can easily prepare in your dorm kitchens.

http://www.CookingWithSteven.com
]]></description>
			<content:encoded><![CDATA[<p><strong><em>Cooking with Steven</em></strong> is a Chinese cooking program for college students by college students. We show you how to make economical, healthy and authentic Chinese dishes that you can easily prepare in your dorm kitchens.</p>
<p style="text-align: center;"><a href="http://www.cookingwithsteven.com"><img class="aligncenter size-full wp-image-552" style="border: 0px solid black;" title="Cooking with Steven: A Chinese cooking show for poor, busy college students" src="http://www.purplevalleyfilms.com/pvf/wp-content/uploads/2009/10/title-without-navigation.jpg" border="1" alt="Cooking with Steven: A Chinese cooking show for poor, busy college students" width="572" height="289" /></a></p>
<p style="text-align: center;"><a href="http://www.CookingWithSteven.com">http://www.<strong>Cooking</strong>With<strong>Steven</strong>.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sysnet1.cs.williams.edu/danny/wp/?feed=rss2&amp;p=311</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ulimit</title>
		<link>http://sysnet1.cs.williams.edu/danny/wp/?p=309</link>
		<comments>http://sysnet1.cs.williams.edu/danny/wp/?p=309#comments</comments>
		<pubDate>Fri, 23 Oct 2009 15:47:25 +0000</pubDate>
		<dc:creator>Danny Y. Huang</dc:creator>
				<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://sysnet1.cs.williams.edu/danny/wp/?p=309</guid>
		<description><![CDATA[Will use ulimit to change the max fd, so that i don&#8217;t have to wait 10 minutes before things get screwed. Stay tuned.
]]></description>
			<content:encoded><![CDATA[<p>Will use ulimit to change the max fd, so that i don&#8217;t have to wait 10 minutes before things get screwed. Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysnet1.cs.williams.edu/danny/wp/?feed=rss2&amp;p=309</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Not ssh-able</title>
		<link>http://sysnet1.cs.williams.edu/danny/wp/?p=307</link>
		<comments>http://sysnet1.cs.williams.edu/danny/wp/?p=307#comments</comments>
		<pubDate>Tue, 06 Oct 2009 02:41:55 +0000</pubDate>
		<dc:creator>Danny Y. Huang</dc:creator>
				<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://sysnet1.cs.williams.edu/danny/wp/?p=307</guid>
		<description><![CDATA[When you try to do connect slice williams_gush on more than 900 nodes, most of the nodes are going to be marked as failed, though they can be ssh&#8217;ed into manually. Bizarre!
]]></description>
			<content:encoded><![CDATA[<p>When you try to do <code>connect slice williams_gush</code> on more than 900 nodes, most of the nodes are going to be marked as failed, though they can be ssh&#8217;ed into manually. Bizarre!</p>
]]></content:encoded>
			<wfw:commentRss>http://sysnet1.cs.williams.edu/danny/wp/?feed=rss2&amp;p=307</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python script that pings a large number of hosts</title>
		<link>http://sysnet1.cs.williams.edu/danny/wp/?p=299</link>
		<comments>http://sysnet1.cs.williams.edu/danny/wp/?p=299#comments</comments>
		<pubDate>Sun, 04 Oct 2009 21:38:29 +0000</pubDate>
		<dc:creator>Danny Y. Huang</dc:creator>
				<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://sysnet1.cs.williams.edu/danny/wp/?p=299</guid>
		<description><![CDATA[To address the problem that Gush may run of file descriptors, I have started the Crazy Stress Test in which all the planetlab nodes are added to williams_gush. It took forever to add all the nodes (more than 900 of them), so I had to write a little hack to handle-plcdb.pl.

pingtest.py
A python program that uses [...]]]></description>
			<content:encoded><![CDATA[<p>To address the problem that Gush may run of file descriptors, I have started the Crazy Stress Test in which all the planetlab nodes are added to williams_gush. It took forever to add all the nodes (more than 900 of them), so I had to write a little hack to handle-plcdb.pl.</p>
<p><span id="more-299"></span></p>
<p>pingtest.py</p>
<p>A python program that uses threading to ping a large number of hosts. </p>
<p>Usage: <code>python pingtest.py [input file] [number of threads]</code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">subprocess</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">threading</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
&nbsp;
&nbsp;
badHosts = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
hostQueue = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
lock = <span style="color: #dc143c;">threading</span>.<span style="color: black;">Lock</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
debug = <span style="color: #008000;">False</span>
count = 0
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> parseHost<span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> line.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'node name'</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span>= 0:
        <span style="color: #ff7700;font-weight:bold;">return</span> line<span style="color: black;">&#91;</span>line.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&quot;'</span><span style="color: black;">&#41;</span> + 1 : <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span> - 4<span style="color: black;">&#93;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">None</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> ping<span style="color: black;">&#40;</span>host<span style="color: black;">&#41;</span>:
    ret = <span style="color: #dc143c;">subprocess</span>.<span style="color: black;">call</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;ping -c 1 %s&quot;</span> <span style="color: #66cc66;">%</span> host,
                          shell=<span style="color: #008000;">True</span>,
                          stdout=<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/dev/null'</span>, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span>,
                          stderr=<span style="color: #dc143c;">subprocess</span>.<span style="color: black;">STDOUT</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> ret == 0
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> popQueue<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">global</span> lock
    <span style="color: #ff7700;font-weight:bold;">global</span> hostQueue
&nbsp;
    host = <span style="color: #008000;">None</span>
&nbsp;
    lock.<span style="color: black;">acquire</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>hostQueue<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> 0:
        host = hostQueue.<span style="color: black;">pop</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    lock.<span style="color: black;">release</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> host
&nbsp;
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> dequeue<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">global</span> lock
    <span style="color: #ff7700;font-weight:bold;">global</span> badHosts
    <span style="color: #ff7700;font-weight:bold;">global</span> hostQueue
    <span style="color: #ff7700;font-weight:bold;">global</span> count
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #008000;">True</span>:
        host = popQueue<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> host:
            <span style="color: #ff7700;font-weight:bold;">return</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> ping<span style="color: black;">&#40;</span>host<span style="color: black;">&#41;</span>:
            lock.<span style="color: black;">acquire</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
            badHosts.<span style="color: black;">append</span><span style="color: black;">&#40;</span>host<span style="color: black;">&#41;</span>
            lock.<span style="color: black;">release</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        lock.<span style="color: black;">acquire</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        count -= 1
        <span style="color: #ff7700;font-weight:bold;">if</span> debug:
            <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;%d left&quot;</span> <span style="color: #66cc66;">%</span> count
        lock.<span style="color: black;">release</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">global</span> debug
    <span style="color: #ff7700;font-weight:bold;">global</span> badHosts
    <span style="color: #ff7700;font-weight:bold;">global</span> hostQueue
    <span style="color: #ff7700;font-weight:bold;">global</span> count
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        <span style="color: #008000;">file</span> = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span>1<span style="color: black;">&#93;</span>
        n = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span>2<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">except</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Usage: python pingtest.py [input file] [number of threads] [optional debug]&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> 3:
        debug = <span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span> == <span style="color: #483d8b;">'debug'</span><span style="color: black;">&#41;</span>
&nbsp;
    f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #008000;">file</span>, <span style="color: #483d8b;">'r'</span><span style="color: black;">&#41;</span>
    lines = f.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    threads = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    count = 0
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> lines:
        host = parseHost<span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> host:
            hostQueue.<span style="color: black;">append</span><span style="color: black;">&#40;</span>host<span style="color: black;">&#41;</span>
            count += 1
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>n<span style="color: black;">&#41;</span>:
        t = <span style="color: #dc143c;">threading</span>.<span style="color: black;">Thread</span><span style="color: black;">&#40;</span>target = dequeue<span style="color: black;">&#41;</span>
        t.<span style="color: black;">start</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        threads.<span style="color: black;">append</span><span style="color: black;">&#40;</span>t<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">for</span> t <span style="color: #ff7700;font-weight:bold;">in</span> threads:
        t.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> debug:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Writing to file...&quot;</span>
&nbsp;
    f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'static-list-of-pingable-nodes.txt'</span>, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> lines:
        host = parseHost<span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> host:
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> host <span style="color: #ff7700;font-weight:bold;">in</span> badHosts:
                f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>
    f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> debug:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Done. Nodes written to static-list-of-pingable-nodes.txt&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">'__main__'</span>:
    main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>The following lines were added to the beginning of <code>handle-plcdb.pl</code> as a temporary hack, so that all nodes that are returned by the Perl script are pingable.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">-</span>f <span style="color: #ff0000;">&quot;static-list-of-pingable-nodes.txt&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;cat static-list-of-pingable-nodes.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span>0<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://sysnet1.cs.williams.edu/danny/wp/?feed=rss2&amp;p=299</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GeniWrapper Support</title>
		<link>http://sysnet1.cs.williams.edu/danny/wp/?p=295</link>
		<comments>http://sysnet1.cs.williams.edu/danny/wp/?p=295#comments</comments>
		<pubDate>Fri, 25 Sep 2009 20:52:22 +0000</pubDate>
		<dc:creator>Danny Y. Huang</dc:creator>
				<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://sysnet1.cs.williams.edu/danny/wp/?p=295</guid>
		<description><![CDATA[Gush now supports the latest stable version of SFA/SFI/GeniWrapper. It also works if the user is not a PI (e.g. me). A few caveats though. In my case, my private key requires a pass phrase, so when I&#8217;m running the GeniWrapper as a standalone Python script, it prompts for my PEM Pass Phrase incessantly, because [...]]]></description>
			<content:encoded><![CDATA[<p>Gush now supports the latest stable version of SFA/SFI/GeniWrapper. It also works if the user is not a PI (e.g. me). A few caveats though. In my case, my private key requires a pass phrase, so when I&#8217;m running the GeniWrapper as a standalone Python script, it prompts for my PEM Pass Phrase incessantly, because it&#8217;s trying to make several XML-RPC calls that require my credentials. Furthermore, if GeniWrapper is run inside Gush, the PEM Passphrase prompt kills Gush, which freezes and accepts no input (not even ^C or ^D). I think it has to do with how Gush handles I/O of external processes.</p>
<p>As a temporary solution, any passphrase needs to be removed from the private key. Otherwise, everything works fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysnet1.cs.williams.edu/danny/wp/?feed=rss2&amp;p=295</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PlanetLab, I&#8217;m back!</title>
		<link>http://sysnet1.cs.williams.edu/danny/wp/?p=291</link>
		<comments>http://sysnet1.cs.williams.edu/danny/wp/?p=291#comments</comments>
		<pubDate>Thu, 24 Sep 2009 20:27:36 +0000</pubDate>
		<dc:creator>Danny Y. Huang</dc:creator>
				<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://sysnet1.cs.williams.edu/danny/wp/?p=291</guid>
		<description><![CDATA[Development resumes now, after almost a month of inactivity. Expect to see more upgrades of Gush and related stuff. Right now, I&#8217;m going to integrate SFA/GeniWrapper into Gush. And finally its documentation is available at http://svn.planet-lab.org/wiki/SFAGuide.
]]></description>
			<content:encoded><![CDATA[<p>Development resumes now, after almost a month of inactivity. Expect to see more upgrades of Gush and related stuff. Right now, I&#8217;m going to integrate SFA/GeniWrapper into Gush. And finally its documentation is available at <a href="http://svn.planet-lab.org/wiki/SFAGuide">http://svn.planet-lab.org/wiki/SFAGuide</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysnet1.cs.williams.edu/danny/wp/?feed=rss2&amp;p=291</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Tunnelling over HTTP/HTTPs with SOCKS 5</title>
		<link>http://sysnet1.cs.williams.edu/danny/wp/?p=271</link>
		<comments>http://sysnet1.cs.williams.edu/danny/wp/?p=271#comments</comments>
		<pubDate>Fri, 07 Aug 2009 03:40:00 +0000</pubDate>
		<dc:creator>Danny Y. Huang</dc:creator>
				<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://sysnet1.cs.williams.edu/danny/wp/?p=271</guid>
		<description><![CDATA[This article explains how to create an SSH (Secure Shell) Tunnel over HTTP/HTTPS with SOCKS 5 proxy. This article assumes that you have access to an OpenSSH server, and that you’re running a *nix operating system, e.g. Mac OS, Linux, FreeBSD.
Specially dedicated to E.Y. who has struggled for months behind the Great Firewall.
First, you need [...]]]></description>
			<content:encoded><![CDATA[<p>This article explains how to create an SSH (Secure Shell) Tunnel over HTTP/HTTPS with SOCKS 5 proxy. This article assumes that you have access to an OpenSSH server, and that you’re running a *nix operating system, e.g. Mac OS, Linux, FreeBSD.</p>
<p>Specially dedicated to E.Y. who has struggled for months behind the Great Firewall.</p>
<p>First, you need SSH access to any server. Go to the terminal and enter:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">ssh -vv -CND 1080 yourUserName@yourServer.com</pre></div></div>

<p>You&#8217;ll be prompted to enter the password. Then, some messy texts are printed out. When it&#8217;s ready, you&#8217;ll see (varies across different flavors of Linux):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">debug1: Entering interactive session.</pre></div></div>

<p>Now you need to set up Firefox. Go to Edit > Preferences and open up &#8220;Firefox Preferences&#8221;. Then proceed to Advanced > Network, as shown. Click on &#8220;Settings&#8221;.</p>
<div id="attachment_276" class="wp-caption alignnone" style="width: 543px"><img src="http://sysnet1.cs.williams.edu/danny/wp/wp-content/uploads/2009/08/ssh-tunnel-http-socks-5-great-firewall-01.png" alt="Creating SSH Tunnel over HTTP/HTTPs using SOCKS v5 Proxy" title="Creating SSH Tunnel over HTTP/HTTPs using SOCKS v5 Proxy" width="533" height="516" class="size-full wp-image-276" /><p class="wp-caption-text">Firefox Preference</p></div>
<p>In &#8220;Connection Settings&#8221; window, check &#8220;Manual proxy configuration&#8221;. In &#8220;SOCKS Host&#8221;, enter &#8220;localhost&#8221; with port number 1080. Make sure that &#8220;SOCKS v5&#8243; is checked. </p>
<div id="attachment_277" class="wp-caption alignnone" style="width: 482px"><img src="http://sysnet1.cs.williams.edu/danny/wp/wp-content/uploads/2009/08/ssh-tunnel-http-socks-5-great-firewall-02.png" alt="Creating SSH Tunnel over HTTP/HTTPs using SOCKS v5 Proxy" title="Creating SSH Tunnel over HTTP/HTTPs using SOCKS v5 Proxy" width="472" height="526" class="size-full wp-image-277" /><p class="wp-caption-text">Configuring the proxy in Firefox</p></div>
<p>Next, we need to override the default DNS settings. We can force Firefox to resolve domain names using the SOCKS v5 proxy, rather than using the DNS servers provided by the DHCP by default.</p>
<p>In Firefox&#8217;s address bar, enter &#8220;about:config&#8221;.</p>
<p>Firefox may warn you that you&#8217;re about to make changes that will probably upset the browser. Ignore it and proceed.</p>
<p>In the &#8220;Filter&#8221; text box, enter &#8220;dns&#8221;. You are may see this:</p>
<div id="attachment_282" class="wp-caption alignnone" style="width: 598px"><img src="http://sysnet1.cs.williams.edu/danny/wp/wp-content/uploads/2009/08/firefox-config-remote-dns-01.png" alt="Configure remote DNS in Firefox" title="Configure remote DNS in Firefox" width="588" height="402" class="size-full wp-image-282" /><p class="wp-caption-text">Configure remote DNS in Firefox</p></div>
<p>Look for the line that says &#8220;network.proxy.socks_remote_dns&#8221;. By default, it is set to false. Double click on that line so that the value becomes true, as shown:</p>
<div id="attachment_283" class="wp-caption alignnone" style="width: 595px"><img src="http://sysnet1.cs.williams.edu/danny/wp/wp-content/uploads/2009/08/firefox-config-remote-dns-02.png" alt="Configure remote DNS in Firefox" title="Configure remote DNS in Firefox" width="585" height="401" class="size-full wp-image-283" /><p class="wp-caption-text">Configure remote DNS in Firefox</p></div>
<p>Your Firefox is now correctly set up. All web traffic has to go through your SSH server, and all packets are encrypted so you don&#8217;t need to worry about being sniffed.</p>
<p>If you&#8217;re not convinced, open up <a href="http://www.ip-adress.com">http://www.ip-adress.com</a> in Firefox. Instead of your usual IP, you&#8217;ll see your server&#8217;s IP address. What is more, your address has changed: your location is shown to be that of the server! Yay! Done!</p>
<h4>Reference</h4>
<p>&#8220;Access Facebook Through The Great Firewall&#8221;, <<a href="http://rejon.org/2009/07/access-facebook-through-the-great-firewall-second-line-ssh-tunnel/">http://rejon.org/2009/07/access-facebook-through-the-great-firewall-second-line-ssh-tunnel/</a>></p>
]]></content:encoded>
			<wfw:commentRss>http://sysnet1.cs.williams.edu/danny/wp/?feed=rss2&amp;p=271</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple TCP chat program using C Sockets</title>
		<link>http://sysnet1.cs.williams.edu/danny/wp/?p=269</link>
		<comments>http://sysnet1.cs.williams.edu/danny/wp/?p=269#comments</comments>
		<pubDate>Mon, 03 Aug 2009 19:30:36 +0000</pubDate>
		<dc:creator>Danny Y. Huang</dc:creator>
				<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://sysnet1.cs.williams.edu/danny/wp/?p=269</guid>
		<description><![CDATA[I&#8217;ve been reading this: http://dejant.blogspot.com/2007/08/chat-program-in-c.html
More coming up.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been reading this: <a href="http://dejant.blogspot.com/2007/08/chat-program-in-c.html">http://dejant.blogspot.com/2007/08/chat-program-in-c.html</a></p>
<p>More coming up.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysnet1.cs.williams.edu/danny/wp/?feed=rss2&amp;p=269</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gush now supports Emulab resources</title>
		<link>http://sysnet1.cs.williams.edu/danny/wp/?p=262</link>
		<comments>http://sysnet1.cs.williams.edu/danny/wp/?p=262#comments</comments>
		<pubDate>Mon, 03 Aug 2009 18:07:46 +0000</pubDate>
		<dc:creator>Danny Y. Huang</dc:creator>
				<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://sysnet1.cs.williams.edu/danny/wp/?p=262</guid>
		<description><![CDATA[Using Emulab Resources in Gush

This example illustrates how to add Emulab resources (in particular, nodes) into Gush. We assume that you are already familiar with the basic configurations of Emulab and Gush experiments. We also assume that the working directory of Gush is ~/gush.
Configuring Emulab for Gush

Set up an Emulab experiment as you normally would. [...]]]></description>
			<content:encoded><![CDATA[<h4 id="UsingEmulabResourcesinGush">Using Emulab Resources in Gush</h4>
<p>
This example illustrates how to add <a href="http://www.emulab.net">Emulab</a> resources (in particular, nodes) into Gush. We assume that you are already familiar with the basic configurations of <a href="http://www.emulab.net">Emulab</a> and Gush experiments. We also assume that the working directory of Gush is <tt>~/gush</tt>.</p>
<h4 id="ConfiguringEmulabforGush">Configuring Emulab for Gush</h4>
<p>
Set up an Emulab experiment as you normally would. Ensure that the experiment is swapped in because Gush does not do this automatically. This example uses two Emulab nodes. The NS file is as follows:
</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">source tb_compat.tcl
set ns [new Simulator]
&nbsp;
set devbox0 [$ns node]
tb-set-hardware $devbox0 pc
tb-set-node-os $devbox0 &quot;PLAB-DEVBOX-v42&quot;
&nbsp;
set devbox1 [$ns node]
tb-set-hardware $devbox1 pc
tb-set-node-os $devbox1 &quot;PLAB-DEVBOX-v42&quot;
&nbsp;
$ns run</pre></div></div>

<p>
Next we need to set up the SSL Certificate which enables Gush to authenticate with Emulab. In the Emulab web interface, go to &#8220;My Emulab&#8221;. In the &#8220;Profile&#8221; section, click on &#8220;Generate SSL Cert&#8221;. Supply the necessary information and download the SSL Certificate. Save the file as <tt>emulab.pem</tt> in the directory <tt>~/gush/emulab/.ssl</tt>. Create one if the directory does not exist.
</p>
<p>
This SSL Certificate consists of two sections: the RSA private key and the certificate. The private key is encrypted with a pass phrase. We need to remove the pass phrase so that it may work correctly in Gush. Refer to <a class="ext-link" href="http://sysnet1.cs.williams.edu/danny/wp/?p=253"><span class="icon">this step-by-step guide</span></a> on the removal of the PEM pass phrase.</p>
<h4 id="ConfiguringGushforEmulab">Configuring Gush for Emulab</h4>
<p>
Add the following section to <tt>~/gush/directory.xml</tt>:
</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;resource_manager type=&quot;emulab&quot;&gt;
    &lt;user&gt;yh1&lt;/user&gt;
    &lt;port&gt;15888&lt;/port&gt;
&nbsp;
    &lt;EmulabProjectID&gt;Gush&lt;/EmulabProjectID&gt;
    &lt;EmulabExperimentID&gt;gush&lt;/EmulabExperimentID&gt;
&lt;/resource_manager&gt;</pre></div></div>

<h4 id="Runningtheexperiment">Running the experiment</h4>
<p>
Start Gush. If the above is configured correctly, Gush should say that it has learned about the Emulab resources. To verify that the Emulab nodes have indeed been added to the resource pool, do the following:
</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">gush&gt; info nodes
There are 10 known nodes:
[ P         ] williams_gush@planetlab1.ucsd.edu:15001(pref=0) (Disconnected.)
[ P         ] williams_gush@planetlab5.williams.edu:15001(pref=0) (Disconnected.)
[   U       ] yh1@devbox0.gush.Gush.emulab.net:15888(pref=0) (Disconnected.)
[   U       ] yh1@devbox1.gush.Gush.emulab.net:15888(pref=0) (Disconnected.)</pre></div></div>

<p>
Try connecting to the Emulab nodes:
</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">gush&gt; connect pat emulab 2
Initiated connections to 2 of 2 hosts.
gush&gt; yh1@devbox1.gush.gush.emulab.net:15888 has joined the mesh.
yh1@devbox0.gush.gush.emulab.net:15888 has joined the mesh.</pre></div></div>

<p>
And run a very simple experiment:
</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">gush&gt; shell 'hostname'
gush&gt; yh1@devbox0.gush.gush.emulab.net:15888,15413: devbox0.gush.gush.emulab.net
&nbsp;
yh1@devbox1.gush.gush.emulab.net:15888,15314: devbox1.gush.gush.emulab.net</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://sysnet1.cs.williams.edu/danny/wp/?feed=rss2&amp;p=262</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Same node appearing twice</title>
		<link>http://sysnet1.cs.williams.edu/danny/wp/?p=255</link>
		<comments>http://sysnet1.cs.williams.edu/danny/wp/?p=255#comments</comments>
		<pubDate>Thu, 30 Jul 2009 15:57:41 +0000</pubDate>
		<dc:creator>Danny Y. Huang</dc:creator>
				<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://sysnet1.cs.williams.edu/danny/wp/?p=255</guid>
		<description><![CDATA[The same emulab node appears twice within Gush, after I added a dummy EmulabResourceManager. For the record,

gush&#62; info nodes
There are 10 known nodes:
[ P   C     ] williams_gush@planetlab1.ucsd.edu:15001(pref=10) (Finished.)
[ P   C     ] williams_gush@planetlab2.ucsd.edu:15001(pref=10) (Finished.)
[ P   C     ] williams_gush@planetlab3.ucsd.edu:15001(pref=10) [...]]]></description>
			<content:encoded><![CDATA[<p>The same emulab node appears twice within Gush, after I added a dummy EmulabResourceManager. For the record,</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">gush&gt; info nodes
There are 10 known nodes:
[ P   C     ] williams_gush@planetlab1.ucsd.edu:15001(pref=10) (Finished.)
[ P   C     ] williams_gush@planetlab2.ucsd.edu:15001(pref=10) (Finished.)
[ P   C     ] williams_gush@planetlab3.ucsd.edu:15001(pref=10) (Finished.)
[ P   C     ] williams_gush@planetlab1.williams.edu:15001(pref=10) (Idle.)
[ P   C     ] williams_gush@planetlab2.williams.edu:15001(pref=10) (Idle.)
[ P   C     ] williams_gush@planetlab3.williams.edu:15001(pref=10) (Idle.)
[ P       F ] williams_gush@planetlab4.williams.edu:15001(pref=-25) (Failed.)
[ P   C     ] williams_gush@planetlab5.williams.edu:15001(pref=10) (Idle.)
[   U       ] yh1@devbox0.gush.Gush.emulab.net:15420(pref=0) (Connecting.)
[     C     ] yh1@devbox0.gush.gush.emulab.net:15420(pref=10) (Idle.)
gush&gt; info mesh
Mesh:
williams_gush@planetlab1.ucsd.edu:15001: connected; (fds=9,9 last_heard=1248969258)
williams_gush@planetlab2.ucsd.edu:15001: connected; (fds=7,7 last_heard=1248969258)
williams_gush@planetlab3.ucsd.edu:15001: connected; (fds=6,6 last_heard=1248969258)
williams_gush@planetlab1.williams.edu:15001: connected; (fds=15,15 last_heard=1248969258)
williams_gush@planetlab2.williams.edu:15001: connected; (fds=12,12 last_heard=1248969258)
williams_gush@planetlab3.williams.edu:15001: connected; (fds=11,11 last_heard=1248969258)
williams_gush@planetlab4.williams.edu:15001: failed; (fds=18,17 last_heard=0)
williams_gush@planetlab5.williams.edu:15001: connected; (fds=14,14 last_heard=1248969258)
yh1@devbox0.gush.gush.emulab.net:15420: connected; (fds=16,16 last_heard=1248969258)
yh1@devbox0.gush.gush.emulab.net:15420: connected; (fds=16,16 last_heard=1248969258)
Summary: 9 mesh members; 0 nodes connecting.
gush&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://sysnet1.cs.williams.edu/danny/wp/?feed=rss2&amp;p=255</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
