<?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>Sprayfly</title>
	<atom:link href="http://sprayfly.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sprayfly.com</link>
	<description>Languages, Linux, Life</description>
	<lastBuildDate>Fri, 15 Jan 2010 22:40:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fix the &#8220;534 Protection level negotiation failed.&#8221; error in lftp</title>
		<link>http://sprayfly.com/2010/01/15/fix-the-534-protection-level-negotiation-failed-error-in-lftp/</link>
		<comments>http://sprayfly.com/2010/01/15/fix-the-534-protection-level-negotiation-failed-error-in-lftp/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 22:40:59 +0000</pubDate>
		<dc:creator>Jono</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[534]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ftpes]]></category>
		<category><![CDATA[leeds]]></category>
		<category><![CDATA[lftp]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://sprayfly.com/?p=443</guid>
		<description><![CDATA[If you are using lftp to connect to a secure FTP (SFTP) server using SSL, you may sometimes get the following error during file transfers:
534 Protection level negotiation failed.
In this case, you need to add the following line to the bottom of your /etc/lftp.conf file
set ftp:ssl-protect-data
Now try connecting again and hopefully everything should work ok [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using lftp to connect to a secure FTP (SFTP) server using SSL, you may sometimes get the following error during file transfers:</p>
<pre>534 Protection level negotiation failed.</pre>
<p>In this case, you need to add the following line to the bottom of your /etc/lftp.conf file</p>
<pre>set ftp:ssl-protect-data</pre>
<p>Now try connecting again and hopefully everything should work ok &#8211; it sorted my problems when I was trying to connect to the Leeds University SFTP servers using lftp on Ubuntu 9.10 (Karmic).</p>
<div id="mainphotoarea"></div>]]></content:encoded>
			<wfw:commentRss>http://sprayfly.com/2010/01/15/fix-the-534-protection-level-negotiation-failed-error-in-lftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>View PDF files inline in Firefox on Ubuntu Karmic 9.10</title>
		<link>http://sprayfly.com/2010/01/15/view-pdf-files-inline-in-firefox-on-ubuntu-karmic-9-10/</link>
		<comments>http://sprayfly.com/2010/01/15/view-pdf-files-inline-in-firefox-on-ubuntu-karmic-9-10/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 20:34:07 +0000</pubDate>
		<dc:creator>Jono</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[evince]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[xpdf]]></category>

		<guid isPermaLink="false">http://sprayfly.com/?p=436</guid>
		<description><![CDATA[ When using Firefox on Ubuntu, PDF files are opened in a separate PDF viewer rather than being displayed within the browser window itself.
If you follow this guide, you should be able to get PDF files to open inline, embedded within the Firefox window as in the screenshot below:

To allow PDF files to be opened [...]]]></description>
			<content:encoded><![CDATA[<p> When using Firefox on Ubuntu, PDF files are opened in a separate PDF viewer rather than being displayed within the browser window itself.</p>
<p>If you follow this guide, you should be able to get PDF files to open inline, embedded within the Firefox window as in the screenshot below:</p>
<p><a href="http://www.flickr.com/photos/jonolumb/4277431528/" class="tt-flickr tt-flickr-Medium" title="firefox-inline-pdf.png"><img class="alignnone" src="http://farm5.static.flickr.com/4060/4277431528_383206e21c.jpg" alt="firefox-inline-pdf.png" width="500" height="302" /></a></p>
<p>To allow PDF files to be opened inline within the browser window, you need to do the following:</p>
<p>Install Mozplugger and Evince:</p>
<pre>sudo apt-get install evince mozplugger</pre>
<p>Edit the Mozplugger config file:</p>
<pre>gksudo gedit /etc/mozpluggerrc</pre>
<p>Find the following block of text (or something very similar):</p>
<pre>
application/pdf:pdf:PDF file
application/x-pdf:pdf:PDF file
text/pdf:pdf:PDF file
text/x-pdf:pdf:PDF file
        ACROREAD()
        repeat noisy swallow(kpdf) fill: kpdf "$file"
        repeat noisy swallow(Xpdf) fill: xpdf -g +9000+9000 "$file"
        repeat noisy swallow(okular) fill: okular "$file"
        GV()
        repeat noisy fill exits: evince "$file"
</pre>
<p>If you prefer to use the Evince PDF viewer replace the above code with the following:</p>
<pre>
application/pdf:pdf:PDF file
application/x-pdf:pdf:PDF file
text/pdf:pdf:PDF file
text/x-pdf:pdf:PDF file
	repeat noisy swallow(evince) fill: evince "$file"
	ACROREAD()
	repeat noisy swallow(kpdf) fill: kpdf "$file"
	repeat noisy swallow(Xpdf) fill: xpdf -g +9000+9000 "$file"
	repeat noisy swallow(okular) fill: okular "$file"
	GV()
	repeat noisy fill exits: evince "$file"
</pre>
<p>Or if you prefer to use the xpdf PDF viewer, you can use the following lines (make sure you if not already installed that you install xpdf using the command <em>sudo apt-get install xpdf</em>):</p>
<pre>
application/pdf:pdf:PDF file
application/x-pdf:pdf:PDF file
text/pdf:pdf:PDF file
text/x-pdf:pdf:PDF file
	repeat noisy swallow(Xpdf) fill: xpdf "$file"
	ACROREAD()
	repeat noisy swallow(kpdf) fill: kpdf "$file"
	repeat noisy swallow(okular) fill: okular "$file"
	GV()
	repeat noisy fill exits: xpdf "$file"
</pre>
<p>Save changes, close all instances of Firefox and Evince/Xpdf and then open firefox and try viewing a PDF file. Everything should now function as you want it to.</p>
<div id="mainphotoarea"></div>]]></content:encoded>
			<wfw:commentRss>http://sprayfly.com/2010/01/15/view-pdf-files-inline-in-firefox-on-ubuntu-karmic-9-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Improve Wireless Performance in Ubuntu Karmic on Asus EeePC 1005HA</title>
		<link>http://sprayfly.com/2009/11/17/improve-wireless-performance-in-ubuntu-karmic-on-asus-eeepc-1005ha/</link>
		<comments>http://sprayfly.com/2009/11/17/improve-wireless-performance-in-ubuntu-karmic-on-asus-eeepc-1005ha/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 11:12:46 +0000</pubDate>
		<dc:creator>Jono</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[1005HA]]></category>
		<category><![CDATA[asus]]></category>
		<category><![CDATA[backports]]></category>
		<category><![CDATA[eeepc]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://sprayfly.com/?p=432</guid>
		<description><![CDATA[We have a problem
For the last month or so since I bought my Asus EeePC 1005HA, I&#8217;ve been wanting to throw the thing out of the window, such has my frustration been with it&#8217;s wireless performance.
Poor Wireless Performance
Whilst the laptop is a great little machine, since I installed Ubuntu Karmic on it, the wireless connection [...]]]></description>
			<content:encoded><![CDATA[<p><strong>We have a problem</strong><br />
For the last month or so since I bought my Asus EeePC 1005HA, I&#8217;ve been wanting to throw the thing out of the window, such has my frustration been with it&#8217;s wireless performance.</p>
<p><strong>Poor Wireless Performance</strong><br />
Whilst the laptop is a great little machine, since I installed Ubuntu Karmic on it, the wireless connection had been completely useless. At first, Network Manager would report great signal strength for wireless networks within range of the netbook. However, once connected to the access point, the wireless signal which was first reported at over 80% would rapidly deteriorate to something much lower, often below 30%. Even when the computer was within metres of the wireless access point, the connection speed would be incredibly slow and I frequently experienced wireless drops, especially when connecting to secure wireless networks.</p>
<p><strong>Solution at hand</strong><br />
However, fear not. After doing much searching around on the internet it seems that there is a solution to this problem. I managed to find a <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/414560?comments=all">bug on launchpad</a> where other EeePC 1005HA users suggested that installing the &#8220;Karmic Wireless Backports Module&#8221; would make most of the problems go away. This module contains all the cutting edge wireless drivers for Ubuntu Karmic from the testing repositories which haven&#8217;t yet been officially released.</p>
<p>After installing the module via apt-get, I have experienced a 30% increase in wireless signal strength, a faster connection and no drops for the last half and hour or so, it would indeed seem that the problem is solved or at least much less annoying. Here are the steps you need to follow to install the backport modules:</p>
<p><strong>Enable Karmic backports</strong><br />
First we need to enable the Karmic backports repository. Open up &#8220;Software Sources&#8221; and browse to the &#8220;Updates&#8221; tab, make sure the karmic-backports option is ticked.</p>
<p><a href="http://www.flickr.com/photos/jonolumb/4112112734/" class="tt-flickr tt-flickr-Medium" title="软件源.png"><img class="alignnone" src="http://farm3.static.flickr.com/2560/4112112734_27d0d1ed0c.jpg" alt="软件源.png" width="404" height="465" /></a> </p>
<p><strong>Install the Karmic wireless backports module</strong><br />
Now open a terminal and enter the following commands to install the backports wireless module.</p>
<pre>sudo apt-get update &#038;&#038; sudo apt-get install linux-backports-modules-wireless-karmic-generic</pre>
<p>Please note that it is not recommended to install <em>linux-backports-modules-karmic-generic</em> as it has been suggested in some posts as this may affect other things on your system apart from the wireless.</p>
<p>Once complete, reboot your computer and enjoy.</p>
<div id="mainphotoarea"></div>]]></content:encoded>
			<wfw:commentRss>http://sprayfly.com/2009/11/17/improve-wireless-performance-in-ubuntu-karmic-on-asus-eeepc-1005ha/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>使用 totem-pps 在 Ubuntu 下完美地观看 PPS 电影</title>
		<link>http://sprayfly.com/2009/10/24/%e4%bd%bf%e7%94%a8-totem-pps-%e5%9c%a8-ubuntu-%e4%b8%8b%e5%ae%8c%e7%be%8e%e5%9c%b0%e8%a7%82%e7%9c%8b-pps-%e7%94%b5%e5%bd%b1/</link>
		<comments>http://sprayfly.com/2009/10/24/%e4%bd%bf%e7%94%a8-totem-pps-%e5%9c%a8-ubuntu-%e4%b8%8b%e5%ae%8c%e7%be%8e%e5%9c%b0%e8%a7%82%e7%9c%8b-pps-%e7%94%b5%e5%bd%b1/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 23:19:00 +0000</pubDate>
		<dc:creator>Jono</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[chinese]]></category>
		<category><![CDATA[films]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[pps]]></category>
		<category><![CDATA[totem]]></category>
		<category><![CDATA[totem-pps]]></category>
		<category><![CDATA[中文，在线视频]]></category>

		<guid isPermaLink="false">http://sprayfly.com/?p=425</guid>
		<description><![CDATA[ 
我之前在 Ubuntu 的中文论坛里看到过不少有关使用一个 Totem 插件来观看 PPS 在线视频的帖子，而且我最近还注意到了 PPS 的官方下载页面上竟然多出了一个 Linux 版本的链接与相关安装说明。
 
本人作为一个热爱看中国电影的老外，只要闲着都会跑一趟图书馆去借一些中国片子。我得知有如此有用的 Totem 插件之后，就根据帖子里面的说明安装到我电脑上了。然而，我很快就发现安装上述插件的过程并非简单，需要我自己下载源代码，将其编译好。虽然我最终还是安装成功了，但是后来发现这个插件有不少缺陷，其中最主要的是你只能在 Totem 里用这个插件来浏览 PPS 所提供的在线视频而不能用浏览器直接上官方网站去找。插件的浏览界面很简单又超级慢，其电影的分类杂乱无章，也没有搜索电影功能。因此，我怎么都找不到我想看的片子，实在是太不好用了，还是算了吧！
既然在 Ubuntu 下收看在线视频如此的麻烦，所以我暂且在 Virtualbox 的虚拟机里安装了 XP 和 PPS，每次想看电影时我就会启动虚拟机，打开 PPS 后就能开始收看电影了。不过，由于我这用的是笔记本，所以每当我同时开着 Ubuntu 和 Windows，电脑就会变得非常热，内存占满，处理器忙不过来，以至于电影的画面质量大大降低，收看的体验大打折扣，我实在是看不下去了。
面临着如此大的困难，我今天又在谷歌上搜了一下，想知道有没有别的办法让我能够顺顺利利地看一些在线电影。令我吃惊的是，在一两个月的时间内，上述插件的开发者都已经发布了一个新的版本，名叫 totem-pps。这次开发者还提供了一个 DEB 的软件包，让用户能摆脱十分复杂的手动安装过程。不仅如此，开发者还编了一个非常棒的 Greasemonkey 脚本。使用 Firefox 的用户安装这个脚本后便能直接到 PPS 的官方网站上去找电影看，只要点击电影的缩略图即可，视频将在 Firefox 的窗口里自动开始播放。
总之，totem-pps 这个插件使 Ubuntu 用户能享受到一个完美的，非常便捷的收看在线视频的体验。它的功能非常丰富，性能也很强，而且如果你将它与 Greasemonkey 并用的话，搜索到你最想看的电影已经不成一个问题了。有人感兴趣的话，可以按照下面的安装步骤，自己试一下这个非常棒的 Totem 插件。
如何安装:
先把 Mingming 的 Launchpad PPA 添加到你的软件源：
Ubuntu Karmic: [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/jonolumb/4037821949/" class="tt-flickr tt-flickr-Medium" title="在 Ubuntu 下运行 PPS"><img class="alignnone" src="http://farm4.static.flickr.com/3493/4037821949_77d8ca0236.jpg" alt="在 Ubuntu 下运行 PPS" width="500" height="302" /></a> </p>
<p>我之前在 Ubuntu 的中文论坛里看到过不少有关使用一个 Totem 插件来观看 PPS 在线视频的帖子，而且我最近还注意到了 PPS 的<a href="http://dl.pps.tv/">官方下载页面</a>上竟然多出了一个 Linux 版本的链接与相关安装说明。</p>
<p><a href="http://www.flickr.com/photos/jonolumb/4039447860/" class="tt-flickr tt-flickr-Medium" title="pps-linux.png"><img class="alignnone" src="http://farm3.static.flickr.com/2799/4039447860_d040cffc47.jpg" alt="pps-linux.png" width="500" height="229" /></a> </p>
<p>本人作为一个热爱看中国电影的老外，只要闲着都会跑一趟图书馆去借一些中国片子。我得知有如此有用的 Totem 插件之后，就根据帖子里面的说明安装到我电脑上了。然而，我很快就发现安装上述插件的过程并非简单，需要我自己下载源代码，将其编译好。虽然我最终还是安装成功了，但是后来发现这个插件有不少缺陷，其中最主要的是你只能在 Totem 里用这个插件来浏览 PPS 所提供的在线视频而不能用浏览器直接上官方网站去找。插件的浏览界面很简单又超级慢，其电影的分类杂乱无章，也没有搜索电影功能。因此，我怎么都找不到我想看的片子，实在是太不好用了，还是算了吧！</p>
<p>既然在 Ubuntu 下收看在线视频如此的麻烦，所以我暂且在 Virtualbox 的虚拟机里安装了 XP 和 PPS，每次想看电影时我就会启动虚拟机，打开 PPS 后就能开始收看电影了。不过，由于我这用的是笔记本，所以每当我同时开着 Ubuntu 和 Windows，电脑就会变得非常热，内存占满，处理器忙不过来，以至于电影的画面质量大大降低，收看的体验大打折扣，我实在是看不下去了。</p>
<p>面临着如此大的困难，我今天又在谷歌上搜了一下，想知道有没有别的办法让我能够顺顺利利地看一些在线电影。令我吃惊的是，在一两个月的时间内，上述插件的开发者都已经发布了一个新的版本，名叫 <a href="http://code.google.com/p/totem-pps/">totem-pps</a>。这次开发者还提供了一个 DEB 的软件包，让用户能摆脱十分复杂的手动安装过程。不仅如此，开发者还编了一个非常棒的 Greasemonkey 脚本。使用 Firefox 的用户安装这个脚本后便能直接到 PPS 的官方网站上去找电影看，只要点击电影的缩略图即可，视频将在 Firefox 的窗口里自动开始播放。</p>
<p>总之，totem-pps 这个插件使 Ubuntu 用户能享受到一个完美的，非常便捷的收看在线视频的体验。它的功能非常丰富，性能也很强，而且如果你将它与 Greasemonkey 并用的话，搜索到你最想看的电影已经不成一个问题了。有人感兴趣的话，可以按照下面的安装步骤，自己试一下这个非常棒的 Totem 插件。</p>
<p><strong>如何安装:</strong></p>
<p>先把 Mingming 的 Launchpad PPA 添加到你的软件源：</p>
<p>Ubuntu Karmic: </p>
<pre>sudo add-apt-repository ppa:portis25/ppa</pre>
<p>Ubuntu Jaunty:</p>
<p>将下面两行添加到 /etc/apt/sources.list/totem-pps.list</p>
<pre>deb http://ppa.launchpad.net/portis25/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/portis25/ppa/ubuntu karmic main</pre>
<p>在终端中执行下面的命令来获取上述 PPA 源的密钥。</p>
<pre>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EF666E7B1E758171B82B7C5327F5B2C1B3EAC8D9</pre>
<p>更新软件包列表：</p>
<pre>sudo apt-get update</pre>
<p>安装 totem-pps 和 totem-mozilla (Totem 的 Firefox 插件）：</p>
<pre>sudo apt-get install totem-pps totem-mozilla</pre>
<p><strong>在 Totem 里启用 totem-pps 插件:</strong></p>
<p><a href="http://www.flickr.com/photos/jonolumb/4038696095/" class="tt-flickr tt-flickr-Medium" title="配置插件.png"><img class="alignnone" src="http://farm3.static.flickr.com/2421/4038696095_7f557229a3.jpg" alt="配置插件.png" width="500" height="301" /></a> </p>
<p>打开 Totem（电影播放器），然后在菜单里面选：</p>
<p>编辑 &#8211;> 插件</p>
<p>在所打开的窗口里勾上 &#8220;PPS 浏览器&#8221; 此插件就可以了</p>
<p><strong>在 Firefox 里安装 Greasemonkey 脚本:</strong></p>
<p>你如果没有安装过 Greasemonkey，要先到<a href="https://addons.mozilla.org/en-US/firefox/addon/748">此网页</a>，安装后要重启 Firefox。</p>
<p><a href="http://userscripts.org/scripts/source/59991.user.js">点击此链接来安装脚本</a></p>
<p>脚本的配置如下：</p>
<p><a href="http://www.flickr.com/photos/jonolumb/4039449450/" class="tt-flickr tt-flickr-Medium" title="管理用户脚本.png"><img class="alignnone" src="http://farm4.static.flickr.com/3490/4039449450_f8e79e6052.jpg" alt="管理用户脚本.png" width="500" height="416" /></a> </p>
<p><strong>测试一下:</strong></p>
<p>到 <a href="http://kan.pps.tv/">http://kan.pps.tv/</a> 找自己想看的电影并点开，等视频在 Firefox 的窗口中开始播放就行了。 （要等待视频缓冲完了才能开始看，等候时间根据自己的网速而定）</p>
<p>要想知道更多关于这个插件的开发，可以到它的<a href="http://code.google.com/p/totem-pps/">Google Code</a>页面去看看。</p>
<div id="mainphotoarea"></div>]]></content:encoded>
			<wfw:commentRss>http://sprayfly.com/2009/10/24/%e4%bd%bf%e7%94%a8-totem-pps-%e5%9c%a8-ubuntu-%e4%b8%8b%e5%ae%8c%e7%be%8e%e5%9c%b0%e8%a7%82%e7%9c%8b-pps-%e7%94%b5%e5%bd%b1/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>Ubuntu 9.04 Settings for Eduroam Wireless Networks</title>
		<link>http://sprayfly.com/2009/09/29/ubuntu-9-04-settings-for-eduroam-wireless-networks/</link>
		<comments>http://sprayfly.com/2009/09/29/ubuntu-9-04-settings-for-eduroam-wireless-networks/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 23:21:38 +0000</pubDate>
		<dc:creator>Jono</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://sprayfly.com/?p=421</guid>
		<description><![CDATA[Many UK universities use Eduroam wireless networks which require certificate authentication along with a username and password. Despite following the official guide to getting my laptop setup at the University of Leeds, my laptop wouldn&#8217;t seem to connect &#8211; however, after a bit of playing I managed to get things up and running.
Here are the [...]]]></description>
			<content:encoded><![CDATA[<p>Many UK universities use Eduroam wireless networks which require certificate authentication along with a username and password. Despite following the official guide to getting my laptop setup at the University of Leeds, my laptop wouldn&#8217;t seem to connect &#8211; however, after a bit of playing I managed to get things up and running.</p>
<p>Here are the settings you will need:</p>
<li>Set &#8216;Wireless security&#8217; to WPA or WPA2 Enterprise</li>
<li>Set &#8216;EAP method&#8217; to TTLS</li>
<li>Set &#8216;Key type&#8217; to MSCHAP</li>
<li>Set &#8216;Identity&#8217; to your ISS Username with @leeds.ac.uk appended, for example jh1761@leeds.ac.uk</li>
<li>Type your normal ISS password into the password box</li>
<li>Leave &#8216;Anonymous Identity&#8217; blank</li>
<li>Leave &#8216;Client certificate file&#8217; set to (none)</li>
<li>Click the &#8216;CA Certificate file&#8217; option, a file open window should popup &#8211; locate the file: /etc/ssl/certs/GTE_CyberTrust_Global_Root.pem , select it and click open</li>
<p>You should now find that the computer connects without any issues.</p>
<div id="mainphotoarea"></div>]]></content:encoded>
			<wfw:commentRss>http://sprayfly.com/2009/09/29/ubuntu-9-04-settings-for-eduroam-wireless-networks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable the touchpad whilst typing on the Asus EeePC 1005HA in Ubuntu</title>
		<link>http://sprayfly.com/2009/08/23/disable-the-touchpad-whilst-typing-on-the-asus-eeepc-1005ha-in-ubuntu/</link>
		<comments>http://sprayfly.com/2009/08/23/disable-the-touchpad-whilst-typing-on-the-asus-eeepc-1005ha-in-ubuntu/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 19:02:41 +0000</pubDate>
		<dc:creator>Jono</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[1005HA]]></category>
		<category><![CDATA[asus]]></category>
		<category><![CDATA[eeepc]]></category>
		<category><![CDATA[fdi]]></category>
		<category><![CDATA[hal]]></category>
		<category><![CDATA[shmconfig]]></category>
		<category><![CDATA[synaptics]]></category>
		<category><![CDATA[syndaemon]]></category>
		<category><![CDATA[touchpad]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://sprayfly.com/?p=419</guid>
		<description><![CDATA[If you install Ubuntu Netbook Remix 9.04 (UNR) on the Asus EeePC 1005HA you do get most features supported out of the box, however there are a couple of things that require a bit of tweaking such as the ethernet and wireless drivers and some of the function keys and touchpad. For a full-on guide [...]]]></description>
			<content:encoded><![CDATA[<p>If you install Ubuntu Netbook Remix 9.04 (UNR) on the Asus EeePC 1005HA you do get most features supported out of the box, however there are a couple of things that require a bit of tweaking such as the ethernet and wireless drivers and some of the function keys and touchpad. For a full-on guide to setting up your machine with Ubuntu, head over to <a href="http://www.jfwhome.com/2009/08/06/perfect-ubuntu-jaunty-on-the-asus-eeepc-1005ha-and-1008ha/">this excellent blog post</a>.</p>
<p><strong>Disable the touchpad whilst typing</strong><br />
One thing that I did not feel was configured properly in the above guide is the touchpad for the 1005HA. On such a small laptop, it is inevitable that whilst typing emails or doing word processing tasks on the netbook, your hands will often brush the touchpad, activating tapping or scrolling features that may cause undesired outcomes such as text being deleted or being moved around within the document. This problem can however be dealt with by using a program that temporarily deactivates the touchpad whilst text is being typed and then reactivates it once typing is finished. Whilst this feature is discussed in the above guide, there is no documentation regarding customisation &#8211; for example users may want to change the amount of time for which the touchpad is disabled or only disable tapping and scrolling (and not the pointer itself). I did some investigation on my own and found the following solution:</p>
<p><strong>Configuring the touchpad device</strong><br />
Before we do anything else, we need to enable configuration of the touchpad by enabling SHMConfig in a configuration file. In a terminal, enter the following commands:</p>
<pre>sudo nano /etc/hal/fdi/policy/shmconfig.fdi</pre>
<p>Paste the following code into the file and save:</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;deviceinfo version="0.2"&gt;&lt;device&gt;&lt;match key="input.x11_driver" string="synaptics"&gt;&lt;merge key="input.x11_options.SHMConfig" type="string"&gt;True&lt;/merge&gt;&lt;/match&gt;&lt;/device&gt;&lt;/deviceinfo&gt;</pre>
<p>You now need to restart X (logout and log back in again) or restart the computer for changes to take effect.</p>
<p><strong>Syndaemon &#8211; disable the touchpad on typing</strong><br />
Next, we will use syndaemon to setup automatic disabling of the touchpad when typing. Here are the configuration options for this daemon.</p>
<pre>Usage: syndaemon [-i idle-time] [-m poll-delay] [-d] [-t] [-k]
  -i How many seconds to wait after the last key press before
     enabling the touchpad. (default is 2.0s)
  -m How many milli-seconds to wait until next poll.
     (default is 200ms)
  -d Start as a daemon, ie in the background.
  -p Create a pid file with the specified name.
  -t Only disable tapping and scrolling, not mouse movements.
  -k Ignore modifier keys when monitoring keyboard activity.
  -K Like -k but also ignore Modifier+Key combos.
  -S Use SHMConfig even if input device properties are available.</pre>
<p>It is best to setup syndaemon to run as a daemon process in the background &#8211; if you run it as a normal command in a terminal then it will terminate when you quit the terminal session. Here is the command I use to run syndaemon:</p>
<pre>syndaemon -t -K -d -i 1</pre>
<p>The -t flag only disables tapping and scrolling whilst typing. This is useful as it means that you can continue to move the mouse pointer whilst or immediately after typing &#8211; but you will not accidentally click on text or scroll within a window whilst you are typing when your hands brush against the touchpad.</p>
<p>The -K flag means that the touchpad will only be deactivated when you are typing real text and not when you are using shortcut keys within programs.</p>
<p>Finally, I personally prefer a slightly shorter time delay of just one second before the touchpad is reactivated, this is set by the -i flag followed by the delay time in seconds.</p>
<p><strong>Automation</strong><br />
Instead of running this manually in a terminal every time you need it, you can setup syndaemon to run automatically on session startup. In the menu, go to System &#8211;> Preferences &#8211;> Startup Programs and add an entry named &#8220;Syndaemon&#8221;. You can then copy and paste the above command into the dialogue box and hit ok.</p>
<div id="mainphotoarea"></div>]]></content:encoded>
			<wfw:commentRss>http://sprayfly.com/2009/08/23/disable-the-touchpad-whilst-typing-on-the-asus-eeepc-1005ha-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>用 tsocks 和 proxychains 使 Linux 下所有软件能够翻墙</title>
		<link>http://sprayfly.com/2009/07/09/%e7%94%a8-tsocks-%e4%bd%bf-linux-%e4%b8%8b%e6%89%80%e6%9c%89%e8%bd%af%e4%bb%b6%e8%83%bd%e5%a4%9f%e7%bf%bb%e5%a2%99/</link>
		<comments>http://sprayfly.com/2009/07/09/%e7%94%a8-tsocks-%e4%bd%bf-linux-%e4%b8%8b%e6%89%80%e6%9c%89%e8%bd%af%e4%bb%b6%e8%83%bd%e5%a4%9f%e7%bf%bb%e5%a2%99/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 05:31:36 +0000</pubDate>
		<dc:creator>Jono</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[china]]></category>
		<category><![CDATA[翻墙]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[gfw]]></category>
		<category><![CDATA[gwibber]]></category>
		<category><![CDATA[proxychains]]></category>
		<category><![CDATA[SOCKS]]></category>
		<category><![CDATA[tsocks]]></category>
		<category><![CDATA[封锁]]></category>
		<category><![CDATA[封杀]]></category>

		<guid isPermaLink="false">http://sprayfly.com/?p=403</guid>
		<description><![CDATA[情况
由于最近在中国某个地方爆发了 riot, 所以境内很多网站又是无法访问 (twitter.com、facebook.com 等)，让我们这些网民很无奈。
使用 SSH 翻墙
我曾经介绍过如何使用 SSH 来建立一个 SOCKS 代理服务器，让你能够在 Firefox 里正常访问以上所提起的网址。然而不是所有 Linux 软件都能支持代理服务器。如果你最热爱的 Linux 工具需要访问&#8221;被封&#8221;的网站，又没有嵌入的代理支持，该怎么办呢？
遇到这种情况当然不要放弃该软件&#8230; 毕竟我们用的系统是 Linux 而不是以前让我们咳声叹气，丧失信心的 Windows，总有一个方法去解决问题。
举个例子吧
我不久前发现了 Twitter 这个网站。我一开始不经常用，也搞不明白别人为什么对这个 web 2.0 服务都着了迷。后来我在推特上跟的人越来越多，跟着我的人亦是日益增多，不知不觉我也迷上了该网站，天天都会上。凡是经常用推特的人一般都会用一个推特的客户端，这才能跟得上朋友们的状态更新和最火热的网络新闻。本人作为 Ubuntu 的用户，我自然就选了 Gwibber 这个基于 GNOME 的客户端来访问我的推特。这个软件功能很丰富，用起来得心应手，不过总有一个问题让我有点遗憾，就是 Gwibber 还不听从 GNOME 的代理设置。平时这也不是一个很大的问题，但是每遇中国网络封锁较严重时，都会让我暂时无法使用该软件。
解决方案&#8230; Tsocks
经过几个 Google 搜索，我最终很高兴地发现 Linux 有一个能够强迫任何软件通过 SOCKS 代理上网的工具，其名就是 tsocks。Tsocks 是一个透明 SOCKS 代理软件，只要你电脑有一个连接到国外服务器的 SSH 隧道，你就能让任何软件翻墙。
安装并配置 Tsocks
以下说明都是为了那些使用 Ubuntu  的 Linux 用户，不过在别的 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>情况</strong><br />
由于最近在中国某个地方爆发了 riot, 所以境内很多网站又是无法访问 (twitter.com、facebook.com 等)，让我们这些网民很无奈。</p>
<p><strong>使用 SSH 翻墙</strong><br />
<a href="http://sprayfly.com/2009/07/05/%E5%9C%A8-linux-%E4%B8%8B%E4%BD%BF%E7%94%A8%E4%BD%A0%E7%9A%84%E7%BD%91%E7%AB%99%E4%B8%BB%E6%9C%BA%E4%BD%9C%E4%B8%BA%E5%8A%A0%E5%AF%86%E4%BB%A3%E7%90%86%E6%9C%8D%E5%8A%A1%E5%99%A8/">我曾经介绍过</a>如何使用 SSH 来建立一个 SOCKS 代理服务器，让你能够在 Firefox 里正常访问以上所提起的网址。然而不是所有 Linux 软件都能支持代理服务器。如果你最热爱的 Linux 工具需要访问&#8221;被封&#8221;的网站，又没有嵌入的代理支持，该怎么办呢？<br />
遇到这种情况当然不要放弃该软件&#8230; 毕竟我们用的系统是 Linux 而不是以前让我们咳声叹气，丧失信心的 Windows，总有一个方法去解决问题。</p>
<p><strong>举个例子吧</strong><br />
我不久前发现了 Twitter 这个网站。我一开始不经常用，也搞不明白别人为什么对这个 web 2.0 服务都着了迷。后来我在推特上跟的人越来越多，跟着我的人亦是日益增多，不知不觉我也迷上了该网站，天天都会上。凡是经常用推特的人一般都会用一个推特的客户端，这才能跟得上朋友们的状态更新和最火热的网络新闻。本人作为 Ubuntu 的用户，我自然就选了 <a href="https://launchpad.net/gwibber">Gwibber</a> 这个基于 GNOME 的客户端来访问我的推特。这个软件功能很丰富，用起来得心应手，不过总有一个问题让我有点遗憾，就是 Gwibber <a href="https://bugs.launchpad.net/gwibber/+bug/259830">还不听从 GNOME 的代理设置</a>。平时这也不是一个很大的问题，但是每遇中国网络封锁较严重时，都会让我暂时无法使用该软件。</p>
<p><strong>解决方案&#8230; Tsocks</strong><br />
经过几个 Google 搜索，我最终很高兴地发现 Linux 有一个能够强迫任何软件通过 SOCKS 代理上网的工具，其名就是 tsocks。Tsocks 是一个透明 SOCKS 代理软件，只要你电脑有一个<a href="http://sprayfly.com/2009/07/05/%E5%9C%A8-linux-%E4%B8%8B%E4%BD%BF%E7%94%A8%E4%BD%A0%E7%9A%84%E7%BD%91%E7%AB%99%E4%B8%BB%E6%9C%BA%E4%BD%9C%E4%B8%BA%E5%8A%A0%E5%AF%86%E4%BB%A3%E7%90%86%E6%9C%8D%E5%8A%A1%E5%99%A8/">连接到国外服务器的 SSH 隧道</a>，你就能让任何软件翻墙。</p>
<p><strong>安装并配置 Tsocks</strong><br />
以下说明都是为了那些使用 Ubuntu  的 Linux 用户，不过在别的 Linux 发行版下，安装的过程应该与此差不多。</p>
<p>在终端中:</p>
<pre>sudo apt-get install tsocks</pre>
<p>修改配置文件:</p>
<pre>sudo nano /etc/tsocks.conf</pre>
<p>将其内容改成以下几行并保存退出:</p>
<pre>local = 192.168.1.0/255.255.255.0 #local表示本地的网络，也就是不使用socks代理的网络
server = 127.0.0.1 # SOCKS 服务器的 IP
server_type = 5 # SOCKS 服务版本
server_port = 9999 ＃SOCKS 服务使用的端口</pre>
<p>你可能需要修改一下以上内容，用你自己的 SSH 隧道设置。</p>
<p><strong>运行软件</strong><br />
用 tsocks 运行你的软件很简单，在终端中:</p>
<pre>tsocks 你的软件 &#038;</pre>
<p>我现在运行 Gwibber 都是这样运行的:</p>
<pre>tsocks gwibber &#038;</pre>
<p>祝你们翻墙愉快！</p>
<p><strong>EDIT&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;></strong></p>
<p>我今天还发现了另外一个工具，其功能似乎比 tsocks 要更丰富，配置起来更简单，而且不会那么容易出错。这个工具就是 <a href="proxychains.sourceforge.net/">proxychains</a>。以下有配置方法:</p>
<pre>sudo apt-get install proxychains</pre>
<p>修改配置文件 (/etc/proxychains.conf)，应该如下：</p>
<pre># proxychains.conf  VER 2.0
#
#        HTTP, SOCKS4, SOCKS5 tunneling proxifier.
#

# The option below identifies how the ProxyList is treated.
# only one option should be uncommented at time,
# otherwise the last appearing option will be accepted
#
# Dynamic - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped)
# otherwise EINTR is returned to the app
#
# Strict - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# all proxies must be online to play in chain
# otherwise EINTR is returned to the app
#
# Random - Each connection will be done via random proxy
# (or proxy chain, see  chain_len) from the list
# this option is good for scans

dynamic_chain
#strict_chain
#random_chain

# Make sense only if random_chain
chain_len = 2

# Quiet mode (no output)
#quiet_mode

# Write stats about good proxies to proxychains.stats
#write_stats

#Some timeouts in milliseconds
#
tcp_read_time_out 15000
tcp_connect_time_out 10000

[ProxyList]
# ProxyList format
#       type  host  port [user pass]
#       (values separated by 'tab' or 'blank')
#
#
#        Examples:
#
#            	socks5	192.168.67.78	1080	lamer  secret
#		http	192.168.89.3	8080	justu	hidden
#	 	socks4	192.168.1.49	1080
#	        http	192.168.39.93	8080
#
#
#       proxy types: http, socks4, socks5
#        ( auth types supported: "basic"-http  "user/pass"-socks )
#
#http 	10.0.0.5 3128
socks5 127.0.0.1 9999
socks4 127.0.0.1 9050
</pre>
<p>注意事项:</p>
<ol>
<li>要选 dynamic_chain 而不是 random_chain</li>
<li>可以列举几个代理服务器，proxychains  会按顺序用，代理无法访问即自动选用下一个</li>
<li>代理服务器要根据自己电脑的情况自行调整</li>
</ol>
<p><strong>运行 proxychains</strong><br />
运行 proxychains 跟运行 tsocks 完全一样。在终端中:</p>
<pre>proxychains 你的软件 &#038;</pre>
<p>比如说:</p>
<pre>proxychains chromium-browser &#038;</pre>
<p>我还是推荐你使用 proxychains！</p>
<div id="mainphotoarea"></div>]]></content:encoded>
			<wfw:commentRss>http://sprayfly.com/2009/07/09/%e7%94%a8-tsocks-%e4%bd%bf-linux-%e4%b8%8b%e6%89%80%e6%9c%89%e8%bd%af%e4%bb%b6%e8%83%bd%e5%a4%9f%e7%bf%bb%e5%a2%99/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
		<item>
		<title>Install latest VLC 1.0 in Ubuntu using the Launchpad Repository</title>
		<link>http://sprayfly.com/2009/07/09/install-latest-vlc-1-0-in-ubuntu-using-the-launchpad-repository/</link>
		<comments>http://sprayfly.com/2009/07/09/install-latest-vlc-1-0-in-ubuntu-using-the-launchpad-repository/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 02:12:13 +0000</pubDate>
		<dc:creator>Jono</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[1.0]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[launchpad]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[ppa]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[videolan]]></category>
		<category><![CDATA[vlc]]></category>

		<guid isPermaLink="false">http://sprayfly.com/?p=394</guid>
		<description><![CDATA[As some of you may have heard by now, VLC reached its version 1.0 milestone yesterday and is already available for download for use on your OS of preference bringing you plenty of new features.
New Features

Free, Open Source and cross-platform
Independant of systems codecs to support most video types
Live recording
Instant pausing and Frame-by-Frame support
Finer speed controls
New [...]]]></description>
			<content:encoded><![CDATA[<p>As <a href="http://lifehacker.com/5309097/vlc-hits-10-with-better-playback-and-file-support">some of you may have heard by now</a>, VLC reached its version 1.0 milestone yesterday and is already available for download for use on your OS of preference bringing you plenty of new features.</p>
<p><strong>New Features</strong></p>
<ul>
<li>Free, Open Source and cross-platform</li>
<li>Independant of systems codecs to support most video types</li>
<li>Live recording</li>
<li>Instant pausing and Frame-by-Frame support</li>
<li>Finer speed controls</li>
<li>New HD codecs (AES3, Dolby Digital Plus, TrueHD, Blu-Ray Linear PCM, Real Video 3.0 and 4.0, &#8230;)</li>
<li>New formats (Raw Dirac, M2TS, &#8230;) and major improvements in many formats&#8230;</li>
<li>New Dirac encoder and MP3 fixed-point encoder</li>
<li>Video scaling in fullscreen</li>
<li>RTSP Trickplay support</li>
<li>Zipped file playback</li>
<li>Customizable toolbars</li>
<li>Easier encoding GUI in Qt interface</li>
<li>Better integration in Gtk environments</li>
<li>MTP devices on linux</li>
<li>AirTunes streaming</li>
<li>New skin for the skins2 interface</li>
</ul>
<p>Whilst it may take a while before packages start hitting the repositories for your favourite linux distributions, for those of you who are in a hurry to try out the latest version and happen to be running on Ubuntu, here is a quick method to download and install the latest version.</p>
<p><strong>Launchpad Repository</strong><br />
Whilst older versions of VLC are already available in the repositories provided by Ubuntu, the newest version has not yet been rolled out. Don&#8217;t despair however&#8230; Videolan provide an <a href="https://launchpad.net/~c-korn/+archive/vlc">alternative PPA repository</a> hosted on Launchpad which has the latest edition of your favourite media player.</p>
<p><strong>Installing VLC 1.0</strong><br />
To install VLC 1.0, fire up a terminal and follow the instructions below:</p>
<p>Add the repository:</p>
<pre>sudo nano /etc/apt/sources.list.d/vlc.list</pre>
<p>For Jaunty, paste in the lines below, save and exit:</p>
<pre>deb http://ppa.launchpad.net/c-korn/vlc/ubuntu jaunty main
deb-src http://ppa.launchpad.net/c-korn/vlc/ubuntu jaunty main</pre>
<p>Add the key for the Launchpad PPA:</p>
<pre>sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 7613768D</pre>
<p>Update your repositories:</p>
<pre>sudo apt-get update</pre>
<p>Install:</p>
<pre>sudo apt-get install vlc vlc-plugin-esd mozilla-plugin-vlc</pre>
<p>That should prompt apt to look for the latest version in the repositories and to download and install it for you. Next time you fire up VLC you should now see that the version number is 1.0!</p>
<p><a href="http://www.flickr.com/photos/jonolumb/3700928749/" class="tt-flickr tt-flickr-Medium" title="vlc_1.png"><img class="alignnone" src="http://farm3.static.flickr.com/2455/3700928749_2231fabc78.jpg" alt="vlc_1.png" width="500" height="417" /></a></p>
<p>Source: <a href="http://www.videolan.org/vlc/download-ubuntu.html">Install VLC on Ubuntu</a></p>
<div id="mainphotoarea"></div>]]></content:encoded>
			<wfw:commentRss>http://sprayfly.com/2009/07/09/install-latest-vlc-1-0-in-ubuntu-using-the-launchpad-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在 Linux 下使用你的网站主机作为加密代理服务器</title>
		<link>http://sprayfly.com/2009/07/05/%e5%9c%a8-linux-%e4%b8%8b%e4%bd%bf%e7%94%a8%e4%bd%a0%e7%9a%84%e7%bd%91%e7%ab%99%e4%b8%bb%e6%9c%ba%e4%bd%9c%e4%b8%ba%e5%8a%a0%e5%af%86%e4%bb%a3%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8/</link>
		<comments>http://sprayfly.com/2009/07/05/%e5%9c%a8-linux-%e4%b8%8b%e4%bd%bf%e7%94%a8%e4%bd%a0%e7%9a%84%e7%bd%91%e7%ab%99%e4%b8%bb%e6%9c%ba%e4%bd%9c%e4%b8%ba%e5%8a%a0%e5%af%86%e4%bb%a3%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 08:18:54 +0000</pubDate>
		<dc:creator>Jono</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[网站]]></category>
		<category><![CDATA[网络]]></category>
		<category><![CDATA[翻墙]]></category>
		<category><![CDATA[脚本]]></category>
		<category><![CDATA[gfw]]></category>
		<category><![CDATA[host]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tunnel]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[代理]]></category>

		<guid isPermaLink="false">http://sprayfly.com/?p=331</guid>
		<description><![CDATA[我曾经介绍过如何使用 Amazon EC2 建立自己的代理服务器来“翻墙“。用这个方法翻墙虽然网速很快，但还是有些缺点。Amazon EC2 是收费的，而且按小时算，所以不能随时都开着我的代理服务器。另外，每次想用代理的时候还得先等一两分钟，让服务器启动。
然而我今天看到了这个贴子，这才发现还可以使用一个普通的网站主机作为我的代理服务器。与 Amazon EC2 不同，普通的网站主机是 24/7 运行的，而且你本来就要用它做你的网站，不用额外花钱。以上帖子是专门写给使用 Dreamhost 的 Windows 用户。不过，凡是有支持 SSH 服务网站主机的 Linux 用户也可以享受翻墙的自由感。我为 Linux 用户编了一个小的 BASH 脚本，其主要功能为:

与网站主机创建一个 SSH 隧道连接
SSH 隧道用完之后，安全地关闭 SSH 隧道连接

用这个脚本，我试了一下上平时被 GFW 封杀的 youtube.com&#8230; 结果 Firefox 差点让我晕倒了! 用这个代理，网速快极了&#8230; 感觉好像我还在英国上网似的 (那边一般都用 8M 以上的宽带) &#8211; 你可以看一下视频:

介绍一下脚本的内容
export SSH_HOST=admin@yoursite.com # username@host
这个需要你自己改一下&#8230; 就是你的 webhost 给你的 SSH 用户名和主机地址。 格式为 用户名@地址 （凡是用过 SSH 的人都应该知道写什么）
if [ [...]]]></description>
			<content:encoded><![CDATA[<p>我<a href="http://sprayfly.com/2009/06/28/shell-script-for-automated-amazon-ec2-personal-proxy-server/">曾经介绍过</a>如何使用 Amazon EC2 建立自己的代理服务器来“翻墙“。用这个方法翻墙虽然网速很快，但还是有些缺点。Amazon EC2 是收费的，而且按小时算，所以不能随时都开着我的代理服务器。另外，每次想用代理的时候还得先等一两分钟，让服务器启动。</p>
<p>然而我今天看到了这个<a href="http://www.fishnote.net/?p=86">贴子</a>，这才发现还可以使用一个普通的网站主机作为我的代理服务器。与 Amazon EC2 不同，普通的网站主机是 24/7 运行的，而且你本来就要用它做你的网站，不用额外花钱。以上帖子是专门写给使用 Dreamhost 的 Windows 用户。不过，凡是有支持 SSH 服务网站主机的 Linux 用户也可以享受翻墙的自由感。我为 Linux 用户编了一个小的 BASH 脚本，其主要功能为:</p>
<ul>
<li>与网站主机创建一个 SSH 隧道连接</li>
<li>SSH 隧道用完之后，安全地关闭 SSH 隧道连接</li>
</ul>
<p>用这个脚本，我试了一下上平时被 GFW 封杀的 youtube.com&#8230; 结果 Firefox 差点让我晕倒了! 用这个代理，网速快极了&#8230; 感觉好像我还在英国上网似的 (那边一般都用 8M 以上的宽带) &#8211; 你可以看一下视频:</p>
<p><object width="400" height="250" style="display: block; margin-left: auto; margin-right: auto;"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5468249&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5468249&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="250"></embed></object></p>
<p><strong>介绍一下脚本的内容</strong></p>
<pre>export SSH_HOST=admin@yoursite.com # username@host</pre>
<p>这个需要你自己改一下&#8230; 就是你的 webhost 给你的 SSH 用户名和主机地址。 格式为 用户名@地址 （凡是用过 SSH 的人都应该知道写什么）</p>
<pre>if [ ! -f /tmp/.tunnel ]</pre>
<p>看看是否已经有 SSH 隧道开着。有的话就将其关闭。没有就创建新的 SSH 隧道。</p>
<pre>ssh -f -D 9999 $SSH_HOST "if [ -f ~/.tunnel ]; then rm ~/.tunnel; fi; while [ ! -f ~/.tunnel ]; do echo > /dev/null; done" &#038;</pre>
<p>创建新的 SSH 隧道，设定本地 SOCKS 端口为 9999。隧道将会开着直到远程目录 “~/” 里有人创建 .tunnel 此文件为止。</p>
<pre>touch /tmp/.tunnel</pre>
<p>在你的电脑上创建 .tunnel 这个文件。这样脚本就知道正开着一个 SSH 隧道。</p>
<pre>ssh $SSH_HOST "touch ~/.tunnel"</pre>
<p>在远程目录 “~/&#8221; 里创建 .tunnel 此文件，这将会断开你电脑与代理服务器的连接</p>
<pre>rm /tmp/.tunnel</pre>
<p>删除 .tunnel 这个文件。这样脚本就知道 SSH 隧道已关闭。</p>
<p><strong>下载并执行脚本</strong><br />
<a href="http://files.getdropbox.com/u/316115/tunnel.sh">可以在此下载脚本</a></p>
<p>下载后放在你的首目录，比如在 ~/bin/。用一个文字编辑器修改脚本里的 ssh 变量并用 chmod 改一下文件权限</p>
<pre>chmod u+x tunnel.sh</pre>
<p><strong>创建连接</strong><br />
在终端中执行脚本，执行后可以关闭终端。</p>
<p><a href="http://www.flickr.com/photos/jonolumb/3689649442/" class="tt-flickr tt-flickr-Medium" title="open_tunnel.png"><img class="alignnone" src="http://farm3.static.flickr.com/2544/3689649442_9dd0cbe710.jpg" alt="open_tunnel.png" width="500" height="335" /></a></p>
<p><strong>关闭连接</strong><br />
再次在终端中执行脚本并关闭 Firefox (如果 Firefox 还在用隧道的话，连接暂时无法关闭)</p>
<p> <a href="http://www.flickr.com/photos/jonolumb/3688843963/" class="tt-flickr tt-flickr-Medium" title="close_tunnel.png"><img class="alignnone" src="http://farm4.static.flickr.com/3640/3688843963_8fdffbed01.jpg" alt="close_tunnel.png" width="500" height="335" /></a></p>
<p><strong>用 SSH 密钥进行授权</strong><br />
你或许注意到了&#8230; 以上脚本里没有任何地方可以写下你的 SSH 密码。这就是因为我在用 SSH 密钥来进行电脑与服务器的授权工作，这样更自动化而且比将密码直接写入文本的文件里要安全多了。先打开一个终端，根据一下步骤进行密钥配置:</p>
<pre>[jonolumb@jonoxps .ssh]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/jonolumb/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/jonolumb/.ssh/id_rsa
Your public key has been saved in /home/jonolumb/.ssh/id_rsa.pub
The key fingerprint is:
h7:10:49:46:ab:2t:3b:a3:36:2z:15:56:d4:f2:b7:3d jonolumb@jonoxps</pre>
<p>请注意，配置时密码要留为空白。</p>
<p>将生成的 /home/jonolumb/.ssh/id_rsa.pub 的内容复制到远程服务器目录下，具体位置是:<br />
~/.ssh/authorized_keys<br />
要保证远程的 authorized_keys 和 本地的 id_rsa 文件的权限均为 700。<br />
这样就可以自动登录到远程服务器了。</p>
<p><strong>配置 Firefox 使用代理</strong><br />
创建了 SSH 隧道之后，就进入 Firefox 并打开:</p>
<pre>首选项 --> 高级 --> 连接设置</pre>
<p>选择“手动配置代理”并将其设定为:<br />
HTTP 代理: localhost 端口: 9999</p>
<p> <a href="http://www.flickr.com/photos/jonolumb/3689657500/" class="tt-flickr tt-flickr-Medium" title="firefox_proxy.png"><img class="alignnone" src="http://farm3.static.flickr.com/2536/3689657500_4c7c03d871.jpg" alt="firefox_proxy.png" width="488" height="500" /></a></p>
<p>如果你用这个脚本遇到什么问题，请跟我取得联系。我很想听你们的意见。谢谢！</p>
<div id="mainphotoarea"></div>]]></content:encoded>
			<wfw:commentRss>http://sprayfly.com/2009/07/05/%e5%9c%a8-linux-%e4%b8%8b%e4%bd%bf%e7%94%a8%e4%bd%a0%e7%9a%84%e7%bd%91%e7%ab%99%e4%b8%bb%e6%9c%ba%e4%bd%9c%e4%b8%ba%e5%8a%a0%e5%af%86%e4%bb%a3%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Gnome-Colors: Elegant, consistent and colourful GNOME desktop themes</title>
		<link>http://sprayfly.com/2009/07/04/elegant-consistent-and-colourful-gnome-desktop-themes-in-six-colours/</link>
		<comments>http://sprayfly.com/2009/07/04/elegant-consistent-and-colourful-gnome-desktop-themes-in-six-colours/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 09:43:48 +0000</pubDate>
		<dc:creator>Jono</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[9.04]]></category>
		<category><![CDATA[backgrounds]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[登陆窗口]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[背景]]></category>
		<category><![CDATA[GDM]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[gnome-colors]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[launchpad]]></category>
		<category><![CDATA[ppa]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[wallpaper]]></category>
		<category><![CDATA[图标]]></category>
		<category><![CDATA[桌面]]></category>
		<category><![CDATA[主题]]></category>

		<guid isPermaLink="false">http://sprayfly.com/?p=290</guid>
		<description><![CDATA[Problem
I have never been a big fan of the default Brown/Orange GNOME themes that ship as standard with each new Ubuntu distribution. Although they are fully functional, they seem quite dull and uninspiring and certainly don&#8217;t have any &#8216;Wow&#8217; factor. Definitely not a way to win over windows/mac users to use Linux. 
 
For a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
I have never been a big fan of the default Brown/Orange GNOME themes that ship as standard with each new Ubuntu distribution. Although they are fully functional, they seem quite dull and uninspiring and certainly don&#8217;t have any &#8216;Wow&#8217; factor. Definitely not a way to win over windows/mac users to use Linux. </p>
<p><a href="http://www.flickr.com/photos/jonolumb/3686230753/" class="tt-flickr tt-flickr-Medium" title="brown.png"><img class="aligncenter" src="http://farm3.static.flickr.com/2611/3686230753_f9e5e3c578.jpg" alt="brown.png" width="500" height="313" /></a> </p>
<p>For a while then, I have been trying out various different GNOME themes from <a href="http://gnome-look.org/">Gnome-Look</a> on my computer with varying degrees of success. There are indeed a good number of attractive themes available for download &#8211; but the biggest problem I have encountered is that of consistency. Whilst the theme itself may be attractive, it is often hard to find a good icon set which doesn&#8217;t clash completely with it. Likewise, the theme is installed, chances are you will feel obliged to go searching around for some matching wallpaper &#8211; and the perfectionists among you will also insist on finding a colour coordinated GDM theme to finish off the job. All in all, what should be a quick, simple desktop personalisation task can take quite a few hours &#8211; and you won&#8217;t necessarily be 100% happy with the result either.</p>
<p><strong>A solution is at hand</strong><br />
The truth is, getting a nice colourful desktop theme with matching wallpaper, icons and GDM doesn&#8217;t have to be this complicated. It turns out that there is a brilliant project called <a href="http://code.google.com/p/gnome-colors/">Gnome-Colours</a> that has set itself the task of dealing with this problem. </p>
<p><a href="http://www.flickr.com/photos/jonolumb/3686107117/" class="tt-flickr tt-flickr-Original" title="gnomecolorsg.png"><img class="alignnone" src="http://farm3.static.flickr.com/2664/3686107117_b39075e4df_o.png" alt="gnomecolorsg.png" width="328" height="49" /></a> </p>
<p>From what I have seen from just a couple of days use, I believe that it has the potential to completely revolutionise your GNOME Desktop and make Linux a much more attractive and user friendly Operating System.</p>
<blockquote><p>The Gnome-Colors is a project that aims to make the GNOME desktop as elegant, consistent and colorful as possible.</p>
<p>The current goal is to allow full color customization of themes, icons, GDM logins and splash screens. There are already six full color-schemes available; Brave (Blue), Human (Orange), Wine (Red), Noble (Purple), Wise (Green) and Dust (Chocolate). </p></blockquote>
<p><strong>Themes, Icons, GDM and Wallpaper</strong><br />
Gnome-Colors currently provides matching themes, icons, GDM login window and desktop wallpaper in 6 different colours. These are all inter-compatible and are designed to blend together nicely giving your desktop a seamless and consistent feel &#8211; a bit like using a Mac! Furthermore, thanks to the power of GNOME, you can mix and match between different colour schemes &#8211; so you could have a green theme with blue icons, a purple login window and an orange desktop wallpaper and it would still look pretty damn good!</p>
<p><strong>What it looks like</strong><br />
Enough talking, lets have a look at what this setup actually looks like. In the examples below I am using the Brave (blue) theme on Ubuntu 9.04 &#8211; but as mentioned above, there are a total of 6 colour schemes to choose from.</p>
<p><strong>Arc-Colors</strong> -GDM login window complete with user list and picture<br />
<a href="http://www.flickr.com/photos/jonolumb/3685651401/" class="tt-flickr tt-flickr-Medium" title="login_1.png"><img class="alignnone" src="http://farm3.static.flickr.com/2509/3685651401_b42303294d.jpg" alt="login_1.png" width="500" height="311" /></a> </p>
<p><strong>Arc-Colors</strong> &#8211; GDM login window with standard text input<br />
<a href="http://www.flickr.com/photos/jonolumb/3686455982/" class="tt-flickr tt-flickr-Medium" title="login_2.png"><img class="alignnone" src="http://farm3.static.flickr.com/2598/3686455982_aa379c39e9.jpg" alt="login_2.png" width="500" height="313" /></a> </p>
<p><strong>Shiki-Colors</strong> &#8211; Six different colourful GNOME themes<br />
<a href="http://www.flickr.com/photos/jonolumb/3685651695/" class="tt-flickr tt-flickr-Medium" title="themes.png"><img class="alignnone" src="http://farm3.static.flickr.com/2429/3685651695_b9a96e8a38.jpg" alt="themes.png" width="500" height="313" /></a> </p>
<p><strong>Shiki-Colors</strong> &#8211; An example of what Shiki-Colors looks like running on Ubuntu (the dock at the bottom is <a href="http://do.davebsd.com/">GNOME Do</a>)<br />
<a href="http://www.flickr.com/photos/jonolumb/3686630772/" class="tt-flickr tt-flickr-Medium" title="shiki_colors.png"><img class="alignnone" src="http://farm3.static.flickr.com/2445/3686630772_23261b4e86.jpg" alt="shiki_colors.png" width="500" height="313" /></a> </p>
<p><strong>Arc-Colors</strong> &#8211; A selection of colourful GDM themes to choose from<br />
<a href="http://www.flickr.com/photos/jonolumb/3686631436/" class="tt-flickr tt-flickr-Medium" title="gdm.png"><img class="alignnone" src="http://farm3.static.flickr.com/2464/3686631436_5bd70847bd.jpg" alt="gdm.png" width="500" height="313" /></a> </p>
<p><strong>Gnome-Colors</strong> &#8211; Six different icon sets to choose from<br />
<a href="http://www.flickr.com/photos/jonolumb/3685651099/" class="tt-flickr tt-flickr-Medium" title="icons.png"><img class="alignnone" src="http://farm3.static.flickr.com/2642/3685651099_8bcd1b810e.jpg" alt="icons.png" width="500" height="313" /></a> </p>
<p><strong>Getting it up and running on your system</strong><br />
Of course, you&#8217;re now probably wondering how you can get such a lush GNOME theme up and running on your own desktop. There are in fact two ways of going about this.</p>
<p><strong>1. Download and install manually from Gnome-Look</strong><br />
The gnome-colors themes, icons, GDM window and wallpapers are all available separately on Gnome-Look for download and installation and can then be configured as mentioned below.</p>
<ul>
<li><a href="http://gnome-look.org/content/show.php/Arc-Colors+GDM-Walls?content=88305">Arc-Colors GDM Themes and Wallpapers</a></li>
<li><a href="http://gnome-look.org/content/show.php/Shiki-Colors?content=86717">Shiki-Colors GNOME Themes</a></li>
<li><a href="http://gnome-look.org/content/show.php/GNOME-colors?content=82562">Gnome-Colors Icons</a></li>
</ul>
<p><strong>Official Gnome-Colors Repository</strong><br />
Of course, the above method is a tedious and long winded approach to installation &#8211; and your themes and icons won&#8217;t be updated automatically when changes are made upstream. By far the best way of installing Gnome-Colors is to use their <a href="https://launchpad.net/~gnome-colors-packagers/+archive/ppa">official PPA repository</a>.</p>
<p><strong>Add the Repository:</strong><br />
To do so, open up a terminal and paste the following:</p>
<pre>sudo echo "deb http://ppa.launchpad.net/gnome-colors-packagers/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/gnome-colors-packagers/ppa/ubuntu jaunty main" > /etc/apt/sources.list.d/gnome-colors.list</pre>
<p>Make sure you change the &#8220;jaunty&#8221; in the above to your current ubuntu version (hardy, intrepid etc) if you are not running Jaunty 9.04.</p>
<p><strong>Add the key for the repository:</strong></p>
<pre>sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2d79f61be8d31a30</pre>
<p><strong>Update Repositories:</strong></p>
<pre>sudo apt-get update</pre>
<p><strong>Install packages:</strong></p>
<pre>sudo apt-get install gnome-colors shiki-colors arc-colors</pre>
<p><strong>Configure your GNOME Desktop to use Gnome-Colors</strong><br />
In the Ubuntu menu, open: </p>
<pre>System --> Preferences --> Appearance</pre>
<p>You can select the Gnome-Colors wallpaper of your preference in the &#8220;Background&#8221; tab and you can choose one of the newly installed Shiki-Colors themes in the &#8220;Theme&#8221; tab. The Gnome-Colors icons will be selected automatically depending on the colour of the theme.</p>
<p>Now open: </p>
<pre>System --> Preferences --> Login Window</pre>
<p>You can select an Arc-Colors GDM theme in the &#8220;Local&#8221; tab.</p>
<p><strong>Summary</strong><br />
Gnome-Colors is looking like a very promising theme pack for GNOME and one of only a few that provide a PPA repository for regular updates. Whilst it may not be for everyone, I would certainly recommend that popular distributions such as Ubuntu and Fedora seriously consider including it as an option in their official releases as it really does enhance the Linux user experience and brings along a lot of eye candy to an operating system that has for quite some time fallen behind in the aesthetics department. I have to say a big thank you to the developers &#8211; and I look forward to seeing what else there is to come!</p>
<div id="mainphotoarea"></div>]]></content:encoded>
			<wfw:commentRss>http://sprayfly.com/2009/07/04/elegant-consistent-and-colourful-gnome-desktop-themes-in-six-colours/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>
