<?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>avenger::Life() &#187; Linux</title>
	<atom:link href="http://avenger.name/blog/category/internet/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://avenger.name</link>
	<description>Some Words. Explain My Life.</description>
	<lastBuildDate>Fri, 19 Mar 2010 07:39:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>在 Ubuntu 8.10 (Intrepid) 中使用 vpn</title>
		<link>http://avenger.name/blog/ubuntu-810-intrepid-vpn/</link>
		<comments>http://avenger.name/blog/ubuntu-810-intrepid-vpn/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 02:50:24 +0000</pubDate>
		<dc:creator>avenger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Intrepid]]></category>
		<category><![CDATA[pptp]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://avenger.name/?p=276</guid>
		<description><![CDATA[上周把我的 T60 上的 Ubuntu 升级到了最新版本 Intrepid，对比上个版本的升级过程，相对顺利了很多。新版本中最大的改版之一，就是网络管理器的更换。新的管理器使用起来更加简单，不过在使用公司的 vpn 的时候却碰到了一些麻烦，在网上搜索了一下，大部分人都有类似的问题，不过还没有找到好的解决办法。 趁着周末的时间，找了一些国外的相关资料，终于把 vpn 给搞定了，我下面描述下我的方法，不一定对所有人有效，大家权当参考。 1.需要安装的软件包 很多人反馈 vpn 添加的按钮是灰色不可用的，是因为你的相应的软件包没安装完整，使用新立得安装 network-manager-pptp，或者使用以下命令行： sudo apt-get install network-manager-pptp 也有些同学是像我这样从低版本升级上来的，可能也会有一些杂七杂八的问题，有碰到问题找不到头绪的时候，建议把以下软件包重新安装： network-manager、network-manager-gnome 2.新建 VPN 连接 按下面截图的步骤开始，新连接类型要选择  pptp 3.设置 VPN 属性 按下图所示，“Getway”  是你的网关地址，“User name” 也不能为空，注意密码这里先暂时保持为空，连接的时候会提示你填写，这里填写的话可能会导致连接失败。 然后点击 “Advanced”，打开高级选项，选中 “Use Point-to-Point encryption(MPPE)”，如下图所示，其它选项不用改动： 到这里就配置结束了，不出意外的话，连接应该是正常的。 4.路由问题 正常情况下，拔上  vpn 后，本地的网络会不正常，这是因为本地网络默认会走 vpn 的路由的关系，我们需要设置只有远程地址才需要走远程的网关。 在设置对话框中选择 “IPV4 Setting”，然后点击 “Route”，参考下面的截图： 我这里是设置了 172.20.1.x 和 172.20.2.x 的网段才通过远程网关，你需要根据你的情况来做相应的修改： [...]]]></description>
			<content:encoded><![CDATA[<p class='fp'>上周把我的 T60 上的 Ubuntu 升级到了最新版本 Intrepid，对比上个版本的升级过程，相对顺利了很多。新版本中最大的改版之一，就是网络管理器的更换。新的管理器使用起来更加简单，不过在使用公司的 vpn 的时候却碰到了一些麻烦，在网上搜索了一下，大部分人都有类似的问题，不过还没有找到好的解决办法。</p>
<p>趁着周末的时间，找了一些国外的相关资料，终于把 vpn 给搞定了，我下面描述下我的方法，不一定对所有人有效，大家权当参考。</p>
<p><span id="more-276"></span></p>
<p><strong>1.需要安装的软件包</strong></p>
<p>很多人反馈 vpn 添加的按钮是灰色不可用的，是因为你的相应的软件包没安装完整，使用新立得安装 <strong>network-manager-pptp</strong>，或者使用以下命令行：</p>
<p><strong><code>sudo apt-get install network-manager-pptp</code></strong></p>
<p>也有些同学是像我这样从低版本升级上来的，可能也会有一些杂七杂八的问题，有碰到问题找不到头绪的时候，建议把以下软件包重新安装：</p>
<p><strong>network-manager、network-manager-gnome</strong></p>
<p><strong>2.新建 VPN 连接</strong></p>
<p>按下面截图的步骤开始，新连接类型要选择  pptp</p>
<p><a href="http://avenger.name/wp-content/uploads/2008/11/vpn1.png"><img class="aligncenter size-full wp-image-277" title="vpn1" src="http://avenger.name/wp-content/uploads/2008/11/vpn1.png" alt="" width="397" height="257" /></a></p>
<p><strong>3.设置 VPN 属性</strong></p>
<p>按下图所示，“<strong>Getway</strong>”  是你的网关地址，“<strong>User name</strong>” 也不能为空，注意密码这里先暂时保持为空，连接的时候会提示你填写，这里填写的话可能会导致连接失败。</p>
<p><a href="http://avenger.name/wp-content/uploads/2008/11/vpn2.png"><img class="aligncenter size-full wp-image-278" title="vpn2" src="http://avenger.name/wp-content/uploads/2008/11/vpn2.png" alt="" width="422" height="552" /></a></p>
<p>然后点击 “<strong>Advanced</strong>”，打开高级选项，选中 “<strong>Use Point-to-Point encryption(MPPE)</strong>”，如下图所示，其它选项不用改动：</p>
<p><a href="http://avenger.name/wp-content/uploads/2008/11/vpn3.png"><img class="aligncenter size-full wp-image-279" title="vpn3" src="http://avenger.name/wp-content/uploads/2008/11/vpn3.png" alt="" width="420" height="549" /></a></p>
<p>到这里就配置结束了，不出意外的话，连接应该是正常的。</p>
<p><strong>4.路由问题</strong></p>
<p>正常情况下，拔上  vpn 后，本地的网络会不正常，这是因为本地网络默认会走 vpn 的路由的关系，我们需要设置只有远程地址才需要走远程的网关。</p>
<p>在设置对话框中选择 “<strong>IPV4 Setting</strong>”，然后点击 “<strong>Route</strong>”，参考下面的截图：</p>
<p>我这里是设置了 172.20.1.x 和 172.20.2.x 的网段才通过远程网关，你需要根据你的情况来做相应的修改：</p>
<p><a href="http://avenger.name/wp-content/uploads/2008/11/vpn4.png"><img class="aligncenter size-full wp-image-280" title="vpn4" src="http://avenger.name/wp-content/uploads/2008/11/vpn4.png" alt="" width="470" height="530" /></a></p>
<p>到这里如果你还有问题，还可以通过查看系统日志（dmesg 或 cat /var/log/syslog）来进一步判断问题所在。</p>
</p><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>October 30, 2008 -- <a href="http://avenger.name/blog/yui-compressor-for-nautilus/" title="YUI Compressor for nautilus">YUI Compressor for nautilus</a></li><li>April 14, 2008 -- <a href="http://avenger.name/blog/whats-in-my-history/" title="What&#8217;s in my history?">What&#8217;s in my history?</a></li><li>April 1, 2008 -- <a href="http://avenger.name/blog/my_firefox_ext/" title="我目前使用的 Firefox 插件">我目前使用的 Firefox 插件</a></li><li>November 10, 2007 -- <a href="http://avenger.name/blog/ubuntu-gutsy-google-earth/" title="Ubuntu Gutsy 下 Google Earth 不能运行的解决办法">Ubuntu Gutsy 下 Google Earth 不能运行的解决办法</a></li><li>May 21, 2007 -- <a href="http://avenger.name/blog/time-to-update-to-ubuntu-704/" title="Time to Update to Ubuntu 7.04">Time to Update to Ubuntu 7.04</a></li><li>July 3, 2008 -- <a href="http://avenger.name/about/" title="About">About</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://avenger.name/blog/ubuntu-810-intrepid-vpn/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>YUI Compressor for nautilus</title>
		<link>http://avenger.name/blog/yui-compressor-for-nautilus/</link>
		<comments>http://avenger.name/blog/yui-compressor-for-nautilus/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 07:31:44 +0000</pubDate>
		<dc:creator>avenger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://avenger.name/?p=267</guid>
		<description><![CDATA[在 lifesinger 的 blog 上看到淘宝内部使用的 TBCompressor，自己还傻乎乎的留言问有没有 for Linux 版本的。 YUI Compressor 本身就是一个 jar 包，可以方便的跨平台运行，不过每次都要打开控制台来运行，也有些不爽，参考了 TBCompressor，作了一个 nautilus-script，这下就可以直接对 js 和 css 文件点击右键进行操作了。 效果截图如下： 下载地址：MinJS 使用方法：下载后的文件放到 ~/.gnome2/nautilus-scripts 目录下即可，需要先打开文件配置你的 YUI Compressor jar 文件所在的路径。 Related PostsNovember 22, 2008 -- 在 Ubuntu 8.10 (Intrepid) 中使用 vpnApril 14, 2008 -- What&#8217;s in my history?April 1, 2008 -- 我目前使用的 Firefox 插件November 10, 2007 [...]]]></description>
			<content:encoded><![CDATA[<p class='fp'>在 <a href="http://lifesinger.org/blog/?p=464">lifesinger</a> 的 blog 上看到淘宝内部使用的 <strong>TBCompressor</strong>，自己还傻乎乎的留言问有没有 for Linux 版本的。</p>
<p><a href="http://www.julienlecomte.net/yuicompressor/">YUI Compressor </a>本身就是一个 jar 包，可以方便的跨平台运行，不过每次都要打开控制台来运行，也有些不爽，参考了 TBCompressor，作了一个 nautilus-script，这下就可以直接对 js 和 css 文件点击右键进行操作了。</p>
<p><strong>效果截图如下：</strong></p>
<p><img class="aligncenter size-full wp-image-268" title="YUI Compressor for nautilus" src="http://avenger.name/wp-content/uploads/2008/10/2.png" alt="" width="454" height="360" /></p>
<p><strong>下载地址</strong>：<a href="http://avenger.name/wp-content/uploads/2008/10/minjs">MinJS</a></p>
<p><strong>使用方法：</strong>下载后的文件放到 ~/.gnome2/nautilus-scripts 目录下即可，需要先打开文件配置你的 YUI Compressor jar 文件所在的路径。</p>
</p><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>November 22, 2008 -- <a href="http://avenger.name/blog/ubuntu-810-intrepid-vpn/" title="在 Ubuntu 8.10 (Intrepid) 中使用 vpn">在 Ubuntu 8.10 (Intrepid) 中使用 vpn</a></li><li>April 14, 2008 -- <a href="http://avenger.name/blog/whats-in-my-history/" title="What&#8217;s in my history?">What&#8217;s in my history?</a></li><li>April 1, 2008 -- <a href="http://avenger.name/blog/my_firefox_ext/" title="我目前使用的 Firefox 插件">我目前使用的 Firefox 插件</a></li><li>November 10, 2007 -- <a href="http://avenger.name/blog/ubuntu-gutsy-google-earth/" title="Ubuntu Gutsy 下 Google Earth 不能运行的解决办法">Ubuntu Gutsy 下 Google Earth 不能运行的解决办法</a></li><li>October 25, 2007 -- <a href="http://avenger.name/blog/statsvn_shell/" title="StatSVN 自动运行脚本的问题">StatSVN 自动运行脚本的问题</a></li><li>May 21, 2007 -- <a href="http://avenger.name/blog/time-to-update-to-ubuntu-704/" title="Time to Update to Ubuntu 7.04">Time to Update to Ubuntu 7.04</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://avenger.name/blog/yui-compressor-for-nautilus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What&#8217;s in my history?</title>
		<link>http://avenger.name/blog/whats-in-my-history/</link>
		<comments>http://avenger.name/blog/whats-in-my-history/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 02:45:22 +0000</pubDate>
		<dc:creator>avenger</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://avenger.name/blog/whats-in-my-history/</guid>
		<description><![CDATA[在 一宁的 blog 上看到这么好玩的命令： $history&#124;awk '{a[$2]++} END{for(i in a){printf &#34;%5d\t%s\n&#34;,a[i],i}}'&#124;sort -rn&#124;head 82 ls 64 cd 44 sudo 42 vim 37 svn 25 lftp 22 ./test.sh 17 memcached-tool.pl 11 ping 11 gvim 下面是改进版，可以加入百分比统计： $history &#124; awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] &#34; &#34; CMD[a]/count*100 &#34;% &#34; a;}' &#124; grep -v &#34;./&#34; &#124; column -c3 [...]]]></description>
			<content:encoded><![CDATA[<p class='fp'>在 <a href="http://www.yining.org/2008/04/13/whats-in-my-history/">一宁的 blog</a> 上看到这么好玩的命令：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">$history</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{a[$2]++} END{for(i in a){printf &quot;%5d\t%s\n&quot;,a[i],i}}'</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">sort</span> -rn<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">head</span></pre></div></div>

<blockquote><p>82   ls<br />
64   cd<br />
44   sudo<br />
42   vim<br />
37   svn<br />
25   lftp<br />
22   ./test.sh<br />
17   memcached-tool.pl<br />
11   ping<br />
11   gvim
</p></blockquote>
<p>下面是改进版，可以加入百分比统计：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">$history</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] &quot; &quot; CMD[a]/count*100 &quot;% &quot; a;}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">&quot;./&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> column <span style="color: #660033;">-c3</span> <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #660033;">-t</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-nr</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">nl</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-n10</span></pre></div></div>

<blockquote><p>
1  82  16.4%  ls<br />
2  64  12.8%  cd<br />
3  44  8.8%   sudo<br />
4  42  8.4%   vim<br />
5  37  7.4%   svn<br />
6  25  5%     lftp<br />
7  17  3.4%   memcached-tool.pl<br />
8  11  2.2%   ping<br />
9  11  2.2%   gvim<br />
10  10  2%     exit
</p></blockquote>
<p>是不是很有意思，快点回复让我看看你的吧。:)</p>
</p><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>November 22, 2008 -- <a href="http://avenger.name/blog/ubuntu-810-intrepid-vpn/" title="在 Ubuntu 8.10 (Intrepid) 中使用 vpn">在 Ubuntu 8.10 (Intrepid) 中使用 vpn</a></li><li>October 30, 2008 -- <a href="http://avenger.name/blog/yui-compressor-for-nautilus/" title="YUI Compressor for nautilus">YUI Compressor for nautilus</a></li><li>April 1, 2008 -- <a href="http://avenger.name/blog/my_firefox_ext/" title="我目前使用的 Firefox 插件">我目前使用的 Firefox 插件</a></li><li>November 10, 2007 -- <a href="http://avenger.name/blog/ubuntu-gutsy-google-earth/" title="Ubuntu Gutsy 下 Google Earth 不能运行的解决办法">Ubuntu Gutsy 下 Google Earth 不能运行的解决办法</a></li><li>May 21, 2007 -- <a href="http://avenger.name/blog/time-to-update-to-ubuntu-704/" title="Time to Update to Ubuntu 7.04">Time to Update to Ubuntu 7.04</a></li><li>July 3, 2008 -- <a href="http://avenger.name/about/" title="About">About</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://avenger.name/blog/whats-in-my-history/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>我目前使用的 Firefox 插件</title>
		<link>http://avenger.name/blog/my_firefox_ext/</link>
		<comments>http://avenger.name/blog/my_firefox_ext/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 01:02:48 +0000</pubDate>
		<dc:creator>avenger</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://avenger.name/blog/%e6%88%91%e7%9b%ae%e5%89%8d%e4%bd%bf%e7%94%a8%e7%9a%84-firefox-%e6%8f%92%e4%bb%b6/</guid>
		<description><![CDATA[以下列表使用 FEBE 生成： 1. AdblockPlus{0.7.5.3}：广告过滤 2. DownThemAll{1.0}：多线程下载工具 3. FEBE：定时备份插件及使用偏好，这个列表就是它生成的 4. FEBE{5.3.1}：同上 5. Firebug{1.05}：强大的客户端调试工具 6. FoxyProxy{2.7.1}：自动代理切换，“翻墙”用 7. FreeAccessPlus{1.0.5}：访问被屏弊的 Flickr 用，现在好像没啥用 8. HideMenubar{1.0.20080310}：可以把多余的菜单栏隐藏起来 9. MozillaArchiveFormat{0.6.3}：查看和保存为微软的mht格式 10. Paragrasp{1.43}：辅助阅读 11. RememberTheMilkforGmail{1.0.1}：一个GTD工具，For Gmail 的插件 12. Screengrab{0.93}：Linux下用来截网页的软件 13. SearchStatus{1.21}：查看Alexa排名和PageRank 14. SessionManager{0.6.1.13}：会话管理，可以把当前打开的标签保存成一个会话 15. Stop-or-ReloadButton{0.2.2}：把重载按钮和停止按钮整合在一起 16. SuperDragAndGo{0.2.6}：用来拖动链接在后台打开 17. TWSStopper{0.1.1}：时间管理，让你在工作时间可以安心做事，推荐~ 18. TabMixLiteCE{2.0.1}：增强标签功能 19. UserAgentSwitcher{0.6.11}：浏览器的 Agent 模拟和切换 20. WebDeveloper{1.1.5}：辅助WEB开发的工具集 21. YSlow{0.9.4}：Yahoo基于FireBug的页面分析器 22. ZendStudioToolbar{2.0.2}：这个不是我装的~~ 23. del.icio.usBookmarks{1.5.44}：用Delicious来代替你的书签菜单 [...]]]></description>
			<content:encoded><![CDATA[<p class='fp'>以下列表使用 <a href="http://customsoftwareconsult.com/extensions">FEBE</a> 生成：<br />
<br clear="all" /></p>
<hr size="1" /> <br clear="all" /><br />
1. AdblockPlus{0.7.5.3}：广告过滤<br />
2. DownThemAll{1.0}：多线程下载工具<br />
3. FEBE：定时备份插件及使用偏好，这个列表就是它生成的<br />
4. FEBE{5.3.1}：同上<br />
5. Firebug{1.05}：强大的客户端调试工具<br />
6. FoxyProxy{2.7.1}：自动代理切换，“翻墙”用<br />
7. FreeAccessPlus{1.0.5}：访问被屏弊的 Flickr 用，现在好像没啥用<br />
8. HideMenubar{1.0.20080310}：可以把多余的菜单栏隐藏起来<br />
9. MozillaArchiveFormat{0.6.3}：查看和保存为微软的mht格式<br />
10. Paragrasp{1.43}：辅助阅读<br />
11. RememberTheMilkforGmail{1.0.1}：一个GTD工具，For Gmail 的插件<br />
12. Screengrab{0.93}：Linux下用来截网页的软件<br />
13. SearchStatus{1.21}：查看Alexa排名和PageRank<br />
14. SessionManager{0.6.1.13}：会话管理，可以把当前打开的标签保存成一个会话<br />
15. Stop-or-ReloadButton{0.2.2}：把重载按钮和停止按钮整合在一起<br />
16. SuperDragAndGo{0.2.6}：用来拖动链接在后台打开<br />
17. TWSStopper{0.1.1}：时间管理，让你在工作时间可以安心做事，推荐~<br />
18. TabMixLiteCE{2.0.1}：增强标签功能<br />
19. UserAgentSwitcher{0.6.11}：浏览器的 Agent 模拟和切换<br />
20. WebDeveloper{1.1.5}：辅助WEB开发的工具集<br />
21. YSlow{0.9.4}：Yahoo基于FireBug的页面分析器<br />
22. ZendStudioToolbar{2.0.2}：这个不是我装的~~<br />
23. del.icio.usBookmarks{1.5.44}：用Delicious来代替你的书签菜单</p>
<p>用户代理： Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.8.1.13) Gecko/20080325 Ubuntu/7.10 (gutsy) Firefox/2.0.0.13</p>
<p>这篇算凑数……</p>
</p><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>November 22, 2008 -- <a href="http://avenger.name/blog/ubuntu-810-intrepid-vpn/" title="在 Ubuntu 8.10 (Intrepid) 中使用 vpn">在 Ubuntu 8.10 (Intrepid) 中使用 vpn</a></li><li>October 30, 2008 -- <a href="http://avenger.name/blog/yui-compressor-for-nautilus/" title="YUI Compressor for nautilus">YUI Compressor for nautilus</a></li><li>April 14, 2008 -- <a href="http://avenger.name/blog/whats-in-my-history/" title="What&#8217;s in my history?">What&#8217;s in my history?</a></li><li>November 10, 2007 -- <a href="http://avenger.name/blog/ubuntu-gutsy-google-earth/" title="Ubuntu Gutsy 下 Google Earth 不能运行的解决办法">Ubuntu Gutsy 下 Google Earth 不能运行的解决办法</a></li><li>May 21, 2007 -- <a href="http://avenger.name/blog/time-to-update-to-ubuntu-704/" title="Time to Update to Ubuntu 7.04">Time to Update to Ubuntu 7.04</a></li><li>July 3, 2008 -- <a href="http://avenger.name/about/" title="About">About</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://avenger.name/blog/my_firefox_ext/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gnome 下的 Blogger 工具</title>
		<link>http://avenger.name/blog/gnome-blogger-tools/</link>
		<comments>http://avenger.name/blog/gnome-blogger-tools/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 18:30:36 +0000</pubDate>
		<dc:creator>avenger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://avenger.name/blog/gnome-%e4%b8%8b%e7%9a%84-blogger-%e5%b7%a5%e5%85%b7/</guid>
		<description><![CDATA[偶在 译言 网站上看到一篇“Linux中5个优秀的博客工具”的文章。之前写 blog 一直都是登录到 wordpress 的后台发布，自己虽然算不上一名职业 blogger，不过绝对算得上一个职业懒虫，这种可以偷懒的工具，绝对不能错过。 文章上介绍了五个工具，除去一个 KDE 下的和一个 FF 的插件(还是要打开浏览器嘛)，其它三个在 ubuntu 下都是可以用的。于是，马上全部试用了一下，没办法，要怪就怪 ubuntu 下安装软件太方便了~ QTM http://qtm.blogistan.co.uk/ 基于 qt4 开发的，界面上就打了个折扣，如果你也看的不爽，可以再下载一个 qtconfig 来调整。功能是三个工具中最全的，不过作者好像只顾着增加功能，实际用起来并不是很容易上手。 优点：功能最齐全、草稿、trackback、tag都能支持 缺点：易用性不够，不能编译之前的条目 GNOME Blog http://www.gnome.org/~seth/gnome-blog/ 这个其实就是一个对话框，打开后就是一个发布界面，写上标题和内容，点发布就是了，没有其它功能。我想应该比较适用于那些爱唠叨的 blogger 们。呵呵。 优点：功能单一 缺点：功能单一 Drivel Journal Editor http://www.dropline.net/drivel/ 第一感觉很好，界面做的不错。没有 tag 和 trackback 的功能，让其可用性打了点折扣。不过有一些比较贴心的功能，比如编辑之前的条目，HTML 高亮(我尤其喜欢这个)等。 优点：界面友好，细节功能贴心 缺点：发布和更新时稍有延迟 实际用一了遍后，还没有让我完全满意的，不过，权衡了 QTM 和 DJE，最后我还是留下了 DJE。看起来一个好的用户界面甚至比功能还要重要，在竞争中的确是能占到不少便宜啊。希望 DJE 的后续版本中可以加入 trackback 和 [...]]]></description>
			<content:encoded><![CDATA[<p class='fp'>偶在 <a href="http://www.yeeyan.com/">译言</a> 网站上看到一篇“<a href="http://www.yeeyan.com/articles/view/chloerei/2975">Linux中5个优秀的博客工具</a>”的文章。之前写 blog 一直都是登录到 wordpress 的后台发布，自己虽然算不上一名职业 blogger，不过绝对算得上一个职业懒虫，这种可以偷懒的工具，绝对不能错过。 <img src='http://avenger.name/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>文章上介绍了五个工具，除去一个 KDE 下的和一个 FF 的插件(还是要打开浏览器嘛)，其它三个在 ubuntu 下都是可以用的。于是，马上全部试用了一下，没办法，要怪就怪 ubuntu 下安装软件太方便了~</p>
<p><strong>QTM</strong><br />
<a href="http://qtm.blogistan.co.uk/"> http://qtm.blogistan.co.uk/</a><br />
<img src="http://lh6.google.com/ChloeRei/RzB-kthHiCI/AAAAAAAAAoA/b_qY0of8WPU/s288/qtm-with-qt4rc1.png" /><br />
基于 qt4 开发的，界面上就打了个折扣，如果你也看的不爽，可以再下载一个 qtconfig 来调整。功能是三个工具中最全的，不过作者好像只顾着增加功能，实际用起来并不是很容易上手。</p>
<p>优点：功能最齐全、草稿、trackback、tag都能支持<br />
缺点：易用性不够，不能编译之前的条目</p>
<p><strong>GNOME Blog</strong><br />
<a href="http://www.gnome.org/~seth/gnome-blog/"> http://www.gnome.org/~seth/gnome-blog/</a><br />
<img src="http://lh6.google.com/ChloeRei/RzB-kthHiAI/AAAAAAAAAnw/ja5CaPhxEiE/s288/gnomeblog_detail.png" /><br />
这个其实就是一个对话框，打开后就是一个发布界面，写上标题和内容，点发布就是了，没有其它功能。我想应该比较适用于那些爱唠叨的 blogger 们。呵呵。</p>
<p>优点：功能单一<br />
缺点：功能单一</p>
<p><strong>Drivel Journal Editor</strong><br />
<a href="http://www.dropline.net/drivel/"> http://www.dropline.net/drivel/</a><br />
<img src="http://lh5.google.com/ChloeRei/RzB-kdhHh_I/AAAAAAAAAno/A0TqAooa6k0/s288/drivel.png" /><br />
第一感觉很好，界面做的不错。没有 tag 和 trackback 的功能，让其可用性打了点折扣。不过有一些比较贴心的功能，比如编辑之前的条目，HTML 高亮(我尤其喜欢这个)等。</p>
<p>优点：界面友好，细节功能贴心<br />
缺点：发布和更新时稍有延迟</p>
<p>实际用一了遍后，还没有让我完全满意的，不过，权衡了 QTM 和 DJE，最后我还是留下了 DJE。看起来一个好的用户界面甚至比功能还要重要，在竞争中的确是能占到不少便宜啊。希望 DJE 的后续版本中可以加入 trackback 和 tag 的支持，就差不多完美了。</p>
<p>另外，说到用户界面，顺便联想到刚开始内测的 <a href="http://hainei.com/">海内</a>，UI 真是没得说，起码我看起来比 facebook 还顺眼，功能上也都比较单一，不过针对性比较强，相对再来看看功能上日益臃肿的 <a href="http://www.wealink.com/">若邻</a>，我更看好海内，这个扯远了……</p>
</p><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>November 22, 2008 -- <a href="http://avenger.name/blog/ubuntu-810-intrepid-vpn/" title="在 Ubuntu 8.10 (Intrepid) 中使用 vpn">在 Ubuntu 8.10 (Intrepid) 中使用 vpn</a></li><li>October 30, 2008 -- <a href="http://avenger.name/blog/yui-compressor-for-nautilus/" title="YUI Compressor for nautilus">YUI Compressor for nautilus</a></li><li>July 3, 2008 -- <a href="http://avenger.name/about/" title="About">About</a></li><li>April 14, 2008 -- <a href="http://avenger.name/blog/whats-in-my-history/" title="What&#8217;s in my history?">What&#8217;s in my history?</a></li><li>April 1, 2008 -- <a href="http://avenger.name/blog/my_firefox_ext/" title="我目前使用的 Firefox 插件">我目前使用的 Firefox 插件</a></li><li>November 10, 2007 -- <a href="http://avenger.name/blog/ubuntu-gutsy-google-earth/" title="Ubuntu Gutsy 下 Google Earth 不能运行的解决办法">Ubuntu Gutsy 下 Google Earth 不能运行的解决办法</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://avenger.name/blog/gnome-blogger-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Gutsy 下 Google Earth 不能运行的解决办法</title>
		<link>http://avenger.name/blog/ubuntu-gutsy-google-earth/</link>
		<comments>http://avenger.name/blog/ubuntu-gutsy-google-earth/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 13:48:17 +0000</pubDate>
		<dc:creator>avenger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ati]]></category>
		<category><![CDATA[google earth]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://avenger.name/blog/ubuntu-gutsy-%e4%b8%8b-google-earth-%e4%b8%8d%e8%83%bd%e8%bf%90%e8%a1%8c%e7%9a%84%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95/</guid>
		<description><![CDATA[Ubuntu Gutsy 下默认是开启了 Compiz 桌面效果的，在我的 T60 上安装 Google Earth 的过程中碰到点麻烦，记录如下： 1.从 http://earth.google.com/download-earth.html 下载到一个后缀为 bin 的安装包，chmod +x 后执行； 2.安装过程很顺利，装完后会在程序组和桌面上建立快捷方式； 3.第一次运行的时候，发现停留在启动画面，没了反应； 4.切换到终端下，运行 googleearth，发现出现以下错误信息：&#8221;Xlib: extension &#8220;XFree86-DRI&#8221; missing on display &#8220;:1.0&#8243;. &#8220;； 5. 猜想可能是显卡驱动的问题，google了一下，发现有人提到先运行 DISPLAY=:0 再运行 googleearth 的方式，试了一下，是可以通过启动画面了，不过启动好的窗口，没有标题栏，也不能最大化最小化，除非把窗口退出，也没办法操作其它窗口； 6.在 ubuntu 中文论坛上寻找了好久，也没找到解决办法。最终在国外一个邮件列表中看到有人提到这种情况，罪魁祸首原来还是 T60 的 ati 显卡，新版的 ati 驱动有一点小问题，导致刚才的情况发生； 7.解决办法：把 libGL.tar.gz 中的两个文件 cp 到你的 google earth 安装目录下(我的在 /opt/google-earth)，重新启动你的 X 即可。 附效果截图和 [...]]]></description>
			<content:encoded><![CDATA[<p class='fp'>Ubuntu Gutsy 下默认是开启了 Compiz 桌面效果的，在我的 T60 上安装 Google Earth 的过程中碰到点麻烦，记录如下：</p>
<p>1.从 http://earth.google.com/download-earth.html 下载到一个后缀为 bin 的安装包，chmod +x 后执行；</p>
<p>2.安装过程很顺利，装完后会在程序组和桌面上建立快捷方式；</p>
<p>3.第一次运行的时候，发现停留在启动画面，没了反应；</p>
<p>4.切换到终端下，运行 googleearth，发现出现以下错误信息：&#8221;<span class="postbody">Xlib:  extension &#8220;XFree86-DRI&#8221; missing on display &#8220;:1.0&#8243;. </span>&#8220;；</p>
<p>5. 猜想可能是显卡驱动的问题，google了一下，发现有人提到先运行 DISPLAY=:0 再运行 googleearth 的方式，试了一下，是可以通过启动画面了，不过启动好的窗口，没有标题栏，也不能最大化最小化，除非把窗口退出，也没办法操作其它窗口；</p>
<p>6.在 ubuntu 中文论坛上寻找了好久，也没找到解决办法。最终在国外一个邮件列表中看到有人提到这种情况，罪魁祸首原来还是 T60 的 ati 显卡，新版的 ati 驱动有一点小问题，导致刚才的情况发生；</p>
<p>7.解决办法：把 libGL.tar.gz 中的两个文件 cp 到你的 google earth 安装目录下(我的在 /opt/google-earth)，重新启动你的 X 即可。</p>
<p>附效果截图和 <a href="http://avenger.name/wp-content/uploads/2007/11/libgltar.gz" title="libGL.tar.gz">libGL.tar.gz</a> 包本地下载。</p>
<p><a href="http://avenger.name/wp-content/uploads/2007/11/screenshot.png"><img src="http://avenger.name/wp-content/uploads/2007/11/screenshot.thumbnail.png" /></a></p>
</p><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>November 22, 2008 -- <a href="http://avenger.name/blog/ubuntu-810-intrepid-vpn/" title="在 Ubuntu 8.10 (Intrepid) 中使用 vpn">在 Ubuntu 8.10 (Intrepid) 中使用 vpn</a></li><li>October 30, 2008 -- <a href="http://avenger.name/blog/yui-compressor-for-nautilus/" title="YUI Compressor for nautilus">YUI Compressor for nautilus</a></li><li>April 14, 2008 -- <a href="http://avenger.name/blog/whats-in-my-history/" title="What&#8217;s in my history?">What&#8217;s in my history?</a></li><li>April 1, 2008 -- <a href="http://avenger.name/blog/my_firefox_ext/" title="我目前使用的 Firefox 插件">我目前使用的 Firefox 插件</a></li><li>May 21, 2007 -- <a href="http://avenger.name/blog/time-to-update-to-ubuntu-704/" title="Time to Update to Ubuntu 7.04">Time to Update to Ubuntu 7.04</a></li><li>July 3, 2008 -- <a href="http://avenger.name/about/" title="About">About</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://avenger.name/blog/ubuntu-gutsy-google-earth/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>StatSVN 自动运行脚本的问题</title>
		<link>http://avenger.name/blog/statsvn_shell/</link>
		<comments>http://avenger.name/blog/statsvn_shell/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 01:33:30 +0000</pubDate>
		<dc:creator>avenger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[svnstat]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://avenger.name/blog/statsvn-%e8%87%aa%e5%8a%a8%e8%bf%90%e8%a1%8c%e8%84%9a%e6%9c%ac/</guid>
		<description><![CDATA[公司的版本库由 CVS 转到了 SVN，转的过程就不说了，Google 上一搜一把。 为了实时看到 SVN 版本库的状态，在网上找了一个很好用的工具叫 StatSVN，会把当前 SVN 库的状态用数据和图表的方式展现出来，可以按开发者、目录、commit log 分别展示，很是强大。 在计划写个脚本每天凌晨自动生成前一年的报表的时候，碰到一些麻烦。刚开始的脚本是这样的： #!/bin/bash &#40;/usr/bin/svn update /root/SVN&#41; &#40;/usr/bin/svn log /root/SVN --xml -v &#38;gt; /root/SVN/svn.log&#41; &#40;/usr/local/jdk/jre/bin/java -jar /root/statsvn-0.3.1/statsvn.jar /root/SVN/svn.log /root/SVN/ -out put-dir /usr/local/apache2/htdocs/SVN/svnstat/ -title CNFOL -threads 50 -mantis http://xxx.com/bugs / -no-developer admin -include **/*.php:**/*.java:**/*.html:**/*.htm:**/*.js:**/*.css:**/* .shtml:**/*.xml:**/*.sql:**/*.jsp:**/*.do:**/*.cfg&#41; &#40;/bin/rm -f /root/SVN/svn.log&#41; 第二天发现脚本没有自动运行，再尝试着把所有和 PATH 有关的环境变量都加进去，还是不行。后来在 winger 的协助下，通过记录日志的方式，把脚本的错误输出都记录了下来，发现出错的脚本在 /usr/local/jdk/jre/bin/java -jar [...]]]></description>
			<content:encoded><![CDATA[<p class='fp'>公司的版本库由 CVS 转到了 <a href="http://www.google.com/url?sa=t&amp;ct=res&amp;cd=2&amp;url=http%3A%2F%2Fsubversion.tigris.org%2F&amp;ei=uvIfR9uzCJyYswL3yI37Cw&amp;usg=AFQjCNECDGdYIfVJA74uPGr3-JKbCKXFWQ&amp;sig2=aziEbcAPIrsXy99jxhtS4A">SVN</a>，转的过程就不说了，Google 上一搜一把。<br />
为了实时看到 SVN 版本库的状态，在网上找了一个很好用的工具叫 <a href="http://www.statsvn.org/">StatSVN</a>，会把当前 SVN 库的状态用数据和图表的方式展现出来，可以按开发者、目录、commit log 分别展示，很是强大。</p>
<p>在计划写个脚本每天凌晨自动生成前一年的报表的时候，碰到一些麻烦。刚开始的脚本是这样的：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> update <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>SVN<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> log <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>SVN <span style="color: #660033;">--xml</span> <span style="color: #660033;">-v</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>SVN<span style="color: #000000; font-weight: bold;">/</span>svn.log<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>jdk<span style="color: #000000; font-weight: bold;">/</span>jre<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>java <span style="color: #660033;">-jar</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>statsvn-0.3.1<span style="color: #000000; font-weight: bold;">/</span>statsvn.jar <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>SVN<span style="color: #000000; font-weight: bold;">/</span>svn.log <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>SVN<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-out</span>
put-dir <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>SVN<span style="color: #000000; font-weight: bold;">/</span>svnstat<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-title</span> CNFOL <span style="color: #660033;">-threads</span> <span style="color: #000000;">50</span> <span style="color: #660033;">-mantis</span> http:<span style="color: #000000; font-weight: bold;">//</span>xxx.com<span style="color: #000000; font-weight: bold;">/</span>bugs
<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-no-developer</span> admin <span style="color: #660033;">-include</span> <span style="color: #000000; font-weight: bold;">**/*</span>.php:<span style="color: #000000; font-weight: bold;">**/*</span>.java:<span style="color: #000000; font-weight: bold;">**/*</span>.html:<span style="color: #000000; font-weight: bold;">**/*</span>.htm:<span style="color: #000000; font-weight: bold;">**/*</span>.js:<span style="color: #000000; font-weight: bold;">**/*</span>.css:<span style="color: #000000; font-weight: bold;">**/*</span>
.shtml:<span style="color: #000000; font-weight: bold;">**/*</span>.xml:<span style="color: #000000; font-weight: bold;">**/*</span>.sql:<span style="color: #000000; font-weight: bold;">**/*</span>.jsp:<span style="color: #000000; font-weight: bold;">**/*</span>.do:<span style="color: #000000; font-weight: bold;">**/*</span>.cfg<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>SVN<span style="color: #000000; font-weight: bold;">/</span>svn.log<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>第二天发现脚本没有自动运行，再尝试着把所有和 PATH 有关的环境变量都加进去，还是不行。后来在 <a href="http://blog.sina.com.cn/youngman">winger</a> 的协助下，通过记录日志的方式，把脚本的错误输出都记录了下来，发现出错的脚本在 /usr/local/jdk/jre/bin/java -jar /root/statsvn-0.3.1/statsvn.jar 这行，错误信息如下：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Parsing SVN log <span style="color: #ff0000;">'/root/SVN/svn.log'</span> exclude pattern <span style="color: #ff0000;">''</span>
Logfile parsing failed.
<span style="color: #c20cb9; font-weight: bold;">svn</span> log: <span style="color: #c20cb9; font-weight: bold;">svn</span> info: XML document structures must start and end within the same entity.</pre></div></div>

<p>奇怪的是，在控制台下手工运行都没问题，放到脚本里面就报错。看起来还是环境变量有问题，最终还是 winger 帮忙发现了问题，只要在脚本的头部加入</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LANG</span>=en_US.UTF-<span style="color: #000000;">8</span></pre></div></div>

<p>就一切正常了。</p>
</p><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>October 30, 2008 -- <a href="http://avenger.name/blog/yui-compressor-for-nautilus/" title="YUI Compressor for nautilus">YUI Compressor for nautilus</a></li><li>November 22, 2008 -- <a href="http://avenger.name/blog/ubuntu-810-intrepid-vpn/" title="在 Ubuntu 8.10 (Intrepid) 中使用 vpn">在 Ubuntu 8.10 (Intrepid) 中使用 vpn</a></li><li>April 14, 2008 -- <a href="http://avenger.name/blog/whats-in-my-history/" title="What&#8217;s in my history?">What&#8217;s in my history?</a></li><li>April 1, 2008 -- <a href="http://avenger.name/blog/my_firefox_ext/" title="我目前使用的 Firefox 插件">我目前使用的 Firefox 插件</a></li><li>November 10, 2007 -- <a href="http://avenger.name/blog/ubuntu-gutsy-google-earth/" title="Ubuntu Gutsy 下 Google Earth 不能运行的解决办法">Ubuntu Gutsy 下 Google Earth 不能运行的解决办法</a></li><li>September 27, 2007 -- <a href="http://avenger.name/blog/memcache-namespace/" title="Memcache 中模拟 namespace">Memcache 中模拟 namespace</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://avenger.name/blog/statsvn_shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memcache 中模拟 namespace</title>
		<link>http://avenger.name/blog/memcache-namespace/</link>
		<comments>http://avenger.name/blog/memcache-namespace/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 10:10:54 +0000</pubDate>
		<dc:creator>avenger</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://avenger.name/?p=200</guid>
		<description><![CDATA[最近在用 memcache，不可否认，memcache 在实际应用中的表现非常出色。不过也许正是因为其对速度和性能的要求过于严格，导致 memcache 的可操作性不是那么强。PHP 在使用的时候，也只能有限的使用 add、delete、replace、flush 等几个简单的方法。 memcache 官方是不建议我们手动去删除缓冲内容的， 因为官方的 api 中有关删除的方法只有 delete 和flush，前者是在知道 key 的情况下删除一个对象的值，后面是清除服务器上所有对象。 不过很多情况下，我们需要从服务器上删除一部分对象，又不希望把整个服务器上的对象都清空，官方的 FAQ 上提供了一个“伪命名空间(Simulating Namespaces)” 的作法。 示例代码如下： 1 2 3 4 5 6 7 8 //生成一个用来保存 namespace 的 key $ns_key = $memcache-&#38;gt;get&#40;&#34;foo_namespace_key&#34;&#41;; //如果 key 不存在，则创建 if&#40;$ns_key===false&#41; $memcache-&#38;gt;set&#40;&#34;foo_namespace_key&#34;, rand&#40;1, 10000&#41;&#41;; //根据 namespace_key 生成真正的 key $my_key = &#34;foo_&#34;.$ns_key.&#34;_12345&#34;; //需要删除整个 namespace 里的对象的时候，这样处理即可： [...]]]></description>
			<content:encoded><![CDATA[<p class='fp'>最近在用 <a href="http://www.danga.com/memcached/">memcache</a>，不可否认，memcache 在实际应用中的表现非常出色。不过也许正是因为其对速度和性能的要求过于严格，导致 memcache 的可操作性不是那么强。PHP 在使用的时候，也只能有限的使用 add、delete、replace、flush 等几个简单的方法。</p>
<p>memcache 官方是不建议我们手动去删除缓冲内容的， 因为官方的 api 中有关删除的方法只有 delete 和flush，前者是在知道 key 的情况下删除一个对象的值，后面是清除服务器上所有对象。</p>
<p>不过很多情况下，我们需要从服务器上删除一部分对象，又不希望把整个服务器上的对象都清空，官方的 FAQ 上提供了一个“伪命名空间(<a href="http://www.socialtext.net/memcached/index.cgi?faq#deleting_by_namespace">Simulating Namespaces</a>)” 的作法。</p>
<p>示例代码如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//生成一个用来保存 namespace 的 key</span>
<span style="color: #000088;">$ns_key</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;foo_namespace_key&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//如果 key 不存在，则创建</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ns_key</span><span style="color: #339933;">===</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>set<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;foo_namespace_key&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10000</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//根据 namespace_key 生成真正的 key</span>
<span style="color: #000088;">$my_key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;foo_&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$ns_key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;_12345&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//需要删除整个 namespace 里的对象的时候，这样处理即可：</span>
<span style="color: #000088;">$memcache</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>increment<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;foo_namespace_key&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</p><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>August 4, 2009 -- <a href="http://avenger.name/blog/how-php5-use-dotnet-soap/" title="PHP5 调用 dot NET Soap WebService 的技巧">PHP5 调用 dot NET Soap WebService 的技巧</a></li><li>November 22, 2008 -- <a href="http://avenger.name/blog/ubuntu-810-intrepid-vpn/" title="在 Ubuntu 8.10 (Intrepid) 中使用 vpn">在 Ubuntu 8.10 (Intrepid) 中使用 vpn</a></li><li>October 30, 2008 -- <a href="http://avenger.name/blog/yui-compressor-for-nautilus/" title="YUI Compressor for nautilus">YUI Compressor for nautilus</a></li><li>July 19, 2008 -- <a href="http://avenger.name/blog/first-facebook-app/" title="我的第一个 facebook app">我的第一个 facebook app</a></li><li>July 3, 2008 -- <a href="http://avenger.name/about/" title="About">About</a></li><li>April 14, 2008 -- <a href="http://avenger.name/blog/whats-in-my-history/" title="What&#8217;s in my history?">What&#8217;s in my history?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://avenger.name/blog/memcache-namespace/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Time to Update to Ubuntu 7.04</title>
		<link>http://avenger.name/blog/time-to-update-to-ubuntu-704/</link>
		<comments>http://avenger.name/blog/time-to-update-to-ubuntu-704/#comments</comments>
		<pubDate>Mon, 21 May 2007 04:03:30 +0000</pubDate>
		<dc:creator>avenger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CD]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://avenger.name/?p=187</guid>
		<description><![CDATA[ubuntu 的速度还是挺快的，上次寄过来的 6 张光盘还没来得及拍照就被同事和朋友们瓜分了，这次申请了 10 张，没想到速度还是这么快…… 福州有需要的朋友可以联系我。：） Related PostsNovember 22, 2008 -- 在 Ubuntu 8.10 (Intrepid) 中使用 vpnOctober 30, 2008 -- YUI Compressor for nautilusApril 14, 2008 -- What&#8217;s in my history?April 1, 2008 -- 我目前使用的 Firefox 插件November 10, 2007 -- Ubuntu Gutsy 下 Google Earth 不能运行的解决办法July 3, 2008 -- About]]></description>
			<content:encoded><![CDATA[<p class='fp'>ubuntu 的速度还是挺快的，上次寄过来的 6 张光盘还没来得及拍照就被同事和朋友们瓜分了，这次申请了 10 张，没想到速度还是这么快……</p>
<p>福州有需要的朋友可以联系我。：）</p>
<p><a href='http://avenger.name/?attachment_id=186' rel='attachment wp-att-186' title='dscf6289.jpg'><img src='http://avenger.name/wp-content/uploads/2007/05/dscf6289.thumbnail.jpg' alt='dscf6289.jpg' /></a></p>
</p><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>November 22, 2008 -- <a href="http://avenger.name/blog/ubuntu-810-intrepid-vpn/" title="在 Ubuntu 8.10 (Intrepid) 中使用 vpn">在 Ubuntu 8.10 (Intrepid) 中使用 vpn</a></li><li>October 30, 2008 -- <a href="http://avenger.name/blog/yui-compressor-for-nautilus/" title="YUI Compressor for nautilus">YUI Compressor for nautilus</a></li><li>April 14, 2008 -- <a href="http://avenger.name/blog/whats-in-my-history/" title="What&#8217;s in my history?">What&#8217;s in my history?</a></li><li>April 1, 2008 -- <a href="http://avenger.name/blog/my_firefox_ext/" title="我目前使用的 Firefox 插件">我目前使用的 Firefox 插件</a></li><li>November 10, 2007 -- <a href="http://avenger.name/blog/ubuntu-gutsy-google-earth/" title="Ubuntu Gutsy 下 Google Earth 不能运行的解决办法">Ubuntu Gutsy 下 Google Earth 不能运行的解决办法</a></li><li>July 3, 2008 -- <a href="http://avenger.name/about/" title="About">About</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://avenger.name/blog/time-to-update-to-ubuntu-704/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Crontab @reboot</title>
		<link>http://avenger.name/blog/crontab-reboot/</link>
		<comments>http://avenger.name/blog/crontab-reboot/#comments</comments>
		<pubDate>Mon, 27 Oct 2003 18:34:07 +0000</pubDate>
		<dc:creator>avenger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[crontab]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[在任务计划 (crontab) 中,@reboot 这个简单却有效的单词可以让你的程序在系统每次启动的时候自动运行。很方便，不是吗？ 这个被称为 &#8220;Vixie cron&#8221;(Vixie cron is named after Paul Vixie, the creator of BIND and other Unix goodness.) 下面是一个 Vixie cron 的列表: Instead of the first five fields, one of eight special strings may appear: string &#160;&#160; meaning &#8212;&#8212; &#160;&#160; &#8212;&#8212;- @reboot&#160;&#160; Run once, at startup. @yearly&#160;&#160; Run once a year, &#8220;0 [...]]]></description>
			<content:encoded><![CDATA[<p class='fp'>在任务计划 (crontab) 中,@reboot 这个简单却有效的单词可以让你的程序在系统每次启动的时候自动运行。很方便，不是吗？</p>
<p>这个被称为 &#8220;Vixie cron&#8221;(Vixie cron is named after Paul Vixie, the creator of BIND and other Unix goodness.)</p>
<p>下面是一个 Vixie cron 的列表:</p>
<div class="code">Instead of the first five fields, one of eight special strings may appear:</p>
<p>    string &nbsp;&nbsp;        meaning<br />
    &#8212;&#8212; &nbsp;&nbsp;        &#8212;&#8212;-<br />
    @reboot&nbsp;&nbsp;        Run once, at startup.<br />
    @yearly&nbsp;&nbsp;        Run once a year, &#8220;0 0 1 1 *&#8221;.<br />
    @annually &nbsp;&nbsp;     (same as @yearly)<br />
    @monthly  &nbsp;&nbsp;     Run once a month, &#8220;0 0 1 * *&#8221;.<br />
    @weekly &nbsp;&nbsp;       Run once a week, &#8220;0 0 * * 0&#8243;.<br />
    @daily &nbsp;&nbsp;        Run once a day, &#8220;0 0 * * *&#8221;.<br />
    @midnight &nbsp;&nbsp;     (same as @daily)<br />
    @hourly  &nbsp;&nbsp;      Run once an hour, &#8220;0 * * * *&#8221;.
</div>
</p><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>November 22, 2008 -- <a href="http://avenger.name/blog/ubuntu-810-intrepid-vpn/" title="在 Ubuntu 8.10 (Intrepid) 中使用 vpn">在 Ubuntu 8.10 (Intrepid) 中使用 vpn</a></li><li>October 30, 2008 -- <a href="http://avenger.name/blog/yui-compressor-for-nautilus/" title="YUI Compressor for nautilus">YUI Compressor for nautilus</a></li><li>April 14, 2008 -- <a href="http://avenger.name/blog/whats-in-my-history/" title="What&#8217;s in my history?">What&#8217;s in my history?</a></li><li>April 1, 2008 -- <a href="http://avenger.name/blog/my_firefox_ext/" title="我目前使用的 Firefox 插件">我目前使用的 Firefox 插件</a></li><li>November 10, 2007 -- <a href="http://avenger.name/blog/ubuntu-gutsy-google-earth/" title="Ubuntu Gutsy 下 Google Earth 不能运行的解决办法">Ubuntu Gutsy 下 Google Earth 不能运行的解决办法</a></li><li>October 25, 2007 -- <a href="http://avenger.name/blog/statsvn_shell/" title="StatSVN 自动运行脚本的问题">StatSVN 自动运行脚本的问题</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://avenger.name/blog/crontab-reboot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache中ErrorDocument文件的设置问题</title>
		<link>http://avenger.name/blog/apache-errordocument/</link>
		<comments>http://avenger.name/blog/apache-errordocument/#comments</comments>
		<pubDate>Wed, 22 Oct 2003 23:59:26 +0000</pubDate>
		<dc:creator>avenger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[ErrorDocument]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[今天快被这个问题搞死了。 先是在httpd.conf中设置 ErrorDocument 404 /error.php error.php 中的内容是 &#8220;Error Test&#8221;. 结果死活不能用，把上面的错误URL换成一个网址则是好的。 最终在Apache2.0官方手册中找到答案。原来是IE的一个BUG，错误文件需要大于512字节才能正常被显示。估且这么叫吧，真不知道微软的开发人员是如何想的。再晕一次。。 教训： 1.手册是好东西，一定要细心去看。 2.很多情况下应该换个角度去思考问题。在本例中，把IE中的 &#8220;Show Friendly HTTP Error Messages&#8221;打开后，就一切迎刃而解了。 相关资料： 1.Apache2.0手册中关于此项说明的文档 2.Microsoft关于此问题的说明 Related PostsNovember 22, 2008 -- 在 Ubuntu 8.10 (Intrepid) 中使用 vpnOctober 30, 2008 -- YUI Compressor for nautilusApril 14, 2008 -- What&#8217;s in my history?April 1, 2008 -- 我目前使用的 Firefox 插件November 10, 2007 [...]]]></description>
			<content:encoded><![CDATA[<p class='fp'>今天快被这个问题搞死了。<br />
先是在httpd.conf中设置 ErrorDocument 404 /error.php<br />
error.php 中的内容是 &#8220;Error Test&#8221;.<br />
结果死活不能用，把上面的错误URL换成一个网址则是好的。</p>
<p>最终在Apache2.0官方手册中找到答案。原来是IE的一个BUG，错误文件需要大于512字节才能正常被显示。估且这么叫吧，真不知道微软的开发人员是如何想的。再晕一次。。</p>
<p>教训：<br />
1.手册是好东西，一定要细心去看。<br />
2.很多情况下应该换个角度去思考问题。在本例中，把IE中的 &#8220;Show Friendly HTTP Error Messages&#8221;打开后，就一切迎刃而解了。</p>
<p>相关资料：<br />
1.<a href="http://httpd.apache.org/docs-2.0/mod/core.html#errordocument">Apache2.0手册中关于此项说明的文档</a><br />
2.<a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Microsoft关于此问题的说明<br />
</a></p>
</p><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>November 22, 2008 -- <a href="http://avenger.name/blog/ubuntu-810-intrepid-vpn/" title="在 Ubuntu 8.10 (Intrepid) 中使用 vpn">在 Ubuntu 8.10 (Intrepid) 中使用 vpn</a></li><li>October 30, 2008 -- <a href="http://avenger.name/blog/yui-compressor-for-nautilus/" title="YUI Compressor for nautilus">YUI Compressor for nautilus</a></li><li>April 14, 2008 -- <a href="http://avenger.name/blog/whats-in-my-history/" title="What&#8217;s in my history?">What&#8217;s in my history?</a></li><li>April 1, 2008 -- <a href="http://avenger.name/blog/my_firefox_ext/" title="我目前使用的 Firefox 插件">我目前使用的 Firefox 插件</a></li><li>November 10, 2007 -- <a href="http://avenger.name/blog/ubuntu-gutsy-google-earth/" title="Ubuntu Gutsy 下 Google Earth 不能运行的解决办法">Ubuntu Gutsy 下 Google Earth 不能运行的解决办法</a></li><li>October 25, 2007 -- <a href="http://avenger.name/blog/statsvn_shell/" title="StatSVN 自动运行脚本的问题">StatSVN 自动运行脚本的问题</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://avenger.name/blog/apache-errordocument/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
