<?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>Tin&#039;s Blog &#187; status</title>
	<atom:link href="http://www.diamondtin.com/category/status/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.diamondtin.com</link>
	<description>you are coming a long way...</description>
	<lastBuildDate>Thu, 05 Jan 2012 00:19:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>我最喜欢的电台是什么？当然是北京FM91.5轻松调频啦。 What&#8217;s you&#8230;</title>
		<link>http://www.diamondtin.com/2010/%e6%88%91%e6%9c%80%e5%96%9c%e6%ac%a2%e7%9a%84%e7%94%b5%e5%8f%b0%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%9f%e5%bd%93%e7%84%b6%e6%98%af%e5%8c%97%e4%ba%acfm91-5%e8%bd%bb%e6%9d%be%e8%b0%83%e9%a2%91%e5%95%a6/</link>
		<comments>http://www.diamondtin.com/2010/%e6%88%91%e6%9c%80%e5%96%9c%e6%ac%a2%e7%9a%84%e7%94%b5%e5%8f%b0%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%9f%e5%bd%93%e7%84%b6%e6%98%af%e5%8c%97%e4%ba%acfm91-5%e8%bd%bb%e6%9d%be%e8%b0%83%e9%a2%91%e5%95%a6/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 13:41:19 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[status]]></category>
		<category><![CDATA[radio easyfm]]></category>

		<guid isPermaLink="false">http://www.diamondtin.com/2010/%e6%88%91%e6%9c%80%e5%96%9c%e6%ac%a2%e7%9a%84%e7%94%b5%e5%8f%b0%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%9f%e5%bd%93%e7%84%b6%e6%98%af%e5%8c%97%e4%ba%acfm91-5%e8%bd%bb%e6%9d%be%e8%b0%83%e9%a2%91%e5%95%a6/</guid>
		<description><![CDATA[我最喜欢的电台是什么？ 当然是北京FM91.5轻松调频啦。 What&#8217;s your favorite radio station? It&#8217;s definitely Beijing FM 91.5 EasyFM 在iPhone上我可以订阅EasyFM的一些Podcast，还可以通过WunderRadio收听在线的... ]]></description>
			<content:encoded><![CDATA[<dl>
<dt>我最喜欢的电台是什么？</dt>
<dd>当然是北京FM91.5轻松调频啦。</dd>
<dt>What&#8217;s your favorite radio station?</dt>
<dd>It&#8217;s definitely Beijing FM 91.5 EasyFM</dd>
</dl>
<p>在iPhone上我可以订阅EasyFM的一些Podcast，还可以通过<a href="http://www.wunderradio.com/">WunderRadio</a>收听在线的版本。iPod nano可以收到，AIWA的收音机可以受到，家里现在有个大收音机解决了信号不好的问题。That&#8217;s so cool!</p>
<p>I subscribed some podcast from EasyFM, and I also listen EasyFM online by <a href="http://www.wunderradio.com/">WunderRadio</a> on my iPhone. I can receive EasyFM radio through my wife&#8217;s iPod nano, a old portable AIWA FM radio reciever and a advanced big radio receiver at home ,it fixed the bad signal issue. Sweet!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2010/%e6%88%91%e6%9c%80%e5%96%9c%e6%ac%a2%e7%9a%84%e7%94%b5%e5%8f%b0%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%9f%e5%bd%93%e7%84%b6%e6%98%af%e5%8c%97%e4%ba%acfm91-5%e8%bd%bb%e6%9d%be%e8%b0%83%e9%a2%91%e5%95%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>最简单的说，最有用的是这篇教程《Debian上安装l2tpd/IPSec VPN&#8230;</title>
		<link>http://www.diamondtin.com/2010/%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84%e8%af%b4%ef%bc%8c%e6%9c%80%e6%9c%89%e7%94%a8%e7%9a%84%e6%98%af%e8%bf%99%e7%af%87%e6%95%99%e7%a8%8b%e3%80%8adebian%e4%b8%8a%e5%ae%89%e8%a3%85l2tpdipsec-vpn/</link>
		<comments>http://www.diamondtin.com/2010/%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84%e8%af%b4%ef%bc%8c%e6%9c%80%e6%9c%89%e7%94%a8%e7%9a%84%e6%98%af%e8%bf%99%e7%af%87%e6%95%99%e7%a8%8b%e3%80%8adebian%e4%b8%8a%e5%ae%89%e8%a3%85l2tpdipsec-vpn/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 03:13:35 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[status]]></category>
		<category><![CDATA[L2TP linode openswan vpn xl2tpd]]></category>

		<guid isPermaLink="false">http://www.diamondtin.com/2010/%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84%e8%af%b4%ef%bc%8c%e6%9c%80%e6%9c%89%e7%94%a8%e7%9a%84%e6%98%af%e8%bf%99%e7%af%87%e6%95%99%e7%a8%8b%e3%80%8adebian%e4%b8%8a%e5%ae%89%e8%a3%85l2tpdipsec-vpn/</guid>
		<description><![CDATA[最简单的说，最有用的是这篇教程《Debian上安装l2tpd/IPSec VPN服务》。 在Linode的Ubuntu 9.04 (jaunty)上面安装L2TP，由于参考了apple4.us的这篇文章《如何在 Debian / Ubuntu 服务器上架设 L2TP / IPSec VPN》，所... ]]></description>
			<content:encoded><![CDATA[<p>最简单的说，最有用的是这篇教程<a href="http://www.weigblog.com/2010/06/24/setup-l2tpd-ipsec-vpn-debian.html">《Debian上安装l2tpd/IPSec VPN服务》</a>。<br />
在Linode的Ubuntu 9.04 (jaunty)上面安装L2TP，由于参考了apple4.us的这篇文章<a href="http://apple4.us/2010/05/setting-up-l2tp-vpn-on-debian-ubuntu.html">《如何在 Debian / Ubuntu 服务器上架设 L2TP / IPSec VPN》</a>，所以没有配置成功，主要原因是ubuntu上面的openswan版本和这个配置不相符，强行配置是会失败的，照猫画虎难度很大（而且我现在用的jaunty的openswan根本就配不通）。<br />
主要卡在sudo ipsec vierify上的两个disable上面：<br />
<code>Checking for RSA private key (/etc/ipsec.secrets) [DISABLED]<br />
        ipsec showhostkey: no default key in “/etc/ipsec.secrets”</code><br />
<code>Opportunistic Encryption Support [DISABLED]</code><br />
后面的这个Opportunistic Encryption因为oe=off这个配置不对，所以总是提示很多问题。<br />
后来经过了很多无助的搜索才发现了这篇<a href="http://hi.baidu.com/happyge/blog/item/272accf9b8743f54252df2f5.html">《l2tp vpn搭建总结(linode ubuntu)》</a>，解释了这个不要紧：</p>
<blockquote><p>
其中需要注意两项：Checking for RSA private key和Opportunistic Encryption Support，第一项其实你大可不必管他，disable或者ok都行。如果你实在要解决，可以：</p>
<p><code>ipsec newhostkey –file /root/tmpkey<br />
cat /root/tmpkey >> /etc/ipsec.secrets<br />
rm /root/tmpkey</code>
</p></blockquote>
<p>然后，疑问都解决了发现没有仔细阅读<a href="http://www.weigblog.com/2010/06/24/setup-l2tpd-ipsec-vpn-debian.html">《Debian上安装l2tpd/IPSec VPN服务》，<a href="http://www.weigblog.com/2010/06/24/setup-l2tpd-ipsec-vpn-debian.html">人家说</a>：</p>
<blockquote><p>
如果客户端连接显示“server did not respond”，通常说明openswan的版本不对，Debian Lenny自带的版本貌似有些问题。在命令行运行如下命令，即可安装openswan-2.6.24：</p>
<p><code>sudo aptitude install libgmp3-dev gawk flex bison<br />
wget http://www.openswan.org/download/openswan-2.6.24.tar.gz<br />
tar xf openswan-2.6.24.tar.gz<br />
cd openswan-2.6.24<br />
make programs<br />
sudo make install<br />
sudo apt-get remove openswan<br />
sudo /etc/init.d/ipsec restart</code>
</p></blockquote>
<p>卸载openswan并自己编了新的版本后果然就OK了。注意调试的时候应该看/var/log/syslog和/var/log/auth.log。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2010/%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84%e8%af%b4%ef%bc%8c%e6%9c%80%e6%9c%89%e7%94%a8%e7%9a%84%e6%98%af%e8%bf%99%e7%af%87%e6%95%99%e7%a8%8b%e3%80%8adebian%e4%b8%8a%e5%ae%89%e8%a3%85l2tpdipsec-vpn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>登root的时候发现： You have new mail in /var/ma&#8230;</title>
		<link>http://www.diamondtin.com/2010/%e7%99%bbroot%e7%9a%84%e6%97%b6%e5%80%99%e5%8f%91%e7%8e%b0%ef%bc%9a-you-have-new-mail-in-varma/</link>
		<comments>http://www.diamondtin.com/2010/%e7%99%bbroot%e7%9a%84%e6%97%b6%e5%80%99%e5%8f%91%e7%8e%b0%ef%bc%9a-you-have-new-mail-in-varma/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 02:14:47 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[status]]></category>
		<category><![CDATA[ubuntu postfix]]></category>

		<guid isPermaLink="false">http://www.diamondtin.com/2010/%e7%99%bbroot%e7%9a%84%e6%97%b6%e5%80%99%e5%8f%91%e7%8e%b0%ef%bc%9a-you-have-new-mail-in-varma/</guid>
		<description><![CDATA[登root的时候发现： You have new mail in /var/mail/root 原来是有很多root邮件没有传递，查了一下可以这样做，修改/etc/aliases： root: your.gmail.account@gmail.com 然后sudo postalias /etc/aliases就好了，root邮件就会... ]]></description>
			<content:encoded><![CDATA[<p>登root的时候发现：<br />
<code>You have new mail in /var/mail/root</code><br />
原来是有很多root邮件没有传递，查了一下可以这样做，修改/etc/aliases：<br />
<code>root:          your.gmail.account@gmail.com</code><br />
然后sudo postalias /etc/aliases就好了，root邮件就会被传递到你的gmail邮箱。当然我的情况是在ubuntu下使用postfix，否则修改的位置略有不同，谷歌一下。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2010/%e7%99%bbroot%e7%9a%84%e6%97%b6%e5%80%99%e5%8f%91%e7%8e%b0%ef%bc%9a-you-have-new-mail-in-varma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>昨天调试服务器上的L2TP，sudo -i了一下，发现root根目录有好多好多的&#8230;</title>
		<link>http://www.diamondtin.com/2010/%e6%98%a8%e5%a4%a9%e8%b0%83%e8%af%95%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e7%9a%84l2tp%ef%bc%8csudo-i%e4%ba%86%e4%b8%80%e4%b8%8b%ef%bc%8c%e5%8f%91%e7%8e%b0root%e6%a0%b9%e7%9b%ae%e5%bd%95%e6%9c%89/</link>
		<comments>http://www.diamondtin.com/2010/%e6%98%a8%e5%a4%a9%e8%b0%83%e8%af%95%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e7%9a%84l2tp%ef%bc%8csudo-i%e4%ba%86%e4%b8%80%e4%b8%8b%ef%bc%8c%e5%8f%91%e7%8e%b0root%e6%a0%b9%e7%9b%ae%e5%bd%95%e6%9c%89/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 01:55:49 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[status]]></category>
		<category><![CDATA[cron wordpress]]></category>

		<guid isPermaLink="false">http://www.diamondtin.com/2010/%e6%98%a8%e5%a4%a9%e8%b0%83%e8%af%95%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e7%9a%84l2tp%ef%bc%8csudo-i%e4%ba%86%e4%b8%80%e4%b8%8b%ef%bc%8c%e5%8f%91%e7%8e%b0root%e6%a0%b9%e7%9b%ae%e5%bd%95%e6%9c%89/</guid>
		<description><![CDATA[昨天调试服务器上的L2TP，sudo -i了一下，发现root根目录有好多好多的wp-cron留下的垃圾文件，原来是我的crontab写的有问题： */5 * * * * /usr/bin/wget http://www.ermiao.com/wp-cron.php?doing_wp_cron >> /home/public_ht... ]]></description>
			<content:encoded><![CDATA[<p>昨天调试服务器上的L2TP，sudo -i了一下，发现root根目录有好多好多的wp-cron留下的垃圾文件，原来是我的crontab写的有问题：</p>
<p><code>*/5  * * * * /usr/bin/wget  http://www.ermiao.com/wp-cron.php?doing_wp_cron >> /home/public_html/ermiao.com/log/wp-cron.log 2 >> /home/public_html/ermiao.com/log/wp-cron.err</code></p>
<p>因为默认情况下wget会把文件下载到home目录下，而且它还会自动重命名，结果文件越来越多……</p>
<p>解决方法就是增加下载后删除的参数，并且让它quiet运行。</p>
<p><code>*/5  * * * * /usr/bin/wget  -q --delete-after http://www.ermiao.com/wp-cron.php?doing_wp_cron >> /home/public_html/ermiao.com/log/wp-cron.log 2 >> /home/public_html/ermiao.com/log/wp-cron.err</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2010/%e6%98%a8%e5%a4%a9%e8%b0%83%e8%af%95%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e7%9a%84l2tp%ef%bc%8csudo-i%e4%ba%86%e4%b8%80%e4%b8%8b%ef%bc%8c%e5%8f%91%e7%8e%b0root%e6%a0%b9%e7%9b%ae%e5%bd%95%e6%9c%89/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenParty的新网站的Django项目使用了South这个migratio&#8230;</title>
		<link>http://www.diamondtin.com/2010/openparty%e7%9a%84%e6%96%b0%e7%bd%91%e7%ab%99%e7%9a%84django%e9%a1%b9%e7%9b%ae%e4%bd%bf%e7%94%a8%e4%ba%86south%e8%bf%99%e4%b8%aamigratio/</link>
		<comments>http://www.diamondtin.com/2010/openparty%e7%9a%84%e6%96%b0%e7%bd%91%e7%ab%99%e7%9a%84django%e9%a1%b9%e7%9b%ae%e4%bd%bf%e7%94%a8%e4%ba%86south%e8%bf%99%e4%b8%aamigratio/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 09:42:48 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[status]]></category>
		<category><![CDATA[django south]]></category>

		<guid isPermaLink="false">http://www.diamondtin.com/2010/openparty%e7%9a%84%e6%96%b0%e7%bd%91%e7%ab%99%e7%9a%84django%e9%a1%b9%e7%9b%ae%e4%bd%bf%e7%94%a8%e4%ba%86south%e8%bf%99%e4%b8%aamigratio/</guid>
		<description><![CDATA[OpenParty的新网站的Django项目使用了South这个migration工具。可是刚才增加了一个Model以后却无论如何都无法生成这个migration。 ./manage.py schemamigration core --auto 上面这个命令每次都提示： Nothing seems to... ]]></description>
			<content:encoded><![CDATA[<p><a href="http://app.beijing-open-party.org">OpenParty的新网站</a>的Django项目使用了<a href="http://south.aeracode.org">South</a>这个migration工具。可是刚才增加了一个Model以后却无论如何都无法生成这个migration。</p>
<p><code>./manage.py schemamigration core --auto</code></p>
<p>上面这个命令每次都提示：</p>
<p><code>Nothing seems to have changed.</code></p>
<p>很郁闷。试验了看是否是South或者Django的版本问题，都升级到最新版依然有这个问题。看了google groups里面也没有人报有这个问题。于是仔细搜索问题的来源，最终发现是这个原因：</p>
<p><code>    class Meta:<br />
        app_label = 'core'<br />
</code></p>
<p>上次我们Team重构项目的时候去掉了项目的openparty前缀，使用相对路径import，结果造成&#8221;core&#8221;项目实际上是存在&#8221;apps.core&#8221;下面的。所以，需要用Meta类告诉Django实际上对应的app名称。结绳记事。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2010/openparty%e7%9a%84%e6%96%b0%e7%bd%91%e7%ab%99%e7%9a%84django%e9%a1%b9%e7%9b%ae%e4%bd%bf%e7%94%a8%e4%ba%86south%e8%bf%99%e4%b8%aamigratio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在Mac下的Pydev里面几个常用的快捷键 Cmd+e切换tab，配合输入tab&#8230;</title>
		<link>http://www.diamondtin.com/2010/%e5%9c%a8mac%e4%b8%8b%e7%9a%84pydev%e9%87%8c%e9%9d%a2%e5%87%a0%e4%b8%aa%e5%b8%b8%e7%94%a8%e7%9a%84%e5%bf%ab%e6%8d%b7%e9%94%ae-cmde%e5%88%87%e6%8d%a2tab%ef%bc%8c%e9%85%8d%e5%90%88%e8%be%93%e5%85%a5tab/</link>
		<comments>http://www.diamondtin.com/2010/%e5%9c%a8mac%e4%b8%8b%e7%9a%84pydev%e9%87%8c%e9%9d%a2%e5%87%a0%e4%b8%aa%e5%b8%b8%e7%94%a8%e7%9a%84%e5%bf%ab%e6%8d%b7%e9%94%ae-cmde%e5%88%87%e6%8d%a2tab%ef%bc%8c%e9%85%8d%e5%90%88%e8%be%93%e5%85%a5tab/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 07:19:20 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[status]]></category>
		<category><![CDATA[pydev mac shortcut python]]></category>

		<guid isPermaLink="false">http://www.diamondtin.com/2010/%e5%9c%a8mac%e4%b8%8b%e7%9a%84pydev%e9%87%8c%e9%9d%a2%e5%87%a0%e4%b8%aa%e5%b8%b8%e7%94%a8%e7%9a%84%e5%bf%ab%e6%8d%b7%e9%94%ae-cmde%e5%88%87%e6%8d%a2tab%ef%bc%8c%e9%85%8d%e5%90%88%e8%be%93%e5%85%a5tab/</guid>
		<description><![CDATA[在Mac下的Pydev里面几个常用的快捷键 Cmd+e 切换tab，配合输入tab文件的名字的前几个可以快速在上下文中切换tab Cmd+d 删除本行 Cmd+Option+上 复制本行一次（Duplicate this line） Cmd+Shift+R 快速打开文件... ]]></description>
			<content:encoded><![CDATA[<h2>在Mac下的Pydev里面几个常用的快捷键</h2>
<dl>
<dt>Cmd+e</dt>
<dd>切换tab，配合输入tab文件的名字的前几个可以快速在上下文中切换tab</dd>
<dt>Cmd+d</dt>
<dd>删除本行</dd>
<dt>Cmd+Option+上</dt>
<dd>复制本行一次（Duplicate this line）</dd>
<dt>Cmd+Shift+R</dt>
<dd>快速打开文件，注意没有通配符也不是smart匹配……</dd>
<dt>Cmd+Shift+F11</dt>
<dd>Rerun，常用在运行当前的单元测试</dd>
<dt>Cmd+Option+r
<dt>
<dd>Rename refactory，重命名重构，非常实用。不过少数情况下这个重构不安全，注意diff</dd>
<dt>Cmd+Shift+O</dt>
<dd>自动import，缺点是它会搅乱你精心设计的import顺序，不在乎的朋友非常方便，可以让你的coding工作变得非常流畅。不过如果你开启auto import以后这个快捷键就不需要了，但是auto import的副作用就是它经常import那些明明不需要import的东西，如self、len它都会傻傻的import。</dd>
<dt>Cmd+Shift+F</dt>
<dd>在当前Folder搜索，前提是你在文件浏览部分选中了一个Folder</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2010/%e5%9c%a8mac%e4%b8%8b%e7%9a%84pydev%e9%87%8c%e9%9d%a2%e5%87%a0%e4%b8%aa%e5%b8%b8%e7%94%a8%e7%9a%84%e5%bf%ab%e6%8d%b7%e9%94%ae-cmde%e5%88%87%e6%8d%a2tab%ef%bc%8c%e9%85%8d%e5%90%88%e8%be%93%e5%85%a5tab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>刚才写了一个识别网站charset的正则，因为目前写一个网页抓取的工具，里面对中&#8230;</title>
		<link>http://www.diamondtin.com/2010/%e5%88%9a%e6%89%8d%e5%86%99%e4%ba%86%e4%b8%80%e4%b8%aa%e8%af%86%e5%88%ab%e7%bd%91%e7%ab%99charset%e7%9a%84%e6%ad%a3%e5%88%99%ef%bc%8c%e5%9b%a0%e4%b8%ba%e7%9b%ae%e5%89%8d%e5%86%99%e4%b8%80%e4%b8%aa/</link>
		<comments>http://www.diamondtin.com/2010/%e5%88%9a%e6%89%8d%e5%86%99%e4%ba%86%e4%b8%80%e4%b8%aa%e8%af%86%e5%88%ab%e7%bd%91%e7%ab%99charset%e7%9a%84%e6%ad%a3%e5%88%99%ef%bc%8c%e5%9b%a0%e4%b8%ba%e7%9b%ae%e5%89%8d%e5%86%99%e4%b8%80%e4%b8%aa/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 05:32:20 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[status]]></category>
		<category><![CDATA[regexp]]></category>

		<guid isPermaLink="false">http://www.diamondtin.com/2010/%e5%88%9a%e6%89%8d%e5%86%99%e4%ba%86%e4%b8%80%e4%b8%aa%e8%af%86%e5%88%ab%e7%bd%91%e7%ab%99charset%e7%9a%84%e6%ad%a3%e5%88%99%ef%bc%8c%e5%9b%a0%e4%b8%ba%e7%9b%ae%e5%89%8d%e5%86%99%e4%b8%80%e4%b8%aa/</guid>
		<description><![CDATA[刚才写了一个识别网站charset的正则，因为目前写一个网页抓取的工具，里面对中文url做encoding的时候需要先识别页面的编码，可惜UrlEncoding没有强制使用UTF-8编码，真是烦人。下面是一个python下... ]]></description>
			<content:encoded><![CDATA[<p>刚才写了一个识别网站charset的正则，因为目前写一个网页抓取的工具，里面对中文url做encoding的时候需要先识别页面的编码，可惜UrlEncoding没有强制使用UTF-8编码，真是烦人。下面是一个python下的正则表达是的字面文本。</p>
<pre>
r'&lt;meta.*(?:(?:charset\s*=\s*["|\']?)|(?:charset.*content\s*=\s*["|\']\s*))([\d|\w|\-]+)[;|"|\'|\s]'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2010/%e5%88%9a%e6%89%8d%e5%86%99%e4%ba%86%e4%b8%80%e4%b8%aa%e8%af%86%e5%88%ab%e7%bd%91%e7%ab%99charset%e7%9a%84%e6%ad%a3%e5%88%99%ef%bc%8c%e5%9b%a0%e4%b8%ba%e7%9b%ae%e5%89%8d%e5%86%99%e4%b8%80%e4%b8%aa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>我的.profile里面的alias，之前使用kill $(ps auwx &#124; &#8230;</title>
		<link>http://www.diamondtin.com/2010/%e6%88%91%e7%9a%84-profile%e9%87%8c%e9%9d%a2%e7%9a%84alias%ef%bc%8c%e4%b9%8b%e5%89%8d%e4%bd%bf%e7%94%a8kill-ps-auwx/</link>
		<comments>http://www.diamondtin.com/2010/%e6%88%91%e7%9a%84-profile%e9%87%8c%e9%9d%a2%e7%9a%84alias%ef%bc%8c%e4%b9%8b%e5%89%8d%e4%bd%bf%e7%94%a8kill-ps-auwx/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 01:19:35 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[status]]></category>
		<category><![CDATA[ssh proxy]]></category>

		<guid isPermaLink="false">http://www.diamondtin.com/2010/%e6%88%91%e7%9a%84-profile%e9%87%8c%e9%9d%a2%e7%9a%84alias%ef%bc%8c%e4%b9%8b%e5%89%8d%e4%bd%bf%e7%94%a8kill-ps-auwx/</guid>
		<description><![CDATA[我的.profile里面的alias，之前使用kill $(ps auwx &#124; grep qTfnNC &#124; grep -v grep &#124; awk &#8216;{ print $2 }&#8217;)的方法放在.profile里面就不好用了，所以最近就一直没有使用它。既然还是反复在用它（连... ]]></description>
			<content:encoded><![CDATA[<p>我的.profile里面的alias，之前使用kill $(ps auwx | grep qTfnNC | grep -v grep | awk &#8216;{ print $2 }&#8217;)的方法放在.profile里面就不好用了，所以最近就一直没有使用它。既然还是反复在用它（连接断开vpn以后经常需要重启ssh代理），所以还是修正它好了。<br />
<code><br />
alias px="ssh -qTfnNC -D 7777 yourdomain.com"<br />
alias kpx="(ps auwx | grep qTfnNC | grep -v grep | awk '{ print $2 }')|xargs kill;px"<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2010/%e6%88%91%e7%9a%84-profile%e9%87%8c%e9%9d%a2%e7%9a%84alias%ef%bc%8c%e4%b9%8b%e5%89%8d%e4%bd%bf%e7%94%a8kill-ps-auwx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>看到这段话，来自这里： Recently I discovered that l&#8230;</title>
		<link>http://www.diamondtin.com/2010/%e7%9c%8b%e5%88%b0%e8%bf%99%e6%ae%b5%e8%af%9d%ef%bc%8c%e6%9d%a5%e8%87%aa%e8%bf%99%e9%87%8c%ef%bc%9a-recently-i-discovered-that-l/</link>
		<comments>http://www.diamondtin.com/2010/%e7%9c%8b%e5%88%b0%e8%bf%99%e6%ae%b5%e8%af%9d%ef%bc%8c%e6%9d%a5%e8%87%aa%e8%bf%99%e9%87%8c%ef%bc%9a-recently-i-discovered-that-l/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 05:40:03 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[status]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.diamondtin.com/2010/%e7%9c%8b%e5%88%b0%e8%bf%99%e6%ae%b5%e8%af%9d%ef%bc%8c%e6%9d%a5%e8%87%aa%e8%bf%99%e9%87%8c%ef%bc%9a-recently-i-discovered-that-l/</guid>
		<description><![CDATA[看到这段话，来自这里： Recently I discovered that learning a foreign language teaches you two things: how to communicate in that language and how to communicate in your own language to non-native speakers. You learn that simple grammatical str... ]]></description>
			<content:encoded><![CDATA[<p>看到这段话，来自<a href="http://coderoom.wordpress.com/2010/03/26/on-the-fear-of-reading-code/">这里</a>：</p>
<blockquote><p>Recently I discovered that learning a foreign language teaches you two things: how to communicate in that language and how to communicate in your own language to non-native speakers. You learn that simple grammatical structures and shorter sentences are easier to understand. You get a feeling for when someone’s following you and which words in the sentence are most important to pronounce clearly.</p></blockquote>
<p>感觉说的很好。你需要知道如何和没有熟练掌握这门语言（或者领域）的人交流，你需要知道如用简单的表述，清晰的表达你的意思。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2010/%e7%9c%8b%e5%88%b0%e8%bf%99%e6%ae%b5%e8%af%9d%ef%bc%8c%e6%9d%a5%e8%87%aa%e8%bf%99%e9%87%8c%ef%bc%9a-recently-i-discovered-that-l/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>看到那些背着书包穿着校服的中学生，感觉现在比那个时候自由和快乐了，而且也比那个时&#8230;</title>
		<link>http://www.diamondtin.com/2010/%e7%9c%8b%e5%88%b0%e9%82%a3%e4%ba%9b%e8%83%8c%e7%9d%80%e4%b9%a6%e5%8c%85%e7%a9%bf%e7%9d%80%e6%a0%a1%e6%9c%8d%e7%9a%84%e4%b8%ad%e5%ad%a6%e7%94%9f%ef%bc%8c%e6%84%9f%e8%a7%89%e7%8e%b0%e5%9c%a8%e6%af%94/</link>
		<comments>http://www.diamondtin.com/2010/%e7%9c%8b%e5%88%b0%e9%82%a3%e4%ba%9b%e8%83%8c%e7%9d%80%e4%b9%a6%e5%8c%85%e7%a9%bf%e7%9d%80%e6%a0%a1%e6%9c%8d%e7%9a%84%e4%b8%ad%e5%ad%a6%e7%94%9f%ef%bc%8c%e6%84%9f%e8%a7%89%e7%8e%b0%e5%9c%a8%e6%af%94/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 11:32:33 +0000</pubDate>
		<dc:creator>tin</dc:creator>
				<category><![CDATA[status]]></category>
		<category><![CDATA[life emotion]]></category>

		<guid isPermaLink="false">http://www.diamondtin.com/2010/%e7%9c%8b%e5%88%b0%e9%82%a3%e4%ba%9b%e8%83%8c%e7%9d%80%e4%b9%a6%e5%8c%85%e7%a9%bf%e7%9d%80%e6%a0%a1%e6%9c%8d%e7%9a%84%e4%b8%ad%e5%ad%a6%e7%94%9f%ef%bc%8c%e6%84%9f%e8%a7%89%e7%8e%b0%e5%9c%a8%e6%af%94/</guid>
		<description><![CDATA[看到那些背着书包穿着校服的中学生，感觉现在比那个时候自由和快乐了，而且也比那个时候富裕了很多。可代价是，我变老了... ]]></description>
			<content:encoded><![CDATA[<p>看到那些背着书包穿着校服的中学生，感觉现在比那个时候自由和快乐了，而且也比那个时候富裕了很多。可代价是，我变老了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.diamondtin.com/2010/%e7%9c%8b%e5%88%b0%e9%82%a3%e4%ba%9b%e8%83%8c%e7%9d%80%e4%b9%a6%e5%8c%85%e7%a9%bf%e7%9d%80%e6%a0%a1%e6%9c%8d%e7%9a%84%e4%b8%ad%e5%ad%a6%e7%94%9f%ef%bc%8c%e6%84%9f%e8%a7%89%e7%8e%b0%e5%9c%a8%e6%af%94/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

