<?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>Leaf Duo &#187; Linux</title>
	<atom:link href="http://blog.leafduo.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.leafduo.com</link>
	<description>All About My Life and Information Technology</description>
	<lastBuildDate>Sat, 06 Aug 2011 07:34:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Installing Gentoo Linux on DELL R710</title>
		<link>http://blog.leafduo.com/10/installing-gentoo-linux-on-dell-r710/</link>
		<comments>http://blog.leafduo.com/10/installing-gentoo-linux-on-dell-r710/#comments</comments>
		<pubDate>Sun, 29 May 2011 15:42:10 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[DELL]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[RAID]]></category>

		<guid isPermaLink="false">http://blog.leafduo.com/?p=277</guid>
		<description><![CDATA[公司买了一台 R710，第一次自己装服务器上的 Linux，虽说区别不是很大，但是还是很值得纪录一下的哦。 服务器跟 PC 最大的区别大概就是硬件了吧，涉及到驱动的基本上就只有 RAID 控制器了吧？编译内核的时候那个纠结啊……那个启动不起来啊……真是…… 首先是得照着一个指南做，就是这个指南啦，比较适合以前装过 Gentoo 的人看。这个指南是装软件 RAID 和 LVM2，我们做的是硬件 RAID，所以里面软件 RAID 相关的东西就不用安装了，比如 dm-mod 之类的就不用装了。我还是习惯把 /boot 放在 LVM 里面，其实自己有的时候也觉得没啥必要，有点犯贱的意思……如果你也希望把 /boot 放在 LVM 里面，可以参考 Gentoo Wiki 的这篇文章，不过里面的内容略微有点过时了，比如内核参数 dolvm2，现在写成 dolvm 了。一开始安装的时候忘了做 initrd，查了半天才发现，还是不细心啊。 剩下的大概就是编译内核了，先随手把什么声卡驱动什么的去掉，然后重点是 RAID 驱动，一开始天真地以为 RAID 控制器的驱动是 LSI &#8230; <a href="http://blog.leafduo.com/10/installing-gentoo-linux-on-dell-r710/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>公司买了一台 R710，第一次自己装服务器上的 Linux，虽说区别不是很大，但是还是很值得纪录一下的哦。</p>
<p>服务器跟 PC 最大的区别大概就是硬件了吧，涉及到驱动的基本上就只有 RAID 控制器了吧？编译内核的时候那个纠结啊……那个启动不起来啊……真是……</p>
<p>首先是得照着一个指南做，就是<a href="http://www.gentoo.org/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml">这个指南</a>啦，比较适合以前装过 Gentoo 的人看。这个指南是装软件 RAID 和 LVM2，我们做的是硬件 RAID，所以里面软件 RAID 相关的东西就不用安装了，比如 dm-mod 之类的就不用装了。我还是习惯把 /boot 放在 LVM 里面，其实自己有的时候也觉得没啥必要，有点犯贱的意思……如果你也希望把 /boot 放在 LVM 里面，可以参考 Gentoo Wiki 的<a href="http://www.gentoo-wiki.info/HOWTO_Install_Gentoo_on_an_LVM2_root_partition">这篇文章</a>，不过里面的内容略微有点过时了，比如内核参数 dolvm2，现在写成 dolvm 了。一开始安装的时候忘了做 initrd，查了半天才发现，还是不细心啊。</p>
<p>剩下的大概就是编译内核了，先随手把什么声卡驱动什么的去掉，然后重点是 RAID 驱动，一开始天真地以为 RAID 控制器的驱动是 LSI Logic MegaRAID SAS RAID Module 之类的，结果就是直接启动不起来了。后来认真起来，按照 lspci 的结果去网上找内核模块，发现应该是 <a href="http://cateee.net/lkddb/web-lkddb/FUSION.html">CONFIG_FUSION</a> 这个选项，之后就能顺利地启动了。</p>
<p>配置好一些基本的东西之后，还有一些硬件相关的小工具，最重要的还是 RAID 控制器的监控工具，网上找了很多，不过大多数都没法用，<a href="http://hwraid.le-vert.net/wiki/LSIFusionMPT">这一页</a>有两个工具，都比较好用，<a href="http://hwraid.le-vert.net/">HWRaid</a> 这个站似乎也很强大。里面提到的 lsiutil 是 LSI 官方提供的，Gentoo 源里那个似乎年久失修了，LSI 的官网上能够<a href="http://www.lsi.com/DistributionSystem/User/AssetMgr.aspx?asset=51101">找到</a>，不过不是很好找，下载下来是二进制。还有些能改前面板 LCD 的小工具什么的，我觉得没多大用，就算了（想改的话 BIOS 里面就有）。</p>
<p>有点后悔买了一个比较弱的 RAID 控制器，不过一切还要等有了负载再说，哈哈。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/10/installing-gentoo-linux-on-dell-r710/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Get Nagios to Work with Nginx (Gentoo)</title>
		<link>http://blog.leafduo.com/43/get-nagios-to-work-with-nginx/</link>
		<comments>http://blog.leafduo.com/43/get-nagios-to-work-with-nginx/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 18:25:43 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[fcgi]]></category>
		<category><![CDATA[fcgiwrap]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[spawn-fcgi]]></category>

		<guid isPermaLink="false">http://blog.leafduo.com/?p=267</guid>
		<description><![CDATA[今天装 Nagios，开源监控软件。 照例第一步： emerge net-analyzer/nagios 这个包是个 meta 包，里面似乎有一个内核和一些插件，以后再研究，先搭起来再说。 跑起 Nagios： /etc/init.d/nagios start rc-update add nagios default 安装完成之后它会告诉你，要是 Apache 或者 Lighttpd 的话我会给你配好，不是的话自己看着办吧，于是我就自己来了。:-( 首先安装 spawn-fcgi 和 fcgiwrap，第一个是管理 fcgi 进程的，第二个是把 CGI 包装成 fcgi 的。fcgiwrap 这兄弟目前被 ~x86 mask 了，先 unmask。 echo www-misc/fcgiwrap ~x86 &#62;&#62; &#8230; <a href="http://blog.leafduo.com/43/get-nagios-to-work-with-nginx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>今天装 <a href="http://www.nagios.org/">Nagios</a>，开源监控软件。</p>
<p>照例第一步：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">emerge net-analyzer<span style="color: #000000; font-weight: bold;">/</span>nagios</pre></div></div>

<p>这个包是个 meta 包，里面似乎有一个内核和一些插件，以后再研究，先搭起来再说。</p>
<p>跑起 Nagios：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nagios start
rc-update add nagios default</pre></div></div>

<p>安装完成之后它会告诉你，要是 Apache 或者 Lighttpd 的话我会给你配好，不是的话自己看着办吧，于是我就自己来了。:-(</p>
<p>首先安装 spawn-fcgi 和 fcgiwrap，第一个是管理 fcgi 进程的，第二个是把 CGI 包装成 fcgi 的。fcgiwrap 这兄弟目前被 ~x86 mask 了，先 unmask。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> www-misc<span style="color: #000000; font-weight: bold;">/</span>fcgiwrap ~x86 <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>portage<span style="color: #000000; font-weight: bold;">/</span>package.keywords</pre></div></div>

<p>然后安装：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">emerge www-servers<span style="color: #000000; font-weight: bold;">/</span>spawn-fcgi www-misc<span style="color: #000000; font-weight: bold;">/</span>fcgiwrap</pre></div></div>

<p>跑起 spawn-fcgi：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> spawn-fcgi <span style="color: #660033;">-a</span> 127.0.0.1 <span style="color: #660033;">-p</span> <span style="color: #000000;">22222</span> <span style="color: #660033;">-P</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>fcgiwrap.pid <span style="color: #660033;">-u</span> nagios <span style="color: #660033;">-g</span> nagios <span style="color: #660033;">--</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>fcgiwrap</pre></div></div>

<p>-a 是主机，-p 是端口（用 unix domain 也行），-P 是 pid 文件，-u 是用户，-g 是组，-- 后面是要运行的命令，用户名和组一定要对，主机和端口要跟 nginx 对上。这条命令是起 CGI 部分的，Nagios 也用了 PHP，PHP 请通过 fcgi 自行跑起来 <img src='http://blog.leafduo.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ，php-fpm 或者 spawn-fcgi 均可，参考 WordPress 之类就行。</p>
<p>下面是 nginx 的配置，主要是抄的别人的，主体参考<a href="http://yemaosheng.com/?p=899">这里</a>，另外也参考<a href="http://www.matejunkie.com/howto-let-nginx-serve-the-nagios-web-interface/">这里</a>。尤其是<code>fastcgi_param  AUTH_USER          $remote_user; fastcgi_param  REMOTE_USER        $remote_user;</code> 两句，前一篇没有，害惨我了，nagios 一直说认证不通过……</p>
<p>自己发挥改改就好撒。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">location <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        auth_basic <span style="color: #ff0000;">&quot;Restricted&quot;</span>;
        auth_basic_user_file <span style="color: #000000; font-weight: bold;">/</span>PATH<span style="color: #000000; font-weight: bold;">/</span>TO<span style="color: #000000; font-weight: bold;">/</span>HTPASSWD;
&nbsp;
        root <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>htdocs;
&nbsp;
        location ~ \.php$ <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                fastcgi_pass   YOUR_PHP_UPSTREAM;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #007800;">$fastcgi_script_name</span>;
                include fastcgi_params;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
        location <span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                location <span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                        <span style="color: #c20cb9; font-weight: bold;">gzip</span> off;
                <span style="color: #7a0874; font-weight: bold;">&#125;</span>
                expires 30d;
                <span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
        location <span style="color: #000000; font-weight: bold;">/</span>docs<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                root <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>htdocs<span style="color: #000000; font-weight: bold;">/</span>;
                index index.html;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
        location ~ \.cgi <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                fastcgi_pass 127.0.0.1:<span style="color: #000000;">22222</span>;
                fastcgi_index index.cgi;
                fastcgi_param SCRIPT_FILENAME <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #007800;">$fastcgi_script_name</span>;
                include fastcgi_params;
                fastcgi_param  AUTH_USER          <span style="color: #007800;">$remote_user</span>;
                fastcgi_param  REMOTE_USER        <span style="color: #007800;">$remote_user</span>;
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>关于里面提到的 htpasswd，是 <a href="http://en.wikipedia.org/wiki/Basic_access_authentication">basic auth</a> 用的，咋生成看<a href="http://wiki.nginx.org/HttpAuthBasicModule">文档</a>吧。</p>
<p>Restart Nginx &#038; enjoy!</p>
<p>参考：</p>
<ol>
<li><a href="http://yemaosheng.com/?p=899">http://yemaosheng.com/?p=899</a></li>
<li><a href="http://www.matejunkie.com/howto-let-nginx-serve-the-nagios-web-interface/">http://www.matejunkie.com/howto-let-nginx-serve-the-nagios-web-interface/</a></li>
<li><a href="http://wiki.nginx.org/HttpAuthBasicModule">http://wiki.nginx.org/HttpAuthBasicModule</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/43/get-nagios-to-work-with-nginx/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>禁止 ssh 密码登陆</title>
		<link>http://blog.leafduo.com/26/forbid-ssh-login-via-password/</link>
		<comments>http://blog.leafduo.com/26/forbid-ssh-login-via-password/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 13:53:26 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.leafduo.com/?p=266</guid>
		<description><![CDATA[/etc/ssh/sshd_config 里面 PasswordAuthentication no UsePAM no 为啥这样不要问我……去看看 /etc/ssh/sshd_config 里面的注释或者 man sshd 之类的吧，因为我也说不非常清楚，哈哈哈哈。]]></description>
			<content:encoded><![CDATA[<p><code>/etc/ssh/sshd_config</code> 里面</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">PasswordAuthentication no
UsePAM no</pre></div></div>

<p>为啥这样不要问我……去看看 <code>/etc/ssh/sshd_config</code> 里面的注释或者 <code>man sshd</code> 之类的吧，因为我也说不非常清楚，哈哈哈哈。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/26/forbid-ssh-login-via-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决 WordPress 自动升级中遇到的一个验证问题</title>
		<link>http://blog.leafduo.com/05/solution-to-wordpress-auto-update-auth-problem/</link>
		<comments>http://blog.leafduo.com/05/solution-to-wordpress-auto-update-auth-problem/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 18:50:05 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenSSH]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.leafduo.com/?p=263</guid>
		<description><![CDATA[WordPress 要升级 3.0.5，我懒，所以自动升级，点开自动升级的页面，输入验证方式，发现木有 sftp 的选项，印象中原来是有的，去查了一下，发现不是 WordPress 的问题，而是 PHP 没有装载 ssh 的模块，于是装上。 emerge dev-php5/pecl-ssh2 然后升级页面就神奇地出现了 SSH2 的选项，于是开心地填上用户名密码，一个回车，告诉你用户名或密码错误……我说不可能啊，于是去查系统日志，日志里竟然一个字都没写……明显就不是密码错了嘛。 啥问题呢，不清楚，咋办呢，查 WordPress 的源码吧。发现 wp-admin/includes/file.php 里有个函数叫 get_filesystem_method()，它的注释告诉我 WordPress 升级写文件有这么几种方式：Direct, SSH2, FTP PHP Extension, FTP Sockets，优先级依次递减，于是发现还有 Direct 这么一种神奇的方式，快速解决问题： chown -R nobody:nobody /path/to/WordPress。（我用 php-fpm 运行的，php 的 user &#8230; <a href="http://blog.leafduo.com/05/solution-to-wordpress-auto-update-auth-problem/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress 要升级 3.0.5，我懒，所以自动升级，点开自动升级的页面，输入验证方式，发现木有 sftp 的选项，印象中原来是有的，去查了一下，发现不是 WordPress 的问题，而是 PHP 没有装载 ssh 的模块，于是装上。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">emerge dev-php5<span style="color: #000000; font-weight: bold;">/</span>pecl-ssh2</pre></div></div>

<p>然后升级页面就神奇地出现了 SSH2 的选项，于是开心地填上用户名密码，一个回车，告诉你用户名或密码错误……我说不可能啊，于是去查系统日志，日志里竟然一个字都没写……明显就不是密码错了嘛。</p>
<p><a href="https://picasaweb.google.com/lh/photo/xkySpdVTZ8xpIVrPLffVhA?feat=embedwebsite"><img src="https://lh6.googleusercontent.com/_7Y_7M0vQVWs/TVLi45Y4HfI/AAAAAAAACZY/v4afyZn-oHM/s800/Screen%20shot%202011-02-10%20at%202.09.08%20AM.png" height="383" width="534" /></a></p>
<p>啥问题呢，不清楚，咋办呢，查 WordPress 的源码吧。发现 <a href="http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-admin/includes/file.php.source.html#l850">wp-admin/includes/file.php</a> 里有个函数叫 <a href="http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-admin/includes/file.php.source.html#l850"><code>get_filesystem_method()</code></a>，它的注释告诉我 WordPress 升级写文件有这么几种方式：Direct, SSH2, FTP PHP Extension, FTP Sockets，优先级依次递减，于是发现还有 Direct 这么一种神奇的方式，快速解决问题： <code>chown -R nobody:nobody /path/to/WordPress</code>。（我用 php-fpm 运行的，php 的 user 是 nobody）</p>
<p>不能把问题放着不管是不？去看看是啥问题，在 WordPress 源码里搜 "Username/Password incorrect for"，发现几个文件里都有，分别对应几种连接方式：direct、ssh2、ftpext、ftpsockets。当然我们要看 SSH2 是不？于是这个文件是 <a href="http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-admin/includes/class-wp-filesystem-ssh2.php.source.html#l103">wp-admin/includes/class-wp-filesystem-ssh2.php</a>，里面那个 <a href="http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-admin/includes/class-wp-filesystem-ssh2.php.source.html#l103"><code>connect()</code></a> 函数是我感兴趣的，里面有这么一句：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">keys</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #339933;">@</span><span style="color: #990000;">ssh2_auth_password</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">errors</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'auth'</span><span style="color: #339933;">,</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Username/Password incorrect for %s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>也就是说没有使用 key 的时候，用密码验证，<a href="http://php.net/manual/en/function.ssh2-auth-password.php"><code>ssh2_auth_password()</code></a> 失败的话就说是用户名或密码错。（PHP 达人告诉我前面的 @ 是啥？）</p>
<p>查这个函数的<a href="http://php.net/manual/en/function.ssh2-auth-password.php">原型</a>，人家只说失败的时候返回 false，谁说一定是密码错误了，你妹的……</p>
<p>不过在这个文件里还有新发现，在<a href="http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-admin/includes/class-wp-filesystem-ssh2.php.source.html#l1">这个类的注释</a>里，发现了<a href="http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/">一篇 pecl-ssh2 的安装指南</a>，在里面发现了问题：On the serverside, 'PasswordAuthentication yes' must be enabled in the sshd_config. 一查我的配置，果然给弄成 no 了……</p>
<p>欣喜若狂地改成 yes，然后重启 sshd，<code>/etc/init.d/sshd restart</code>，竟然没法重启……尝试 reload，<code>/etc/init.d/sshd reload</code>，说 sshd 没运行（No /usr/sbin/sshd found running; none killed.），又开始扯淡了！！！</p>
<p>遵循不知道谁的教导，重新 emerge 一遍 openssh。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">emerge net-misc<span style="color: #000000; font-weight: bold;">/</span>openssh</pre></div></div>

<p>然后</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>sshd restart</pre></div></div>

<p>就能重启了……</p>
<p>之后回到 WordPress 输上密码，发现能登录上了，变成 PHP 错误了……仔细一看，我的账户也没有改 WordPress 代码的权限啊……</p>
<p>折腾一圈白干了，专门弄个账户还不如改权限（<code>chown -R nobody:nobody</code>）呢。</p>
<p><del datetime="2011-02-09T18:03:26+00:00">不过过程中还发现了新的问题，sshd_config 里面 PasswordAuthentication no 之后还是能从别的主机用密码登陆（不过 php 这个 ssh2 的库登陆不了了），很神奇吧……以后再看是什么问题吧。</del></p>
<p>大概找到是啥问题了，下篇发出来吧。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/05/solution-to-wordpress-auto-update-auth-problem/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Gentoo/Nginx with IPv6 (Tunnel) Support</title>
		<link>http://blog.leafduo.com/51/gentoonginx-with-ipv6-tunnel-support/</link>
		<comments>http://blog.leafduo.com/51/gentoonginx-with-ipv6-tunnel-support/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 10:47:51 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[tunnel]]></category>

		<guid isPermaLink="false">http://blog.leafduo.com/?p=262</guid>
		<description><![CDATA[弄了一个 he.net 的 IPv6 隧道，给服务器用。（你说你 Linode 为啥不提供原生 IPv6，为啥？） 一会就申请完了，你就获得 4 个 IP，服务器的 IPv4、IPv6，客户端的 IPv4、IPv6，你需要这些 IP 来做一些配置。 首先是配好 Gentoo，LInode 的 wiki 写的很清楚，注意 interface 的名字似乎不能太短，一开始我起的叫 he，出了奇怪的错误……改成 hetun 就好了…… 注意 Linode 的 eth0 是用的 DHCP，别乱改。 接下来是 Nginx，因为编译的时候已经带上 USE="ipv6" 了，所以就不需要重新编译了，改一下 Listen 语句就行。我原先都是用的 Listen 0.0.0.0:80，要使 &#8230; <a href="http://blog.leafduo.com/51/gentoonginx-with-ipv6-tunnel-support/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>弄了一个 <a href="http://he.net/">he.net</a> 的 <a href="http://tunnelbroker.net/">IPv6 隧道</a>，给服务器用。（你说你 <a href="http://www.linode.com/">Linode</a> 为啥不提供原生 IPv6，为啥？）</p>
<p>一会就申请完了，你就获得 4 个 IP，服务器的 IPv4、IPv6，客户端的 IPv4、IPv6，你需要这些 IP 来做一些配置。</p>
<p>首先是配好 Gentoo，<a href="http://www.linode.com/wiki/index.php/IPv6#Gentoo">LInode 的 wiki</a> 写的很清楚，注意 interface 的名字似乎不能太短，一开始我起的叫 he，出了奇怪的错误……改成 hetun 就好了……</p>
<p>注意 Linode 的 eth0 是用的 DHCP，别乱改。</p>
<p>接下来是 Nginx，因为编译的时候已经带上 USE="ipv6" 了，所以就不需要重新编译了，改一下 Listen 语句就行。我原先都是用的 Listen 0.0.0.0:80，要使 IPv6 有效的话要改成 [::]:80，于是尝试性地改了一个域名的配置。</p>
<p>重启 Nginx，报错，说 80 端口已经被 bind 了，我说不可能啊，lsof -i tcp:80 也是空的。想了想隐约知道是怎么回事了，于是把所有的配置文件都从 Listen 0.0.0.0:80 改成 Listen [::]:80，重启，OK 了。</p>
<p>想来是因为 Nginx 把 0.0.0.0:80 和 [::]:80 认成了两个端口，于是 bind 了两遍，这不就冲突了嘛……都改成 Listen [::]:80 就好了。</p>
<p>参考文献：</p>
<ol>
<li><a href="http://kovyrin.net/2010/01/16/enabling-ipv6-support-in-nginx/">http://kovyrin.net/2010/01/16/enabling-ipv6-support-in-nginx/</a></li>
<li>tunnelbroker.net 给的配置命令</li>
<li><a href="http://www.linode.com/wiki/index.php/IPv6#Gentoo">http://www.linode.com/wiki/index.php/IPv6#Gentoo</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/51/gentoonginx-with-ipv6-tunnel-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cURL 下载迅雷离线</title>
		<link>http://blog.leafduo.com/20/use-curl-to-download-xunlei-offline-download/</link>
		<comments>http://blog.leafduo.com/20/use-curl-to-download-xunlei-offline-download/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 02:57:20 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.leafduo.com/?p=261</guid>
		<description><![CDATA[今天下载 Xcode 4 GM，很大，3G+（苹果东西一向大），于是想走这样的线路，BT->迅雷离线->某服务器->笔记本，这样就避免迅雷离线有的时候下载不稳定之类的问题，所以需要用 cURL 之类的东西下载迅雷离线，稍微尝试之后，办法出来啦。 首先用浏览器获得真实的下载链接，开头类似 http://vod19.c7.lixian.vip.xunlei.com/download 这样的，要真正开始下载之后的链接。 找到 vip.xunlei.com 这个域名下面的 cookie，名字是 gdriveid，把名字和值记下来。 curl "http://DOWNLOAD.LINK/" --cookie "gdriveid=VALUE" -o FILE_NAME OK 了。 本来是用 http://gdl.lixian.vip.xunlei.com/download? 开头的链接来尝试的，后来发现重定向到 http://vod19.c7.lixian.vip.xunlei.com/download 之后 cURL 没有把 cookie 带上，而服务器对这两个 URI 的访问都需要验证这个 cookie，我对 cURL 又不是很熟，就转而用 http://vod19.c7.lixian.vip.xunlei.com/download 这样的链接了…… 可能从文件里读取 cookie &#8230; <a href="http://blog.leafduo.com/20/use-curl-to-download-xunlei-offline-download/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>今天下载 Xcode 4 GM，很大，3G+（苹果东西一向大），于是想走这样的线路，BT->迅雷离线->某服务器->笔记本，这样就避免迅雷离线有的时候下载不稳定之类的问题，所以需要用 cURL 之类的东西下载迅雷离线，稍微尝试之后，办法出来啦。</p>
<ol>
<li>首先用浏览器获得真实的下载链接，开头类似 http://vod19.c7.lixian.vip.xunlei.com/download 这样的，要真正开始下载之后的链接。
</li>
<li>找到 vip.xunlei.com 这个域名下面的 cookie，名字是 gdriveid，把名字和值记下来。
</li>
<li>curl "http://DOWNLOAD.LINK/" --cookie "gdriveid=VALUE" -o FILE_NAME
</li>
<li>OK 了。</li>
</ol>
<p>本来是用 http://gdl.lixian.vip.xunlei.com/download? 开头的链接来尝试的，后来发现重定向到 http://vod19.c7.lixian.vip.xunlei.com/download 之后 cURL 没有把 cookie 带上，而服务器对这两个 URI 的访问都需要验证这个 cookie，我对 cURL 又不是很熟，就转而用 http://vod19.c7.lixian.vip.xunlei.com/download 这样的链接了……</p>
<p>可能从文件里读取 cookie 可行，我没试成功。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/20/use-curl-to-download-xunlei-offline-download/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>2010 -&gt; 2011</title>
		<link>http://blog.leafduo.com/37/2010-2011/</link>
		<comments>http://blog.leafduo.com/37/2010-2011/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 16:51:37 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://blog.leafduo.com/?p=257</guid>
		<description><![CDATA[不知道这时候写这种标题的文章算不算有点太晚了呢？ 先总结总结吧，从年初开始。 依我自己的记忆力，估计是什么都想不起来了，于是还是询问了一位重要参考人，嗯嗯。 1 月，复习考试……咋上来就是考试呢，考试复习，高数杯具了…… 2 月放假，放假了，看书，玩，反正也没做什么正事吧。买了机械键盘，不过一直也没机会用，也就在家用用，以后或许就好了。 开学了，半路跟着做了个项目，为 MSTC PK 赛做的游戏，进去的时候就已经很乱了，其实我也没做啥……就是提供了一台笔记本测试用……帮忙调试，写了一些网络相关的代码。第一次通宵，终于做完了，天亮了起来去 M 记一起吃早饭，然后回去睡觉……中午再出去做 PK 赛的宣传。两轮比赛完了活动也就结束了，开发挺累，不过比赛就当是玩了。 结束了之后也就快考试了，再次复习考试。这次还好。 放假前找好了一个实验室，放假之后就去了，开始做项目，内容就不说了。 去看了移动开发者大会，Google 创新论坛，出去逛逛挺好。 下学期也跟上学期差不多，开学 -> 项目 -> 休息 -> 复习考试。考试也还好，嗯。 老婆说这一年我逐渐适应大学生活了，嗯，应该是这样吧。每学期换个地方，每学期做个项目，每学期一次考试，呵呵。 这一年做的项目在变，呆的地方在变，不过还是有些东西没变。比如说一直还是在玩 Linux，虽然不拿来当桌面用已经有一年半了，不过各种机会还是一直在折腾，手里有几台服务器，也装过一段时间 Gentoo Prefix。也折腾过两天 FreeBSD，觉得不好玩……主要是跟 Linux 的区别没有体会出来。 暑假还做了一会 Mac 开发，一个小项目，仿照单词随意背做的一个 Mac 版本。算是了解了一下 Objective-C &#8230; <a href="http://blog.leafduo.com/37/2010-2011/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://picasaweb.google.com/lh/photo/I4n5vCyrJQK9YJn1A4Jrug?feat=embedwebsite"><img src="https://lh6.googleusercontent.com/_7Y_7M0vQVWs/TUwgcIkx0SI/AAAAAAAACZA/Hr1CryVNZk4/s640/Screen%20shot%202011-02-04%20at%2011.48.28%20PM.png" height="201" width="640" /></a></p>
<p>不知道这时候写这种标题的文章算不算有点太晚了呢？</p>
<p>先总结总结吧，从年初开始。</p>
<p>依我自己的记忆力，估计是什么都想不起来了，于是还是询问了一位重要参考人，嗯嗯。</p>
<p>1 月，复习考试……咋上来就是考试呢，考试复习，高数杯具了……</p>
<p>2 月放假，放假了，看书，玩，反正也没做什么正事吧。买了<a href="http://s.taobao.com/search?q=Cherry+G80-3000+LSCEU-2">机械键盘</a>，不过一直也没机会用，也就在家用用，以后或许就好了。</p>
<p>开学了，半路跟着做了个项目，为 MSTC PK 赛做的游戏，进去的时候就已经很乱了，其实我也没做啥……就是提供了一台笔记本测试用……帮忙调试，写了一些网络相关的代码。第一次通宵，终于做完了，天亮了起来去 M 记一起吃早饭，然后回去睡觉……中午再出去做 PK 赛的宣传。两轮比赛完了活动也就结束了，开发挺累，不过比赛就当是玩了。</p>
<p>结束了之后也就快考试了，再次复习考试。这次还好。</p>
<p>放假前找好了一个实验室，放假之后就去了，开始做项目，内容就不说了。</p>
<p>去看了移动开发者大会，Google 创新论坛，出去逛逛挺好。</p>
<p>下学期也跟上学期差不多，开学 -> 项目 -> 休息 -> 复习考试。考试也还好，嗯。</p>
<p>老婆说这一年我逐渐适应大学生活了，嗯，应该是这样吧。每学期换个地方，每学期做个项目，每学期一次考试，呵呵。</p>
<p>这一年做的项目在变，呆的地方在变，不过还是有些东西没变。比如说一直还是在玩 Linux，虽然不拿来当桌面用已经有一年半了，不过各种机会还是一直在折腾，手里有几台服务器，也装过一段时间 <a href="http://www.gentoo.org/proj/en/gentoo-alt/prefix/">Gentoo Prefix</a>。也折腾过两天 FreeBSD，觉得不好玩……主要是跟 Linux 的区别没有体会出来。</p>
<p>暑假还做了一会 Mac 开发，一个小项目，仿照<a href="http://www.i5023.com/works/beidanc/">单词随意背</a>做的一个 Mac 版本。算是了解了一下 Objective-C 和 Cocoa，算是为接下来的 Cocoa Touch 和 iOS 做了点铺垫。</p>
<p>接下来的比较长的一段时间，我会专注于一个项目，我的职责主要是 Linux、Web 和 iOS 开发，基本上都是我稍微有点熟的领域，另外还能远离 Windows，真好。</p>
<p>下学期的课应该不是很重了，有更多的时间做自己的事情，哈哈哈哈。</p>
<p>给自己订几个本年目标吧，截止明年寒假？</p>
<ul>
<li>翻译一篇维基百科条目。既锻炼了英语水平又做了贡献，当然，一篇只是开头而已，一旦第一篇搞定了，接下来也就简单了。</li>
<li>平均每两周一篇博客。2010 年没写多少东西，惭愧。</li>
<li>锻炼。据说 7+1>8，加油。</li>
<li>读一本自己觉得有深度的书。偏底层、偏理论或者偏思想的。</li>
<li>学五笔。唉……不知道拖了多久了……</li>
</ul>
<p>还有些推荐执行的？</p>
<ul>
<li>博客要有题图。（就像这篇一样这么烂的？）</li>
<li>读一本非技术类英语书。</li>
<li>日语。现在这个日语水平啊……惭愧啊……</li>
</ul>
<p>明年这个时候来 check 吧！</p>
<p>最后给大家拜年！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/37/2010-2011/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing Gentoo Linux on Macbook Pro</title>
		<link>http://blog.leafduo.com/04/installing-gentoo-linux-on-macbook-pro/</link>
		<comments>http://blog.leafduo.com/04/installing-gentoo-linux-on-macbook-pro/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 12:14:04 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Macbook Pro]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/?p=209</guid>
		<description><![CDATA[那是公元某年某月某日，我开始在 MBP 上装 Gentoo…… 其实不是个很简单的活，所以来记录下，没装过 Gentoo 的先回家去看安装手册。（这不是 Linux 入门教程） 首先说一下配置，2008 年的 Macbook Pro 5,1，型号是 MB471LL/A，配置不一样的话底下的过程也酌情修改。 然后小补一点知识，Macbook Pro 没有 BIOS，而是采用了 EFI。因而也没有常用的分区表格式 MBR，而是采用了 GPT。GPT 传说中能放很多分区（而不是最多四个），fdisk 传说中不支持 GPT（不过好像有人用 fdisk 成功过）。 正式开始了： 说明一下，我要保留 Mac OS X，因为我觉得 Mac OS X 也很好用，呵呵。 事先准备好 Gentoo Minimal Install &#8230; <a href="http://blog.leafduo.com/04/installing-gentoo-linux-on-macbook-pro/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>那是公元某年某月某日，我开始在 MBP 上装 Gentoo……</p>
<p>其实不是个很简单的活，所以来记录下，没装过 Gentoo 的先回家去看<a href="http://www.gentoo.org/doc/en/handbook/index.xml">安装手册</a>。<em>（这不是 Linux 入门教程）</em></p>
<p>首先说一下配置，2008 年的 Macbook Pro 5,1，型号是 MB471LL/A，配置不一样的话底下的过程也酌情修改。</p>
<p>然后小补一点知识，Macbook Pro 没有 BIOS，而是采用了 <a href="http://en.wikipedia.org/wiki/Extensible_Firmware_Interface">EFI</a>。因而也没有常用的分区表格式 MBR，而是采用了 <a href="http://en.wikipedia.org/wiki/GUID_Partition_Table">GPT</a>。GPT 传说中能放很多分区（而不是最多四个），fdisk 传说中不支持 GPT（不过好像有人用 fdisk 成功过）。</p>
<p>正式开始了：</p>
<ol>
<li>说明一下，我要保留 Mac OS X，因为我觉得 Mac OS X 也很好用，呵呵。</li>
<li>事先准备好 Gentoo Minimal Install CD、stage3 和 snapshot 备用（直接用最新的 stage，我用的是 amd64 的 CD 和 stage）</li>
<li>在 Mac OS X 里安装 <a href="http://refit.sourceforge.net/">rEFIt</a>。</li>
<li>分区，这里我用 Mac OS X 自带的 Disk Utility，先 resize HFS+ 分区，给 Gentoo 留出空间，然后新建几个 FAT 分区，具体怎么分你自己定吧。</li>
<li>插入 Gentoo Minimal Install CD，重启，开机时按住 Option 键，等一会应该会出现一个光盘下面写着 Windows，不管它写的是什么了，从这个光盘启动。</li>
<li>启动之后，用 parted 改下分区表，把 FAT 改成 Linux 的分区（注意有一个大约 200MB 的 EFI 分区，不要搞掉），然后关机，开机（注意不要 reboot），进到 rEFIt 之后同步一下分区表。</li>
<li>再次从光盘启动，安装 Gentoo。</li>
<li>配内核的时候可以参考一下 <a href="http://en.gentoo-wiki.com/wiki/Apple_Macbook_Pro/Configuration_Files/Kernel">Gentoo Linux Wiki</a>。</li>
<li>make.conf 我是这样写的：<br />
<blockquote><p>CFLAGS="-O2 -march=core2 -pipe -msse4.1"<br />
CXXFLAGS="${CFLAGS}"<br />
MAKEOPTS="-j3"</p></blockquote>
</li>
<li>装 Grub 的时候请注意，不要装到 /dev/sda，装到 /boot 的分区上吧。</li>
</ol>
<p>鉴于 Macbook Pro 有很多诡异的设备，我们来说一下万恶的驱动：</p>
<ol>
<li>alsa 不出声
<p>alsa 编成模块，/etc/modprobe.d/alsa.conf 里面加一行 </p>
<blockquote><p>options snd-hda-intel model=mbp3</p></blockquote>
<p>然后运行 update-modules。（<a href="http://www.linuxsir.org/bbs/showthread.php?p=1724248">via</a>）</li>
<li>触摸板无法使用<br />
2.6.29-r5 里不知道 bcm5974 还是 usbhid 有问题，反正是有问题，touchpad 没法正常工作，升级到 2.6.30-r4 后就正常了（2.6.28-r5 好像也正常），注意 2.6.30-r4 目前还是 ~amd，相应的，x11-drivers/nvidia-drivers 也要用 ~amd64 里的。</p>
<p>bcm5974 还是很好的。</li>
<li>无线网卡的驱动
<p>portage 里面有，不过是 ~amd64 的，叫 net-wireless/broadcom-sta。</li>
<li>键盘背光
<p>portage 里有 app-laptop/macbook-backlight，用这个包就 OK 了。
</li>
</ol>
<p>写得不是很详细，有什么问题可以在下面留言或者 email 我，不过要先问 Google 和各大发行版的相关内容。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/04/installing-gentoo-linux-on-macbook-pro/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>《UNIX 实用教程》笔记</title>
		<link>http://blog.leafduo.com/46/just-enough-unix-note/</link>
		<comments>http://blog.leafduo.com/46/just-enough-unix-note/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 11:06:46 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/?p=210</guid>
		<description><![CDATA[感觉这本书比较适合初学者，什么都不懂的也可以看，简单易懂，有的时候一样的话会重复很多遍…… 推荐对 *nix 有兴趣或者有需求的人看下。 和以前一样，还是只记我不知道的。 ls -l 第二列是链接数； 有 tee 这么个东西；（不知道的请自行查阅手册） ~jack 是 jack 的主目录； 命令行编辑（command-line editing）挺好玩，如果是 bash 和 vi，那么 set -o vi； 还有个东西叫 finger； ssh 里 ~? 能列出转义序列； 221 页 forwarded 翻译成前面了，应该是转发； 后面的 shell 脚本我只是略懂皮毛，awk 一窍不通，Perl 暂时没兴趣，C/C++ 基本略过，所以也没什么好写的了。]]></description>
			<content:encoded><![CDATA[<p>感觉<a href="http://www.douban.com/subject/2364802/">这本书</a>比较适合初学者，什么都不懂的也可以看，简单易懂，有的时候一样的话会重复很多遍……</p>
<p>推荐对 *nix 有兴趣或者有需求的人看下。</p>
<p>和以前一样，还是只记我不知道的。</p>
<ol>
<li>ls -l 第二列是链接数；
</li>
<li>有 tee 这么个东西；（不知道的请自行查阅手册）
</li>
<li>~jack 是 jack 的主目录；
</li>
<li>命令行编辑（command-line editing）挺好玩，如果是 bash 和 vi，那么 set -o vi；
</li>
<li>还有个东西叫 finger；
</li>
<li>ssh 里 ~? 能列出转义序列；
</li>
<li>221 页 forwarded 翻译成前面了，应该是转发；
</li>
</ol>
<p>后面的 shell 脚本我只是略懂皮毛，awk 一窍不通，Perl 暂时没兴趣，C/C++ 基本略过，所以也没什么好写的了。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/46/just-enough-unix-note/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>记得加载模块</title>
		<link>http://blog.leafduo.com/08/remember-to-load-modules/</link>
		<comments>http://blog.leafduo.com/08/remember-to-load-modules/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 15:44:08 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[printer]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/?p=176</guid>
		<description><![CDATA[为了启动的时候能更快一点，我把要加载的模块直接写进了 /etc/rc.conf （方法看这里），启动确实快了。不过有的时候还是有些郁闷…… 很少用 USB flash drive，偶尔用，郁闷了，怎么看也没这个设备，只有两块硬盘，很久之后发现没加载模块，于是加载之： 1 modprobe usb-storage 又过了很长时间，用到打印机。很少打印东西，而且这个打印机比较难搞，所以导致我每次用打印机都心惊肉跳……这回直接找不到打印机了，良久之后，发现应该加载一个模块…… 1 modprobe usblp 唉…… 注意下，如果你用 2.4 内核的话，应该加载 printer 这个模块，详细的可以看 ArchWiki 的说明。 启动是快了，可是要记得加载模块啊…… 提醒下自己，下次别忘了。]]></description>
			<content:encoded><![CDATA[<p>为了启动的时候能更快一点，我把要加载的模块直接写进了 /etc/rc.conf （方法看<a href="http://liangzhdp.blogspot.com/2008/04/modules-udev.html">这里</a>），启动确实快了。不过有的时候还是有些郁闷……</p>
<p>很少用 USB flash drive，偶尔用，郁闷了，怎么看也没这个设备，只有两块硬盘，很久之后发现没加载模块，于是加载之：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">modprobe usb-storage</pre></td></tr></table></div>

<p>又过了很长时间，用到打印机。很少打印东西，而且这个打印机比较难搞，所以导致我每次用打印机都心惊肉跳……这回直接找不到打印机了，良久之后，发现应该加载一个模块……</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">modprobe usblp</pre></td></tr></table></div>

<p>唉……</p>
<p>注意下，如果你用 2.4 内核的话，应该加载 printer 这个模块，详细的可以看 <a href="http://wiki.archlinux.org/index.php/Cups#Kernel_Modules">ArchWiki 的说明</a>。</p>
<p>启动是快了，可是要记得加载模块啊……</p>
<p>提醒下自己，下次别忘了。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/08/remember-to-load-modules/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>试用 ibus</title>
		<link>http://blog.leafduo.com/56/test-ibus/</link>
		<comments>http://blog.leafduo.com/56/test-ibus/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 03:56:56 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Arch]]></category>
		<category><![CDATA[Archlinux]]></category>
		<category><![CDATA[ibus]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PKGBUILD]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/?p=175</guid>
		<description><![CDATA[关于 ibus 的新闻已经不少了，鉴于我也忍不了 SCIM 和 fcitx 了，所以准备投靠 ibus 。这次是在 Archlinux 上安装的，先写 PKGBUILD ，装好之后没有引擎……晕菜…… 然后扔掉包直接装， OK 了，最后改了一下 PKGBUILD ，也 OK 了。 PKGBUILD 仅仅是到了能用的程度。 用了一下，感觉起码比 SCIM 和 fcitx 都要漂亮，至于 bug ，我就打了这么几个字，还没找出什么来，看起来不错。 这个是 ibus-git 的 PKGBUILD 1 2 3 4 5 6 7 &#8230; <a href="http://blog.leafduo.com/56/test-ibus/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>关于 <a href="http://code.google.com/p/ibus/">ibus</a> 的新闻已经不少了，鉴于我也忍不了 SCIM 和 fcitx 了，所以准备投靠 ibus 。这次是在 Archlinux 上安装的，先写 PKGBUILD  ，装好之后没有引擎……晕菜……</p>
<p>然后扔掉包直接装， OK 了，最后改了一下 PKGBUILD ，也 OK 了。</p>
<p>PKGBUILD  仅仅是到了能用的程度。</p>
<p>用了一下，感觉起码比 SCIM 和 fcitx 都要漂亮，至于 bug ，我就打了这么几个字，还没找出什么来，看起来不错。</p>
<p>这个是 ibus-git 的 PKGBUILD</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Contributor: leafduo&lt;leafduo@gmail.com&gt;</span>
&nbsp;
<span style="color: #007800;">pkgname</span>=ibus-git
<span style="color: #007800;">pkgver</span>=<span style="color: #c20cb9; font-weight: bold;">git</span>
<span style="color: #007800;">pkgrel</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">pkgdesc</span>=<span style="color: #ff0000;">&quot;a next generation input framework.&quot;</span>
<span style="color: #007800;">arch</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'i686'</span> <span style="color: #ff0000;">'x86_64'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">license</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'GPL'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">depends</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'python'</span> <span style="color: #ff0000;">'dbus-python&gt;=0.83.0'</span> <span style="color: #ff0000;">'automake'</span> <span style="color: #ff0000;">'autoconf'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">makedepends</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'git'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">url</span>=<span style="color: #ff0000;">&quot;http://code.google.com/p/ibus/&quot;</span>
<span style="color: #007800;">source</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">md5sum</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">install</span>=ibus.install
&nbsp;
build<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$startdir</span><span style="color: #000000; font-weight: bold;">/</span>src
    <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>phuang<span style="color: #000000; font-weight: bold;">/</span>ibus.git ibus
    <span style="color: #7a0874; font-weight: bold;">cd</span> ibus
    .<span style="color: #000000; font-weight: bold;">/</span>autogen.sh <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr
    <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
    <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">DESTDIR</span>=<span style="color: #007800;">$pkgdir</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<p>对应的 ibus.install</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">post_install<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</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>gtk-query-immodules-<span style="color: #000000;">2.0</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>gtk-<span style="color: #000000;">2.0</span><span style="color: #000000; font-weight: bold;">/</span>gtk.immodules
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
post_upgrade<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</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>gtk-query-immodules-<span style="color: #000000;">2.0</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>gtk-<span style="color: #000000;">2.0</span><span style="color: #000000; font-weight: bold;">/</span>gtk.immodules
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
post_remove<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</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>gtk-query-immodules-<span style="color: #000000;">2.0</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>gtk-<span style="color: #000000;">2.0</span><span style="color: #000000; font-weight: bold;">/</span>gtk.immodules
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<p>ibus-pinyin-git 的 PKGBUILD</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Contributor: leafduo&lt;leafduo@gmail.com&gt;</span>
&nbsp;
<span style="color: #007800;">pkgname</span>=ibus-pinyin-git
<span style="color: #007800;">pkgver</span>=<span style="color: #c20cb9; font-weight: bold;">git</span>
<span style="color: #007800;">pkgrel</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">pkgdesc</span>=<span style="color: #ff0000;">&quot;pinyin input method for ibus&quot;</span>
<span style="color: #007800;">arch</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'i686'</span> <span style="color: #ff0000;">'x86_64'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">license</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'GPL'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">depends</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'python'</span> <span style="color: #ff0000;">'dbus-python&gt;=0.83.0'</span> <span style="color: #ff0000;">'automake'</span> <span style="color: #ff0000;">'autoconf'</span> <span style="color: #ff0000;">'ibus-git'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">makedepends</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'git'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">url</span>=<span style="color: #ff0000;">&quot;http://code.google.com/p/ibus/&quot;</span>
<span style="color: #007800;">source</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">md5sum</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
build<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$startdir</span><span style="color: #000000; font-weight: bold;">/</span>src
    <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>phuang<span style="color: #000000; font-weight: bold;">/</span>ibus-pinyin.git ibus-pinyin
    <span style="color: #7a0874; font-weight: bold;">cd</span> ibus-pinyin
    .<span style="color: #000000; font-weight: bold;">/</span>autogen.sh <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr
    <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
    <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">DESTDIR</span>=<span style="color: #007800;">$pkgdir</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<p>当然，你可以在<a href="http://code.google.com/p/mypkgbuild/">这里</a>找到我所有的 PKGBUILD。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/56/test-ibus/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>学习 LaTeX &amp; 二项式定理的证明</title>
		<link>http://blog.leafduo.com/51/learning-latex/</link>
		<comments>http://blog.leafduo.com/51/learning-latex/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 15:05:51 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tex]]></category>
		<category><![CDATA[typesetting]]></category>
		<category><![CDATA[XeLaTex]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/?p=174</guid>
		<description><![CDATA[小小学习了一下 LaTeX ，于是找个东西小试牛刀，来证明一下二项式定理吧，用数学归纳法证明的。 具体的大家看下面的附件吧： 二项式定理的证明 TeX 源文件 同样，还是请大家提提意见，拍拍砖，非常感谢。 P.S. 这里有我收集的一些关于 LaTeX 的资料。]]></description>
			<content:encoded><![CDATA[<p>小小学习了一下 <a href="http://www.google.com/search?q=LaTeX">LaTeX</a> ，于是找个东西小试牛刀，来证明一下二项式定理吧，用数学归纳法证明的。</p>
<p>具体的大家看下面的附件吧：</p>
<p><a href='http://leafduo.com/blog/wp-content/uploads/2008/08/binomial_theorem.pdf'>二项式定理的证明</a></p>
<p><a href="http://leafduo.com/blog/wp-content/uploads/2008/08/binomial_theorem.tex">TeX 源文件</a></p>
<p>同样，还是请大家提提意见，拍拍砖，非常感谢。</p>
<p>P.S. <a href="http://delicious.com/LeafDuo/LaTeX">这里</a>有我收集的一些关于 LaTeX 的资料。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/51/learning-latex/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>VMware 下安装 Gentoo 的唯一注意事项</title>
		<link>http://blog.leafduo.com/54/gentoo-installation-tip-under-vmware/</link>
		<comments>http://blog.leafduo.com/54/gentoo-installation-tip-under-vmware/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 14:32:54 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/?p=160</guid>
		<description><![CDATA[好吧，安装 Gentoo 其实挺复杂，不过按手册来就是了。 但是我在 VMware 下安装 Gentoo 却怎么安都连不上网……我郁闷啊…… 后来得知，VMware 虚拟的是一块 AMD 网卡，而默认 menuconfig 是不选它的，所以就连不上网了…… 所以请在 make menuconfig 的时候选上以下几项： Device Drivers -&#62; Network device support -&#62; Ethernet (10 or 100Mbit) -&#62; EISA, VLB, PCI and on board controllers 还有它下属的 AMD PCnet32 &#8230; <a href="http://blog.leafduo.com/54/gentoo-installation-tip-under-vmware/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>好吧，安装 Gentoo 其实挺复杂，不过按手册来就是了。</p>
<p>但是我在 VMware 下安装 Gentoo 却怎么安都连不上网……我郁闷啊……</p>
<p>后来得知，VMware 虚拟的是一块 AMD 网卡，而默认 menuconfig 是不选它的，所以就连不上网了……</p>
<p>所以请在 make menuconfig 的时候选上以下几项：</p>
<p><span style="font-size: small;">Device Drivers -&gt; </span><span style="font-size: small;">Network device support -&gt; </span><span style="font-size: small;">Ethernet (10 or 100Mbit) -&gt; EISA, VLB, PCI and on board controllers 还有它下属的 AMD PCnet32 PCI support 和 Use RX polling (NAPI)</span></p>
<p>之后编译内核，就 OK 了。</p>
<p>（我被它折腾了很长时间！我郁闷啊！）</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/54/gentoo-installation-tip-under-vmware/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>我的字体设置</title>
		<link>http://blog.leafduo.com/00/my-font-config/</link>
		<comments>http://blog.leafduo.com/00/my-font-config/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 10:22:00 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[fontconfig]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/?p=159</guid>
		<description><![CDATA[很久以前把中文字体搞定以后，就再没有搞过字体的问题，前几天看到别人的截图，字体很漂亮，倍感嫉妒……一问之后，用的是 wqy-zenhei ，于是更加郁闷了，明明是一样的字体，我的就不好看…… 于是，简单的读了一下 fontconfig 的手册，改了一个 .fonts.conf ，基于 wqy-zenhei 自带的 config 。没有很仔细地读手册，所以不知道这样的 .fonts.conf 有没有什么错误，不过效果还是不错的，于是贴一下： 先贴效果图： 写这篇 post 的时候打开的网页，这张主要是中文（其实这张加粗的太多了，不太好看）： 这张主要是英文，英文字体是 DejaVu ： 最后贴 .fonts.conf ： &#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62; &#60;!DOCTYPE fontconfig SYSTEM &#34;fonts.dtd&#34;&#62; &#160; &#60;fontconfig&#62; &#160; &#60;!-- modified by leafduo@gmail.com --&#62; &#60;match &#8230; <a href="http://blog.leafduo.com/00/my-font-config/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>很久以前把中文字体搞定以后，就再没有搞过字体的问题，前几天看到别人的截图，字体很漂亮，倍感嫉妒……一问之后，用的是 <a href="http://wenq.org/?ZenHei">wqy-zenhei</a> ，于是更加郁闷了，明明是一样的字体，我的就不好看……</p>
<p>于是，简单的读了一下 <a href="http://fontconfig.org/wiki/">fontconfig</a> 的<a href="http://fontconfig.org/fontconfig-user.html">手册</a>，改了一个 .fonts.conf ，基于 wqy-zenhei 自带的 config 。没有很仔细地读手册，所以不知道这样的 .fonts.conf 有没有什么错误，不过效果还是不错的，于是贴一下：</p>
<p>先贴效果图：</p>
<p>写这篇 post 的时候打开的网页，这张主要是中文（其实这张加粗的太多了，不太好看）：</p>
<p><a href="http://picasaweb.google.com/LeafDuo/Blog/photo#5223923636252101858"><img src="http://lh4.ggpht.com/LeafDuo/SH8a3qCSzOI/AAAAAAAAAkM/7eRF3wBMUpM/s800/wqy-zenhei.png" width="590" alt="wqy-zenhei" /></a></p>
<p>这张主要是英文，英文字体是 DejaVu ：</p>
<p><a href="http://picasaweb.google.com/LeafDuo/Blog/photo#5223923645799571138"><img src="http://lh5.ggpht.com/LeafDuo/SH8a4NmlnsI/AAAAAAAAAkU/TrZx_4wPZ3Q/s800/DejaVu.png" width="590" alt="DejaVu" /></a></p>
<p>最后贴 .fonts.conf ：</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE fontconfig SYSTEM &quot;fonts.dtd&quot;&gt;</span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fontconfig<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- modified by leafduo@gmail.com --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;font&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;test</span> <span style="color: #000066;">qual</span>=<span style="color: #ff0000;">&quot;any&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;family&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>WenQuanYi Zen Hei<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>文泉驿正黑<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>文泉驛正黑<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/test<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;globaladvance&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;spacing&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;int<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/int<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;antialias&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;assign&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hinting&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;assign&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hintstyle&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;assign&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;const<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>hintnone<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/const<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;autohint&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;assign&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;rh_prefer_bitmaps&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;assign&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;rgba&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;assign&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;const<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>none<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/const<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;embeddedbitmap&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;font&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;test</span> <span style="color: #000066;">qual</span>=<span style="color: #ff0000;">&quot;any&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;family&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DejaVu Serif<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DejaVu Sans<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DejaVu Sans Mono<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/test<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;autohint&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hintstyle&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;const<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>hintfull<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/const<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;antialias&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>serif<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DejaVu Serif<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>WenQuanYi Zen Hei<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>sans-serif<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DejaVu Sans<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>WenQuanYi Zen Hei<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>monospace<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DejaVu Sans Mono<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>WenQuanYi Zen Hei<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fontconfig<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>嗯，我觉得不错。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/00/my-font-config/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>vim 启动缓慢</title>
		<link>http://blog.leafduo.com/18/vim-slow-start/</link>
		<comments>http://blog.leafduo.com/18/vim-slow-start/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 09:05:18 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[X]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/?p=129</guid>
		<description><![CDATA[今天终于忍不住 vim 慢如蜗牛的启动速度，于是 Google 解决办法…… 省略搜索数次…… 在这里找到了办法，原来是启动的时候要连接 X ，这样速度就慢下来了，实在懒得自己编译一个不带 X11 的版本，于是就在 ~/.bashrc 加了一行： alias vim='vim -X' 不过这样也丧失了一些功能，比如更改窗口标题和使用 X 的剪切板，反正我也不常用这个功能，所以无所谓了…… 现在瞬间就可以帮助乌干达的穷苦儿童了，高兴啊……]]></description>
			<content:encoded><![CDATA[<p>今天终于忍不住 vim 慢如蜗牛的启动速度，于是 Google 解决办法……</p>
<p>省略搜索数次……</p>
<p>在<a href="http://www.vim.org/htmldoc/starting.html#slow-start">这里</a>找到了办法，原来是启动的时候要连接 X ，这样速度就慢下来了，实在懒得自己编译一个不带 X11 的版本，于是就在 ~/.bashrc 加了一行：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">alias vim='vim -X'</li></ol></div>
<p>不过这样也丧失了<a href="http://www.vim.org/htmldoc/starting.html#-X">一些功能</a>，比如更改窗口标题和使用 X 的剪切板，反正我也不常用这个功能，所以无所谓了……</p>
<p>现在瞬间就可以帮助乌干达的穷苦儿童了，高兴啊……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/18/vim-slow-start/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>一句话搞定 KDEmod 烦人的服务器</title>
		<link>http://blog.leafduo.com/52/slow-kdemod-mirror/</link>
		<comments>http://blog.leafduo.com/52/slow-kdemod-mirror/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 15:14:52 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Arch]]></category>
		<category><![CDATA[Archlinux]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[kdemod]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/52/slow-kdemod-mirror</guid>
		<description><![CDATA[由于 KDEmod 官方网站和一个镜像站被功夫网收购，我们这些墙内的同学就只能用 http://kdemod.iskrembilen.com/ 这个镜像了，但是这个镜像经常出些奇奇怪怪的问题，有的时候速度很快，有的时候进度根本不动…… 令人非常郁闷…… 一怒之下，在 /etc/pacman.conf 的 [options] 这一部分加了一句话： XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u 哈哈，调出我们强大的 wget 吧，一切就都安静了……]]></description>
			<content:encoded><![CDATA[<p>由于 KDEmod 官方网站和一个镜像站被功夫网收购，我们这些墙内的同学就只能用 <a href="http://kdemod.iskrembilen.com/">http://kdemod.iskrembilen.com/</a> 这个镜像了，但是这个镜像经常出些奇奇怪怪的问题，有的时候速度很快，有的时候进度根本不动…… 令人非常郁闷……</p>
<p>一怒之下，在 /etc/pacman.conf 的 [options] 这一部分加了一句话：</p>
<blockquote><p>XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u</p></blockquote>
<p>哈哈，调出我们强大的 wget 吧，一切就都安静了……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/52/slow-kdemod-mirror/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Arch 下安装 Acroread 简体中文字体包</title>
		<link>http://blog.leafduo.com/07/install-acrobat-chs-under-arch/</link>
		<comments>http://blog.leafduo.com/07/install-acrobat-chs-under-arch/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 09:42:07 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[acroread]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[Arch]]></category>
		<category><![CDATA[Archlinux]]></category>
		<category><![CDATA[Chinese]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/07/install-acrobat-chs-under-arch</guid>
		<description><![CDATA[转到 Arch 下面也有两个星期了，感觉用 Arch 很习惯，比较简洁，比较快（废话，要不怎么叫 Arch），不过不是很习惯 KDE ，和 GNOME 操作上有很多不同， Amarok 倒是个好东西…… 扯远了，拉回来，前两天装 Adobe Reader 的时候遇到了一点小问题，这里说一下。 安装很简单， pacman -S arcoread 就搞定了，不过好像源里没有语言包，要自己装。于是去下载，之后安装。进行到让我输入安装路径的时候出问题了，无论我输入什么路径，它都让我再输入一遍……晕死……无奈之下，打开脚本看。发现按 Adboe 的要求， Arcoread 应该装在 $dir/Adobe/Reader8/Reader ，但是 Arch 把它装在了 /usr/share/acrobat ，这就出问题了，安装脚本就找不到路径了…… 没办法，手动来吧，发现其他几个文件是压缩包，于是解开，发现是按照 acroread 的目录结构放的一些文件，于是按照压缩包提供的路径手动复制过去，启动 acroread ，OK 了。 不得不抱怨一下， Arch 乱改什么路径， &#8230; <a href="http://blog.leafduo.com/07/install-acrobat-chs-under-arch/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>转到 <a href="http://www.archlinux.org/">Arch</a> 下面也有两个星期了，感觉用 Arch 很习惯，比较简洁，比较快（废话，要不怎么叫 <a href="http://wiki.archlinux.org/index.php/The_Arch_Way">Arch</a>），不过不是很习惯 <a href="http://www.kde.org/">KDE</a> ，和 <a href="http://www.gnome.org/">GNOME</a> 操作上有很多不同， <a href="http://amarok.kde.org/">Amarok</a> 倒是个好东西……</p>
<p>扯远了，拉回来，前两天装 Adobe Reader 的时候遇到了一点小问题，这里说一下。</p>
<p>安装很简单， pacman -S arcoread 就搞定了，不过好像源里没有语言包，要自己装。于是去<a href="http://www.adobe.com/products/acrobat/acrrasianfontpack.html">下载</a>，之后安装。进行到让我输入安装路径的时候出问题了，无论我输入什么路径，它都让我再输入一遍……晕死……无奈之下，打开脚本看。发现按 Adboe 的要求， Arcoread 应该装在 $dir/Adobe/Reader8/Reader ，但是 Arch 把它装在了 /usr/share/acrobat ，这就出问题了，安装脚本就找不到路径了……</p>
<p>没办法，手动来吧，发现其他几个文件是压缩包，于是解开，发现是按照 acroread 的目录结构放的一些文件，于是按照压缩包提供的路径手动复制过去，启动 acroread ，OK 了。</p>
<p>不得不抱怨一下， Arch 乱改什么路径， Adobe 的脚本连点提示都没有…… 哪位有空的时候把安装脚本改一下，改个 Arch 专用版。 <img src='http://blog.leafduo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>update:</strong> 也可以简单一句搞定：yaourt -S acroread8-fonts  （via <a href="http://lymanrb.spaces.live.com/">lyman</a>）</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/07/install-acrobat-chs-under-arch/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>高二的生活开始了</title>
		<link>http://blog.leafduo.com/52/senior-2-start/</link>
		<comments>http://blog.leafduo.com/52/senior-2-start/#comments</comments>
		<pubDate>Sun, 09 Sep 2007 14:29:52 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[senior]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/52/senior-2-start</guid>
		<description><![CDATA[今天是9月9号了，说这句话貌似晚了点。没办法，谁让这几天比较忙呢，都不知道自己在忙什么，总之比较忙就是了。我们这个学期是从9月3号开始的，开学第一天就上了晚自习，上到8：40，回家就到了9：30左右了，天都全黑了……刚开始的几天比较累，后来就习惯点了。上的课总是那么几门，语文、数学、英语、物理、化学、生物、政治，就这些上起来没完，让人有点烦，谁让高二没有历史、地理这样能听故事的课呢？高二和高三的学生一个人有一个柜子（貌似英文刚学的 locker ），其实应该说是半个，两个人共用一个，中间用隔板隔开。这个 locker 还没怎么利用起来，里面就放了一本信息技术课本，在家应该用不到这本书吧，不过我想过几天这个 locker 就有可能装满了……想像着成堆的教课书和教辅……中午和晚上都是出去吃，基本这个学期还没在食堂吃过，因为总是被同学拉出去…… 还有一件事就是我买了个手机，8月11号就买了，有些同学已经知道了……最近实在比较忙，所以没来的及跟大家说一声，号码就不说了啊……型号是索爱 W700c ，钛金色的那款，买了一张2GB的Memory Stick Pro Duo。这里顺便批评一下 Windows ，Windows 下往手机上传文件还得装个什么驱动，真是烦人，又不是什么特殊设备……（其实就是一个 Memory Stick Pro Duo 的读卡器）而 Linux 下直接 mount 上就行了，用不用什么驱动，比 Windows 方便。 星期五，也就是9月7号，下午实验没上课，老师好像要庆祝教师节，我们学生也就放学了，下午去初中看了看，老师都挺好的，几乎所有老师都说了两句话：一句是说我瘦了，第二句是说9班真乱啊 ，第二句没人否认，第一句貌似不太对吧，我好像没太变瘦啊……第三、四节课老师照例要开会，我们走了。之后，我到一个 同学家玩到晚上才回的家，打开手机一看，N个未接来电，其中一个到现在都不知道谁打的，知道的回一声，谢了。 课程上，原来学过的几科还是那么个难度，这个生物挺令人郁闷，前几节挺简单，学到细胞的基本结构就郁闷了，作业基本都错了……刚开始学，好好来吧。 别的大概没什么要说的了，就到这里吧 。想到哪里就说哪里，有点乱，大家见谅。]]></description>
			<content:encoded><![CDATA[<p>今天是9月9号了，说这句话貌似晚了点。没办法，谁让这几天比较忙呢，都不知道自己在忙什么，总之比较忙就是了。我们这个学期是从9月3号开始的，开学第一天就上了晚自习，上到8：40，回家就到了9：30左右了，天都全黑了……刚开始的几天比较累，后来就习惯点了。上的课总是那么几门，语文、数学、英语、物理、化学、生物、政治，就这些上起来没完，让人有点烦，谁让高二没有历史、地理这样能听故事的课呢？高二和高三的学生一个人有一个柜子（貌似英文刚学的 locker ），其实应该说是半个，两个人共用一个，中间用隔板隔开。这个 locker 还没怎么利用起来，里面就放了一本信息技术课本，在家应该用不到这本书吧，不过我想过几天这个 locker 就有可能装满了……想像着成堆的教课书和教辅……中午和晚上都是出去吃，基本这个学期还没在食堂吃过，因为总是被同学拉出去……</p>
<p>还有一件事就是我买了个手机，8月11号就买了，有些同学已经知道了……最近实在比较忙，所以没来的及跟大家说一声，号码就不说了啊……型号是索爱 W700c ，钛金色的那款，买了一张2GB的Memory Stick Pro Duo。这里顺便批评一下 Windows ，Windows 下往手机上传文件还得装个什么驱动，真是烦人，又不是什么特殊设备……（其实就是一个 Memory Stick Pro Duo 的读卡器）而 Linux 下直接 mount 上就行了，用不用什么驱动，比 Windows 方便。</p>
<p>星期五，也就是9月7号，下午实验没上课，老师好像要庆祝教师节，我们学生也就放学了，下午去初中看了看，老师都挺好的，几乎所有老师都说了两句话：一句是说我瘦了，第二句是说9班真乱啊 ，第二句没人否认，第一句貌似不太对吧，我好像没太变瘦啊……第三、四节课老师照例要开会，我们走了。之后，我到一个 同学家玩到晚上才回的家，打开手机一看，N个未接来电，其中一个到现在都不知道谁打的，知道的回一声，谢了。</p>
<p>课程上，原来学过的几科还是那么个难度，这个生物挺令人郁闷，前几节挺简单，学到细胞的基本结构就郁闷了，作业基本都错了……刚开始学，好好来吧。</p>
<p>别的大概没什么要说的了，就到这里吧 。想到哪里就说哪里，有点乱，大家见谅。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/52/senior-2-start/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>我回来了</title>
		<link>http://blog.leafduo.com/26/back-from-rizhao/</link>
		<comments>http://blog.leafduo.com/26/back-from-rizhao/#comments</comments>
		<pubDate>Sat, 28 Jul 2007 15:57:26 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/archives/91</guid>
		<description><![CDATA[貌似这句话今天说不太合适，因为我是26号下午回来的。26号下午上网看完了所有的feed（好几天的啊……），晚上跟同学聊天，打了几个电话。27号上午在家闲着，下午陪同学去游泳了，说是游泳，其实我已经不会了，小学的时候曾经学过，但现在却忘得一干二净了，在那里就光玩水了，连漂都漂不起来了，不过有同学陪着还是挺开心的^_^。今天上午去要了同学的数学笔记和作业，下午开始抄笔记（我是不记数学笔记的），刚才跟同学玩了一会QQtang，感觉远不如初中的时候玩得好了。（以上纯系流水帐，大家见谅） 回头说说夏令营吧。在那呆了十多天，那的食宿条件是在不敢恭维，而且还有舍管，我们这些没住过校的学生那能适应那个舍管啊……最重要的是不允许出校门！（虽然我们还是出去了，呵呵）但是，学到的东西还是不少的，最重要的体会就是写的代码太少，还应该多加练习才行。 回来之后发现很多东西变了。mofile和土豆换播放器了，Firefox下貌似不能全屏。维基好像又抽筋了，虽然我没赶上。wp的两个插件更新了，但是我没更新。Firefox也不知不觉的更新到了2.0.0.5，虽然这次更新貌似跟Linux用户关系不大。如此种种，是在太多了…… 回来之后，第一任务是写作业、抄笔记；第二就是多写点代码，准备11月竞赛。令人郁闷的是，物理的电学部分都快忘了，连闭合电路的欧姆定律、楞次定律、焦耳定律等等的很基础的东西也得想半天，郁闷ing。 最后附上在日照照的照片，都是乱照的，大家不要说我技术差啊……（虽然事实如此）（最前面几张是晚上照的，所以很黑）]]></description>
			<content:encoded><![CDATA[<p>貌似这句话今天说不太合适，因为我是26号下午回来的。26号下午上网看完了所有的feed（好几天的啊……），晚上跟同学聊天，打了几个电话。27号上午在家闲着，下午陪同学去游泳了，说是游泳，其实我已经不会了，小学的时候曾经学过，但现在却忘得一干二净了，在那里就光玩水了，连漂都漂不起来了，不过有同学陪着还是挺开心的^_^。今天上午去要了同学的数学笔记和作业，下午开始抄笔记（我是不记数学笔记的），刚才跟同学玩了一会QQtang，感觉远不如初中的时候玩得好了。（以上纯系流水帐，大家见谅）</p>
<p>回头说说夏令营吧。在那呆了十多天，那的食宿条件是在不敢恭维，而且还有舍管，我们这些没住过校的学生那能适应那个舍管啊……最重要的是不允许出校门！（虽然我们还是出去了，呵呵）但是，学到的东西还是不少的，最重要的体会就是写的代码太少，还应该多加练习才行。</p>
<p>回来之后发现很多东西变了。<a href="http://www.mofile.com" target="_blank">mofile</a>和<a href="http://www.tudou.com/" target="_blank">土豆</a>换播放器了，Firefox下貌似不能全屏。维基好像又抽筋了，虽然我没赶上。wp的两个插件更新了，但是我没更新。Firefox也不知不觉的更新到了2.0.0.5，虽然这次更新貌似跟Linux用户关系不大。如此种种，是在太多了……</p>
<p>回来之后，第一任务是写作业、抄笔记；第二就是多写点代码，准备11月竞赛。令人郁闷的是，物理的电学部分都快忘了，连闭合电路的欧姆定律、楞次定律、焦耳定律等等的很基础的东西也得想半天，郁闷ing。</p>
<p>最后附上在日照照的照片，都是乱照的，大家不要说我技术差啊……（虽然事实如此）（最前面几张是晚上照的，所以很黑）</p>
<p><embed src="http://picasaweb.google.com/s/c/bin/slideshow.swf" type="application/x-shockwave-flash" flashvars="host=picasaweb.google.com&amp;captions=1&amp;RGB=0x000000&amp;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2FLeafDuo%2Falbumid%2F5092219161400854769%3Fkind%3Dphoto%26alt%3Drss" pluginspage="http://www.macromedia.com/go/getflashplayer" height="267" width="400"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/26/back-from-rizhao/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>终于放假了</title>
		<link>http://blog.leafduo.com/46/holiday-come/</link>
		<comments>http://blog.leafduo.com/46/holiday-come/#comments</comments>
		<pubDate>Thu, 05 Jul 2007 14:03:46 +0000</pubDate>
		<dc:creator>Leaf Duo</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[holiday]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://leafduo.com/blog/?p=89</guid>
		<description><![CDATA[今天终于放假了，虽然正式放假的时间是5月8日，但是从现在开始的相当长的时间里我们就不用去学校了，所以就算是放假了吧。 先说一下假期的安排吧。这个假期是高中唯一一个完整的暑假，所以一定要珍惜啊，直接结果就是这个暑假会很忙。7月14日到26日要到日照一中东校区参加信息学夏令营，其实就是去上课，为11月的比赛做准备。除了去夏令营，我自己也应该为比赛做好准备，自己在家多看看说，多写写代码，提高一下水平，争取考个好成绩。除了搞竞赛，跟计算机相关的事情还有不少，例如说学习一下LAMP（Linux、Apache、MySQL、PHP），学习一下python或者perl，学习一下Photoshop……这个假期作业也不少，语文、数学、英语、物理、化学每科有一本作业，着实比较恐怖。而且还得复习和预习，虽然说没有历史和地理之后减少了很大负担，但是数学、物理、化学就够忙得了，还有语文、英语得看，还得背，真的比较多啊。总之，这个假期就是计算机和学习两件事了。（of course, enjoying is necessary.） 在说一下前几天的事。前几天光忙着准备期末考试了，Blog上没写多少东西，写了的也都没什么内容，现在一看，这都是什么啊……然后，考试完了，第二天就出了成绩，考的还行，班里第5，级部407，比较正常，可能是文科考的少的关系吧。然后，跟着英卓社开了个会，说开blog，要求有办blog和Photoshop的能力，做blog没问题，但是Photoshop就比较悬了，我来了个速成，交了一个作品，水平显然是不够了，可能英卓社的老大正看着我的blog呢，呵呵。 好了，今天就到这里吧。]]></description>
			<content:encoded><![CDATA[<p>今天终于放假了，虽然正式放假的时间是5月8日，但是从现在开始的相当长的时间里我们就不用去学校了，所以就算是放假了吧。</p>
<p>先说一下假期的安排吧。这个假期是高中唯一一个完整的暑假，所以一定要珍惜啊，直接结果就是这个暑假会很忙。7月14日到26日要到日照一中东校区参加信息学夏令营，其实就是去上课，为11月的比赛做准备。除了去夏令营，我自己也应该为比赛做好准备，自己在家多看看说，多写写代码，提高一下水平，争取考个好成绩。除了搞竞赛，跟计算机相关的事情还有不少，例如说学习一下LAMP（Linux、Apache、MySQL、PHP），学习一下python或者perl，学习一下Photoshop……这个假期作业也不少，语文、数学、英语、物理、化学每科有一本作业，着实比较恐怖。而且还得复习和预习，虽然说没有历史和地理之后减少了很大负担，但是数学、物理、化学就够忙得了，还有语文、英语得看，还得背，真的比较多啊。总之，这个假期就是计算机和学习两件事了。（of course, enjoying is necessary.）</p>
<p>在说一下前几天的事。前几天光忙着准备期末考试了，Blog上没写多少东西，写了的也都没什么内容，现在一看，这都是什么啊……然后，考试完了，第二天就出了成绩，考的还行，班里第5，级部407，比较正常，可能是文科考的少的关系吧。然后，跟着英卓社开了个会，说开blog，要求有办blog和Photoshop的能力，做blog没问题，但是Photoshop就比较悬了，我来了个速成，交了一个作品，水平显然是不够了，可能英卓社的老大正看着我的blog呢，呵呵。</p>
<p>好了，今天就到这里吧。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leafduo.com/46/holiday-come/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

