<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0UGSXsyeCp7ImA9WhRVE0s.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882</id><updated>2012-01-12T19:53:48.590+08:00</updated><category term="linux Linux LINUX 轻量级" /><category term="ucloner" /><category term="QQ for Linux" /><category term="grub" /><category term="rpm Fusion" /><category term="ubuntu linux 800" /><category term="linux，控制台" /><category term="linux game" /><category term="pidgin" /><category term="操作系统" /><category term="gnome" /><category term="linux 游戏" /><category term="MPlayer" /><category term="Compiz" /><category term="python" /><category term="opear" /><category term="player" /><category term="操作系统 桌面环境" /><category term="sun" /><category term="gimp" /><category term="网络电视" /><category term="gnone" /><category term="vim" /><category term="btrfs" /><category term="Firefox  gmail  Google Docs" /><category term="微软" /><category term="xp" /><category term="cpu" /><category term="xen" /><category term="linux" /><category term="ubuntu linux" /><category term="炒股" /><category term="终端" /><category term="Debian" /><category term="linux openSUSE" /><category term="kde" /><category term="pdf" /><category term="Redflag linux 红旗" /><category term="linux chrome" /><category term="desktip" /><category term="3D" /><category term="unix" /><category term="开源浏览器" /><category term="linux 桌面" /><category term="gmchess" /><category term="Bluetooth" /><category term="Linux Kernel" /><category term="vpn" /><category term="dhcp" /><category term="linux gnome" /><category term="vista" /><title>Eastnux</title><subtitle type="html">Eleven +</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>101</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Eastnuxblogger" /><feedburner:info uri="eastnuxblogger" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><entry gd:etag="W/&quot;CkAGQ3s6fip7ImA9WhZTE0o.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-7442789131728109379</id><published>2011-03-17T21:48:00.001+08:00</published><updated>2011-03-17T22:05:22.516+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-17T22:05:22.516+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title>CMMusic: 小巧而实用的 MPlayer 音乐播放前端</title><content type="html">文章來自：http://linuxtoy.org/archives/cmmusic.html&lt;br /&gt;
&lt;br /&gt;
CMMusic 是一个不错的 MPlayer 音乐播放前端，感兴趣的朋友不妨试试。&lt;span id="more-4646"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="document" id="cmmusic-mplayer"&gt;&lt;table class="docinfo" frame="void" rules="none"&gt;&lt;col class="docinfo-name"&gt;&lt;/col&gt; &lt;col class="docinfo-content"&gt;&lt;/col&gt; &lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;th class="docinfo-name"&gt;Author:&lt;/th&gt; &lt;td&gt;Jiqing (&lt;a class="reference external" href="mailto:jiqingwu@gmail.com"&gt;jiqingwu@gmail.com&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
&lt;tr class="field"&gt;&lt;th class="docinfo-name"&gt;home:&lt;/th&gt;&lt;td class="field-body"&gt;&lt;a class="reference external" href="http://hi.baidu.com/jiqing0925"&gt;http://hi.baidu.com/jiqing0925&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr class="field"&gt;&lt;th class="docinfo-name"&gt;create:&lt;/th&gt;&lt;td class="field-body"&gt;2011-03-10&lt;/td&gt; &lt;/tr&gt;
&lt;tr class="field"&gt;&lt;th class="docinfo-name"&gt;update:&lt;/th&gt;&lt;td class="field-body"&gt;2011-03-10&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;div class="section" id="cmmusic"&gt;&lt;h2&gt;为啥用cmmusic&lt;/h2&gt;mplayer是元老级的媒体播放器，到现在依然强大，因为它的“全能”， 一直拥有大量的用户。 但我们主要用mplayer看电影，其实用mplayer播放音乐也很不错： 占用资源很少，而且支持的格式非常多。&lt;br /&gt;
如果用xmms2或者mpd听音乐，如果想听wma什么的还要装额外的解码器。 而只要装了mplayer，看电影和听音乐只用它就够了。 无奈，mplayer没有个好用的前端。 不过，现在，小巧的cmmusic来了，为mplayer提供了一个简单实用的 音乐播放前端。&lt;br /&gt;
作者是咱中国人，可以从 &lt;a class="reference external" href="http://bbs.ylmf.net/forum.php?mod=viewthread&amp;amp;tid=1141319&amp;amp;extra="&gt;这个网页&lt;/a&gt; 看到更多的信息。 大家有什么问题或建议可以用中文给他写信啊，方便交流。 感谢作者，向作者致敬。&lt;br /&gt;
cmmusic是用ncurse库的终端下运行的程序。 虽然界面不华丽，但功能全面，很实用，先看个截图吧。&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="section" id="id2"&gt;&lt;h2&gt;安装cmmusic&lt;/h2&gt;现在，cmmusic似乎还没加到各发行版的仓库中。 可以从 &lt;a class="reference external" href="https://sourceforge.net/projects/cmmusic/"&gt;https://sourceforge.net/projects/cmmusic/&lt;/a&gt; 下载源码编译安装。&lt;br /&gt;
因为依赖ncurses，所以编译前请安装ncurses的开发库。 最好装libncursesw，支持宽字符，这样能支持中文显示。:&lt;br /&gt;
&lt;pre class="literal-block"&gt;sudo apt-get install libncursesw5-dev&lt;/pre&gt;应该差不多了，如果提示缺什么库，就安装libxxx-dev吧。 然后使出程咬金的三板斧：:&lt;br /&gt;
&lt;pre class="literal-block"&gt;./configure
make
sudo make install&lt;/pre&gt;安装的文件如下：&lt;br /&gt;
&lt;ul class="simple"&gt;&lt;li&gt;cmmusic 核心程序，位于 /usr/local/bin&lt;/li&gt;
&lt;li&gt;cmmusicx 其实是一个脚本，自动打开一个终端运行cmmusic， 位于 /usr/local/bin&lt;/li&gt;
&lt;li&gt;cmmusic.xpm 用于在菜单中显示的图标，位于 /usr/local/share/pixmaps&lt;/li&gt;
&lt;li&gt;cmmusic.desktop 程序菜单中显示的项目，位于 /usr/local/share/applications/&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div class="section" id="id3"&gt;&lt;h2&gt;使用&lt;/h2&gt;&lt;ul class="simple"&gt;&lt;li&gt;l 载入或存储播放列表lst文件，也用于指定添加音乐文件的目录&lt;/li&gt;
&lt;li&gt;+ 添加音乐文件，会给出刚才用 l 指定的目录下的文件列表， 空格选中，按回车添加到播放列表&lt;/li&gt;
&lt;li&gt;- 移除播放列表中的项目。&lt;/li&gt;
&lt;li&gt;] 增加音量&lt;/li&gt;
&lt;li&gt;[ 减小音量&lt;/li&gt;
&lt;li&gt;, 上一首&lt;/li&gt;
&lt;li&gt;. 下一首&lt;/li&gt;
&lt;li&gt;p 播放/暂停&lt;/li&gt;
&lt;li&gt;s 停止&lt;/li&gt;
&lt;li&gt;m 静音&lt;/li&gt;
&lt;li&gt;q 退出&lt;/li&gt;
&lt;li&gt;d 切换播放模式。&lt;ul&gt;&lt;li&gt;SING 表示只播放一遍当前选中的文件&lt;/li&gt;
&lt;li&gt;SILP 重复播放当前选中的文件&lt;/li&gt;
&lt;li&gt;MULT 顺序播放一遍当前列表中的文件&lt;/li&gt;
&lt;li&gt;MULP 重复按顺序播放列表中的文件&lt;/li&gt;
&lt;li&gt;RAND 乱序播放列表中的文件&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;r 设置歌词（只支持lrc文件）搜索目录。 默认lrc为GBK，如果为UTF8，请使用选项``-lrc UTF-8``&lt;/li&gt;
&lt;/ul&gt;另外，cmmusic同样可以用于播放电影，有播放列表，看电视剧很方便。 最后，再次为国人的精彩作品喝彩！&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-7442789131728109379?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/7442789131728109379/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2011/03/cmmusic-mplayer.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/7442789131728109379?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/7442789131728109379?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2011/03/cmmusic-mplayer.html" title="CMMusic: 小巧而实用的 MPlayer 音乐播放前端" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0UNQXk9eCp7ImA9Wx9UFU8.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-2813343149880006177</id><published>2011-02-13T00:48:00.000+08:00</published><updated>2011-02-13T00:48:10.760+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-13T00:48:10.760+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="gimp" /><title>学习 GIMP</title><content type="html">原文：http://linuxtoy.org/archives/free-gimp-tutorial-pdfs.html &lt;br /&gt;
&lt;br /&gt;
如果您对于开源的跨平台图像处理软件 GIMP 感兴趣，却又找不到好的教程的，那么可以看看这个。&lt;span id="more-4557"&gt;&lt;/span&gt;&lt;br /&gt;
曾为 &lt;a href="http://www.linuxformat.com/"&gt;Linux Format 杂志&lt;/a&gt;做个系列 GIMP 教程的 &lt;a href="http://www.graphics-muse.org/"&gt;Michel J. Hammel&lt;/a&gt;最近放出最新18个 GIMP 教程的&lt;strong&gt;高清 PDF&lt;/strong&gt;，允许&lt;strong&gt;个人免费使用及分发（严禁商用）&lt;/strong&gt;。&lt;br /&gt;
18 个教程为： &lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Product design for geeks&lt;/li&gt;
&lt;li&gt;Shattered face&lt;/li&gt;
&lt;li&gt;Leopard-style icons&lt;/li&gt;
&lt;li&gt;Sin City style&lt;/li&gt;
&lt;li&gt;Summer of love&lt;/li&gt;
&lt;li&gt;Travel to the stars&lt;/li&gt;
&lt;li&gt;Going to warp speed&lt;/li&gt;
&lt;li&gt;Create a fire goddess&lt;/li&gt;
&lt;li&gt;Decay in the city&lt;/li&gt;
&lt;li&gt;Enhance the interface&lt;/li&gt;
&lt;li&gt;iPod fun&lt;/li&gt;
&lt;li&gt;Use other tools&lt;/li&gt;
&lt;li&gt;Text effects&lt;/li&gt;
&lt;li&gt;3D effects in Gimp&lt;/li&gt;
&lt;li&gt;Speedy colour fixes&lt;/li&gt;
&lt;li&gt;Printing and colour&lt;/li&gt;
&lt;li&gt;Know your selections&lt;/li&gt;
&lt;li&gt;Creative text with Gimp&lt;/li&gt;
&lt;/ol&gt;整个18个教程被打包在一个 &lt;strong&gt;90M 的压缩包&lt;/strong&gt;中，请前往 &lt;a href="http://tuxradar.com/gimp"&gt;TuxRadar 页面&lt;/a&gt;下载。&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-2813343149880006177?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/2813343149880006177/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2011/02/gimp.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/2813343149880006177?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/2813343149880006177?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2011/02/gimp.html" title="学习 GIMP" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DUcMQ385cCp7ImA9Wx9XGEw.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-9090845682435884040</id><published>2011-01-12T15:24:00.000+08:00</published><updated>2011-01-12T15:24:42.128+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-12T15:24:42.128+08:00</app:edited><title>China's J-20 Stealth Fighter Test Flight  Safe Landing 2011.01.11</title><content type="html">&lt;iframe src="http://www.youtube.com/embed/NfPbf3Ob_1M?fs=1" frameborder="0" height="344" width="425"&gt;&lt;/iframe&gt;&lt;br /&gt;中国之未来&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-9090845682435884040?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/9090845682435884040/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2011/01/chinas-j-20-stealth-fighter-test-flight.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/9090845682435884040?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/9090845682435884040?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2011/01/chinas-j-20-stealth-fighter-test-flight.html" title="China's J-20 Stealth Fighter Test Flight  Safe Landing 2011.01.11" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://img.youtube.com/vi/NfPbf3Ob_1M/default.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CUYNQXg6fCp7ImA9Wx5RFk4.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-8939834925860838476</id><published>2010-08-24T14:59:00.000+08:00</published><updated>2010-08-24T14:59:50.614+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-24T14:59:50.614+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title>使用grep恢复被删文件内容</title><content type="html">&lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: 文泉驿正黑; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="color: #555555; font-family: Verdana,'BitStream vera Sans',Tahoma,Helvetica,sans-serif; font-size: 12px; line-height: 17px;"&gt;&lt;div style="margin: 0px 0px 10px; padding: 0px;"&gt;在Unix/Linux下，最危险的命令恐怕就属rm命令了，每次在root下使用这个命令的时候，我都要盯着命令行看上几分钟才敢把回车敲下去。以前，看到同事在脚本中使用rm命令 ——&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;rm {$App_Dir}/*&lt;/code&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;。因为脚本没有判断变量$App_Dir是否为空，结果，在一次用root操作的时候，整个操作系统一下就不见了，还好只是开发机。从此，我们大家都再也不敢使用rm命令了。&lt;/div&gt;&lt;div style="margin: 0px 0px 10px; padding: 0px;"&gt;这里给大家介绍一个小技巧用来恢复一些被rm了的文件中的数据。我们知道，rm命令其实并不是真正的从物理上删除文件内容，只过不把文件的inode回收了，其实文件内容还在硬盘上。所以，如果你不小删除了什么比较重要的程序配置文件的时候，我们完全可以用grep命令在恢复，下面是一个恢复示例：&lt;/div&gt;&lt;div class="syntaxhighlighter  " id="highlighter_421566" style="background-color: rgb(255, 255, 255) ! important; background-image: none ! important; border: 1px solid rgb(224, 224, 224) ! important; bottom: auto ! important; direction: ltr ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 1em 0px ! important; outline-width: 0px ! important; padding: 0px ! important; position: relative ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: 594px;"&gt;&lt;div class="lines" style="background-image: none ! important; border-width: 0px ! important; bottom: auto ! important; direction: ltr ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; outline-width: 0px ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"&gt;&lt;div class="line alt1" style="background-color: rgb(255, 255, 255) ! important; background-image: none ! important; border-width: 0px ! important; bottom: auto ! important; direction: ltr ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; outline-width: 0px ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"&gt;&lt;table style="background-color: white; border-collapse: collapse ! important; border: 2px solid rgb(204, 204, 204); bottom: auto ! important; direction: ltr ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 5px 0px 10px; outline-width: 0px ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"&gt;&lt;tbody style="background-image: none ! important; border-width: 0px ! important; bottom: auto ! important; direction: ltr ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; outline-width: 0px ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"&gt;
&lt;tr style="background-image: none ! important; border-width: 0px ! important; bottom: auto ! important; direction: ltr ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; outline-width: 0px ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"&gt;&lt;td class="number" style="background-image: none ! important; border: 1px solid rgb(204, 204, 204); bottom: auto ! important; color: rgb(175, 175, 175) ! important; direction: ltr ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; outline-width: 0px ! important; padding: 3px 10px; position: static ! important; right: auto ! important; text-align: left; top: auto ! important; vertical-align: top ! important; width: 3em ! important;"&gt;&lt;code style="background-image: none ! important; border-width: 0px ! important; bottom: auto ! important; direction: ltr ! important; display: block ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; outline-width: 0px ! important; padding: 0px 0.3em 0px 0px ! important; position: static ! important; right: auto ! important; text-align: right ! important; top: auto ! important; vertical-align: baseline ! important; width: 2.7em ! important;"&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class="content" style="background-image: none ! important; border-bottom: 1px solid rgb(204, 204, 204); border-left: 3px solid rgb(108, 226, 108) ! important; border-right: 1px solid rgb(204, 204, 204); border-top: 1px solid rgb(204, 204, 204); bottom: auto ! important; color: rgb(0, 0, 0) ! important; direction: ltr ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 13px; margin: 0px ! important; outline-width: 0px ! important; overflow: hidden; padding-bottom: 3px; padding-left: 0.5em ! important; padding-right: 10px; padding-top: 3px; position: static ! important; right: auto ! important; text-align: left; top: auto ! important; vertical-align: top ! important; width: auto ! important;"&gt;&lt;code class="functions" style="background-image: none ! important; border-width: 0px ! important; bottom: auto ! important; color: rgb(255, 20, 147) ! important; direction: ltr ! important; display: inline ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; outline-width: 0px ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"&gt;grep&lt;/code&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="plain" style="background-image: none ! important; border-width: 0px ! important; bottom: auto ! important; color: rgb(0, 0, 0) ! important; direction: ltr ! important; display: inline ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; outline-width: 0px ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"&gt;-a -B 50 -A 60&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;code class="string" style="background-image: none ! important; border-width: 0px ! important; bottom: auto ! important; color: blue ! important; direction: ltr ! important; display: inline ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; outline-width: 0px ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"&gt;'some string in the file'&lt;/code&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="plain" style="background-image: none ! important; border-width: 0px ! important; bottom: auto ! important; color: rgb(0, 0, 0) ! important; direction: ltr ! important; display: inline ! important; float: none ! important; font-family: Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace ! important; font-size: 1em ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; outline-width: 0px ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"&gt;/dev/sda1 &amp;gt; results.txt&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin: 0px 0px 10px; padding: 0px;"&gt;说明：&lt;/div&gt;&lt;ul style="margin: 0px; padding: 0px 0px 10px;"&gt;&lt;li style="list-style-position: inside; margin: 0px; padding: 0px 0px 0px 20px;"&gt;关于grep的-a意为–binary-files=text，也就是把二进制文件当作文本文件。&lt;/li&gt;
&lt;li style="list-style-position: inside; margin: 0px; padding: 0px 0px 0px 20px;"&gt;-B和-A的选项就是这段字符串之前几行和之后几行。&lt;/li&gt;
&lt;li style="list-style-position: inside; margin: 0px; padding: 0px 0px 0px 20px;"&gt;/dev/sda1，就是硬盘设备，&lt;/li&gt;
&lt;li style="list-style-position: inside; margin: 0px; padding: 0px 0px 0px 20px;"&gt;&amp;gt; results.txt，就是把结果重定向到results.txt文件中。&lt;/li&gt;
&lt;/ul&gt;&lt;div style="margin: 0px 0px 10px; padding: 0px;"&gt;如果你幸运的话，你就可以看到被恢复的内容了。这正是Unix的简单哲学（详见《&lt;a href="http://coolshell.cn/articles/2324.html" style="color: #2970a6; text-decoration: none;" target="_blank"&gt;Unix传奇下篇&lt;/a&gt;》）——&lt;strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;所有的设备都是文件&lt;/strong&gt;。&lt;/div&gt;&lt;div style="margin: 0px 0px 10px; padding: 0px;"&gt;当然，我还是建议你把root用户的rm的命令用alias换成别一个脚本，那个脚本会帮你把删除的文件放到某个地方。&lt;/div&gt;&lt;div style="margin: 0px 0px 10px; padding: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 10px; padding: 0px;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;文章来自: &lt;a href="http://coolshell.cn/articles/2822.html"&gt;http://coolshell.cn/articles/2822.html&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-8939834925860838476?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/8939834925860838476/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/08/grep.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/8939834925860838476?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/8939834925860838476?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/08/grep.html" title="使用grep恢复被删文件内容" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEEFRn88cCp7ImA9Wx5RFEo.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-1755442206291343603</id><published>2010-08-22T18:23:00.000+08:00</published><updated>2010-08-22T18:23:37.178+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-22T18:23:37.178+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="vim" /><title>介绍 urxvt 插件一枚: vim-scrollback</title><content type="html">这个插件和 urxvt 自带的 searchable-scrollback 插件一样提供了一种在终端的命令行输出结果中搜索或复制关键字的快捷方式，vim-scrollback 将这种快捷方式 Vim 行为化了。&lt;br /&gt;
&lt;span id="more-4277"&gt;&lt;/span&gt;&lt;br /&gt;
简单来说，通过这个插件，你可以用 Vim 的方式操纵终端。假设你在命令行查看 ls 的 man 手册，看到有一个网址，你想用浏览器看看这个网址，但你又懒得去动鼠标: &lt;br /&gt;
&lt;pre&gt;1. Alt-v 启用 vim-scrollback 模式&lt;/pre&gt;&lt;pre&gt;2. 移动光标到网址处&lt;/pre&gt;&lt;pre&gt;3. 键入 gf 两个字符&lt;/pre&gt;&lt;pre&gt;4. Esc 或 Ctrl-C 可退出 vim-scrollback 模式&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;strong&gt;支持普通模式&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&amp;nbsp;&lt;/strong&gt; &lt;br /&gt;
&lt;pre&gt;h j k l
w e b
0 _ $
ctrl-u ctrl-d
gg G&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;strong&gt;支持可视模式&lt;/strong&gt;(甚至支持列模式)&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;V v ctrl-v
gv&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;strong&gt;支持搜索&lt;/strong&gt;(遗憾的是不支持中文搜索)&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;/ - searches up
? - searches down
n - next in current direction
N - next in opposite direction
* - search for word under the cursor&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;strong&gt;其他更多&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&amp;nbsp;&lt;/strong&gt; &lt;br /&gt;
&lt;pre&gt;gf - 允许你打开当前光标下的超级链接&lt;/pre&gt;如果你感兴趣，可以从&lt;a href="http://github.com/ervandew/vimfiles/raw/master/urxvt/vim-scrollback"&gt;这里&lt;/a&gt;下载 vim-scrollback 保存到本地某目录下，配置 ~/.Xresources 或 ~/.Xdefaults&lt;br /&gt;
&lt;br /&gt;
添加下面几行内容:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;pre&gt;urxvt.perl-lib: /Your/Path/vim-scrollback
urxvt.perl-ext-common: vim-scrollback
urxvt.vim-scrollback-paste: none&lt;/pre&gt;&lt;!-- google_ad_section_end --&gt;    &lt;br /&gt;
&lt;div style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;&lt;strong&gt;Read More:&lt;/strong&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;No related posts&lt;br /&gt;
&lt;br /&gt;
文章来自:http://linuxtoy.org/archives/vim-scrollback.html&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-1755442206291343603?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/1755442206291343603/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/08/urxvt-vim-scrollback.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/1755442206291343603?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/1755442206291343603?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/08/urxvt-vim-scrollback.html" title="介绍 urxvt 插件一枚: vim-scrollback" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D0MBSH07eyp7ImA9WxFbEUk.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-192151519315668995</id><published>2010-07-03T16:24:00.000+08:00</published><updated>2010-07-03T16:24:19.303+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-03T16:24:19.303+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="炒股" /><title>JStock 1.0.5m 发布，免费炒股软件</title><content type="html">JStock 是个股市软件。&lt;a href="http://jstock.sourceforge.net/"&gt;http://jstock.sourceforge.net&lt;/a&gt;&lt;br /&gt;
该版本主要改进内容：&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;支持简体中文显示，及许多错误修正&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;
我们最近打算支援中国股市。&lt;br /&gt;
因为工程庞大，我们每当完成小阶段，就会开始发布。&lt;br /&gt;
我们最近让JStock能支援中文显示，欢迎大家下载尝试。我们的中文不好。如果翻译得不对，请让我们知道。&lt;br /&gt;
我们也希望能吸引开发人员，翻译人员(翻译软件，翻译网页）。。。加入我们的团队。&lt;br /&gt;
&lt;a href="https://sourceforge.net/apps/mediawiki/jstock/index.php?title=Main_Page"&gt;https://sourceforge.net/apps/mediawiki/jstock/index.php?title=Main_Page&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
原文：&lt;a href="http://www.oschina.net/news/10247/JStock-1-0-5m"&gt;http://www.oschina.net/news/10247/JStock-1-0-5m&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-192151519315668995?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/192151519315668995/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/07/jstock-105m.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/192151519315668995?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/192151519315668995?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/07/jstock-105m.html" title="JStock 1.0.5m 发布，免费炒股软件" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DE4EQnY_cCp7ImA9WxFXEEo.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-5719469504690342373</id><published>2010-05-17T14:15:00.000+08:00</published><updated>2010-05-17T14:15:03.848+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-17T14:15:03.848+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="gmchess" /><category scheme="http://www.blogger.com/atom/ns#" term="pidgin" /><title>没事就和朋友下下棋，pidgin象棋插件偷跑版</title><content type="html">&lt;a href="http://code.google.com/p/gmchess/"&gt;gmchess&lt;/a&gt;是一款由阳光灿烂的&lt;a href="http://lerosua.org/"&gt;lerosua&lt;/a&gt;写的linux下开源的中国象棋程序，使用gtkmm和C++完成。支持人机对战和人人对战。但是之前只能在同一台机子上进行人人对战，这显然很不方便。&lt;br /&gt;
于是牛逼的lerosua又给我们带来了gmchess的pidgin对战插件，功能不必多说，大家也能猜到，肯定是通过pidgin，和好友在线下象棋了~&lt;br /&gt;
下面来看两个截图：&lt;br /&gt;
这是装了插件以后的pidgin窗口，可以看到已经多了一个很“帅”的按钮了~&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_ze53Vsu43ME/S_Dd1DXh7_I/AAAAAAAAB5Q/GzV--W-C-Wc/s1600/Screenshot-lerosua.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_ze53Vsu43ME/S_Dd1DXh7_I/AAAAAAAAB5Q/GzV--W-C-Wc/s320/Screenshot-lerosua.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #bbbbbb; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: medium;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px; line-height: 19px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;如果你和你的好友，都装了这个插件的话，你一点这个“帅”，对方一接受，就会出来gmchess的对战窗口了，gmchess的对战模式大致和人机对战一致，只是对方换成了有血有肉的人了，哈哈，如图：&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_ze53Vsu43ME/S_DeC8Lpt4I/AAAAAAAAB5Y/wiWND3bVBts/s1600/Screenshot-GMChess.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_ze53Vsu43ME/S_DeC8Lpt4I/AAAAAAAAB5Y/wiWND3bVBts/s320/Screenshot-GMChess.png" /&gt;&lt;/a&gt;&lt;/div&gt;如果感兴趣的话，在这里&lt;a href="http://code.google.com/p/geekr/downloads/list"&gt;下载&lt;/a&gt;最新的代码，注意gmchess-0.29.0.tar.bz2和pidgin-gmchess-0.01.tar.gz都要下载安装哦。&lt;br /&gt;
由于这个目前是偷跑版，也可以理解成是alpha版，所以难免会有点小问题，&lt;a href="http://code.google.com/p/geekr/issues/list"&gt;遇到bug&lt;/a&gt;或疑似bug的话，大家尽情地报告bug去，哈哈。&lt;br /&gt;
再八卦一下，gmchess里的提示音很多都是人声哦，而且这些声音正是出自lerosua的老婆，还蛮好听的呢，哈哈。&lt;br /&gt;
&lt;br /&gt;
原文:&lt;a href="http://li2z.cn/2010/05/16/pidgin-gmchess/"&gt;http://li2z.cn/2010/05/16/pidgin-gmchess/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-5719469504690342373?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/5719469504690342373/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/05/pidgin.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/5719469504690342373?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/5719469504690342373?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/05/pidgin.html" title="没事就和朋友下下棋，pidgin象棋插件偷跑版" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_ze53Vsu43ME/S_Dd1DXh7_I/AAAAAAAAB5Q/GzV--W-C-Wc/s72-c/Screenshot-lerosua.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DEcMSXczeSp7ImA9WxFXEEo.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-6999978973196258059</id><published>2010-05-17T14:00:00.001+08:00</published><updated>2010-05-17T14:01:28.981+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-17T14:01:28.981+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>一个支持上传的简单http server</title><content type="html">&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;/span&gt;&lt;br /&gt;
{ 撰文/&lt;a href="http://li2z.cn/" style="color: #2244bb;" target="_blank"&gt;bones7456&lt;/a&gt;&amp;nbsp;}&lt;br /&gt;
现在，很多人都知道，Python 里有个 SimpleHTTPServer，可以拿来方便地共享文件。比如，你要发送某个文件给局域网里的同学，你只要 cd 到所在路径，然后执行这么一行：&lt;br /&gt;
&lt;pre style="font-size: 12px;"&gt;&lt;code style="font-size: 12px;"&gt;python -m SimpleHTTPServer
&lt;/code&gt;&lt;/pre&gt;人家就可以通过 http://你的IP:8000 来访问你要共享的文件了。像我早已把这个命令做了 alias。但是，某一天，你需要从同学哪里复制一个文件到本机，然后你就会跟你同学说，XX，共享下某目录。当你以为可以用 HTTP 来访问他的 8000 端口的时候，他却告诉你，不好意思，我是 Windows 啦~~当然你可以选择在他 Windows 里装个 Python，也可以选择使用 Samba、FTP 等其他方式，但是有没有和之前一样简单的方式呢~当然了，这时候，你就需要一个支持上传的简单 HTTP Server，也就是我这个：&lt;a href="http://bones7456.googlecode.com/svn/trunk/SimpleHTTPServerWithUpload.py" style="color: #2244bb;" target="_blank"&gt;SimpleHTTPServerWithUpload.py&lt;/a&gt;，哈哈。然后你开个服务，让人家上传即可。&lt;br /&gt;
其实这个就是修改自 SimpleHTTPServer 的，只不过我给它加上了最原始的上传功能，安全性方面没有验证过，不过理论上应该不会没人一直开着这个吧？另外，我对 RFC1867 的理解不一定透彻，所以，Use on your own risk!&lt;br /&gt;
截图如下：&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_ze53Vsu43ME/S_DbVI-WcwI/AAAAAAAAB5I/AAYNw9f9YFU/s1600/SimpleHTTPServerWithUpload.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_ze53Vsu43ME/S_DbVI-WcwI/AAAAAAAAB5I/AAYNw9f9YFU/s320/SimpleHTTPServerWithUpload.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"&gt;代码&lt;a href="http://bones7456.googlecode.com/svn/trunk/SimpleHTTPServerWithUpload.py" style="color: #2244bb;" target="_blank"&gt;在此&lt;/a&gt;，单文件、零配置，直接用 Python 运行。&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;原文：&lt;a href="http://linuxtoy.org/"&gt;linuxTOY&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-6999978973196258059?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/6999978973196258059/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/05/http-server.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/6999978973196258059?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/6999978973196258059?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/05/http-server.html" title="一个支持上传的简单http server" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_ze53Vsu43ME/S_DbVI-WcwI/AAAAAAAAB5I/AAYNw9f9YFU/s72-c/SimpleHTTPServerWithUpload.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CkYFQHo9cCp7ImA9WxFQGUk.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-3784208785144710609</id><published>2010-05-16T00:15:00.001+08:00</published><updated>2010-05-16T00:15:11.468+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-16T00:15:11.468+08:00</app:edited><title>HTML 简史</title><content type="html">&lt;div style="font-family: Verdana; font-size: 14px; line-height: 21px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;新闻来源:A List Apart&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;HTML 是 Web 统一语言，这些容纳在尖括号里的简单标签，构成了如今的 Web。1991 年，Tim Berners-Lee 编写了一份叫做 “HTML 标签”的文档，里面包含了大约20个用来标记网页的 HTML 标签。他直接借用 SGML 的标记格式，也就是后来我们看到的 HTML 标记的格式。本文讲述了 HTML 这门 Web 标记语言的发展简史。&lt;/div&gt;&lt;div style="font-family: Verdana; font-size: 14px; line-height: 21px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;从 IETF 到 W3C: HTML 4 之路&amp;nbsp;&lt;/strong&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;HTML 1 并不曾存在，HTML 的第一个官方版本就是由 IETF （互联网工程任务组） 推出的 HTML 2.0。问世之前，这个版本中的很多细则已经被实现，比如，1994年的 Mosaic 浏览器已经实现了在文档中嵌入图片的方法，后来 HTML 2.0 便吸纳了 img 这个标签。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;后来，W3C 取代 IETF 的角色，成为 HTML 的标准组织，1990年代的后半页，HTML 的版本被频繁修改，直到1999年的 HTML 4.01，至此，HTML 到达了它的第一个拐点。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;XHTML 1: XML 风格的 HTML&amp;nbsp;&lt;/strong&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;HTML 在 HTML 4.01 之后的第一个修订版本就是 XHTML 1.0，其中 X 代表 “eXtensible” ，扩展，当然也有人将之解读为 “eXtreme”，极端。XHTML 1.0 是基于 HTML 4.01 的，并没有引入任何新标签或属性，唯一的区别是语法，HTML 对语法比较随便，而 XHTML 则要求 XML 般的严格语法。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;使用严格的语法规范并非坏事，要求开发者使用单一的代码风格，比如，HTML 4.01 允许你使用大写或小写字母标识标记元素和属性，XHTML 则只允许小写字母。XHTML 1.0 的推出刚好碰上了 CSS 的崛起，Web 开发设计者们开始意识到 Web 标准问题，基于 XHTML 的严格语法规范被视为编写 HTML 代码的最佳实践。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;于是，W3C 推出 XHTML 1.1。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;如果说 XHTML 1.0 是 XML 风格的 HTML，XHTML 1.1 则是货真价实的 XML。这意味着 XHTML 1.1 无法使用 text/html mime-type 直接输出，然而，如果 Web 开发者使用 XML mime-type，则当时的主流浏览器，IE 则压根不支持。看上去，W3C 似乎正在与当时的 Web 脱节。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;出力不讨好的 XHTML 2&amp;nbsp;&lt;/strong&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;对 W3C 而言，到了 HTML 4 已经是功德圆满，他们的下一步工作是 XHTML 2，希望将 Web 带向 XML 的光明未来。虽然 XHTML 2 听上去和 XHTML 1 类似，它们却有很多差别，XHTML 2 不向前兼容，甚至不兼容之前的 HTML。它是一种全新的语言，赤条条来去无牵挂。这实在是一场灾难。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;WHATWG：与 W3C 决裂&amp;nbsp;&lt;/strong&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;W3C 闭门造车的作风引起了一些人的不满，来自 Opera, Apple, 以及 Mozilla 的代表开始表达反对声音。2004年，Opera 的 Ian Hickson 提议在 HTML 基础上进行扩展以适应新的 Web 应用，该提议遭到 W3C 的拒绝。于是，他们自发组织成立了超文本应用技术工作组，就是 WHATWG。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;从 Web Apps 1.0 到 HTML5&amp;nbsp;&lt;/strong&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;从一开始，WHATWG 就和 W3C 走不同的路线，W3C 对问题的讨论是集体投票，而 WHATWG 则由主笔 Ian Hickson 定度。表面上看，W3C 更民主，然而事实上，各种内部纷争会使一些决议限于泥潭，在 WHATWG，事情的进展会更容易，不过，主笔的权力并非无限大，他们的委员会可以对那些过于偏执的主笔进行弹劾。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;一开始，WHATWG 的主要工作包括两部分，Web Forms 2.0 和 Web Apps 1.0，它们都是 HTML 的扩展，后来，他们合并到一起成为现在的 HTML5 规范。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;言归于好&amp;nbsp;&lt;/strong&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;在 WHATWG 致力于 HTML5 的同时，W3C 继续他们的 XHTML 2.0，然而，他们慢慢地陷入困境。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;2006年10月，Web 之父 Tim Berners-Lee 发表了一篇博客文章，表示，从 HTML 走向 XML 的路是行不通的，几个月后，W3C 组建了一个新的 HTML 工作组，他们非常明智地选择了 WHATWG 的成果作为基础。这一转变带来一些困惑，W3C 同时进行这两套规范，XHTML 2 和 HTML 5 （注意，W3C 的 HTTML 5 在 5 之前有个空格，而 WHATWG 的 HTML5 则没有空格），而 WHATWG 也在进行着同样的工作。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;XHTML 已死: XHTML 语法永存&amp;nbsp;&lt;/strong&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;这一混乱局面到了 2009 年开始变得清晰，W3C 宣布终止 XHTML 2 的工作，这是一份关于 XHTML 2 的迟到的讣告。这一消息被那些 XML 的反对者视为珍宝，他们借此嘲笑那些使用 XHTML 1 规范的人，然而他们似乎忘记了，XHTML 1 和 XHTML 2 是截然不同的东西。于此同时，XHTML 1 规范的制定者担心，XHTML 1 中的严格语法规范会被 HTML5 弃用，这种担心后来证明是多余的，HTML5 既支持松散语法，也支持 XHTML 1 般的严格语法。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;HTML5 路线图&amp;nbsp;&lt;/strong&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;HTML5 的现状是，它不再象以前那样让人困惑，然而仍不够明朗。有两个组织在同时制定它的规范，这两个组织有着完全不同的行事风格，WHATWG 是先买后尝，W3C 是先尝后买，他们形成了一个不太靠谱的联姻，最终人们必将面临一个 HTML5 还是 HTML 5 的问题。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;更让开发者困惑的是，他们什么时候才可以试水 HTML5。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;在一次访谈中，Ian Hickson 提到了 2022，表示要到那时 HTML5 才会形成"推荐标准"，此话一出，立刻招来 Web 设计者们的愤怒，尽管他们不知道推荐标准时什么意思，但他们明白，2022 已经是猴年马月的事了。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;这还不算，更重要的是，这个推荐标准涉及两套规范，考虑到 HTML5 标准的规模，这个日期还是太乐观了，毕竟，各大浏览器以往对既有标准的兼容并不遂人意，想当初，IE 花了10年才接纳 abbr 这个标签。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;2012 年，HTML5 会被接纳为候选标准，这将是 HTML5 真正开始发力的日子。对 Web 开发设计者来说，这并不重要，重要的是浏览器的支持，就像 CSS 2.1，当有浏览器开始支持这一规范的时候，就有开发设计者在使用了，倘若必须等到所有浏览器都支持才开始入手，恐怕我们现在还在等待中。&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;HTML5 也一样，并不会有一个时间点，宣布 HTML5 已经准备妥当，相反，我们会先开始使用它的部分功能，HTML5 并不是一个从零开始全新的东西，它是旧的 HTML 标准的改进，事实上，不管你正在使用的 HTML 是哪个版本，你已经在使用 HTML5 了。&lt;/div&gt;&lt;div style="font-family: Verdana; font-size: 14px; line-height: 21px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;本文国际来源：A List Apart&amp;nbsp;&lt;a href="http://www.alistapart.com/articles/a-brief-history-of-markup/" style="color: #003366; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;"&gt;A Brief History of Markup&lt;/a&gt;&amp;nbsp;（原文作者：&lt;a href="http://www.alistapart.com/authors/k/jeremykeith" style="color: #003366; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;"&gt;Jeremy Keith&lt;/a&gt;）&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;中文编译来源：&lt;a href="http://www.comsharp.com/" style="color: #003366; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;"&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;锐商企业CMS&lt;/strong&gt;&amp;nbsp;网站内容管理系统&lt;/a&gt;&amp;nbsp;官方网站&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-3784208785144710609?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/3784208785144710609/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/05/html.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/3784208785144710609?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/3784208785144710609?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/05/html.html" title="HTML 简史" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A08DQn47cSp7ImA9WxFQGU4.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-8668990087223451248</id><published>2010-05-16T00:11:00.000+08:00</published><updated>2010-05-16T00:11:13.009+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-16T00:11:13.009+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="btrfs" /><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu linux" /><title>Ubuntu 10.10可能使用Btrfs为默认文件系统</title><content type="html">&lt;div style="font-family: Verdana; font-size: 14px; line-height: 21px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;EXT文件系统家族如ext2、ext3、ext4，多年来一直是众多发行版默认的文件系统，桌面发行版Ubuntu当然也不例外。然而现在事件正在发生改变，Ubuntu 10.10 Maverick Meerkat可能不再默认使用ext4文件系统。&amp;nbsp;&lt;/div&gt;&lt;div style="font-family: Verdana; font-size: 14px; line-height: 21px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Canonical公司雇员、Ubuntu开发主管Scott James Remnant在博客上说，他们正在设法让btrfs作为Ubuntu 10.10的可选文件系统，而且不排除让btrfs作为默认文件系统。Scott指出，预计到内核2.6.35发布之时btrfs将不会在kernel配 置文件中标记为是一种“实验性”的文件系统，Ubuntu Maverick Meerkat预计将使用2.6.35。&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-8668990087223451248?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/8668990087223451248/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/05/ubuntu-1010btrfs.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/8668990087223451248?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/8668990087223451248?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/05/ubuntu-1010btrfs.html" title="Ubuntu 10.10可能使用Btrfs为默认文件系统" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEECQn45fyp7ImA9WxFQGEo.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-5066863583645067542</id><published>2010-05-15T05:31:00.000+08:00</published><updated>2010-05-15T05:31:03.027+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-15T05:31:03.027+08:00</app:edited><title>Compiz Fusion</title><content type="html">&lt;object style="background-image:url(http://i2.ytimg.com/vi/Y4wB3GUemVw/hqdefault.jpg)" width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Y4wB3GUemVw&amp;amp;hl=zh_CN&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/Y4wB3GUemVw&amp;amp;hl=zh_CN&amp;amp;fs=1" width="425" height="344" allowscriptaccess="never" allowfullscreen="true" wmode="transparent" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-5066863583645067542?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/5066863583645067542/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/05/compiz-fusion.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/5066863583645067542?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/5066863583645067542?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/05/compiz-fusion.html" title="Compiz Fusion" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;C0QDSHk-eCp7ImA9WxFQGEo.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-5336600467439103928</id><published>2010-05-15T05:09:00.000+08:00</published><updated>2010-05-15T05:09:39.750+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-15T05:09:39.750+08:00</app:edited><title>Introduction to HTML 5</title><content type="html">&lt;object style="background-image:url(http://i4.ytimg.com/vi/siOHh0uzcuY/hqdefault.jpg)" width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/siOHh0uzcuY&amp;amp;hl=zh_CN&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/siOHh0uzcuY&amp;amp;hl=zh_CN&amp;amp;fs=1" width="425" height="344" allowscriptaccess="never" allowfullscreen="true" wmode="transparent" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-5336600467439103928?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/5336600467439103928/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/05/introduction-to-html-5.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/5336600467439103928?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/5336600467439103928?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/05/introduction-to-html-5.html" title="Introduction to HTML 5" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;C0YAQX4zfCp7ImA9WxFTGEw.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-7729101102181360834</id><published>2010-04-09T19:04:00.001+08:00</published><updated>2010-04-09T19:05:40.084+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-09T19:05:40.084+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title>在Linux下挂载U盘，硬盘，光驱及自动化挂载管理</title><content type="html">1. Linux挂载U盘:&lt;br /&gt;
插入u盘到计算机，如果目前只插入了一个u盘而且你的硬盘不是scsi的硬盘接口的话，那它的硬件名称为:sda1。 在mnt目录下先建立一个usb的目录:&lt;br /&gt;
(如:[root@localhost root]# mkdir /mnt/usb)&lt;br /&gt;
&lt;br /&gt;
挂 载U盘：mount -t vfat /dev/sda1 /mnt/usb&lt;br /&gt;
卸载U盘：umount /mnt/usb&lt;br /&gt;
删除usb目 录:rm -rf /mnt/usb&lt;br /&gt;
&lt;br /&gt;
2. Linux挂载硬盘:&lt;br /&gt;
&lt;br /&gt;
挂载FAT32文件系统最简单的用法&lt;br /&gt;
mount  /dev/hda6 /mnt/wine&lt;br /&gt;
&lt;br /&gt;
/dev/hda6是Windows的E盘，/mnt/wine是目录加挂点。Linux会识 别到/dev/hda6分区的文件系统类型是什么，然后加挂的。当然也可以指定分区的文件系统类型，命令如下：&lt;br /&gt;
mount -t vfat  /dev/hda6 /mnt/wine&lt;br /&gt;
&lt;br /&gt;
在实际中操作中，直接加挂一个windows的分区，中文的文件名和目录名会出现乱码，为了避免 这种情况可以指定字符集，命令如下：&lt;br /&gt;
mount /dev/hda6 /mnt/d -o  codepage=936,iocharset=cp936&lt;br /&gt;
mount -t vfat /dev/hda6 /mnt/d -o  codepage=936,iocharset=cp936&lt;br /&gt;
mount -t vfat -o  iocharset=cp936,codepage=936 /dev/hda6 /mnt/wine&lt;br /&gt;
&lt;br /&gt;
注意：cp936是指简体中 文，cp950是指繁体中文。&lt;br /&gt;
&lt;br /&gt;
卸载所挂的硬盘 umount /mnt/wine&lt;br /&gt;
删除所挂的硬盘 rm -rf  /mnt/wine&lt;br /&gt;
&lt;br /&gt;
挂载NTFS文件系统&lt;br /&gt;
在目前多数的Linux版本上，需要重编译Linux核心才能，加挂NTFS分区(编译 方法请参阅其它文章)。核心支持NTFS后，可以用以下命令加挂：&lt;br /&gt;
mount -t ntfs /dev/hda2 /mnt/c&lt;br /&gt;
&lt;br /&gt;
同 样对于中文的文件名和目录名会出现乱码的问题可以指定字符集，不过和加挂vfat分区不同，实际中用以下命令是可行的：&lt;br /&gt;
mount -t  ntfs -o iocharset=cp936 /dev/hda2 /mnt/c -r&lt;br /&gt;
mount -t ntfs -o  iocharset=cp936,rw /dev/hda2 /mnt/c&lt;br /&gt;
&lt;br /&gt;
注意：cp936是指简体中文，cp950是指繁体中文。&lt;br /&gt;
卸 载删除同上。&lt;br /&gt;
&lt;br /&gt;
3. Linux自动挂载硬盘&lt;br /&gt;
&lt;br /&gt;
打开/etc找到里面的fstab文件进行编辑,如果你是以管理员身份登入的 话,可以直接右键-&amp;gt;打开方式-&amp;gt;gedit,可以直接在后面追加行:&lt;br /&gt;
/dev/hda6 /mnt/wine vfat  codepage=936,iocharset=cp936,defaults,umask=0 0 0&lt;br /&gt;
/dev/hda5 /mnt/wind  vfat codepage=936,iocharset=cp936 0 0&lt;br /&gt;
&lt;umask=0表示普通用户也有也可以读写&gt;&lt;br /&gt;
&lt;br /&gt;
4.  Linux挂载光驱:&lt;br /&gt;
命令: mount -t iso9660 /dev/hdc /mnt/cdrom&lt;br /&gt;
卸载删除同上。&lt;/umask=0表示普通用户也有也可以读写&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;umask=0表示普通用户也有也可以读写&gt;原文:&lt;a href="http://aolinux.blogspot.com/2009/04/linuxu.html?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+aolinux+%28%E5%99%A2%EF%BC%81Linux%29"&gt;http://aolinux.blogspot.com/2009/04/linuxu.html?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+aolinux+%28%E5%99%A2%EF%BC%81Linux%29 &lt;/a&gt;&lt;/umask=0表示普通用户也有也可以读写&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-7729101102181360834?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/7729101102181360834/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/04/linuxu.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/7729101102181360834?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/7729101102181360834?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/04/linuxu.html" title="在Linux下挂载U盘，硬盘，光驱及自动化挂载管理" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CkAMSHY5fCp7ImA9WxFTGEw.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-2343811729758688893</id><published>2010-04-09T18:57:00.001+08:00</published><updated>2010-04-09T18:59:49.824+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-09T18:59:49.824+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="MPlayer" /><title>mplayer-wrapper:自动从射手网下载字幕的 MPlayer 脚本</title><content type="html">mplayer-wrapper是&lt;a href="http://www.mplayerhq.hu/"&gt;Mplayer&lt;/a&gt;的一个简单的命令行前端。能实现如:自动视频,从上次结束的位置继续播放,自动字幕下载等功能。&lt;br /&gt;
地址:&lt;a href="http://gosubi.me/adow/mplayer-wrapper"&gt;http://gosubi.me/adow/mplayer-wrapper &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-2343811729758688893?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/2343811729758688893/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/04/mplayer-wrapper-mplayer.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/2343811729758688893?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/2343811729758688893?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/04/mplayer-wrapper-mplayer.html" title="mplayer-wrapper:自动从射手网下载字幕的 MPlayer 脚本" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A04EQnwyeip7ImA9WxBVEUg.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-7010551702444049306</id><published>2010-02-14T23:05:00.000+08:00</published><updated>2010-02-14T23:05:03.292+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-14T23:05:03.292+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux Kernel" /><title>编译Linux内核</title><content type="html">&lt;span class="Apple-style-span" style="color: #333333; font-family: 'Lucida Grande', Geneva, Arial, Verdana, 'Lucida Sans Unicode', Helvetica, sans-serif; font-size: 14px; line-height: 24px;"&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;1．需要先安装编译环境&lt;/strong&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;进入 root 帐户：&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;gt; su&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;输入密码&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;安装必要的工具：&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span id="more-3457"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;gt; apt-get install build-essential&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;(安装 gcc, make 等)&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;gt; apt-get install libncurses-dev&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;(安装 make menuconfig 时必须的库文件)&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;gt; apt-get install kernel-package, fakeroot&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;(Debian 系统里生成 kernel-image 的一些配置文件和工具)&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;gt; apt-get install initramfs-tools, module-init-tools&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;2.安装 kernel-source：&lt;/strong&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;可以从 Ubuntu 的源安装，这样的好处是简单，而且安装的内核是Debian 化了的，缺点是内核不是最新的内核。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;gt; apt-get install linux-source&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;也可以从 www.kernel.org 下载内核安装。kernel.org 的境象应该很多，选一个最快的来下载，因为要下载的文件很大。我这里介绍的是安装 2.6.24 的内核，加上了 ck 的补丁。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;下载 linux-2.6.24.tar.bz2 和 patch-2.6.24.bz2 ，并且把它们都存放在 /usr/src 目录下。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;gt; tar xvjf linux-2.6.24.tar.bz2&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;gt; ln -s linux-2.6.24 linux&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;(如果已经有了 linux 目录，则要先将其删除)&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;gt; cd linux&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;gt; bzcat ../patch-2.6.24.bz2 | patch -p1&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;至此，内核源文件以及补丁就都安装好了。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;3.编译内核&lt;/strong&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;把源码包解压到 /usr/src/linux-2.6.24，然后在/usr/src/下创建一个名为linux的指向/usr/src/linux-2.6.24的链接(link)。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;在shell中输入&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root@FE2000:~# cd ..&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root@FE2000:/# cd /usr/src/linux&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root@FE2000:/usr/src/linux# make mrproper&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root@FE2000:/usr/src/linux# make menuconfig&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;或者make gconfig&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;此时qconf已经读取了默认配置，你也可以这样做：&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;在qconf中点File-&amp;gt;Load 去读取其他的设置文件。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;比如 /boot/config-2.6.18-23-686&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;下面在qconf中配置.config文件。选“Y”（打勾）就是把它编译到内核中，选“M”（打点）把它编译成模块，供内核动态调用。选“N”就是不安装。也可以保持默认选项……&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;下面只是简单提几项：&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;General setup&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Optimize for size (Look out for broken compilers!) 发烧友可以选Y以获得更小的内核。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Processor type and features&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Symmetric multi-processing support 如果你没有多线程处理器这个可以选N&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Processor family 根据你的CPU来选择。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;High Memory Support 1G以上内存的选“4GB”, 1G以下的，将来也不打算升级到1G的，选“off”.&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Bus options (PCI, PCMCIA, EISA, MCA, ISA)&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;PCI support&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;PCI Express support 老式机器没有PCI-E设备的可以选N&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;ISA support 较新的新机器没有ISA设备，可以选N&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;MCA support 一般选N&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;NatSemi SCx200 support 一般选N&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;PCI Hotplug Support&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Support for PCI Hotplug (EXPERIMENTAL) 如果没有PCI热插拔设备，选N&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Device Drivers&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Block devices&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Packet writing on CD/DVD media&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Enable write caching (EXPERIMENTAL) 如果你有刻录机，想启用写缓存功能，选Y&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;ATA/ATAPI/MFM/RLL support&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Include IDE/ATA-2 DISK support 如果你的/boot是放在IDE硬盘上，那么这里一定要选Y，选M都不行。否则启动时会出现“waiting for root file system”的提示而停滞不前。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;SCSI device support 如果有SATA硬盘，就选Y&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;SCSI disk support 如果你的/boot放在SATA硬盘上，一定要选Y。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Character devices&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;I2C support 一般可以选Y或者M&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Graphics support 不建议把显卡驱动编译进内核。,选M,编译成模块方便日后升级驱动。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Support for frame buffer devices&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;VESA VGA graphics support 可以选Y&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Logo configuration&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Bootup logo 如果想看到Linux启动logo，选Y&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Sound&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Sound card support 选Y， 除非你没有声卡&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;其他的驱动，酌情添加删除，根据机器配置删除不需要的驱动可以缩短编译时间。你可以在命令行下输如lspci或者dmesg查看硬件信息。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;File systems&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;CD-ROM/DVD Filesystems&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;ISO 9660 CDROM file system support 一般选Y&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;DOS/FAT/NT Filesystems&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;VFAT (Windows-95) fs support 有FAT32分区就选Y吧&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;NTFS file system support 有NTFS分区就选Y吧&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;NTFS write support 如果想对 NTFS分区进行写操作，选Y&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Native Language Support&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Simplified Chinese charset (CP936, GB2312) 选Y或者M使读取FAT分区不会遇到中文乱码现象&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;设置完毕后，按一下保存按钮,无论原先载入的是哪个配置文件，qconfig都将设置保存到 /usr/src/linux/.config 这个隐含文件。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;下面输入make开始编译，这一过程大约需要40－100分钟，具体的要看你的机器速度啦……&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root@FE2000:/usr/src/linux# make&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;安装内核&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root@FE2000:/usr/src/linux# make install&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;编译模块&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root@FE2000:/usr/src/linux# make modules&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;安装模块&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root@FE2000:/usr/src/linux# make modules_install&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;然后&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root@FE2000:/usr/src/linux# cd /&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root@FE2000:/usr/src/linux# /usr/sbin/mkinitramfs -o /boot/initrd.img-2.6.24 2.6.24&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;如果有出错提示，可能是因为 initramfs－tools 没有装，先把它装上吧。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;如果没有这一步骤，那么开机就会出现提示&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;……&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;initrd /initrd.img-2.6.24&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Error 15: File not found&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong&gt;4.修改内核启动选项&lt;/strong&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;最后打开 /boot/grub/menu.lst&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;在 ## ## End Default Options ## 下面添加类似下面的两段&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;title Ubuntu, kernel 2.6.24&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root (hd0,4)&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;kernel /vmlinuz-2.6.24 root=/dev/hdd6&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;initrd /initrd.img-2.6.24&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;savedefault&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;boot&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;title Ubuntu, kernel 2.6.24 (recovery mode)&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;root (hd0,4)&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;kernel /vmlinuz-2.6.24 root=/dev/hdd6 ro single&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;initrd /initrd.img-2.6.24&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;boot&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;注意 root和kernel字段要模仿menu.lst下面已有的内容写。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;下面是 (hd0,4)，那么你也写(hd0,4)，下面写root=/dev/hdd6，你也写root=/dev/hdd6，只是内核的版本号改为现在编译的版本号。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;然后把下面重复的savedefault删除。&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;重新启动计算机，在GRUB中选择新内核启动。(仅供参考,实际应用中还有很多不同之处欢迎讨论)&lt;/div&gt;&lt;div style="margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span class="Apple-style-span" style="line-height: normal;"&gt;&lt;strong&gt;&lt;span style="color: black; font-size: 13px;"&gt;原文链接：&lt;/span&gt;&lt;a href="http://www.ownlinux.cn/2010/02/11/compile-linuxkernel.html" rel="bookmark" style="color: #3882c3; outline-color: initial; outline-style: none; outline-width: initial; text-decoration: none;" title="Permanent Link to 编译Linux内核"&gt;&lt;span style="color: #0099ff; font-size: 13px;"&gt;http://www.ownlinux.cn/2010/02/11/compile-linuxkernel.html&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.ownlinux.cn/" style="color: #3882c3; outline-color: initial; outline-style: none; outline-width: initial; text-decoration: none;"&gt;&lt;span style="color: #0099ff; font-size: 13px;"&gt;OwnLinux.cn&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-7010551702444049306?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/7010551702444049306/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/02/linux.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/7010551702444049306?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/7010551702444049306?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/02/linux.html" title="编译Linux内核" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CkQER3k-eSp7ImA9WxBXFk0.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-2362264905325714660</id><published>2010-01-27T21:51:00.000+08:00</published><updated>2010-01-27T21:51:46.751+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-27T21:51:46.751+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu linux" /><category scheme="http://www.blogger.com/atom/ns#" term="vpn" /><title>在Ubuntu中配置可供Windows主机共享上网的VPN服务器</title><content type="html">&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', 'Lucida Sans Unicode', Calibri, Arial, Helvetica, Sans, FreeSans, Jamrul, Garuda, Kalimati; font-size: 13px; line-height: 20px;"&gt;原文发表于:&amp;nbsp;&lt;a href="http://xiaogaozi.blogspot.com/2010/01/ubuntuwindowsvpn.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/xiaogaozi.blogspot.com');" style="color: #f44365; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;"&gt;http://xiaogaozi.blogspot.com/2010/01/ubuntuwindowsvpn.html&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Lucida Grande', 'Lucida Sans Unicode', Calibri, Arial, Helvetica, Sans, FreeSans, Jamrul, Garuda, Kalimati; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 20px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Lucida Grande', 'Lucida Sans Unicode', Calibri, Arial, Helvetica, Sans, FreeSans, Jamrul, Garuda, Kalimati; font-size: small;"&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Virtual_private_network" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" style="color: #0071bb; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;VPN&lt;/a&gt;&amp;nbsp;(Virtual Private Network, 虚拟专用网) 是一种在现有网络基础上建立的虚拟网络, 主要用于帮助两个网络通过VPN隧道 (tunnel) 进行通信. VPN的好处在于网络A中的电脑A&lt;sub style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;1&lt;/sub&gt;通过隧道与网络B中的电脑连接上后, A&lt;sub style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;1&lt;/sub&gt;将能够使用网络B的网络环境. VPN分为加密与不加密两种, 通常我们使用的都是加密VPN. 加密VPN常用的协议有SSL、PPTP等, 其中PPTP是Windows系统内置的协议, 因此如果想要搭建一个支持Windows电脑接入的VPN服务器, 最好是使用PPTP服务器软件. 当前VPN的主要用途有在异地接入一个内部网络, 以及翻越&lt;a href="http://en.wikipedia.org/wiki/Golden_Shield_Project" onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');" style="color: #0071bb; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;功夫网&lt;/a&gt;.&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;span id="more-884" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;/span&gt;&lt;br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /&gt;&lt;span style="color: red; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;注意: VPN服务器必须是具有外网IP的电脑, 如果IP地址属于10.0.0.0~10.255.255.255, 172.16.0.0~172.31.255.255, 192.168.0.0~192.168.255.255这三个IP地址段, 则不具备搭建VPN服务器的条件.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;&lt;a href="http://www.poptop.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.poptop.org');" style="color: #0071bb; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Poptop&lt;/a&gt;是一款Linux下的PPTP服务器软件, 今天我们就主要借助它来完成一个VPN服务器的配置. Ubuntu系统使用如下命令安装Poptop:&lt;br /&gt;
&lt;/div&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: white; background-image: initial; background-position: initial initial; background-repeat: initial; font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono'; font-size: 12px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.4em; padding-left: 0.4em; padding-right: 0.4em; padding-top: 0.4em; white-space: pre-wrap; word-wrap: break-word;"&gt;$ sudo apt-get install pptpd
&lt;/pre&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;如果你的Linux的内核版本低于2.6.15, 那么需要先检查一下是否支持MPPE:&lt;br /&gt;
&lt;/div&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: white; background-image: initial; background-position: initial initial; background-repeat: initial; font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono'; font-size: 12px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.4em; padding-left: 0.4em; padding-right: 0.4em; padding-top: 0.4em; white-space: pre-wrap; word-wrap: break-word;"&gt;$ sudo modprobe ppp-compress-18 &amp;amp;&amp;amp; echo "success"
&lt;/pre&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;若是没有输出“success”则证明内核不支持, 可以跟随&lt;a href="http://pptpclient.sourceforge.net/howto-debian-build.phtml" onclick="javascript:pageTracker._trackPageview('/outbound/article/pptpclient.sourceforge.net');" style="color: #0071bb; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;这里的步骤&lt;/a&gt;进行内核的配置.&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;Poptop安装完毕之后需要简单配置一下, 打开“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;/etc/pptpd.conf&lt;/code&gt;”文件, 添加下面两行, 或者这个文件已经有了一些示例, 只需要去掉注释符号.&lt;br /&gt;
&lt;/div&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: white; background-image: initial; background-position: initial initial; background-repeat: initial; font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono'; font-size: 12px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.4em; padding-left: 0.4em; padding-right: 0.4em; padding-top: 0.4em; white-space: pre-wrap; word-wrap: break-word;"&gt;localip 192.168.0.1
remoteip 192.168.0.234-238,192.168.0.245
&lt;/pre&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;localip&lt;/code&gt;”表示VPN隧道中服务器 (server) 的IP地址, “&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;remoteip&lt;/code&gt;”表示VPN隧道中客户端 (client) 可以分配的IP地址. 关于“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;pptdp.conf&lt;/code&gt;”文件的更多选项, 可以阅读它的man page.&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;然后设置用于登录的用户名和密码, 打开“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;/etc/ppp/chap-secrets&lt;/code&gt;”文件, 添加下面一行, 中括号部分代表需要配置的地方:&lt;br /&gt;
&lt;/div&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: white; background-image: initial; background-position: initial initial; background-repeat: initial; font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono'; font-size: 12px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.4em; padding-left: 0.4em; padding-right: 0.4em; padding-top: 0.4em; white-space: pre-wrap; word-wrap: break-word;"&gt;[username] pptpd [password] *
&lt;/pre&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;最后重启Poptop:&lt;br /&gt;
&lt;/div&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: white; background-image: initial; background-position: initial initial; background-repeat: initial; font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono'; font-size: 12px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.4em; padding-left: 0.4em; padding-right: 0.4em; padding-top: 0.4em; white-space: pre-wrap; word-wrap: break-word;"&gt;$ sudo /etc/init.d/pptpd restart
&lt;/pre&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;现在试试用其它电脑是否可以成功连上, 注意客户端填写的IP地址是VPN服务器的外网IP, 而不是刚才配置的“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;localip&lt;/code&gt;”.&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;虽然可以成功建立VPN连接, 但通常情况下还不能通过VPN服务器连接到Internet. 原因有多种, 先来看看客户端通过VPN服务器与Internet上的服务器通信的全过程:&lt;br /&gt;
&lt;/div&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: white; background-image: initial; background-position: initial initial; background-repeat: initial; font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono'; font-size: 12px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.4em; padding-left: 0.4em; padding-right: 0.4em; padding-top: 0.4em; white-space: pre-wrap; word-wrap: break-word;"&gt;client &amp;lt;--&amp;gt; client ppp0 &amp;lt;--&amp;gt; VPN server ppp0 &amp;lt;--&amp;gt; VPN server &amp;lt;--&amp;gt; VPN server eth0 &amp;lt;--&amp;gt; Internet server eth0 &amp;lt;--&amp;gt; Internet server
&lt;/pre&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;ppp0&lt;/code&gt;”其实是VPN虚拟的一个网络接口 (可以想象成这是一个虚拟的网卡), VPN隧道就是通过客户端与服务器的这两个网络接口建立的. 而“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;eth0&lt;/code&gt;”则代表服务器上真实存在的物理网卡, VPN服务器与外网通信就需要通过它. 具体流程是: 客户端通过“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;ppp0&lt;/code&gt;”向VPN服务器发出请求, VPN服务器侦测到之后, 再将请求通过“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;eth0&lt;/code&gt;”转发出去, 当请求到达目的地之后, Internet服务器就根据请求做出相应的回复, 这个回复再按照刚才来的路径返回到客户端, 这样客户端就成功与Internet服务器完成一次通信.&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;上面图示中的箭头部分 (“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&amp;lt;--&amp;gt;&lt;/code&gt;”) 就是可能造成无法连接Internet的关键, 因此需要针对每个部分一一排查. 这里只对可能性最大的两个地方进行介绍, 想要了解每一个关键点的检测方法的同学可以阅读“&lt;a href="http://poptop.sourceforge.net/dox/diagnose-forwarding.phtml" onclick="javascript:pageTracker._trackPageview('/outbound/article/poptop.sourceforge.net');" style="color: #0071bb; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Diagnosing Forwarding on pptpd&lt;/a&gt;”这篇文章.&lt;br /&gt;
&lt;/div&gt;&lt;ol style="line-height: 19px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0.4em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;li style="list-style-position: outside; margin-bottom: 0px; margin-left: 1.6em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;是否已经打开IP转发?&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;查看“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;/proc/sys/net/ipv4/ip_forward&lt;/code&gt;”文件中的值是否为“1”, 如果不是, 则需要在“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;/etc/sysctl.conf&lt;/code&gt;”文件中添加“&lt;code style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;net.ipv4.ip_forward=1&lt;/code&gt;”, 然后执行以下命令:&lt;br /&gt;
&lt;/div&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: white; background-image: initial; background-position: initial initial; background-repeat: initial; font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono'; font-size: 12px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.4em; padding-left: 0.4em; padding-right: 0.4em; padding-top: 0.4em; white-space: pre-wrap; word-wrap: break-word;"&gt;$ sudo /etc/init.d/procps restart
&lt;/pre&gt;&lt;/li&gt;
&lt;li style="list-style-position: outside; margin-bottom: 0px; margin-left: 1.6em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;是否在VPN服务器上设置了对于客户端IP地址的NAT?&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;执行下面的命令查看表中是否有相应的表项:&lt;br /&gt;
&lt;/div&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: white; background-image: initial; background-position: initial initial; background-repeat: initial; font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono'; font-size: 12px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.4em; padding-left: 0.4em; padding-right: 0.4em; padding-top: 0.4em; white-space: pre-wrap; word-wrap: break-word;"&gt;$ sudo iptables --table nat -L POSTROUTING
&lt;/pre&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;如果没有则执行以下命令:&lt;br /&gt;
&lt;/div&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: white; background-image: initial; background-position: initial initial; background-repeat: initial; font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono'; font-size: 12px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0.4em; padding-left: 0.4em; padding-right: 0.4em; padding-top: 0.4em; white-space: pre-wrap; word-wrap: break-word;"&gt;$ sudo iptables --table nat --append POSTROUTING --out-interface eth0 --jump MASQUERADE
&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;在完成上面两个检查之后, 应该就可以成功通过VPN服务器与Internet进行通信, 一个VPN服务器也基本配置完毕.&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0.6em; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px;"&gt;参考资料:&amp;nbsp;&lt;a href="http://poptop.sourceforge.net/dox/debian-howto.phtml" style="color: #0071bb; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Debian pptpd HOWTO&lt;/a&gt;,&amp;nbsp;&lt;a href="http://ubuntuforums.org/showpost.php?p=5430429&amp;amp;postcount=13" onclick="javascript:pageTracker._trackPageview('/outbound/article/ubuntuforums.org');" style="color: #0071bb; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;#13&lt;/a&gt;,&amp;nbsp;&lt;a href="http://poptop.sourceforge.net/dox/diagnose-forwarding.phtml" onclick="javascript:pageTracker._trackPageview('/outbound/article/poptop.sourceforge.net');" style="color: #0071bb; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Diagnosing Forwarding on pptpd&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-2362264905325714660?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/2362264905325714660/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2010/01/ubuntuwindowsvpn.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/2362264905325714660?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/2362264905325714660?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2010/01/ubuntuwindowsvpn.html" title="在Ubuntu中配置可供Windows主机共享上网的VPN服务器" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CkUHRnc9eyp7ImA9WxBTFE4.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-8467147278779771721</id><published>2009-12-10T15:30:00.000+08:00</published><updated>2009-12-10T15:30:37.963+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-10T15:30:37.963+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="xen" /><title>翻译：Xen体系结构</title><content type="html">&lt;h2&gt;翻译说明&lt;/h2&gt;在研究和学习虚拟化技术的过程中看了很多文档，很多是翻译成中文的，对那些无私的为大家服务的贡献者很是敬佩，同时也触发了我为大家做些贡献的愿望。事实上翻译和整理的过程也是自己进一步学习的过程。由于自己的水平有限，翻译过程中的错误欢迎大家批评指正。&lt;br /&gt;
开源，很好！&lt;br /&gt;
&lt;h2&gt;概要&lt;/h2&gt;本文档描述的是Xen hypervisor的宏观体系结构、辅助工具以及构建一个完整虚拟化环境所需的应用程序。本文的综合介绍了基于Xen3.2（2008年1月）的Xen体系结构，更详尽的描述请参考Xen books。&lt;br /&gt;
&lt;h2&gt;Xen组成要素&lt;/h2&gt;一个Xen虚拟化环境由以下相互配合的元素构成：&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; Xen Hypervisor&lt;/li&gt;
&lt;li&gt;Domain 0&lt;/li&gt;
&lt;li&gt;Domain管理和控制工具&lt;/li&gt;
&lt;li&gt;Domain U PV客户系统&lt;/li&gt;
&lt;li&gt;Domain U HVM客户系统&lt;/li&gt;
&lt;/ul&gt;下面的图形是对这些要素基本组织的描述&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_ze53Vsu43ME/SyCg5Vs2uDI/AAAAAAAABzw/ZnGsq3QpWZg/s1600-h/xen1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_ze53Vsu43ME/SyCg5Vs2uDI/AAAAAAAABzw/ZnGsq3QpWZg/s320/xen1.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Xen Hypervisor&lt;/strong&gt;&lt;br /&gt;
Xen Hypervisor是一个介于硬件和操作系统之间的软件层，它负责在各虚拟机之间进行CPU调度和内存分配（partitioning）。Xen Hypervisor不仅抽象出硬件层，同时控制虚拟机的执行，因为这些虚拟机共享同一个处理环境。Xen Hypervisor不会处理网络、存储设备、视频以及其他I/O。&lt;br /&gt;
&lt;strong&gt; &lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Domain 0&lt;/strong&gt;&lt;br /&gt;
Domain 0是一个修改过的Linux kernel，是唯一运行在Xen Hypervisor之上的虚拟机，它拥有访问物理I/O资源的权限，同时和系统上运行的其他虚拟机进行交互。Domain 0需要在其它Domain启动之前启动。&lt;br /&gt;
Domain 0中包含两个驱动：Network Backend Driver和Block Backend Driver，分别负责处理来自Domain U的网络和本地磁盘请求。Network Backend Driver直接和本地网络硬件进行通信以处理所有来自Domain U上客户操作系统的网络请求。Block Backend Driver和本地存储设备进行通信以处理来自Domain U的读写请求。&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_ze53Vsu43ME/SyChfY3KNqI/AAAAAAAABz4/zxOPphKJCUY/s1600-h/xen2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_ze53Vsu43ME/SyChfY3KNqI/AAAAAAAABz4/zxOPphKJCUY/s320/xen2.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;strong&gt;Domain U&lt;/strong&gt;&lt;br /&gt;
运行在Xen Hypervisor上的所有半虚拟化（paravirtualized）虚拟机被称为“Domain U PV Guests”，其上运行着被修改过内核的操作系统，如Linux、Solaris、FreeBSD等其它UNIX操作系统。所有的全虚拟化虚拟机被称为 “Domain U HVM Guests”，其上运行着不用修改内核的操作系统，如Windows等。&lt;br /&gt;
Domain U PV Guests的内核知道它自己不能直接访问物理硬件，因为他知道有其他的虚拟机也运行在同一个环境中。而Domain U HVM Guests的内核不知道他正在和其他虚拟机共享一个处理环境，它认为它运转在物理硬件上。&lt;br /&gt;
Domain U PV Guests包含两个驱动：“PV Network Driver”和“PV Block Driver”。&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_ze53Vsu43ME/SyChtcswFBI/AAAAAAAAB0A/ql0zHyzFMzs/s1600-h/xen3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_ze53Vsu43ME/SyChtcswFBI/AAAAAAAAB0A/ql0zHyzFMzs/s320/xen3.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;Domain U HVM Guests虚拟机内没有PV Driver，而是在Domain 0里为每一个HVM Guest启动一个特殊守护进程：Qemu-dm，由Qemu-dm负责客户操作系统的网络和磁盘请求。&lt;br /&gt;
Domain U HVM Guests必须进行初始化为某类机器，所以要在Domain U上附加一个软件：Xen虚拟固件，来模拟BIOS。关于Xen虚拟化固件的更多信息请参考后面的内容。&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_ze53Vsu43ME/SyCiT-0bNDI/AAAAAAAAB0I/snmI1rOYCC4/s1600-h/xen4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_ze53Vsu43ME/SyCiT-0bNDI/AAAAAAAAB0I/snmI1rOYCC4/s320/xen4.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;strong&gt;域（Domain）管理和控制&lt;/strong&gt;&lt;br /&gt;
开源社区提供了一系列的域管理和控制工具（Linux守护程序）。这些服务运行在Domain 0，他们支持所有对虚拟化环境的管理和控制，下面的几个图中为了更清楚的说明将这些守护进程画在了Domain 0的外部。&lt;br /&gt;
Xend&lt;br /&gt;
Xend是一个python应用程序，它是Xen虚拟化环境的系统管理工具。它通过对libxenctrl库的调用实现对Xen Hypervisor的请求。Xend处理的所有请求都是通过Xm工具提供的XML RPC接口提交的，见下图。&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_ze53Vsu43ME/SyCijolRlmI/AAAAAAAAB0Q/yE7X-_KXD6g/s1600-h/xen5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_ze53Vsu43ME/SyCijolRlmI/AAAAAAAAB0Q/yE7X-_KXD6g/s320/xen5.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Xm&lt;br /&gt;
Xm是一个命令行工具，它接受用户的输入并把指令通过XML RPC传输给Xend。&lt;br /&gt;
Xenstored&lt;br /&gt;
Xenstored维护一个信息档案，包括内存和建立在Domain 0与Domain U之间的事件通道。Domain 0通过改变这个档案来设置和其他虚拟机的设备通道。（具体信息请参考Domain 0和Domain U的通信）&lt;br /&gt;
Libxenctrl&lt;br /&gt;
Libxenctrl是一个C语言的库，它为Xend提供与Xen Hypervisor通信的能力。privcmd是Domain 0中的一个特殊驱动，它负责提交请求到hypervisor。&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_ze53Vsu43ME/SyCiwR4E8rI/AAAAAAAAB0Y/GDiC7RcqTNg/s1600-h/xen7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_ze53Vsu43ME/SyCiwR4E8rI/AAAAAAAAB0Y/GDiC7RcqTNg/s320/xen7.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Qemu-dm&lt;br /&gt;
每一个运行在Xen虚拟化环境下的HVM客户系统都有他自己的Qemu守护进程。该进程处理来自HVM客户系统的所有网络和磁盘请求，以支持Xen虚拟化 环境下的全虚拟化。Qemu必须存在于Xen hypervisor之外，因为它需要访问网络和I/O设备，所以他运行在Domain 0 。&lt;br /&gt;
现在已经有一个新的工具来代替Qemu对HVM客户系统的支持，这就是Stub-dm。它是为Xen的将来版本开发的，Xen3.2还不具备该特性，可能发布在Xen3.3中。&lt;br /&gt;
Xen虚拟化固件&lt;br /&gt;
Xen虚拟化固件是一个虚拟的BIOS，它被加载到每一个Domain U HVM Guest以提供标准的启动指令，保证客户操作系统在正常启动过程中能得到标准的PC兼容的软件环境。&lt;br /&gt;
&lt;h2&gt;Xen操作&lt;/h2&gt;这部分描述一个半虚拟化的Domain U如何通过Xen hypervisor、Domain 0 与外部的网络以及存储进行通信的。&lt;br /&gt;
&lt;strong&gt;Domain 0与Domain U的通信&lt;/strong&gt;&lt;br /&gt;
前面讲到过，Xen Hypervisor不会支持网络和磁盘请求的，因此一个PV客户系统必须通过和Xen Hypervisor、Domain 0通信，来实现网络和磁盘请求。下面这个例子描述了PV客户系统如何将一个数据写到本地硬盘。&lt;br /&gt;
PV客户系统的开设备驱动程序接收到一个写请求，并且通过Xen Hypervisor写数据到适当的本地内存中，该内存是和Domain 0共享的。在Domain 0 和Domain U之间存在一个事件通道（event channel），通过该通道二者进行异步的域间中断通信。Domain 0会接收到一个来自Xen Hypervisor的中断，触发PV Block Backend Driver访问上述的内存，读取来自PV客户系统的数据，然后将这些数据写入硬件磁盘。&lt;br /&gt;
下图中事件通道表示为连接Domain 0与Domain U的一个区域，这是系统工作流的一个简化。事实上事件通道运行在Xen Hypervisor，通过Xenstored中的特定中断实现，提供Domain 0与Domain U之间的快速共享内存。&lt;br /&gt;
见下图。&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_ze53Vsu43ME/SyCi88jW_uI/AAAAAAAAB0g/_R_ygkMEQEw/s1600-h/xen8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_ze53Vsu43ME/SyCi88jW_uI/AAAAAAAAB0g/_R_ygkMEQEw/s320/xen8.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
术语表&lt;br /&gt;
C: http://www.cprogramming.com/; a computer programming language&lt;br /&gt;
Daemons: http://en.wikipedia.org/wiki/Daemon_(computer_software); a program running in the background rather than under direct control of a user&lt;br /&gt;
Driver: http://en.wikipedia.org/wiki/Device_driver; program allowing software to interact with hardware&lt;br /&gt;
Full Virtualization: http://en.wikipedia.org/wiki/Full_virtualization; a virtual machine not aware of its virtualization&lt;br /&gt;
Interrupt:&amp;nbsp; http://en.wikipedia.org/wiki/Interrupt; signal from hardware to software requesting a specific action in software&lt;br /&gt;
Kernel: http://en.wikipedia.org/wiki/Linux_kernel; the central component of a computer operating system&lt;br /&gt;
Paravirtualized: http://en.wikipedia.org/wiki/Paravirtualization; virtual machine running on a hypervisor that is aware of it being virtualized]&lt;br /&gt;
Python: http://www.python.org/; a dynamic object oriented programming language&lt;br /&gt;
ROM BIOS: http://en.wikipedia.org/wiki/BIOS; software instructions run on a machine when turned on&lt;br /&gt;
XML PRC: http://www.xmlrpc.com/; method for an application to leverage another application using HTTP for the remote procedure call and XML as the encoding&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;译者：BiaBear&lt;br /&gt;
博客：http://www.lupaworld.com/386879&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-8467147278779771721?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/8467147278779771721/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2009/12/xen.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/8467147278779771721?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/8467147278779771721?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2009/12/xen.html" title="翻译：Xen体系结构" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_ze53Vsu43ME/SyCg5Vs2uDI/AAAAAAAABzw/ZnGsq3QpWZg/s72-c/xen1.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0MFQHYyfSp7ImA9WxBTFE8.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-3610389114535966654</id><published>2009-12-10T15:16:00.000+08:00</published><updated>2009-12-10T15:16:51.895+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-10T15:16:51.895+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title>Nessus 4.2开源漏洞扫描工具发布</title><content type="html">&lt;div style="font-style: italic;"&gt; &lt;!-- JiaThis Button END --&gt; &lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.tenablesecurity.com/nessus/"&gt;&lt;img alt="NessusLogo-9e60aec32eb934b1" class="alignleft size-full wp-image-4060" height="53" src="http://osss.cn/news/wp-content/uploads/2009/12/NessusLogo-9e60aec32eb934b1.png" style="margin-left: 6px; margin-right: 6px;" title="NessusLogo-9e60aec32eb934b1" width="53" /&gt;Nessus&lt;/a&gt;是一款非常优秀的开源漏洞扫描工具，被认为是目前全世界最多人使用的系统漏洞扫描与分析软件。该软件的&lt;a href="http://osss.cn/news/2009/12/04/nessus-4-2%e5%bc%80%e6%ba%90%e6%bc%8f%e6%b4%9e%e6%89%ab%e6%8f%8f%e5%b7%a5%e5%85%b7%e5%8f%91%e5%b8%83%e9%99%84%e6%88%aa%e5%b1%8f/href=%22http://blog.tenablesecurity.com/2009/11/nessus-42-released.html"&gt;4.2版本发布&lt;/a&gt;，这个新版本是有史以来发动最大的一次，首先就是增加了一个基于Web的用户界面，界面的美工做到极致，让人赞叹，可以见系统截屏。这个Web界面的推出，意味着是一个新的客户端，用户可以通过浏览器来管理设置系统。&lt;br /&gt;
详细功能请查看官方&lt;a href="http://www.tenablesecurity.com/nessus/features/"&gt;功能描述&lt;/a&gt;、&lt;a href="http://www.tenablesecurity.com/download/"&gt;下载&lt;/a&gt;、&lt;a href="http://www.tenablesecurity.com/documentation/"&gt;文档&lt;/a&gt;、&lt;a href="http://www.tenablesecurity.com/plugins/"&gt;插件&lt;/a&gt;。&lt;br /&gt;
&lt;br /&gt;
转载自&lt;a href="http://osss.cn/news/"&gt;Osss.cn 开源社区&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-3610389114535966654?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/3610389114535966654/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2009/12/nessus-42.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/3610389114535966654?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/3610389114535966654?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2009/12/nessus-42.html" title="Nessus 4.2开源漏洞扫描工具发布" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0UNSH4-fSp7ImA9WxBTFE8.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-7504251893305119242</id><published>2009-12-10T15:14:00.000+08:00</published><updated>2009-12-10T15:14:59.055+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-10T15:14:59.055+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title>Musca + Xfce4-panel：接近完美</title><content type="html">{ 撰文/&lt;a href="http://hi.baidu.com/jiqing0925"&gt;吴吉庆&lt;/a&gt; }&lt;br /&gt;
我上篇讲 &lt;a href="http://linuxtoy.org/archives/musca-config.html"&gt;Musca 配置的文章&lt;/a&gt;中所说的用 Conky 显示窗口列表，效果并不是很好，文本经常显示不全。而且也不能像真的任务栏那样操作。&lt;span id="more-3550"&gt;&lt;/span&gt; &lt;br /&gt;
PyPanel 也不行，根本不能显示窗口列表。&lt;br /&gt;
我一开始还以为是 Musca 不符合 MWM 规范呢，但看到一个网友用 Tint2 可以显示窗口列表。 他告诉我说，就 PyPanel 不行，别的 panel 都可以。 原来这样，看来 Musca 都可以嵌入到 GNOME 中用了，真的很不错啊。&lt;br /&gt;
我试用了 Tint2，基本满意，但是有两个问题：&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;它对系统托盘程序的支持并不好。它对方形的托盘图标显示没问题，但是对于 Workrave 这样的长矩形托盘也只能显示个方形，显示不全。&lt;/li&gt;
&lt;li&gt;用鼠标激活窗口时，任务栏上的窗口才显示被激活的状态，用快捷键激活窗口时，任务栏上所有的窗口都没有被激活的状态。&lt;/li&gt;
&lt;/ol&gt;我于是试了下 Xfce4-panel，效果几乎完美。Tint2 的那两个问题都解决了。 而且对工作区的显示非常棒，你看截图右下角的工作区显示。 可能美中不足的就是它是 Xfce4 的组件，不能独立安装，也不能独立调节它的显示外观。希望朋友们提出更好的方案。&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_ze53Vsu43ME/SyCeNjgnDUI/AAAAAAAABzo/DuYNbDgV0l8/s1600-h/musca_xfce_panel-thumb.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_ze53Vsu43ME/SyCeNjgnDUI/AAAAAAAABzo/DuYNbDgV0l8/s320/musca_xfce_panel-thumb.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-7504251893305119242?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/7504251893305119242/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2009/12/musca-xfce4-panel.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/7504251893305119242?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/7504251893305119242?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2009/12/musca-xfce4-panel.html" title="Musca + Xfce4-panel：接近完美" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_ze53Vsu43ME/SyCeNjgnDUI/AAAAAAAABzo/DuYNbDgV0l8/s72-c/musca_xfce_panel-thumb.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;AkEHR34yfSp7ImA9WxBTFE8.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-448698975883005510</id><published>2009-12-10T15:03:00.000+08:00</published><updated>2009-12-10T15:03:56.095+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-10T15:03:56.095+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title>《SED 单行脚本快速参考》的 awk 实现</title><content type="html">sed 和 awk 都是 Linux 下常用的流编辑器，他们各有各的特色，本文并不是要做什么对比，而是权当好玩，把《&lt;a href="http://sed.sourceforge.net/sed1line_zh-CN.html"&gt;SED 单行脚本快速参考&lt;/a&gt;》这文章，用 awk 做了一遍~ 至于孰好孰坏，那真是很难评论了。一般来说，sed 的命令会更短小一些，同时也更难读懂；而 awk 稍微长点，但是 if、while 这样的，逻辑性比较强，更加像“程序”。到底喜欢用哪个，就让各位看官自己决定吧！&lt;span id="more-3552"&gt;&lt;/span&gt; &lt;br /&gt;
&lt;strong&gt;文本间隔：&lt;/strong&gt;&lt;br /&gt;
# 在每一行后面增加一空行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed G
awk '{printf("%s\n\n",$0)}'
&lt;/code&gt;&lt;/pre&gt;# 将原来的所有空行删除并在每一行后面增加一空行。&lt;br /&gt;
# 这样在输出的文本中每一行后面将有且只有一空行。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/^$/d;G'
awk '!/^$/{printf("%s\n\n",$0)}'
&lt;/code&gt;&lt;/pre&gt;# 在每一行后面增加两行空行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 'G;G'
awk '{printf("%s\n\n\n",$0)}'
&lt;/code&gt;&lt;/pre&gt;# 将第一个脚本所产生的所有空行删除（即删除所有偶数行）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 'n;d'
awk '{f=!f;if(f)print $0}'
&lt;/code&gt;&lt;/pre&gt;# 在匹配式样“regex”的行之前插入一空行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/regex/{x;p;x;}'
awk '{if(/regex/)printf("\n%s\n",$0);else print $0}'
&lt;/code&gt;&lt;/pre&gt;# 在匹配式样“regex”的行之后插入一空行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/regex/G'
awk '{if(/regex/)printf("%s\n\n",$0);else print $0}'
&lt;/code&gt;&lt;/pre&gt;# 在匹配式样“regex”的行之前和之后各插入一空行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/regex/{x;p;x;G;}'
awk '{if(/regex/)printf("\n%s\n\n",$0);else print $0}'
&lt;/code&gt;&lt;/pre&gt;&lt;strong&gt;编号：&lt;/strong&gt;&lt;br /&gt;
# 为文件中的每一行进行编号（简单的左对齐方式）。这里使用了“制表符”&lt;br /&gt;
# （tab，见本文末尾关于’\t’的用法的描述）而不是空格来对齐边缘。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed = filename | sed 'N;s/\n/\t/'
awk '{i++;printf("%d\t%s\n",i,$0)}'
&lt;/code&gt;&lt;/pre&gt;# 对文件中的所有行编号（行号在左，文字右端对齐）。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed = filename | sed 'N; s/^/     /; s/ *\(.\{6,\}\)\n/\1  /'
awk '{i++;printf("%6d  %s\n",i,$0)}'
&lt;/code&gt;&lt;/pre&gt;# 对文件中的所有行编号，但只显示非空白行的行号。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/./=' filename | sed '/./N; s/\n/ /'
awk '{i++;if(!/^$/)printf("%d %s\n",i,$0);else print}'
&lt;/code&gt;&lt;/pre&gt;# 计算行数 （模拟 “wc -l”）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '$='
awk '{i++}END{print i}'
&lt;/code&gt;&lt;/pre&gt;&lt;strong&gt;文本转换和替代：&lt;/strong&gt;&lt;br /&gt;
# Unix环境：转换DOS的新行符（CR/LF）为Unix格式。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 's/.$//'                     # 假设所有行以CR/LF结束
sed 's/^M$//'                    # 在bash/tcsh中，将按Ctrl-M改为按Ctrl-V
sed 's/\x0D$//'                  # ssed、gsed 3.02.80，及更高版本
awk '{sub(/\x0D$/,"");print $0}'
&lt;/code&gt;&lt;/pre&gt;# Unix环境：转换Unix的新行符（LF）为DOS格式。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed "s/$/`echo -e \\\r`/"        # 在ksh下所使用的命令
sed 's/$'"/`echo \\\r`/"         # 在bash下所使用的命令
sed "s/$/`echo \\\r`/"           # 在zsh下所使用的命令
sed 's/$/\r/'                    # gsed 3.02.80 及更高版本
awk '{printf("%s\r\n",$0)}'
&lt;/code&gt;&lt;/pre&gt;# DOS环境：转换Unix新行符（LF）为DOS格式。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed "s/$//"                      # 方法 1
sed -n p                         # 方法 2
&lt;/code&gt;&lt;/pre&gt;DOS环境的略过&lt;br /&gt;
# DOS环境：转换DOS新行符（CR/LF）为Unix格式。&lt;br /&gt;
# 下面的脚本只对UnxUtils sed 4.0.7 及更高版本有效。要识别UnxUtils版本的&lt;br /&gt;
# sed可以通过其特有的“–text”选项。你可以使用帮助选项（“–help”）看&lt;br /&gt;
# 其中有无一个“–text”项以此来判断所使用的是否是UnxUtils版本。其它DOS&lt;br /&gt;
# 版本的的sed则无法进行这一转换。但可以用“tr”来实现这一转换。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed "s/\r//" infile &amp;gt;outfile     # UnxUtils sed v4.0.7 或更高版本
tr -d \r &lt;infile&gt;outfile        # GNU tr 1.22 或更高版本
&lt;/infile&gt;&lt;/code&gt;&lt;/pre&gt;DOS环境的略过&lt;br /&gt;
# 将每一行前导的“空白字符”（空格，制表符）删除&lt;br /&gt;
# 使之左对齐&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 's/^[ \t]*//'                # 见本文末尾关于'\t'用法的描述
awk '{sub(/^[ \t]+/,"");print $0}'
&lt;/code&gt;&lt;/pre&gt;# 将每一行拖尾的“空白字符”（空格，制表符）删除&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 's/[ \t]*$//'                # 见本文末尾关于'\t'用法的描述
awk '{sub(/[ \t]+$/,"");print $0}'
&lt;/code&gt;&lt;/pre&gt;# 将每一行中的前导和拖尾的空白字符删除&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 's/^[ \t]*//;s/[ \t]*$//'
awk '{sub(/^[ \t]+/,"");sub(/[ \t]+$/,"");print $0}'
&lt;/code&gt;&lt;/pre&gt;# 在每一行开头处插入5个空格（使全文向右移动5个字符的位置）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 's/^/     /'
awk '{printf("     %s\n",$0)}'
&lt;/code&gt;&lt;/pre&gt;# 以79个字符为宽度，将所有文本右对齐&lt;br /&gt;
# 78个字符外加最后的一个空格&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e :a -e 's/^.\{1,78\}$/ &amp;amp;/;ta'
awk '{printf("%79s\n",$0)}'
&lt;/code&gt;&lt;/pre&gt;# 以79个字符为宽度，使所有文本居中。在方法1中，为了让文本居中每一行的前&lt;br /&gt;
# 头和后头都填充了空格。 在方法2中，在居中文本的过程中只在文本的前面填充&lt;br /&gt;
# 空格，并且最终这些空格将有一半会被删除。此外每一行的后头并未填充空格。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed  -e :a -e 's/^.\{1,77\}$/ &amp;amp; /;ta'                     # 方法1
sed  -e :a -e 's/^.\{1,77\}$/ &amp;amp;/;ta' -e 's/\( *\)\1/\1/'  # 方法2
awk '{for(i=0;i&amp;lt;39-length($0)/2;i++)printf(" ");printf("%s\n",$0)}'  #相当于上面的方法二
&lt;/code&gt;&lt;/pre&gt;# 在每一行中查找字串“foo”，并将找到的“foo”替换为“bar”&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 's/foo/bar/'                 # 只替换每一行中的第一个“foo”字串
sed 's/foo/bar/4'                # 只替换每一行中的第四个“foo”字串
sed 's/foo/bar/g'                # 将每一行中的所有“foo”都换成“bar”
sed 's/\(.*\)foo\(.*foo\)/\1bar\2/' # 替换倒数第二个“foo”
sed 's/\(.*\)foo/\1bar/'            # 替换最后一个“foo”
awk '{gsub(/foo/,"bar");print $0}'   # 将每一行中的所有“foo”都换成“bar”
&lt;/code&gt;&lt;/pre&gt;# 只在行中出现字串“baz”的情况下将“foo”替换成“bar”&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/baz/s/foo/bar/g'
awk '{if(/baz/)gsub(/foo/,"bar");print $0}'
&lt;/code&gt;&lt;/pre&gt;# 将“foo”替换成“bar”，并且只在行中未出现字串“baz”的情况下替换&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/baz/!s/foo/bar/g'
awk '{if(/baz$/)gsub(/foo/,"bar");print $0}'
&lt;/code&gt;&lt;/pre&gt;# 不管是“scarlet”“ruby”还是“puce”，一律换成“red”&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 's/scarlet/red/g;s/ruby/red/g;s/puce/red/g'  #对多数的sed都有效
gsed 's/scarlet\|ruby\|puce/red/g'               # 只对GNU sed有效
awk '{gsub(/scarlet|ruby|puce/,"red");print $0}'
&lt;/code&gt;&lt;/pre&gt;# 倒置所有行，第一行成为最后一行，依次类推（模拟“tac”）。&lt;br /&gt;
# 由于某些原因，使用下面命令时HHsed v1.5会将文件中的空行删除&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '1!G;h;$!d'               # 方法1
sed -n '1!G;h;$p'             # 方法2
awk '{A[i++]=$0}END{for(j=i-1;j&amp;gt;=0;j--)print A[j]}'
&lt;/code&gt;&lt;/pre&gt;# 将行中的字符逆序排列，第一个字成为最后一字，……（模拟“rev”）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/\n/!G;s/\(.\)\(.*\n\)/&amp;amp;\2\1/;//D;s/.//'
awk '{for(i=length($0);i&amp;gt;0;i--)printf("%s",substr($0,i,1));printf("\n")}'
&lt;/code&gt;&lt;/pre&gt;# 将每两行连接成一行（类似“paste”）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '$!N;s/\n/ /'
awk '{f=!f;if(f)printf("%s",$0);else printf(" %s\n",$0)}'
&lt;/code&gt;&lt;/pre&gt;# 如果当前行以反斜杠“\”结束，则将下一行并到当前行末尾&lt;br /&gt;
# 并去掉原来行尾的反斜杠&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e :a -e '/\\$/N; s/\\\n//; ta'
awk '{if(/\\$/)printf("%s",substr($0,0,length($0)-1));else printf("%s\n",$0)}'
&lt;/code&gt;&lt;/pre&gt;# 如果当前行以等号开头，将当前行并到上一行末尾&lt;br /&gt;
# 并以单个空格代替原来行头的“=”&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e :a -e '$!N;s/\n=/ /;ta' -e 'P;D'
awk '{if(/^=/)printf(" %s",substr($0,2));else printf("%s%s",a,$0);a="\n"}END{printf("\n")}'
&lt;/code&gt;&lt;/pre&gt;# 为数字字串增加逗号分隔符号，将“1234567”改为“1,234,567”&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;gsed ':a;s/\B[0-9]\{3\}\&amp;gt;/,&amp;amp;/;ta'                     # GNU sed
sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta'  # 其他sed
&lt;/code&gt;&lt;/pre&gt;#awk的正则没有后向匹配和引用，搞的比较狼狈，呵呵。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;awk '{while(match($0,/[0-9][0-9][0-9][0-9]+/)){$0=sprintf("%s,%s",substr($0,0,RSTART+RLENGTH-4),substr($0,RSTART+RLENGTH-3))}print $0}'
&lt;/code&gt;&lt;/pre&gt;# 为带有小数点和负号的数值增加逗号分隔符（GNU sed）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;gsed -r ':a;s/(^|[^0-9.])([0-9]+)([0-9]{3})/\1\2,\3/g;ta'
&lt;/code&gt;&lt;/pre&gt;#和上例差不多&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;awk '{while(match($0,/[^\.0-9][0-9][0-9][0-9][0-9]+/)){$0=sprintf("%s,%s",substr($0,0,RSTART+RLENGTH-4),substr($0,RSTART+RLENGTH-3))}print $0}'
&lt;/code&gt;&lt;/pre&gt;# 在每5行后增加一空白行 （在第5，10，15，20，等行后增加一空白行）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;gsed '0~5G'                      # 只对GNU sed有效
sed 'n;n;n;n;G;'                 # 其他sed
awk '{print $0;i++;if(i==5){printf("\n");i=0}}'
&lt;/code&gt;&lt;/pre&gt;&lt;strong&gt;选择性地显示特定行：&lt;/strong&gt;&lt;br /&gt;
# 显示文件中的前10行 （模拟“head”的行为）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 10q
awk '{print;if(NR==10)exit}'
&lt;/code&gt;&lt;/pre&gt;# 显示文件中的第一行 （模拟“head -1”命令）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed q
awk '{print;exit}'
&lt;/code&gt;&lt;/pre&gt;# 显示文件中的最后10行 （模拟“tail”）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e :a -e '$q;N;11,$D;ba'
&lt;/code&gt;&lt;/pre&gt;#用awk干这个有点亏，得全文缓存，对于大文件肯定很慢&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;awk '{A[NR]=$0}END{for(i=NR-9;i&amp;lt;=NR;i++)print A[i]}'
&lt;/code&gt;&lt;/pre&gt;# 显示文件中的最后2行（模拟“tail -2”命令）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '$!N;$!D'
awk '{A[NR]=$0}END{for(i=NR-1;i&amp;lt;=NR;i++)print A[i]}'
&lt;/code&gt;&lt;/pre&gt;# 显示文件中的最后一行（模拟“tail -1”）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '$!d'                        # 方法1
sed -n '$p'                      # 方法2
&lt;/code&gt;&lt;/pre&gt;#这个比较好办，只存最后一行了。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;awk '{A=$0}END{print A}'
&lt;/code&gt;&lt;/pre&gt;# 显示文件中的倒数第二行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e '$!{h;d;}' -e x              # 当文件中只有一行时，输出空行
sed -e '1{$q;}' -e '$!{h;d;}' -e x  # 当文件中只有一行时，显示该行
sed -e '1{$d;}' -e '$!{h;d;}' -e x  # 当文件中只有一行时，不输出
&lt;/code&gt;&lt;/pre&gt;#存两行呗（当文件中只有一行时，输出空行）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;awk '{B=A;A=$0}END{print B}'
&lt;/code&gt;&lt;/pre&gt;# 只显示匹配正则表达式的行（模拟“grep”）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '/regexp/p'               # 方法1
sed '/regexp/!d'                 # 方法2
awk '/regexp/{print}'
&lt;/code&gt;&lt;/pre&gt;# 只显示“不”匹配正则表达式的行（模拟“grep -v”）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '/regexp/!p'              # 方法1，与前面的命令相对应
sed '/regexp/d'                  # 方法2，类似的语法
awk '!/regexp/{print}'
&lt;/code&gt;&lt;/pre&gt;# 查找“regexp”并将匹配行的上一行显示出来，但并不显示匹配行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '/regexp/{g;1!p;};h'
awk '/regexp/{print A}{A=$0}'
&lt;/code&gt;&lt;/pre&gt;# 查找“regexp”并将匹配行的下一行显示出来，但并不显示匹配行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '/regexp/{n;p;}'
awk '{if(A)print;A=0}/regexp/{A=1}'
&lt;/code&gt;&lt;/pre&gt;# 显示包含“regexp”的行及其前后行，并在第一行之前加上“regexp”所在行的行号 （类似“grep -A1 -B1”）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n -e '/regexp/{=;x;1!p;g;$!N;p;D;}' -e h
awk '{if(F)print;F=0}/regexp/{print NR;print b;print;F=1}{b=$0}'
&lt;/code&gt;&lt;/pre&gt;# 显示包含“AAA”、“BBB”和“CCC”的行（任意次序）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/AAA/!d; /BBB/!d; /CCC/!d'   # 字串的次序不影响结果
awk '{if(match($0,/AAA/) &amp;amp;&amp;amp; match($0,/BBB/) &amp;amp;&amp;amp; match($0,/CCC/))print}'
&lt;/code&gt;&lt;/pre&gt;# 显示包含“AAA”、“BBB”和“CCC”的行（固定次序）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/AAA.*BBB.*CCC/!d'
awk '{if(match($0,/AAA.*BBB.*CCC/))print}'
&lt;/code&gt;&lt;/pre&gt;# 显示包含“AAA”“BBB”或“CCC”的行 （模拟“egrep”）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e '/AAA/b' -e '/BBB/b' -e '/CCC/b' -e d    # 多数sed
gsed '/AAA\|BBB\|CCC/!d'                        # 对GNU sed有效
awk '/AAA/{print;next}/BBB/{print;next}/CCC/{print}'
awk '/AAA|BBB|CCC/{print}'
&lt;/code&gt;&lt;/pre&gt;# 显示包含“AAA”的段落 （段落间以空行分隔）&lt;br /&gt;
# HHsed v1.5 必须在“x;”后加入“G;”，接下来的3个脚本都是这样&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;'
awk 'BEGIN{RS=""}/AAA/{print}'
awk -vRS= '/AAA/{print}'
&lt;/code&gt;&lt;/pre&gt;# 显示包含“AAA”“BBB”和“CCC”三个字串的段落 （任意次序）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;/BBB/!d;/CCC/!d'
awk -vRS= '{if(match($0,/AAA/) &amp;amp;&amp;amp; match($0,/BBB/) &amp;amp;&amp;amp; match($0,/CCC/))print}'
&lt;/code&gt;&lt;/pre&gt;# 显示包含“AAA”、“BBB”、“CCC”三者中任一字串的段落 （任意次序）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e '/./{H;$!d;}' -e 'x;/AAA/b' -e '/BBB/b' -e '/CCC/b' -e d
gsed '/./{H;$!d;};x;/AAA\|BBB\|CCC/b;d'         # 只对GNU sed有效
awk -vRS= '/AAA|BBB|CCC/{print "";print}'
&lt;/code&gt;&lt;/pre&gt;# 显示包含65个或以上字符的行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '/^.\{65\}/p'
&lt;/code&gt;&lt;/pre&gt;cat ll.txt | awk '{if(length($0)&amp;gt;=65)print}'&lt;br /&gt;
# 显示包含65个以下字符的行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '/^.\{65\}/!p'            # 方法1，与上面的脚本相对应
sed '/^.\{65\}/d'                # 方法2，更简便一点的方法
awk '{if(length($0)&amp;lt;=65)print}'
&lt;/code&gt;&lt;/pre&gt;# 显示部分文本——从包含正则表达式的行开始到最后一行结束&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '/regexp/,$p'
awk '/regexp/{F=1}{if(F)print}'
&lt;/code&gt;&lt;/pre&gt;# 显示部分文本——指定行号范围（从第8至第12行，含8和12行）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '8,12p'                   # 方法1
sed '8,12!d'                     # 方法2
awk '{if(NR&amp;gt;=8 &amp;amp;&amp;amp; NR&amp;lt;12)print}'
&lt;/code&gt;&lt;/pre&gt;# 显示第52行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '52p'                     # 方法1
sed '52!d'                       # 方法2
sed '52q;d'                      # 方法3, 处理大文件时更有效率
awk '{if(NR==52){print;exit}}'
&lt;/code&gt;&lt;/pre&gt;# 从第3行开始，每7行显示一次&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;gsed -n '3~7p'                   # 只对GNU sed有效
sed -n '3,${p;n;n;n;n;n;n;}'     # 其他sed
awk '{if(NR==3)F=1}{if(F){i++;if(i%7==1)print}}'
&lt;/code&gt;&lt;/pre&gt;# 显示两个正则表达式之间的文本（包含）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '/Iowa/,/Montana/p'       # 区分大小写方式
awk '/Iowa/{F=1}{if(F)print}/Montana/{F=0}'
&lt;/code&gt;&lt;/pre&gt;&lt;strong&gt;选择性地删除特定行：&lt;/strong&gt;&lt;br /&gt;
# 显示通篇文档，除了两个正则表达式之间的内容&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/Iowa/,/Montana/d'
awk '/Iowa/{F=1}{if(!F)print}/Montana/{F=0}'
&lt;/code&gt;&lt;/pre&gt;# 删除文件中相邻的重复行（模拟“uniq”）&lt;br /&gt;
# 只保留重复行中的第一行，其他行删除&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '$!N; /^\(.*\)\n\1$/!P; D'
awk '{if($0!=B)print;B=$0}'
&lt;/code&gt;&lt;/pre&gt;# 删除文件中的重复行，不管有无相邻。注意hold space所能支持的缓存大小，或者使用GNU sed。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n 'G; s/\n/&amp;amp;&amp;amp;/; /^\([ -~]*\n\).*\n\1/d; s/\n//; h; P'  #bones7456注：我这里此命令并不能正常工作
awk '{if(!($0 in B))print;B[$0]=1}'
&lt;/code&gt;&lt;/pre&gt;# 删除除重复行外的所有行（模拟“uniq -d”）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '$!N; s/^\(.*\)\n\1$/\1/; t; D'
awk '{if($0==B &amp;amp;&amp;amp; $0!=l){print;l=$0}B=$0}'
&lt;/code&gt;&lt;/pre&gt;# 删除文件中开头的10行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '1,10d'
awk '{if(NR&amp;gt;10)print}'
&lt;/code&gt;&lt;/pre&gt;# 删除文件中的最后一行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '$d'
&lt;/code&gt;&lt;/pre&gt;#awk在过程中并不知道文件一共有几行，所以只能通篇缓存，大文件可能不适合，下面两个也一样&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;awk '{B[NR]=$0}END{for(i=0;i&amp;lt;=NR-1;i++)print B[i]}'
&lt;/code&gt;&lt;/pre&gt;# 删除文件中的最后两行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 'N;$!P;$!D;$d'
awk '{B[NR]=$0}END{for(i=0;i&amp;lt;=NR-2;i++)print B[i]}'
&lt;/code&gt;&lt;/pre&gt;# 删除文件中的最后10行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e :a -e '$d;N;2,10ba' -e 'P;D'   # 方法1
sed -n -e :a -e '1,10!{P;N;D;};N;ba'  # 方法2
awk '{B[NR]=$0}END{for(i=0;i&amp;lt;=NR-10;i++)print B[i]}'
&lt;/code&gt;&lt;/pre&gt;# 删除8的倍数行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;gsed '0~8d'                           # 只对GNU sed有效
sed 'n;n;n;n;n;n;n;d;'                # 其他sed
awk '{if(NR%8!=0)print}' |head
&lt;/code&gt;&lt;/pre&gt;# 删除匹配式样的行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/pattern/d'                      # 删除含pattern的行。当然pattern可以换成任何有效的正则表达式
awk '{if(!match($0,/pattern/))print}'
&lt;/code&gt;&lt;/pre&gt;# 删除文件中的所有空行（与“grep ‘.’ ”效果相同）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/^$/d'                           # 方法1
sed '/./!d'                           # 方法2
awk '{if(!match($0,/^$/))print}'
&lt;/code&gt;&lt;/pre&gt;# 只保留多个相邻空行的第一行。并且删除文件顶部和尾部的空行。&lt;br /&gt;
# （模拟“cat -s”）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/./,/^$/!d'        #方法1，删除文件顶部的空行，允许尾部保留一空行
sed '/^$/N;/\n$/D'      #方法2，允许顶部保留一空行，尾部不留空行
awk '{if(!match($0,/^$/)){print;F=1}else{if(F)print;F=0}}'  #同上面的方法2
&lt;/code&gt;&lt;/pre&gt;# 只保留多个相邻空行的前两行。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/^$/N;/\n$/N;//D'
awk '{if(!match($0,/^$/)){print;F=0}else{if(F&amp;lt;2)print;F++}}'
&lt;/code&gt;&lt;/pre&gt;# 删除文件顶部的所有空行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/./,$!d'
awk '{if(F || !match($0,/^$/)){print;F=1}}'
&lt;/code&gt;&lt;/pre&gt;# 删除文件尾部的所有空行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e :a -e '/^\n*$/{$d;N;ba' -e '}'  # 对所有sed有效
sed -e :a -e '/^\n*$/N;/\n$/ba'        # 同上，但只对 gsed 3.02.*有效
awk '/^.+$/{for(i=l;i&lt;nr-1;i++)print ;print;l="NR}'"&gt;&lt;/nr-1;i++)print&gt;&lt;/code&gt;&lt;/pre&gt;# 删除每个段落的最后一行&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -n '/^$/{p;h;};/./{x;/./p;}'
&lt;/code&gt;&lt;/pre&gt;#很长，很ugly，应该有更好的办法&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;awk -vRS= '{B=$0;l=0;f=1;while(match(B,/\n/)&amp;gt;0){print substr(B,l,RSTART-l-f);l=RSTART;sub(/\n/,"",B);f=0};print ""}'
&lt;/code&gt;&lt;/pre&gt;&lt;strong&gt;特殊应用：&lt;/strong&gt;&lt;br /&gt;
# 移除手册页（man page）中的nroff标记。在Unix System V或bash shell下使&lt;br /&gt;
# 用’echo’命令时可能需要加上 -e 选项。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed "s/.`echo \\\b`//g"    # 外层的双括号是必须的（Unix环境）
sed 's/.^H//g'             # 在bash或tcsh中, 按 Ctrl-V 再按 Ctrl-H
sed 's/.\x08//g'           # sed 1.5，GNU sed，ssed所使用的十六进制的表示方法
awk '{gsub(/.\x08/,"",$0);print}'
&lt;/code&gt;&lt;/pre&gt;# 提取新闻组或 e-mail 的邮件头&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/^$/q'                # 删除第一行空行后的所有内容
awk '{print}/^$/{exit}'
&lt;/code&gt;&lt;/pre&gt;# 提取新闻组或 e-mail 的正文部分&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '1,/^$/d'              # 删除第一行空行之前的所有内容
awk '{if(F)print}/^$/{F=1}'
&lt;/code&gt;&lt;/pre&gt;# 从邮件头提取“Subject”（标题栏字段），并移除开头的“Subject:”字样&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/^Subject: */!d; s///;q'
awk '/^Subject:.*/{print substr($0,10)}/^$/{exit}'
&lt;/code&gt;&lt;/pre&gt;# 从邮件头获得回复地址&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/^Reply-To:/q; /^From:/h; /./d;g;q'
&lt;/code&gt;&lt;/pre&gt;#好像是输出第一个Reply-To:开头的行？From是干啥用的？不清楚规则。。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;awk '/^Reply-To:.*/{print;exit}/^$/{exit}'
&lt;/code&gt;&lt;/pre&gt;# 获取邮件地址。在上一个脚本所产生的那一行邮件头的基础上进一步的将非电邮地址的部分剃除。（见上一脚本）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 's/ *(.*)//; s/&amp;gt;.*//; s/.*[:&amp;lt;] *//'
&lt;/code&gt;&lt;/pre&gt;#取尖括号里的东西吧？&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;awk -F'[&amp;lt;&amp;gt;]+' '{print $2}'
&lt;/code&gt;&lt;/pre&gt;# 在每一行开头加上一个尖括号和空格（引用信息）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 's/^/&amp;gt; /'
awk '{print "&amp;gt; " $0}'
&lt;/code&gt;&lt;/pre&gt;# 将每一行开头处的尖括号和空格删除（解除引用）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed 's/^&amp;gt; //'
awk '/^&amp;gt; /{print substr($0,3)}'
&lt;/code&gt;&lt;/pre&gt;# 移除大部分的HTML标签（包括跨行标签）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed -e :a -e 's/&amp;lt;[^&amp;gt;]*&amp;gt;//g;/&amp;lt;[^&amp;gt;]*&amp;gt;/,"",$0);print}'
&lt;/code&gt;&lt;/pre&gt;# 将分成多卷的uuencode文件解码。移除文件头信息，只保留uuencode编码部分。&lt;br /&gt;
# 文件必须以特定顺序传给sed。下面第一种版本的脚本可以直接在命令行下输入；&lt;br /&gt;
# 第二种版本则可以放入一个带执行权限的shell脚本中。（由Rahul Dhesi的一&lt;br /&gt;
# 个脚本修改而来。）&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/^end/,/^begin/d' file1 file2 ... fileX | uudecode   # vers. 1
sed '/^end/,/^begin/d' "$@" | uudecode                    # vers. 2
&lt;/code&gt;&lt;/pre&gt;#我不想装个uudecode验证，大致写个吧&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;awk '/^end/{F=0}{if(F)print}/^begin/{F=1}' file1 file2 ... fileX
&lt;/code&gt;&lt;/pre&gt;# 将文件中的段落以字母顺序排序。段落间以（一行或多行）空行分隔。GNU sed使用&lt;br /&gt;
# 字元“\v”来表示垂直制表符，这里用它来作为换行符的占位符——当然你也可以&lt;br /&gt;
# 用其他未在文件中使用的字符来代替它。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;sed '/./{H;d;};x;s/\n/={NL}=/g' file | sort | sed '1s/={NL}=//;s/={NL}=/\n/g'
gsed '/./{H;d};x;y/\n/\v/' file | sort | sed '1s/\v//;y/\v/\n/'
awk -vRS= '{gsub(/\n/,"\v",$0);print}' ll.txt | sort | awk '{gsub(/\v/,"\n",$0);print;print ""}'
&lt;/code&gt;&lt;/pre&gt;# 分别压缩每个.TXT文件，压缩后删除原来的文件并将压缩后的.ZIP文件&lt;br /&gt;
# 命名为与原来相同的名字（只是扩展名不同）。（DOS环境：“dir /b”&lt;br /&gt;
# 显示不带路径的文件名）。&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;echo @echo off &amp;gt;zipup.bat
dir /b *.txt | sed "s/^\(.*\)\.TXT/pkzip -mo \1 \1.TXT/" &amp;gt;&amp;gt;zipup.bat
&lt;/code&gt;&lt;/pre&gt;DOS 环境再次略过，而且我觉得这里用 bash 的参数 ${i%.TXT}.zip 替换更帅。&lt;br /&gt;
下面的一些 SED 说明略过，需要的朋友自行查看原文。&lt;br /&gt;
{ &lt;a href="http://li2z.cn/2009/12/07/sed_awk/"&gt;Source&lt;/a&gt;. Thanks bones7456. }&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-448698975883005510?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/448698975883005510/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2009/12/sed-awk.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/448698975883005510?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/448698975883005510?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2009/12/sed-awk.html" title="《SED 单行脚本快速参考》的 awk 实现" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;AkMMQ3s9cSp7ImA9WxBTFE8.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-3156656822819061032</id><published>2009-12-10T15:01:00.000+08:00</published><updated>2009-12-10T15:01:22.569+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-10T15:01:22.569+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title>基于 GTK+ 和 Curl 的下载软件 -- Uget</title><content type="html">依赖很少，功能完整。这就是我对 &lt;a href="http://urlget.sourceforge.net/"&gt;Uget&lt;/a&gt; 的感受。&lt;br /&gt;
希望在 Linux 下使用像 FlashGet 一样的下载程序，怎奈 wxDownloadFast 和 D4x 许久不更新（还记得开发奔流的作者开发过一款下载软件？名字忘了），Gwget 需要一些 GNOME 库，kget需要一些 QT 库。而 Uget 进入了我的视野。&lt;span id="more-3554"&gt;&lt;/span&gt; &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_ze53Vsu43ME/SyCcmJt8ImI/AAAAAAAABzg/MDUIxiSB8Io/s1600-h/uget-thumb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_ze53Vsu43ME/SyCcmJt8ImI/AAAAAAAABzg/MDUIxiSB8Io/s320/uget-thumb.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Uget 过去曾命名为 urlgfe，更名的同时增强了很多，个人喜欢的特点：像 FlashGet 一样的基于通配符的批量下载；每个下载分类都可有自定义的配置；下载后的内容通过右键可以方便的打开，删除（记录或连带删除数据）;有回收站管 理；Firefox 的 Flashgot 内置支持。&lt;br /&gt;
今天看 Gentoo 的更新，发现 Uget 1.5 已经进入了 Portage，就在此推荐一下，若正在使用 Gentoo 又恰好已经有了 GTK+， Uget 是个不错的下载管理器。&lt;br /&gt;
{ Thanks guest. }&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-3156656822819061032?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/3156656822819061032/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2009/12/gtk-curl-uget.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/3156656822819061032?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/3156656822819061032?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2009/12/gtk-curl-uget.html" title="基于 GTK+ 和 Curl 的下载软件 -- Uget" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_ze53Vsu43ME/SyCcmJt8ImI/AAAAAAAABzg/MDUIxiSB8Io/s72-c/uget-thumb.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0YFQn4yeyp7ImA9WxNaGEk.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-1301523992749649296</id><published>2009-12-03T22:05:00.001+08:00</published><updated>2009-12-03T22:05:13.093+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-03T22:05:13.093+08:00</app:edited><title>X 系统的相关命令</title><content type="html">&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;/span&gt;&lt;br /&gt;
X 系统提供了一些丰富的命令，利用这些命令可以方便的完成某些有用的工作。 xset 设置 X 系统的方方面面， 比如设置 bell 响玲的声音大小，设置键盘的重复率，绿色能源控制，字体路径，键盘 led 灯的状态， 鼠标的左右手习惯，设置屏幕保护参数等。&lt;span&gt;&lt;/span&gt;&lt;br /&gt;
例如我在开机的时候执行下面命令来设置鼠标的灵敏度：&lt;br /&gt;
&lt;pre style="font-size: 12px;"&gt;&lt;code style="font-size: 12px;"&gt;xset m 4/2 4
&lt;/code&gt;&lt;/pre&gt;用下面的命令来让屏幕关闭：&lt;br /&gt;
&lt;pre style="font-size: 12px;"&gt;&lt;code style="font-size: 12px;"&gt;xset dpms force off
&lt;/code&gt;&lt;/pre&gt;再配合 slock 命令，这样就完全黑屏锁住了屏幕，而且消耗资源最少。&lt;br /&gt;
另外还有一个 xmodmap 命令，可以对键盘映射进行重新布局。比如用下面的命令把 Windows 键转换成 Ctrl 键来用。&lt;br /&gt;
&lt;pre style="font-size: 12px;"&gt;&lt;code style="font-size: 12px;"&gt;
remove mod4 = Super_L
add Control = Super_L
&lt;/code&gt;
&lt;/pre&gt;另外还有 xsetroot，xhost 等很多命令，希望能抛砖引玉，番茄鸡蛋也可。&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-1301523992749649296?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/1301523992749649296/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2009/12/x.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/1301523992749649296?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/1301523992749649296?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2009/12/x.html" title="X 系统的相关命令" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D0AEQXs_eyp7ImA9WxNbEE0.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-2854555927872364260</id><published>2009-11-12T14:01:00.000+08:00</published><updated>2009-11-12T14:01:40.543+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-12T14:01:40.543+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu linux" /><title>GiftWrap: 轻松创建 .deb 包</title><content type="html">GiftWrap 通过图形化的向导界面一步步的引导你创建供 Ubuntu 使用的 .deb 二进制包，在填入 Debian  包的相关信息后，该程序将为你自动构建包，最终你将获得 .deb 及 .orig.tar.gz 等相关文件。&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_ze53Vsu43ME/SvujyJ4jGqI/AAAAAAAABxg/UbpnZgXK6M0/s1600-h/giftwrap.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_ze53Vsu43ME/SvujyJ4jGqI/AAAAAAAABxg/UbpnZgXK6M0/s320/giftwrap.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
GiftWrap 提供有源码包和 deb 包，可从其官方网站的&lt;a href="http://giftwrap.tuxfamily.org/index.php?pages/download"&gt;下载页面&lt;/a&gt;获取。&lt;br /&gt;
原文链接：http://linuxtoy.org/archives/giftwrap.html&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_ze53Vsu43ME/SvujyJ4jGqI/AAAAAAAABxg/UbpnZgXK6M0/s1600-h/giftwrap.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-2854555927872364260?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/2854555927872364260/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2009/11/giftwrap-deb.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/2854555927872364260?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/2854555927872364260?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2009/11/giftwrap-deb.html" title="GiftWrap: 轻松创建 .deb 包" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_ze53Vsu43ME/SvujyJ4jGqI/AAAAAAAABxg/UbpnZgXK6M0/s72-c/giftwrap.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D0UMRnw9fSp7ImA9WxNbEE0.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-1416450993623963865</id><published>2009-11-12T13:54:00.003+08:00</published><updated>2009-11-12T13:54:47.265+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-12T13:54:47.265+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="开源浏览器" /><title>Uzbl: 极度简约的网络浏览器</title><content type="html">&lt;span style="border-collapse: separate; color: black; font: normal normal normal 16px/normal Simsun; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="font-family: tahoma; font-size: 14px; line-height: 19px; text-align: left;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href="http://www.uzbl.org/" style="color: #bb5500; text-decoration: none;"&gt;Uzbl&lt;/a&gt;&amp;nbsp;是一个很新的网络浏览器，目前正在活跃开发中，虽然眼下它连  Alpha 阶段都没达到，但通过笔者这些天的试用来看，它已经具有一定的可用性，且也足够稳定，感兴趣的同学大可一试。我推荐  Uzbl，主要因为以下几个方面令我产生兴趣：&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;遵循 Unix 哲学开发而成，Uzbl 专注于浏览本身，包括书签、历史、下载等在内的功能通过外部脚本来完成。 &lt;/li&gt;
&lt;li&gt;从 Vi/Vim/&lt;a href="http://linuxtoy.org/archives/vimperator.html" style="color: #bb5500; text-decoration: none;"&gt;Vimperator&lt;/a&gt;&amp;nbsp;身上借鉴了许多，比如：命令/插入模式、Vi/Emacs  风格的键盘绑定、访问链接的 hints 模式等。 &lt;/li&gt;
&lt;li&gt;界面极度简约，没有菜单栏/工具栏/地址栏这些元素，除了内容渲染区外，仅包含状态行（也可隐藏）。 &lt;/li&gt;
&lt;li&gt;完全可配置，配置文件及数据文件基于 plaintext。 &lt;/li&gt;
&lt;li&gt;渲染核心为 WebKit，速度相当快。 &lt;/li&gt;
&lt;li&gt;获取并安装 Uzbl 可参考其官网的&amp;nbsp;&lt;a href="http://www.uzbl.org/get.php" style="color: #bb5500; text-decoration: none;"&gt;Get&lt;/a&gt;&amp;nbsp;页面。&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-1416450993623963865?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/1416450993623963865/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2009/11/uzbl-alpha-uzbl-unix-uzbl-vivim.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/1416450993623963865?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/1416450993623963865?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2009/11/uzbl-alpha-uzbl-unix-uzbl-vivim.html" title="Uzbl: 极度简约的网络浏览器" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D0UHRX06eyp7ImA9WxNbEE0.&quot;"><id>tag:blogger.com,1999:blog-7255337382686308882.post-157846378025372692</id><published>2009-11-12T13:53:00.002+08:00</published><updated>2009-11-12T13:53:54.313+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-12T13:53:54.313+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="终端" /><title>Tilda —— 嵌入桌面的透明终端</title><content type="html">&lt;span style="border-collapse: separate; color: black; font: 16px Simsun; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="color: #333333; font-family: 'Lucida Grande'; font-size: 14px; line-height: 24px; text-align: left;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Tilda  ，是一个第三方的  系统终端工具，相比ubuntu自带的终端，最大的特点就是：它能够完全嵌入桌面，嘿嘿，这点，对于一个系统美化疯子，比如我这样的，非常具有诱惑力喔~除此之外，它还具有如下一些功能：&lt;br /&gt;
&lt;span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;*  可以自定义呼出热键。这能够让你若用即显，不用则隐，非常方便。&lt;br /&gt;
*  能够嵌入桌面。我曾让其他的终端程序达到同样的目的，但往往无法直接实现，需要借助于第三方的工具。&lt;br /&gt;
*  背景透明。这个特性连同上一个特性，能够使你的终端与整个桌面融为一体。&lt;br /&gt;
*  动画效果。在显示或隐藏终端窗口时有个过渡的动画效果，不会突然弹出来把人吓一跳。&lt;br /&gt;
*  具有标签功能。这可以让你不必同时启动多个终端实例程序，一个不够，再开标签即可。&lt;br /&gt;
* 窗口大小可定制。对于窗口的大小、位置都可以定制&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;如果你也想体验下这个嵌入桌面的终端，就跟我一起来吧。配置，就分2部分：安装，设置&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;一.  软件安装&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;简单到姥姥家了，源里面就有，直接：&lt;span style="color: red;"&gt;&lt;strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;sudo apt-get install  tilda&lt;/strong&gt;&lt;/span&gt;，安装完了就退出好了。&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;如果万一你终端提示找不到包，那就去“新立德软件包管理器”里面搜索，也能找到的。&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;二.  简单设置&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;从“应用程序”—“附件”，来运行  Tilda 吧。这里不用截图吧&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;首次运行，就会直接弹出软件设置对话框，如图:&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;a href="http://img.bimg.126.net/photo/MDTk0tCs1YmCOMRC07jyuw==/3166593487995586117.jpg" target="_blank"&gt;&lt;img alt="2009年6月9日 - East - eastnux" src="http://img.bimg.126.net/photo/MDTk0tCs1YmCOMRC07jyuw==/3166593487995586117.jpg" title="2009年6月9日 - East - eastnux" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="border-collapse: separate; color: black; font: 16px Simsun; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="color: #333333; font-family: 'Lucida Grande'; font-size: 14px; line-height: 24px; text-align: left;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;这里，我们需要根据自己的情况，进行写简单的设置。我以自己的配置为例，来简单讲解下。&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;1.  常规&lt;br /&gt;
(1) 让这个终端，在所有的桌面上显示，选中：“&lt;strong&gt;在所有工作空间上显示&lt;/strong&gt;”&lt;br /&gt;
(2)  为了编辑使用方便，我选中了“&lt;strong&gt;置顶&lt;/strong&gt;”，这样每次调出终端后，它就位于其他窗口的上面，直接可以输入东西了。&lt;br /&gt;
(3)  因为我后面，要把 Tilda  加为系统启动，所以，如果它每次开机启动，都显示透明的背景，就比较麻烦了，因此，我选中了：“&lt;strong&gt;Tilda启动后隐藏&lt;/strong&gt;”。&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;其实我觉得大家都应该选中这个，因为我建议大家把Tilda设置为开机启动启动，这样开机后，tilda就在后台运行着呢，每次想用，可以用快捷键自动调用（快捷键的设置后面会说到）&lt;br /&gt;
(4)  字体。毕竟是要嵌入到桌面的，有可能因为你的壁纸太花哨，终端里面的字就看不清了，因此，如果你看不清字，就自己设置个字体吧，我设置了一个粗体，看着比较舒服了，字大小设置成了12。&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;2。外观&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;这里是设置Tilda终端窗口，在桌面上的具体位置的。大家可以直接按照我的图，进行设置，我的图设置好，是处于桌面“中央”的。&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;(1)&lt;strong&gt;高度&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;和&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;宽度&lt;/strong&gt;，是设置终端窗口的“大小”；位置，是设置终端窗口在桌面的具体位置。&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;(2)&lt;strong&gt;启用透明&lt;/strong&gt;，嘿嘿，我是美化狂人，当然要“启用透明”了，透明度，自己选择吧，数值越大，越透明，最大值是  90。（但还不是完全彻底透明，这个有点郁闷。。。。。）&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;(3)&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;动画方向&lt;/strong&gt;。刚才说了你按快捷键弹出终端窗口的时候，是有个小小的动画过渡效果的，从“&lt;strong&gt;上下左右&lt;/strong&gt;”，4个方向弹出，我喜欢从“左边”弹出。自己都试试看效果吧~&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;a href="http://img.bimg.126.net/photo/-BpTPN0j2CRbbVTxJcVUOg==/3166593487995586120.jpg" target="_blank"&gt;&lt;img alt="2009年6月9日 - East - eastnux" src="http://img.bimg.126.net/photo/-BpTPN0j2CRbbVTxJcVUOg==/3166593487995586120.jpg" title="2009年6月9日 - East - eastnux" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="border-collapse: separate; color: black; font: 16px Simsun; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="color: #333333; font-family: 'Lucida Grande'; font-size: 14px; line-height: 24px; text-align: left;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;3.  颜色&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;这里没什么特别的，可以自己设置下“&lt;strong&gt;终端文字的颜色&lt;/strong&gt;”和“&lt;strong&gt;终端背景颜色&lt;/strong&gt;”（如果你透明了，这个背景颜色就没用了，不需要管它）。&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;4.  键绑定。这个就是快捷键设置拉。按下“&lt;strong&gt;捕捉键绑定&lt;/strong&gt;”后，自己按个组合键位吧，用来呼出Tilda。我设置的是alt-Q&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;行了，基本的设置就这些了，已经可以用了，透明的嵌入桌面的，随叫随到的终端，嘿嘿~看看图吧~&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;a href="http://img.bimg.126.net/photo/cLMlOatq_pfWbx9pW9o0RQ==/3166593487995586123.jpg" target="_blank"&gt;&lt;img alt="2009年6月9日 - East - eastnux" src="http://img.bimg.126.net/photo/cLMlOatq_pfWbx9pW9o0RQ==/3166593487995586123.jpg" title="2009年6月9日 - East - eastnux" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="border-collapse: separate; color: black; font: 16px Simsun; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="color: #333333; font-family: 'Lucida Grande'; font-size: 14px; line-height: 24px; text-align: left;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;三.  设置成开机启动启动&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;方法：打开“&lt;strong&gt;系统&lt;/strong&gt;”-“&lt;strong&gt;首选项&lt;/strong&gt;”-“&lt;strong&gt;启动程序&lt;/strong&gt;”，点击：“&lt;strong&gt;添加&lt;/strong&gt;”，名称随便输入，命令，就输入：&lt;span style="color: red;"&gt;&lt;strong&gt;tilda&lt;/strong&gt;&lt;/span&gt;，就行了，描述写不写随便。看图吧~，很简单的。&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;a href="http://img.bimg.126.net/photo/hNe8DRu9H4cOSUqkSh7zoA==/3166593487995586126.jpg" target="_blank"&gt;&lt;img alt="2009年6月9日 - East - eastnux" src="http://img.bimg.126.net/photo/hNe8DRu9H4cOSUqkSh7zoA==/3166593487995586126.jpg" title="2009年6月9日 - East - eastnux" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;&lt;strong&gt;本博图文除特别申明外均采用 &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="nofollow external"&gt;&lt;abbr title="署名-非商业性使用-相同方式共享"&gt;BY-NC-SA&lt;/abbr&gt;&lt;/a&gt; 协议进行授权。&lt;/strong&gt;&lt;/p&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7255337382686308882-157846378025372692?l=eastnux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://eastnux.blogspot.com/feeds/157846378025372692/comments/default" title="帖子评论" /><link rel="replies" type="text/html" href="http://eastnux.blogspot.com/2009/11/tilda.html#comment-form" title="0 条评论" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/157846378025372692?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7255337382686308882/posts/default/157846378025372692?v=2" /><link rel="alternate" type="text/html" href="http://eastnux.blogspot.com/2009/11/tilda.html" title="Tilda —— 嵌入桌面的透明终端" /><author><name>Leng</name><uri>http://www.blogger.com/profile/00064513546058224424</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry></feed>

