<?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>东东有礼 &#187; Linux</title>
	<atom:link href="http://leedd.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://leedd.com</link>
	<description>东东有礼的互联网观察</description>
	<lastBuildDate>Thu, 10 May 2012 16:11:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>你可能会用到的资料</title>
		<link>http://leedd.com/2010/04/some-docs-you-will-need/</link>
		<comments>http://leedd.com/2010/04/some-docs-you-will-need/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 12:53:28 +0000</pubDate>
		<dc:creator>东东有礼</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[leedd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PR]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://leedd.com/?p=1119</guid>
		<description><![CDATA[今天难得清闲，整理下在沉思小屋内部保存的一些资料，这些你可能会用到,本来是作为我个人的网上资料收集库的...]]></description>
			<content:encoded><![CDATA[<p>今天难得清闲，整理下在沉思小屋内部保存的一些<strong>资料</strong>，这些你可能会用到,本来是作为我个人的<strong>网上资料收集库</strong>的（现在还有个想法，想开个docs.leedd.com的知识收集站或是FTP，不知道你有什么好的建议？），废话不多说，下面是一些你可能用到的资料，收集了3年断断续续的，碍于空间有限也不是全部的都放到网上，本地硬盘倒是有很多！因为收集的时间不同而且中间小屋改版过几次所以存放的路径有点乱，见谅。</p>
<p><strong><a href="http://leedd.com/docs/">http://leedd.com/docs/</a> </strong> 这个目录下有好的零碎的文章，可以翻阅下（主力收藏，也是最杂的）</p>
<p><strong><a href="http://leedd.com/html/">http://leedd.com/html/</a></strong> 有三本自己曾经开过的或是再看的网上学习电子书，它们分别是：</p>
<ul>
<li><a href="http://leedd.com/html/abs-3.9.1/"> abs-3.9.1/</a> 高级Bash脚本编程指南&#8212;-一本深入学习shell脚本艺术的书籍</li>
</ul>
<ul>
<li><a href="http://leedd.com/html/html-language/"> html-language/</a> HTML语言剖析  。</li>
<li><a href="http://leedd.com/html/python/"> python/ </a> 简明Python教程 最近在看</li>
</ul>
<p>可能以后主要会写一些Linux系统常用的技术含量低的文章，作为我的成长笔记，也算个Linux“折腾”入门知识，作为一个技术不牛的技术博客，需要慢慢的奋斗，至少要多写点技术方面的，恩   初步规划是 linux、wordpress、shell、Python。</p>
]]></content:encoded>
			<wfw:commentRss>http://leedd.com/2010/04/some-docs-you-will-need/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>为中标普华Linux或Fedora构建本地yum仓库</title>
		<link>http://leedd.com/2010/04/createrepo-yum-for-neoshine-and-fedora/</link>
		<comments>http://leedd.com/2010/04/createrepo-yum-for-neoshine-and-fedora/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 01:00:09 +0000</pubDate>
		<dc:creator>东东有礼</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[leedd]]></category>
		<category><![CDATA[mock]]></category>
		<category><![CDATA[po]]></category>
		<category><![CDATA[yum]]></category>
		<category><![CDATA[工具]]></category>

		<guid isPermaLink="false">http://leedd.com/?p=1087</guid>
		<description><![CDATA[如何为中标普华Linux或Fedora构建本地yum仓库：

1、首先安装创建仓库所用到的工具： createrepo



...]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 2cm } 		TD P { margin-bottom: 0cm } 		P { margin-bottom: 0.21cm } --><strong>如何为中标普华</strong><span style="font-family: Liberation Serif,serif;"><strong>Linux</strong></span><strong>或</strong><span style="font-family: Liberation Serif,serif;"><strong>Fedora</strong></span><strong>构建本地</strong><span style="font-family: Liberation Serif,serif;"><strong>yum</strong></span><strong>仓库：</strong></p>
<p><span style="font-family: Liberation Serif,serif;">1</span>、首先安装创建仓库所用到的工具： <span style="font-family: Liberation Serif,serif;">createrepo</span></p>
<table border="1" cellspacing="2" cellpadding="3" width="100%" bordercolor="#0047ff">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top"><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com ~]$ sudo 			yum install createrepo </span></td>
</tr>
</tbody>
</table>
<p><span style="font-family: Liberation Serif,serif;"> </span>然后根据提示输入当前用户密码，或是直接用<span style="font-family: Liberation Serif,serif;">root</span>帐号进行安装。</p>
<p><span style="font-family: Liberation Serif,serif;">2</span>、为本地仓库创建目录结构，如在当前用户的根目录（<span style="font-family: Liberation Serif,serif;">/home/Lee</span>）下创建<span style="font-family: Liberation Serif,serif;">:</span></p>
<table border="1" cellspacing="2" cellpadding="3" width="100%" bordercolor="#0047ff">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top"><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com ~]$ pwd </span></p>
<p><span style="font-family: Liberation Serif,serif;">/home/Lee </span></p>
<p><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com ~]$ mkdir 			-p /home/Lee/repos/yum/neoshine/base/5/i386 </span></p>
<p><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com ~]$ mkdir 			-p /home/Lee/repos/yum/neoshine/updates/5/i386</span></td>
</tr>
</tbody>
</table>
<p><span style="font-family: Liberation Serif,serif;">3</span>、把<span style="font-family: Liberation Serif,serif;">mock</span>需要用到的文件复制到<span style="font-family: Liberation Serif,serif;">/home/Lee/repos/yum/neoshine/base/5/i386 </span>目录下<span id="more-1087"></span></p>
<p><span style="font-family: Liberation Serif,serif;">4</span>、创建仓库所需要的数据结构文件</p>
<table border="1" cellspacing="2" cellpadding="3" width="100%" bordercolor="#0047ff">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top"><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com ~]$ 			createrepo  /home/Lee/repos/yum/neoshine/base/5/i386 </span></td>
</tr>
</tbody>
</table>
<p><span style="font-family: Liberation Serif,serif;"> </span>创建后会生成：<span style="font-family: Liberation Serif,serif;">/home/Lee/repos/yum/neoshine/base/5/i386/repodata </span>目录。里面包含一些<span style="font-family: Liberation Serif,serif;">.xml </span>和 <span style="font-family: Liberation Serif,serif;">.gz </span>文件。</p>
<p><span style="font-family: Liberation Serif,serif;">5</span>、配置本地<span style="font-family: Liberation Serif,serif;">yum</span>参数</p>
<p><span style="font-family: Liberation Serif,serif;"> </span>到<span style="font-family: Liberation Serif,serif;">yum</span>配置文件所在目录，然后对该目录下的<span style="font-family: Liberation Serif,serif;">.repo</span>文件进行根目录权限编辑（如果是<span style="font-family: Liberation Serif,serif;">root</span>账户则不需要用<span style="font-family: Liberation Serif,serif;">sudo</span>），不同系统的名字可能不一样。</p>
<table border="1" cellspacing="2" cellpadding="3" width="100%" bordercolor="#0047ff">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top"><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com ~]$ cd 			/etc/yum.repos.d/ </span></p>
<p><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com 			yum.repos.d]$ ls </span></p>
<p><span style="font-family: Liberation Serif,serif;">neoshine.repo </span></p>
<p><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com 			yum.repos.d]$ sudo vim neoshine.repo</span></td>
</tr>
</tbody>
</table>
<p>打开该文件后，查找<span style="font-family: Liberation Serif,serif;">-base</span>相关的配置，如：</p>
<table border="1" cellspacing="2" cellpadding="3" width="100%" bordercolor="#0047ff">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top"><span style="font-family: Liberation Serif,serif;"># This is the repo define 			for NSLD5 </span></p>
<p><span style="font-family: Liberation Serif,serif;">[nsld5-base] </span></p>
<p><span style="font-family: Liberation Serif,serif;">name=NeoShine Linux 			Desktop 5 &#8211; base &#8211; i386 </span></p>
<p><span style="font-family: Liberation Serif,serif;">baseurl=ftp://nsupdate:nsupdate@ftp.cs2c.com.cn/ND/5/base/i386/ </span></p>
<p><span style="font-family: Liberation Serif,serif;">enabled=1 </span></p>
<p><span style="font-family: Liberation Serif,serif;">gpgcheck=1 </span></p>
<p><span style="font-family: Liberation Serif,serif;">gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-neoshine-release </span></td>
</tr>
</tbody>
</table>
<p>根据上面参数配置本地仓库所在路径：</p>
<table border="1" cellspacing="2" cellpadding="3" width="100%" bordercolor="#0047ff">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top"><span style="font-family: Liberation Serif,serif;"># This is the repo define 			for NSLD5 </span></p>
<p><span style="font-family: Liberation Serif,serif;">[nsld5-test] </span></p>
<p><span style="font-family: Liberation Serif,serif;">name=NeoShine Linux 			Desktop 5 &#8211; test &#8211; i386 </span></p>
<p><span style="font-family: Liberation Serif,serif;">baseurl=file:///home/Lee/repos/yum/neoshine/base/5/i386 </span></p>
<p><span style="font-family: Liberation Serif,serif;">enabled=1 </span></p>
<p><span style="font-family: Liberation Serif,serif;">gpgcheck=0</span></p>
<p><span style="font-family: Liberation Serif,serif;">gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-neoshine-release </span></td>
</tr>
</tbody>
</table>
<p>注意，<span style="font-family: Liberation Serif,serif;">test</span>为任意文件名字。</p>
<p><span style="font-family: Liberation Serif,serif;">Enabled=1 </span>表示开启该仓库，可以同时并行使用仓库。</p>
<p><span style="font-family: Liberation Serif,serif;">gpgcheck=0 </span>为密匙验证，因为在本机测试，所有包都可信，所以关闭该验证。</p>
<p>然后进入<span style="font-family: Liberation Serif,serif;">/etc/mock</span>目录</p>
<p>找到与刚才 <span style="font-family: Liberation Serif,serif;">nsld5-base </span>对应的<span style="font-family: Liberation Serif,serif;">neoshine-5-i686.cfg</span>文件</p>
<table border="1" cellspacing="2" cellpadding="3" width="100%" bordercolor="#0047ff">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top"><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com mock]$ sudo 			cp neoshine-5-i686.cfg  neoshine-test-i686.cfg </span></p>
<p><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com mock]$ sudo 			vim neoshine-test-i686.cfg </span></td>
</tr>
</tbody>
</table>
<p>然后类比<span style="font-family: Liberation Serif,serif;">nsld5-base </span>创建<span style="font-family: Liberation Serif,serif;">nsld-base-test</span></p>
<table border="1" cellspacing="2" cellpadding="3" width="100%" bordercolor="#0047ff">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top"><span style="font-family: Liberation Serif,serif;">[nsld5-base] </span></p>
<p><span style="font-family: Liberation Serif,serif;">name=NeoShine Linux 			Desktop 5 &#8211; base &#8211; i386 </span></p>
<p><span style="font-family: Liberation Serif,serif;">baseurl=ftp://nsupdate:nsupdate@ftp.cs2c.com.cn/ND/5/base/i386/ </span></p>
<p><span style="font-family: Liberation Serif,serif;">enabled=1 </span></p>
<p><span style="font-family: Liberation Serif,serif;">gpgcheck=1 </span></p>
<p><span style="font-family: Liberation Serif,serif;">gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-neoshine-release </span></p>
<p><span style="font-family: Liberation Serif,serif;">[nsld5-base-test] </span></p>
<p><span style="font-family: Liberation Serif,serif;">name=NeoShine Linux 			Desktop 5 &#8211; base-test &#8211; i386 </span></p>
<p><span style="font-family: Liberation Serif,serif;">baseurl=file:///home/Lee/repos/yum/neoshine/base/5/i386 </span></p>
<p><span style="font-family: Liberation Serif,serif;">enabled=1 </span></p>
<p><span style="font-family: Liberation Serif,serif;">gpgcheck=0 </span></p>
<p><span style="font-family: Liberation Serif,serif;">gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-neoshine-release </span></td>
</tr>
</tbody>
</table>
<p>最后<span style="font-family: Liberation Serif,serif;">cd</span>到所要<span style="font-family: Liberation Serif,serif;">mock</span>的<span style="font-family: Liberation Serif,serif;">.src.rpm</span>二进制包所在目录，<span style="font-family: Liberation Serif,serif;">mock</span>的时候则使用该<span style="font-family: Liberation Serif,serif;">test</span>仓库即可</p>
<table border="1" cellspacing="2" cellpadding="3" width="100%" bordercolor="#0047ff">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top"><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com ~]$ cd 			src-rpm</span></p>
<p><span style="font-family: Liberation Serif,serif;">[Lee@leedd.com src-rpm]$ 			mock -r neoshine-test-i686 &#8211;rebuild  XXX.src.rpm </span></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://leedd.com/2010/04/createrepo-yum-for-neoshine-and-fedora/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mount命令挂载设备的实现原理</title>
		<link>http://leedd.com/2010/04/how-to-mount-device-and-works/</link>
		<comments>http://leedd.com/2010/04/how-to-mount-device-and-works/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 02:31:49 +0000</pubDate>
		<dc:creator>东东有礼</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[nautulus]]></category>

		<guid isPermaLink="false">http://leedd.com/?p=1078</guid>
		<description><![CDATA[要了解linux下的mount命令是如何挂载设备的工作原理，首先我们要回答以下四个问题：1.怎么知道应该去挂载？...]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --> 要了解linux下的mount命令是如何挂载设备的工作原理，首先我们要回答以下四个问题：<strong>1.怎么知道应该去挂载？2.挂载的几种文件格式 3.如何去挂载？ 4.挂载的位置如何确定？</strong>弄明白了这四个问题，就能知道monut的实现原理及工作过程。下面我们来详细分析下</p>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --><br />
<strong>下载并获得nautilsu源码：</strong></p>
<pre>[Lee@leedd.com ~]$ yumdownloader --source nautilus
载入插件: refresh-packagekit
nautilus-2.24.2-5_nd5_8.src.rpm                          | 5.2 MB     00:00
[Lee@leedd.com ~]$ rpm -ivh nautilus-2.24.2-5_nd5_8.src.rpm
[Lee@leedd.com rpmbuild]$ rpmbuild -bp SPECS/nautilus.spec
[Lee@leedd.com rpmbuild]$cd BUILD
[Lee@leedd.com BUILD]$ pwd
/home/Lee/rpmbuild/BUILD</pre>
<p><strong>在</strong><span style="font-family: Liberation Serif,serif;"><strong>nautilus-2.24.2/libnautilus-private/nautilus-autorun.c</strong></span><strong>中</strong><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --><strong>定位</strong><span style="font-family: Liberation Serif,serif;"><strong>mount</strong></span><strong>实现相关的函数</strong><span style="font-family: Liberation Serif,serif;"><strong> </strong></span></p>
<pre><span style="font-family: Liberation Serif,serif;"> </span><span id="more-1078"></span>
<span style="font-family: Liberation Serif,serif;"> </span>用函数<span style="font-family: Liberation Serif,serif;">: should_autorun_mount (GMount *mount)</span>来实现自动挂载，其中<span style="font-family: Liberation Serif,serif;">: </span>
<span style="font-family: Liberation Serif,serif;"> enclosing_volume = g_mount_get_volume (mount) ;
                       // </span>用 <span style="font-family: Liberation Serif,serif;">g_mount_get_volume (mount)</span>来获取需要<span style="font-family: Liberation Serif,serif;">mount</span>的对象，返回 <span style="font-family: Liberation Serif,serif;">Gvolume</span>或<span style="font-family: Liberation Serif,serif;">NULL </span>
<span style="font-family: Liberation Serif,serif;"> if (enclosing_volume != NULL)
                             // </span>如果该介质（封闭的卷）非空，并且如下：<span style="font-family: Liberation Serif,serif;"> </span>
<span style="font-family: Liberation Serif,serif;"> if (g_object_get_data (G_OBJECT (enclosing_volume), "nautilus-allow-autorun") != NULL) {
                             //</span>获取封闭数据卷的类型，非空<span style="font-family: Liberation Serif,serif;"> </span>
<span style="font-family: Liberation Serif,serif;"> ignore_autorun = FALSE; </span>
<span style="font-family: Liberation Serif,serif;"> g_object_set_data (G_OBJECT (enclosing_volume), "nautilus-allow-autorun", NULL); </span>
<span style="font-family: Liberation Serif,serif;"> } </span>
<span style="font-family: Liberation Serif,serif;"> } </span>
<span style="font-family: Liberation Serif,serif;"> </span>
<span style="font-family: Liberation Serif,serif;"> </span>
<span style="font-family: Liberation Serif,serif;"> if (ignore_autorun) { </span>
<span style="font-family: Liberation Serif,serif;"> if (enclosing_volume != NULL) { </span>
<span style="font-family: Liberation Serif,serif;"> g_object_unref (enclosing_volume);
                             //,</span>对封闭的卷<span style="font-family: Liberation Serif,serif;">(enlosing_volume)</span>进行引用计数并排列位置<span style="font-family: Liberation Serif,serif;"> </span>
<span style="font-family: Liberation Serif,serif;"> } </span>
<span style="font-family: Liberation Serif,serif;"> return FALSE; </span>
<span style="font-family: Liberation Serif,serif;"> } </span>
<span style="font-family: Liberation Serif,serif;"> </span></pre>
<p>通过上面的简单分析，我们可以知道mount工作原理及流程，并回答上面四个问题</p>
<p><strong>1.怎么知道应该去挂载？</strong>&#8212;&#8212;&#8212;&#8212;&#8212;-g_mount_get_volume (mount)函数获取需要mount的对象来实现（返回值为Gvolume或NULL）</p>
<p><strong>2.</strong><strong>挂载的几种文件格式</strong> g_object_get_data (G_OBJECT (enclosing_volume), “nautilus-allow-autorun”) 获取nautilus-allow-autorun的数据文件类型</p>
<p>可以挂载的<strong>文件类型</strong>： iso9660 ext ext2 ext3 fat fhs hpfs jfs ntfs ufs vfat等等&#8212;-通过man mount获得</p>
<p><strong>3.如何去挂载</strong>？<strong>用什么挂载 ：</strong> 用函数: should_autorun_mount (GMount *mount)来判断实现自动挂载</p>
<p>具体参考本文上方函数解释</p>
<p><strong>4.挂载的位置如何确定：</strong> 用 g_object_unref(enclosing_volume)来对封闭的卷(enlosing_volume)进行引用计数，当 g_object_unref()值为unreffed 既是不再需要时候取消该挂载位置</p>
]]></content:encoded>
			<wfw:commentRss>http://leedd.com/2010/04/how-to-mount-device-and-works/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>今天Google pr更新</title>
		<link>http://leedd.com/2010/04/google-pr-update/</link>
		<comments>http://leedd.com/2010/04/google-pr-update/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 12:49:15 +0000</pubDate>
		<dc:creator>东东有礼</dc:creator>
				<category><![CDATA[互联网]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[c语言]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[lee.spec]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PR]]></category>
		<category><![CDATA[rpmbuild]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[spec]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[tar.bz2]]></category>
		<category><![CDATA[tar.gz]]></category>
		<category><![CDATA[xpud]]></category>
		<category><![CDATA[本地化]]></category>

		<guid isPermaLink="false">http://leedd.com/?p=1018</guid>
		<description><![CDATA[今天google的 pr更新，在这个推出的时刻至少稳定了部分站长的心，不用担心pr清零等问题

沉思小屋的主页p...]]></description>
			<content:encoded><![CDATA[<p>今天google的 pr更新，在这个时刻gg正常更新至少稳定了部分站长的心，不用担心pr清零等问题</p>
<p><strong>沉思小屋的主页pr依然保持在3 ，不过部分内页权重有些提升，部分pr2的内页如下：</strong></p>
<p><strong><a href="http://leedd.com/html/abs-3.9.1/">高级Bash脚本编程指南 </a></strong></p>
<p><strong><a href="http://leedd.com/2010/02/taobao-servies-call/">淘宝卖家维权电话</a></strong></p>
<p><strong>Linux shell介绍的 <a name="COMPARISON-OPS" href="http://leedd.com/html/abs-3.9.1/comparison-ops.html">其他比较操作符</a></strong></p>
<p><a href="http://leedd.com/2010/03/linux-c-i18n-l10n-xgettext-msgfmt-rpmbuild/"><strong>Linux下C语言的本地化／国际化实现</strong></a> （<a href="http://leedd.com/2010/03/linux-c-i18n-l10n-xgettext-msgfmt-rpmbuild/"><strong>点击查看</strong></a>）</p>
<p><a href="http://leedd.com/2010/03/xpud-linux-system-guide/"><strong>接入云端：轻量级Linux系统xpud</strong></a></p>
<p>遗憾的是下面几个链接只有pr1</p>
<p><a href="http://leedd.com/2010/01/linux-tar-tar-gz-tar-bz2/">Linux下创建与解压tar, tar.gz和tar.bz2文件及压缩率对比</a></p>
<p><a href="http://leedd.com/2009/12/mib-and-mb/">电脑硬盘统计中的MiB和MB的区别</a></p>
<p><strong><a href="http://leedd.com/2009/07/rpmbuild/">在linux下rpmbuild文件lee.spec成功</a></strong> （最早是pr2）</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-其它暂时没有统计</p>
]]></content:encoded>
			<wfw:commentRss>http://leedd.com/2010/04/google-pr-update/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Linux下C语言的本地化／国际化实现</title>
		<link>http://leedd.com/2010/03/linux-c-i18n-l10n-xgettext-msgfmt-rpmbuild/</link>
		<comments>http://leedd.com/2010/03/linux-c-i18n-l10n-xgettext-msgfmt-rpmbuild/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 02:34:31 +0000</pubDate>
		<dc:creator>东东有礼</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[c语言]]></category>
		<category><![CDATA[mock]]></category>
		<category><![CDATA[msgfmt]]></category>
		<category><![CDATA[po-edit]]></category>
		<category><![CDATA[rpmbuild]]></category>
		<category><![CDATA[xgettext]]></category>
		<category><![CDATA[本地化]]></category>

		<guid isPermaLink="false">http://leedd.com/?p=977</guid>
		<description><![CDATA[ 在linux系统下，以c语言程序为例来实现程序的国际化，即让程序根据Linux系统不同的语言环境的不同来显示出...]]></description>
			<content:encoded><![CDATA[<p><strong> 在linux系统下，以c语言程序为例来实现程序的国际化，即让程序根据Linux系统不同的语言环境的不同来显示出对应该语言的文字，即先让c程序支持国际化然后再进行本地化翻译。</strong></p>
<p><strong> Linux上实现这个过程需要用到xgettext和msgfmt这两个工具。</strong></p>
<p><span style="font-family: Liberation Serif,serif;"> Xgettext </span>是国际化的工具，用来提取程序中的字符串，生成＊<span style="font-family: Liberation Serif,serif;">.po</span>或是<span style="font-family: Liberation Serif,serif;">*.pot</span>的文件，</p>
<p><span style="font-family: Liberation Serif,serif;"> msgfmt</span>是本地化的工具，用来编译翻译后的<span style="font-family: Liberation Serif,serif;">.po</span>文件为<span style="font-family: Liberation Serif,serif;">.mo</span>文件<span style="font-family: Liberation Serif,serif;">,</span>这样系统在启动时候会扫描系统环境提取对应名字的<span style="font-family: Liberation Serif,serif;">.mo</span>文件中的字符串替代原来的英文，实现本地化。</p>
<p><strong><span style="font-family: Liberation Serif,serif;"> </span>如我们来做一个简单的<span style="font-family: Liberation Serif,serif;">rpm</span>包，包文件的目录树如下：</strong></p>
<p><span style="font-family: Liberation Serif,serif;"> <strong>hello.c</strong> /*</span>我们用来测试的<span style="font-family: Liberation Serif,serif;">c</span>语言程序<span style="font-family: Liberation Serif,serif;">*/</span></p>
<p><span style="font-family: Liberation Serif,serif;"> <strong>po /zh_CN.po </strong> /*</span>放在该包根目录下的<span style="font-family: Liberation Serif,serif;">po</span>目录。对应于该程序进行的中文翻译<span style="font-family: Liberation Serif,serif;">*/</span></p>
<p><span id="more-977"></span></p>
<p><strong>第一步、支持国际化的C程序(hello.c)如下：</strong></p>
<table border="1" cellspacing="1" cellpadding="3" width="100%" bordercolor="#23ff23">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top">1 <strong>#include 			&lt;stdio.h&gt;</strong>2 			<strong>#include &lt;libintl.h&gt;</strong> // 			gettext 库支持</p>
<p>3 			<strong>#include &lt;locale.h&gt;</strong> // 本地化locale的翻译支持</p>
<p>4</p>
<p>5 			<strong>#define _(STRING)  gettext(STRING) </strong><strong>//</strong><strong>为了减少代码量和输入量，用别名</strong><strong>_(STRING)</strong><strong>替换</strong><strong>gettext(STRONG)</strong></p>
<p>6 			<strong>#define PACKAGE “hello”</strong> // 定义软件包的名字为hello</p>
<p>7 			<strong>#define LOCALEDIR “/usr/share/locale/”</strong> //定义系统语言环境的目录，该目录下存放各种国际化的语言，不同系统可能有差异。</p>
<p>8</p>
<p><span style="color: #000000;">9</span></p>
<p>10 			<strong>int main (int argv, char  *argc[] ) </strong></p>
<p>11 			<strong>{ </strong></p>
<p>12 			        <strong>setlocale (LC_ALL, “”);</strong> //设置locale为系统默认语言环境，gtk程序不需要,因为gtk_init()已经帮我们做了</p>
<p>13 			        <strong>bindtextdomain (PACKAGE, 			LOCALEDIR);</strong> //关联包名称及其对应的国际化翻译语言所在路径</p>
<p>14 			        <strong>textdomain (PACKAGE); </strong>//定义.mo文件的名字，省略“.mo”后缀，（<strong>可以多个路径下的不同</strong><strong>mo</strong><strong>文件） </strong><!-- 可以用不同路径下的不同mo文件，如：  bindtextdomain (PACKAGE, LOCALEDIR);  textdomain (PACKAGE);  printf(_("Hello, World!\n"));          printf(_("test 001\n")); /*上面的翻译用的是LOCALEDIR路径下PACKAGE.mo的翻译*/  bindtextdomain (P2, L2);  textdomain (P2);  printf(_("Hello, World!\n")); /*上面的翻译用的是L2路径下P2.mo*/ --></p>
<p>15 			        <strong>printf(_(“Hello, 			World!\n”)); </strong><strong> //</strong><strong>国际化字符串支持，结合上面的替换，实际应是：</strong><strong>printf(gettext(“Hello, 			World!\n”)); </strong></p>
<p>16 			        <strong>printf(_(“This is a example 			of locale&amp;rpm @ Neoshine Desktop 5!\n”)); </strong></p>
<p>17 			        <strong>return 0; </strong></p>
<p>18 			<strong>} </strong></td>
</tr>
</tbody>
</table>
<p>第二步、提取待翻译<span style="font-family: Liberation Serif,serif;">po</span>并进行本地化</p>
<p><span style="font-family: Liberation Serif,serif;"> </span>先用下面的命令提取出<span style="font-family: Liberation Serif,serif;">c</span>程序中需要进行本地化的语言文件。</p>
<p><span style="font-family: Liberation Serif,serif;"> </span></p>
<table border="1" cellspacing="1" cellpadding="3" width="100%" bordercolor="#23ff23">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top"><span style="color: #ff0000;"><strong>[Lee@leedd.com hello]$ 			xgettext  -k </strong></span><span style="color: #ff0000;"><strong>-</strong><strong>-</strong></span><span style="color: #ff0000;"><strong>keyword=_  hello.c   -o  hello.pot</strong></span></td>
</tr>
</tbody>
</table>
<p><span style="font-family: Liberation Serif,serif;"> </span>再用<span style="font-family: Liberation Serif,serif;">poedit</span>或是<span style="font-family: Liberation Serif,serif;">vim</span>翻译<span style="font-family: Liberation Serif,serif;">hello.pot</span>中对应英文为中文并另存为<span style="font-family: Liberation Serif,serif;">zh_CN.po </span>，作为中文本地化的翻译文件。</p>
<p>如下面翻译后的zh_CN.po文件的内容：</p>
<table border="1" cellspacing="1" cellpadding="3" width="100%" bordercolor="#23ff23">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top">
<table border="1" cellspacing="1" cellpadding="3" width="100%" bordercolor="#23ff23">
<tbody>
<tr>
<td width="100%" valign="top">1 			msgid “”2 			msgstr “”</p>
<p>3 			“Project-Id-Version: \n”</p>
<p>4 			“Report-Msgid-Bugs-To: \n”</p>
<p>5 			“POT-Creation-Date: 2010-03-11 11:52+0800\n”</p>
<p>6 			“PO-Revision-Date: \n”</p>
<p>7 			“Last-Translator: Leedd &lt;iam@Leedd.com&gt;\n”</p>
<p>8 			“Language-Team: \n”</p>
<p>9 			“MIME-Version: 1.0\n”</p>
<p>10 			“Content-Type: text/plain; charset=UTF-8\n”</p>
<p>11 			“Content-Transfer-Encoding: 8bit\n”</p>
<p>12</p>
<p>13 			#: hello.c:15</p>
<p>14 			#, c-format</p>
<p>15 			msgid “Hello, World!\n”</p>
<p>16 			msgstr “你好，世界！\n”</p>
<p>17</p>
<p>18 			#: hello.c:16</p>
<p>19 			#, c-format</p>
<p>20 			msgid “This is a example of locale&amp;rpm @ Leedd.com !\n”</p>
<p>21 			msgstr “这是在沉思小屋下的关于\”本地化\”和\”rpm打包\”的测试!\n”</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><strong>第三步、把翻译后的文件打包</strong></p>
<p><span style="font-family: Liberation Serif,serif;"> </span>制作<span style="font-family: Liberation Serif,serif;">rpm</span>包相当于给源程序添加一个外衣，让用户很容易的安装、使用，而不用理会源程序的编译过程等细节。如果要进行<span style="font-family: Liberation Serif,serif;">rpmbuild</span>我们需要先写个<span style="font-family: Liberation Serif,serif;">SPEC</span>文件，如下：</p>
<p><strong>Neoshine-hello-wrold.spec文件内容</strong></p>
<table border="1" cellspacing="1" cellpadding="3" width="100%" bordercolor="#23ff23">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top">1 			Name:           neoshine-hello-world</p>
<p>2 			Version:        5.0</p>
<p>3 			Release:        1</p>
<p>4 			License:        GPL+</p>
<p>5 			Group:          Applications/System</p>
<p>6 			URL:            http://leedd.com</p>
<p>7 			Source0:        %{name}-%{version}.tar.bz2</p>
<p>8 			BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root</p>
<p>9</p>
<p>10 			Summary:        A applet for Neoshine Desktop (or the other 			similar Linux system).</p>
<p>11 			BuildRequires:  gettext</p>
<p>12 			BuildRequires:  gcc</p>
<p>13</p>
<p>14</p>
<p>15 			%description</p>
<p>16 			        A hello world examples for the locale＆rpm</p>
<p>17</p>
<p>18 			%prep</p>
<p>19 			%setup -q</p>
<p>20</p>
<p>21 			##,%build</p>
<p>22</p>
<p>23 			%install</p>
<p>24</p>
<p>25 			        mkdir -p 			${RPM_BUILD_ROOT}/usr/share/locale/zh_CN/LC_MESSAGES</p>
<p>26 			        mkdir -p ${RPM_BUILD_ROOT}/var/tmp/hello</p>
<p>27 			        xgettext -k &#8211;keyword=_ hello.c -o po/hello.pot</p>
<p>28 			        pushd ./po</p>
<p>29 			                msgmerge zh_CN.po hello.pot</p>
<p>30 			                msgfmt zh_CN.po -o hello.mo</p>
<p>31 			                cp hello.mo 			${RPM_BUILD_ROOT}/usr/share/locale/zh_CN/LC_MESSAGES</p>
<p>32 			        popd</p>
<p>33</p>
<p>34 			        gcc hello.c -o ${RPM_BUILD_ROOT}/var/tmp/hello/hello.out</p>
<p>35</p>
<p>36 			%clean</p>
<p>37 			rm -rf $RPM_BUILD_ROOT</p>
<p>38</p>
<p>39 			%files</p>
<p>40 			%defattr(-,root,root)</p>
<p>41 			/var/tmp/hello/*</p>
<p>42 			/usr/share/locale/zh_CN/LC_MESSAGES</p>
<p>43</p>
<p>44 			%changelog</p>
<p>45 			* Thu Mar 11 2010 Leedd &lt;iam@leedd.com&gt; 5.0-1</p>
<p>46 			- Inital</td>
</tr>
</tbody>
</table>
<p><span style="font-family: Liberation Serif,serif;"> </span>已经有了源文件和<span style="font-family: Liberation Serif,serif;">SPEC</span>文件后，需要把他们分别放在<span style="font-family: Liberation Serif,serif;">rpmbuild</span>目录下对应的<span style="font-family: Liberation Serif,serif;">SOURCES</span>和<span style="font-family: Liberation Serif,serif;">SPECS</span>目录中，然后打包：</p>
<table border="1" cellspacing="1" cellpadding="3" width="100%" bordercolor="#23ff23">
<col width="256"></col>
<tbody>
<tr>
<td width="100%" valign="top"><span style="color: #ff0000;"><strong>[Lee@leedd.com SPECS]$ 			rpmbuild -bs neoshine-hello-world.spec </strong></span><span style="color: #ff0000;"><strong>Wrote: 			/home/Lee/rpmbuild/SRPMS/neoshine-hello-world-5.0-1.src.rpm</strong></span></p>
<p><span style="color: #ff0000;"><strong>[Lee@leedd.com SPECS]$ 			mock -r neoshine-5-i686 </strong></span><span style="color: #ff0000;"><strong>-</strong><strong>-</strong></span><span style="color: #ff0000;"><strong>rebuild  <span style="color: #ff0000;"> </span></strong></span><span style="color: #ff0000;"><strong> /home/Lee/rpmbuild/SRPMS/neoshine-hello-world-5.0-1.src.rpm</strong></span></td>
</tr>
</tbody>
</table>
<pre><span style="color: #ff0000;"><strong>本文用到的源程序：</strong></span>
<span style="color: #ff0000;"><strong><span style="font-family: Liberation Serif,serif;"> <a href="http://leedd.com/docs/linux/hello-world-c/">http://leedd.com/docs/linux/hello-world-c/</a> </span></strong></span>
<span style="font-family: Liberation Serif,serif;"> SOURCES</span>源文件：<span style="font-family: Liberation Serif,serif;">neoshine-hello-world-5.0.tar.bz2</span>
<span style="font-family: Liberation Serif,serif;"> SPEC</span>文件： <span style="font-family: Liberation Serif,serif;"> neoshine-hello-world.spec</span>
<span style="font-family: Liberation Serif,serif;"> </span>编译后的源码包：<span style="font-family: Liberation Serif,serif;">neoshine-hello-world-5.0-1.src.rpm</span></pre>
<p>参考文章：</p>
<p><span style="font-family: Liberation Serif,serif;"> <strong>[1]</strong> Hello World		<a href="http://zh.wikipedia.org/wiki/Hello_World#C">http://zh.wikipedia.org/wiki/Hello_World#C</a> </span></p>
<p><span style="font-family: Liberation Serif,serif;"> <strong>[2]</strong> Linux </span>国际化编程  <span style="font-family: Liberation Serif,serif;"><a href="http://riuliyu.blog126.fc2.com/blog-entry-20.html">http://riuliyu.blog126.fc2.com/blog-entry-20.html</a> </span></p>
<p><span style="font-family: Liberation Serif,serif;"> <strong>[3]</strong> </span>认识下<span style="font-family: Liberation Serif,serif;">linux</span>下程序的国际化（<span style="font-family: Liberation Serif,serif;">C</span>语言实例）</p>
<p><span style="font-family: Liberation Serif,serif;"> <a href="http://swinging-breeze.blogspot.com/2009/05/linuxc.html">http://swinging-breeze.blogspot.com/2009/05/linuxc.html</a> </span>（已经被墙）</p>
<p><span style="font-family: Liberation Serif,serif;"> Google</span>的缓存：<span style="font-family: Liberation Serif,serif;"> <a href="http://203.208.39.132/search?q=cache:E-Os3g0yHjsJ:swinging-breeze.blogspot.com/2009/05/linuxc.html+hello+world+%E5%9B%BD%E9%99%85%E5%8C%96+c%E8%AF%AD%E8%A8%80&amp;cd=1&amp;hl=zh-CN&amp;ct=clnk&amp;gl=cn&amp;st_usg=ALhdy2_j1VcwccRlk394Xz6n81ZnDCvbuQ">http://203.208.39.132/search?q=cache:E-Os3g0yHjsJ:swinging-breeze.blogspot.com/2009/05/linuxc.html+hello+world+%E5%9B%BD%E9%99%85%E5%8C%96+c%E8%AF%AD%E8%A8%80&amp;cd=1&amp;hl=zh-CN&amp;ct=clnk&amp;gl=cn&amp;st_usg=ALhdy2_j1VcwccRlk394Xz6n81ZnDCvbuQ</a> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://leedd.com/2010/03/linux-c-i18n-l10n-xgettext-msgfmt-rpmbuild/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>接入云端：轻量级Linux系统xpud</title>
		<link>http://leedd.com/2010/03/xpud-linux-system-guide/</link>
		<comments>http://leedd.com/2010/03/xpud-linux-system-guide/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 06:03:56 +0000</pubDate>
		<dc:creator>东东有礼</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xpud]]></category>
		<category><![CDATA[上网本]]></category>
		<category><![CDATA[云计算]]></category>

		<guid isPermaLink="false">http://leedd.com/?p=968</guid>
		<description><![CDATA[

 xPUD 是一个基于网页浏览和影音娱乐为主要应用的轻量级Linux 发行版。最新的0.9.2版的大小为64M。其...]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } 		A:link { so-language: zxx } --><br />
<span style="font-family: Liberation Serif,serif;"> </span></p>
<p><span style="font-family: Liberation Serif,serif;"> xPUD </span>是一个基于网页浏览和影音娱乐为主要应用的轻量级<span style="font-family: Liberation Serif,serif;">Linux </span>发行版。最新的<span style="font-family: Liberation Serif,serif;">0.9.2</span>版的大小为<span style="font-family: Liberation Serif,serif;">64M</span>。其界面十分简洁，具有完整的中文支持，特别适合作为 <span style="font-family: Liberation Serif,serif;">Web </span>程序的执行平台，可以作为上网本或是未来基于云端应用的底层支持系统。</p>
<p><span style="font-family: Liberation Serif,serif;"> </span>当然如果你对于电脑的需求只是用来上网和播放影音及办公应该，那么<span style="font-family: Liberation Serif,serif;">xpud</span>够用了，下面是<span style="font-family: Liberation Serif,serif;">LDD</span>下载并在<span style="font-family: Liberation Serif,serif;">VIrtualBox</span>上安装的步骤：</p>
<p><span style="font-family: Liberation Serif,serif;"><span id="more-968"></span> 1.</span>下载，去官方看看最新版 <span style="font-family: Liberation Serif,serif;"><a href="http://www.xpud.org/index.zh-cn.html">http://www.xpud.org/index.zh-cn.html</a> </span></p>
<p><span style="font-family: Liberation Serif,serif;"> 2.</span>在<span style="font-family: Liberation Serif,serif;">VirtualBox</span>上配置安装环境<span style="font-family: Liberation Serif,serif;">,</span>挂在该镜像文件</p>
<p><span style="font-family: Liberation Serif,serif;"> 3.</span>打开及可直接进入系统，如下图：</p>
<p>﻿<a href="http://leedd.com/wp-content/uploads/2010/03/sendpix0.jpg"><img class="alignnone size-full wp-image-969" title="sendpix0" src="http://leedd.com/wp-content/uploads/2010/03/sendpix0.jpg" alt="" width="481" height="411" /></a></p>
<p>选择简体中文进行安装，并进入系统：</p>
<p><a href="http://leedd.com/wp-content/uploads/2010/03/002.jpg"><img class="alignnone size-full wp-image-970" title="002" src="http://leedd.com/wp-content/uploads/2010/03/002.jpg" alt="" width="862" height="548" /></a></p>
<p><a href="http://leedd.com/wp-content/uploads/2010/03/user.jpg"><img class="alignnone size-full wp-image-974" title="user" src="http://leedd.com/wp-content/uploads/2010/03/user.jpg" alt="" width="837" height="282" /></a></p>
<p>在应用程序的浏览器中输入”沉思小屋”网址进行浏览：</p>
<p><a href="http://leedd.com/wp-content/uploads/2010/03/ff003.jpg"><img class="alignnone size-full wp-image-971" title="ff003" src="http://leedd.com/wp-content/uploads/2010/03/ff003.jpg" alt="" width="864" height="553" /></a></p>
<p>可以选择附件的<span style="font-family: Liberation Serif,serif;">office</span>等应用软件下载（如下图可以看到是基于<span style="font-family: Liberation Serif,serif;">apt-get</span>命令的下载，应该是基于<span style="font-family: Liberation Serif,serif;">debian/ubuntu</span>所作的一些精简）：</p>
<p><a href="http://leedd.com/wp-content/uploads/2010/03/addone003.jpg"><img class="alignnone size-full wp-image-972" title="addone003" src="http://leedd.com/wp-content/uploads/2010/03/addone003.jpg" alt="" width="855" height="544" /></a></p>
<p>另外发现一个<span style="font-family: Liberation Serif,serif;">BUG</span>：就是在应用程序的终端中输入“<span style="font-family: Liberation Serif,serif;">exit”</span>命令退出终端后无法重新打开终端进程，已经在官方论坛反馈该问题了，希望不久能解决。</p>
<p><a href="http://leedd.com/wp-content/uploads/2010/03/bug004.jpg"><img class="alignnone size-full wp-image-973" title="bug004" src="http://leedd.com/wp-content/uploads/2010/03/bug004.jpg" alt="" width="860" height="445" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://leedd.com/2010/03/xpud-linux-system-guide/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>测试wordpress在Linux下面的客户端Drivel Blog Editor</title>
		<link>http://leedd.com/2010/01/fedora-linux-drivel-blog-editor/</link>
		<comments>http://leedd.com/2010/01/fedora-linux-drivel-blog-editor/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 02:55:50 +0000</pubDate>
		<dc:creator>东东有礼</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[leedd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PR]]></category>

		<guid isPermaLink="false">http://leedd.com/?p=860</guid>
		<description><![CDATA[   今天看了http://www.chinablogs.org/viewnews-39.htm 上面介绍的几个在wp下面的客户端口，试试在Fedora下...]]></description>
			<content:encoded><![CDATA[<p>今天看了http://www.chinablogs.org/viewnews-39.htm 上面介绍的几个在wp下面的客户端口，<strong>试试在Fedora下面安装Drivel Blog Editor</strong>。<br />
<strong> Drivel Blog Editor下载地址：<a href="http://dropline.net/past-projects/drivel-blog-editor/">http://dropline.net/past-projects/drivel-blog-editor/</a></strong><br />
我下载的是二进制文件，</p>
<pre>[Lee @Leedd.Com down]$ rpm -ivh drivel-2.0.3-1.src.rpm
[Lee @Leedd.Com down]$ cd /home/Lee/rpmbuild/SPECS
[Lee @Leedd.Com SPECS]$ rpmbuild -ba drivel.spec
            ###提示缺少依赖
[Lee @Leedd.Com SPECS]$  sudo yum install gtksourceview-devel
[Lee @Leedd.Com SPECS]$ rpmbuild -ba drivel.spec</pre>
<p>正常编译通过后把i386.rpm文件写到了/home/Lee/rpmbuild/RPMS/i386/drivel-2.0.3-1.i386.rpm</p>
<pre>[Lee @Leedd.Com SPECS]$ sudo rpm -ivh /home/Lee/rpmbuild/RPMS/i386/drivel-2.0.3-1.i386.rpm</pre>
<p>登录wordpress后来 “设置－撰写－启用 WordPress，Movable Type，MetaWeblog和Blogger 的 XML-RPC发布协议” 保存</p>
<pre>[Lee @Leedd.Com SPECS]$drivel      ###运行软件</pre>
<p><span id="more-860"></span>如下图：<br />
<img src="http://leedd.com/pic/archives/20100119leedd_com/drivel-blog-edit0r-for-linux-leedd.jpg" alt="" /><br />
填写用户名、密码，日记类型填写”Movable Type”<br />
服务器地址：填写你的博客根目录+xmlrpc.php   如我的是：“http://Leedd.com.xmlrpc.php”<br />
根据个人喜好填写是否记住密码及自动登录<br />
然后就可以在Linux下用客户端发布日志了。。。。。。</p>
<p><span style="color: #0000ff;"><strong>Tips:</strong></span><br />
快捷键: ctrl+Enter 是发送文章，我写日志的时候不小心用了。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://leedd.com/2010/01/fedora-linux-drivel-blog-editor/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>《高级Bash脚本编程指南》中英电子版</title>
		<link>http://leedd.com/2009/12/linux-shell-books-advanced-bash-scripting-guide/</link>
		<comments>http://leedd.com/2009/12/linux-shell-books-advanced-bash-scripting-guide/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 08:11:12 +0000</pubDate>
		<dc:creator>东东有礼</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[leedd]]></category>
		<category><![CDATA[PR]]></category>

		<guid isPermaLink="false">http://leedd.com/?p=763</guid>
		<description><![CDATA[今天在网上寻找Linux Shell相关的书籍推荐，发现一本《高级Bash脚本编程指南》（《Advanced Bash-Scriptin...]]></description>
			<content:encoded><![CDATA[<p>今天在网上寻找Linux Shell相关的书籍推荐，发现一本<strong>《高级Bash脚本编程指南》</strong>（<strong>《Advanced Bash-Scripting Guide》</strong>）整体评价不错，并找到了该书的在线阅读或是html版、PDF版等格式的中英文翻译的在线阅读或下载地址，收集出来给大家共享，也留着自己备用。</p>
<pre> 作者：thegrendel
 主页：http://personal.riverusers.com/~thegrendel
 中译本：杨春敏(chunmin.yang at gmail.com)  黄毅 (linuxprogram at gmail.com)
 点评： 目前最好的BASH教程，内容全面，详尽无比，有很多脚本实例；最重要的是作者一直跟更新和修正此文档，目前的英文版本是Version 4.2；中文版最新版本是3.9.1.
</pre>
<pre><span style="color: #ff0000;"><strong>在线阅读地址：<a href="http://leedd.com/html/abs-3.9.1/">http://leedd.com/html/abs-3.9.1/</a></strong></span>
Tips:该书中所有的例子用到的程序作者都已经提供，但是最好还是自己写一遍
</pre>
<pre>更多关于该书籍的信息请查看该书籍主页或点击下面的链接：</pre>
<pre><a href="http://www.linuxsir.org/main/?q=node/140#3">http://www.linuxsir.org/main/?q=node/140#3</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://leedd.com/2009/12/linux-shell-books-advanced-bash-scripting-guide/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>电脑硬盘统计中的MiB和MB的区别</title>
		<link>http://leedd.com/2009/12/mib-and-mb/</link>
		<comments>http://leedd.com/2009/12/mib-and-mb/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 07:28:53 +0000</pubDate>
		<dc:creator>东东有礼</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[po]]></category>
		<category><![CDATA[PR]]></category>
		<category><![CDATA[文化]]></category>

		<guid isPermaLink="false">http://leedd.com/?p=761</guid>
		<description><![CDATA[今天用Linux下刻录光盘软件brasero（版本brasero-2.26.3-1）刻录内容时候发现有部分繁体中文，于是对braser...]]></description>
			<content:encoded><![CDATA[<p>今天用Linux下刻录光盘软件brasero（版本brasero-2.26.3-1）刻录内容时候发现有部分繁体中文，于是对brasero.po 进行修改，发现po文件中有部分MiB翻译为MB 但有很多没有翻译。于是网上查找了下MiB与MB的区别。如下：</p>
<pre>kilobyte(KB) = 1000
kibibyte(KiB) = 1024</pre>
<pre>megabyte(MB) = 1000000
mebibyte(MiB) = 1024x1024 = 1048576</pre>
<p>除此之外，还有GiB和GB。算法类同</p>
<p>这是因为硬盘生产商是以GB（十进制，即10的3次方=1000，如1MB=1000KB）计算的，而电脑（操作系统）是以GiB(2进制，即2的10次方， 如1MiB=1024KiB）计算的，但是国内用户一般理解为1MB＝1024 KB,  所以为了便于中文化的理解，翻译MiB为MB 也是可以的。<br />
同样根据硬盘厂商与用户对于1MB大小的不同理解，所以好多160G的硬盘实际容量按计算机实际的1MB＝1024KB算都不到160G，这也可以解释为什么新买的硬盘“缺斤短两”并没有它所标示的那么大。</p>
]]></content:encoded>
			<wfw:commentRss>http://leedd.com/2009/12/mib-and-mb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux本地化翻译中的po或pot格式介绍</title>
		<link>http://leedd.com/2009/12/linux-po-pot/</link>
		<comments>http://leedd.com/2009/12/linux-po-pot/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 13:36:11 +0000</pubDate>
		<dc:creator>东东有礼</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[po]]></category>
		<category><![CDATA[pot]]></category>
		<category><![CDATA[本地化]]></category>

		<guid isPermaLink="false">http://leedd.com/?p=717</guid>
		<description><![CDATA[最近工作中接触到一些Linux系统本地化相关的内容，也搜集了一些资料（有些是公司资料，后期整理下，把不涉及...]]></description>
			<content:encoded><![CDATA[<p>最近工作中接触到一些Linux系统本地化相关的内容，也搜集了一些资料（有些是公司资料，后期整理下，把不涉及到公司内容的东西以CC协议发布出来给大家共享），在搜索的时候发现网上关于这方面的信息能够直接搜索到得相对较少，于是整理发布出来，方便大家的学习和生活。</p>
<p><span id="more-717"></span></p>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } 		TD P { margin-bottom: 0cm } 		CODE { font-family: "方正宋体", monospace } --></p>
<p style="margin-bottom: 0cm;">一般系统中原始获取到的文件有po和pot两种后缀格式，pot为原始的未经翻译的英文文件，po则一般是翻译处理过（即使只翻译一句话）的文件。这两种后缀对翻译没有任何影响，所以后面都以.po为后缀的文件来举例。<span style="font-family: Times New Roman,serif;"> </span></p>
<p style="margin-bottom: 0cm;"><span style="font-family: Times New Roman,serif;"> <strong>Po </strong></span>文件的一般格式如下：</p>
<table style="height: 122px;" border="0" cellspacing="0" cellpadding="2" width="263" bgcolor="#00b232">
<col width="259"></col>
<tbody>
<tr>
<td width="259">
<h2 style="background: #ffffff none repeat scroll 0% 0%; margin-bottom: 0cm;"><strong>#: 			../shell/rb-shell.c:433</strong></h2>
<h2 style="background: #ffffff none repeat scroll 0% 0%;"><strong>#, 			fuzzy, c-format</strong></h2>
<h2 style="background: #ffffff none repeat scroll 0% 0%; margin-bottom: 0cm;"><strong>msgid 			“Import _File&#8230;”</strong></h2>
<h2 style="background: #ffffff none repeat scroll 0% 0%; margin-bottom: 0cm;"><strong>msgstr 			“导入文件(_F)&#8230;”</strong></h2>
<p style="background: #ffffff none repeat scroll 0% 0%;">
</td>
</tr>
</tbody>
</table>
<p style="margin-bottom: 0cm;">
<pre style="margin-bottom: 0cm;">第一行以“<span style="font-family: Times New Roman,serif;">#: ”</span>开头的注释为该翻译所在语言包的路径，也可以没有该行。</pre>
<pre style="margin-bottom: 0cm;">第二行以“#, fuzzy”开头的是模糊翻译标记。需要重新检查翻译，也可以没有该行。</pre>
<pre style="margin-bottom: 0cm;">第三行以“<span style="font-family: Times New Roman,serif;">msgid </span>”为需要翻译的文字。</pre>
<pre style="margin-bottom: 0cm; font-weight: normal;">第四行以“msgstr<span style="font-family: Times New Roman,serif;">”</span>开头的为翻译后的文字。</pre>
<p style="margin-bottom: 0cm; font-weight: normal;">
<p style="margin-bottom: 0cm;"><span style="font-family: Times New Roman,serif;"><span style="font-weight: normal;"> </span></span></p>
<p style="margin-bottom: 0cm;"><span style="font-family: Times New Roman,serif;"><span style="font-weight: normal;"> </span></span><span style="font-weight: normal;">第二类格式是部分含有“</span><span style="font-family: Times New Roman,serif;"><span style="font-weight: normal;">msgctxt ”</span></span><span style="font-weight: normal;">表示上下文，上下文可以消除因具有相同译文</span><span style="font-family: Times New Roman,serif;"><span style="font-weight: normal;">ID</span></span><span style="font-weight: normal;">而产生的歧义。在同一个</span><span style="font-family: Times New Roman,serif;"><span style="font-weight: normal;">PO</span></span><span style="font-weight: normal;">文件中，可能存在多个</span><span style="font-family: Times New Roman,serif;"><span style="font-weight: normal;">entry</span></span><span style="font-weight: normal;">拥有同一个译文</span><span style="font-family: Times New Roman,serif;"><span style="font-weight: normal;">ID</span></span><span style="font-weight: normal;">，前提是每个</span><span style="font-family: Times New Roman,serif;"><span style="font-weight: normal;">entry</span></span><span style="font-weight: normal;">都有不同的上下文。注意，空的上下文字符串与没有 </span><span style="font-family: Times New Roman,serif;"><code><span style="font-weight: normal;">msgctxt</span></code><span style="font-weight: normal;"> </span></span><span style="font-weight: normal;">这行不是一个意思。</span></p>
<p style="margin-bottom: 0cm; font-weight: normal;">如下面所示： （在包：gnome-control-center-2.24.0.1中  line: 2739）</p>
<table style="height: 125px;" border="0" cellspacing="0" cellpadding="2" width="265" bgcolor="#00b232">
<tbody>
<tr>
<td width="259">
<h2 style="background: #ffffff none repeat scroll 0% 0%; margin-bottom: 0cm;"><span style="font-family: Times New Roman,serif;">msgctxt 			“Sound event” </span></h2>
<h2 style="background: #ffffff none repeat scroll 0% 0%; margin-bottom: 0cm;"><span style="font-family: Times New Roman,serif;">msgid 			“Empty trash” </span></h2>
<h2 style="background: #ffffff none repeat scroll 0% 0%; margin-bottom: 0cm;"><span style="font-family: Times New Roman,serif;">msgstr 			“</span>清空回收站<span style="font-family: Times New Roman,serif;">“</span></h2>
</td>
</tr>
</tbody>
</table>
<p style="margin-bottom: 0cm; font-weight: normal;">
<p style="margin-bottom: 0cm; font-weight: normal;">
<p style="margin-bottom: 0cm; font-weight: normal;">第三类是含有“msgid_plura[l] <span style="font-family: Times New Roman,serif;">”</span>的单复数相关的翻译，因为中、日、韩中没有复数，所以只翻译为“msgstr[0]<span style="font-family: Times New Roman,serif;"> ”</span>(删除msgstr[1]即可)的即可。<span style="font-family: Times New Roman,serif;"> </span></p>
<table style="height: 122px;" border="0" cellspacing="0" cellpadding="2" width="334" bgcolor="#00b232">
<col width="330"></col>
<tbody>
<tr>
<td width="330">
<h2 style="background: #ffffff none repeat scroll 0% 0%;"><span style="font-family: Times New Roman,serif;">#: 			src/msgcmp.c:338 src/po-lex.c:701<br />
#, c-format<br />
msgid “found 			%d fatal error”<br />
msgid_plural “found %d fatal 			errors”<br />
msgstr[0] “</span>找到 <span style="font-family: Times New Roman,serif;">%d </span>个严重错误<span style="font-family: Times New Roman,serif;">”<br />
</span></h2>
</td>
</tr>
</tbody>
</table>
<p style="margin-bottom: 0cm;">后面可能还有其他特殊格式，待整理更新后添加。</p>
<p style="margin-bottom: 0cm;">推荐阅读：</p>
<h2><a href="http://leedd.com/2010/03/linux-c-i18n-l10n-xgettext-msgfmt-rpmbuild/ ">Linux下C语言的本地化／国际化实现</a></h2>
<p style="margin-bottom: 0cm;"><a href="http://leedd.com/2010/03/linux-c-i18n-l10n-xgettext-msgfmt-rpmbuild/">http://leedd.com/2010/03/linux-c-i18n-l10n-xgettext-msgfmt-rpmbuild/</a></p>
<p style="margin-bottom: 0cm;">
<p style="margin-bottom: 0cm; font-weight: normal;">
<p style="margin-bottom: 0cm;"><span style="font-family: Times New Roman,serif;"> </span><span style="font-family: Times New Roman,serif;"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://leedd.com/2009/12/linux-po-pot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

