<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>鬼の领地 &#187; Ubuntu</title>
	<atom:link href="http://blog.upsuper.org/tag/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.upsuper.org</link>
	<description>the place where there are some ghost appearing...</description>
	<lastBuildDate>Thu, 17 Jun 2010 08:12:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>半完美解决 zip 文件中中文文件名乱码的问题</title>
		<link>http://blog.upsuper.org/a-half-perfect-solution-for-irrecognizable-encoded-chinese-filename-in-zip-file/</link>
		<comments>http://blog.upsuper.org/a-half-perfect-solution-for-irrecognizable-encoded-chinese-filename-in-zip-file/#comments</comments>
		<pubDate>Mon, 10 May 2010 14:33:46 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[zip]]></category>
		<category><![CDATA[乱码]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=1154</guid>
		<description><![CDATA[前一段由于收了某个 zip 文件，用 Ubuntu 自带的归档管理器打开，哎呦，那真不是一般的蛋疼……因为里面全是中文文件名，那个乱码啊……
于是我就下决心要解决这个问题。
虽然我的系统还在 9.10，但看到网上一篇文章教人如何在 10.04 中解决这个问题，我就了解了，这个问题至今没有解决。那么什么叫做“半完美”呢？大概意思就是说，对我来说差不多完美了，不过还是很可能出问题的……

命令行方法
一般的方法是利用命令行的方式：

1
2
LANG=C 7z x xxxx.zip
convmv -f gbk -t utf8 *

用这个方法，我就写了一个 unzip 的小脚本：

1
2
#! /bin/sh
LANG=C /usr/lib/p7zip/7z x -y &#34;$1&#34; &#124; sed -n 's/^Extracting  //p' &#124; sed '1!G;h;$!d' &#124; xargs convmv -f gbk -t utf8 --notest &#62;\dev\null 2&#62;\dev\null

功能就是 unzip xxxx.zip 能够自动转码。内部机理我就不详细解释了，其实也不复杂。而且由于我不大会用 sed，所以用了两段，但我相信是不需要的。
不过这个不完美，为什么呢？因为这样我用归档管理器打开还是乱码，根本没有解决任何问题！
我的半完美方法
于是我就开始打 7z 程序的主意……当然最后是成功了的，这里先放对比图哈~

现在做了一个 Ubuntu 的 patch 出来，需要的童鞋可以在这里下载：p7zip_9.04~dfsg.1-1chinese.diff.gz (1.1KB)。不要看是 9.04 的，据我观察在 [...]]]></description>
			<content:encoded><![CDATA[<p>前一段由于收了某个 zip 文件，用 Ubuntu 自带的归档管理器打开，哎呦，那真不是一般的蛋疼……因为里面全是中文文件名，那个乱码啊……</p>
<p>于是我就下决心要解决这个问题。</p>
<p>虽然我的系统还在 9.10，但看到网上一篇文章教人如何在 10.04 中解决这个问题，我就了解了，这个问题至今没有解决。那么什么叫做“半完美”呢？大概意思就是说，对我来说差不多完美了，不过还是很可能出问题的……<br />
<span id="more-1154"></span></p>
<h3>命令行方法</h3>
<p>一般的方法是利用命令行的方式：</p>

<div class="wp_codebox"><table><tr id="p11546"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1154code6"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">LANG</span>=C 7z x xxxx.zip
convmv <span style="color: #660033;">-f</span> gbk <span style="color: #660033;">-t</span> utf8 <span style="color: #000000; font-weight: bold;">*</span></pre></td></tr></table></div>

<p>用这个方法，我就写了一个 unzip 的小脚本：</p>

<div class="wp_codebox"><table><tr id="p11547"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1154code7"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/sh</span>
<span style="color: #007800;">LANG</span>=C <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>p7zip<span style="color: #000000; font-weight: bold;">/</span>7z x <span style="color: #660033;">-y</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">'s/^Extracting  //p'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'1!G;h;$!d'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> convmv <span style="color: #660033;">-f</span> gbk <span style="color: #660033;">-t</span> utf8 <span style="color: #660033;">--notest</span> <span style="color: #000000; font-weight: bold;">&gt;</span>\dev\null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span>\dev\null</pre></td></tr></table></div>

<p>功能就是 unzip xxxx.zip 能够自动转码。内部机理我就不详细解释了，其实也不复杂。而且由于我不大会用 sed，所以用了两段，但我相信是不需要的。</p>
<p>不过这个不完美，为什么呢？因为这样我用归档管理器打开还是乱码，根本没有解决任何问题！</p>
<h3>我的半完美方法</h3>
<p>于是我就开始打 7z 程序的主意……当然最后是成功了的，这里先放对比图哈~<br />
<a href="http://blog.upsuper.org/wp-content/uploads/2010/05/Screenshot.png"><img src="http://blog.upsuper.org/wp-content/uploads/2010/05/Screenshot-300x197.png" alt="" title="Screenshot" width="300" height="197" class="alignnone size-medium wp-image-1155" /></a></p>
<p>现在做了一个 Ubuntu 的 patch 出来，需要的童鞋可以在这里下载：<a href="http://down.upsuper.org/p7zip_9.04~dfsg.1-1chinese.diff.gz">p7zip_9.04~dfsg.1-1chinese.diff.gz</a> (1.1KB)。不要看是 9.04 的，据我观察在 lucid 当中版本号还是这个，p7zip 一直没有变化过……</p>
<p>下载完以后再找个目录获取 p7zip 的代码：</p>

<div class="wp_codebox"><table><tr id="p11548"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1154code8"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #7a0874; font-weight: bold;">source</span> p7zip-full</pre></td></tr></table></div>

<p>注意这里不需要 sudo 权限，因为获取源代码是自由的~</p>
<p>然后把刚才下载的那个 patch 文件放进代码目录，一般来说应该是 p7zip-9.04~dfsg.1 目录。然后执行下面代码：</p>

<div class="wp_codebox"><table><tr id="p11549"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1154code9"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-cd</span> p7zip_9.04~dfsg.1-1chinese.diff.gz <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">patch</span> <span style="color: #660033;">-p1</span></pre></td></tr></table></div>

<p>然后就常规了：</p>

<div class="wp_codebox"><table><tr id="p115410"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1154code10"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> all3
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>需要注意的是，这里安装完以后并没有覆盖原来 p7zip 包的文件，但是放在了一个更优先访问的位置，所以以后执行 7z 相关的操作都会访问这里安装的。</p>
<p>由于编译需要很长很长时间，所以我这里编译好了一份：<a href="http://down.upsuper.org/p7z-bin.tar.bz2">p7z-bin.tar.bz2</a> (1.6M)，是 Ubuntu i386 版本的，如果你也是 i386 的就可以直接下载这个，用里面的程序覆盖掉 /usr/lib/p7zip/ 里面的程序，就可以了~</p>
<p>当然，最好把相同功能的 unzip 先卸掉……</p>
<p>现在，在系统里面以任何方式查看或解压任何 zip，理论上应该不会出现乱码了，我想是这样……</p>
<h3>解决思路</h3>
<p>好了，对于只想解决问题的人，看到这里就够了。现在我想写写如何做到的。</p>
<p>我看了一下 p7zip 的代码，还算是条理相当清晰，其中最重要的部分是 ZipIn.cpp 里面的 ReadFileName 函数，我在里面读取文件名之后插入了一段使用 iconv 函数转换编码的代码。</p>
<p>其后我发现不能这样简单的转换编码，因为在 Linux 下面打包的 zip 文件，文件名是用 utf8 而非 gb18030 储存的，这样在转换的时候反而出现乱码。我观察了一下，WinRAR 能够正常读出这些文件名的编码。因此我又在另外一些相关的函数中加入了判断打包平台的代码，以确认是否要转换编码。</p>
<p>此外，由于 gb18030 是硬编码进去的，显然不太好，但我暂时想不出什么更好的解决方法。我想这对于目前的国内自己用应该是足够了，不过考虑到开源软件一向喜欢的国际化，我就实在没什么办法了……如果有人有办法，请一定告诉我！</p>
<p>不过为了平衡，我最后在 config.h 里面加入了 MY_ENCODING 宏，这样可以修改这个以改变硬编码的文字编码值，也算是一点点努力吧……</p>
<h3>一点抱怨</h3>
<p>由于是在上网本上做的，而且我不想折磨我可怜的 SSD 或者移动硬盘，因此我不得不在内存盘中进行编译。每次都是心惊胆战的，生怕内存不够用开始吃交换区……当然最后还是没有……</p>
<p>话说 Windows 混乱的内码转换害死人啊……</p>
<h3>参考资料</h3>
<ul>
<li><a href="http://linux.cn/home/space-5812-do-thread-id-3019.html">使用ubuntu 10.04中的中文乱码问题解决 &#8211; kyohand &#8211; Linux中国</a></li>
<li><a href="http://qq164587043.blog.51cto.com/261469/63349">使用iconv命令轻松实现linux下字符集编码的转换 &#8211; 国产0与1 &#8211; 51CTO技术博客</a></li>
<li><a href="http://www.ibm.com/developerworks/cn/linux/l-diffp/index.html">用Diff和Patch工具维护源码</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/a-half-perfect-solution-for-irrecognizable-encoded-chinese-filename-in-zip-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>在 tty 里添加一个开机自启动的任务管理器</title>
		<link>http://blog.upsuper.org/run-top-automatical-in-tty-after-boot/</link>
		<comments>http://blog.upsuper.org/run-top-automatical-in-tty-after-boot/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 02:31:09 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[tty]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=1126</guid>
		<description><![CDATA[每当感觉到系统卡的时候，最好的方法无外乎进入 tty，登入，打开一个 top 监视。可是每次到了需要的时候才去开，打开的效率自然不敢恭维。于是便想，每次开机的时候，记起来就跑到 tty 下面去先开起来。不过这件事情总归是麻烦的，于是才有了现在的方案。
既然 tty 那么多，那我们就把他利用一下吧~让他开机自动在某个 tty 里面启动 top 无疑最方便了~

首先呢，我找到了 Ubuntu 里面 tty 配置存放的地方 /etc/init/ttyX.conf，其中的 X 便是 tty 的编号，我这里选择了 tty6.conf。打开这个文件，结构简单极了，看到里面

10
exec /sbin/getty -8 38400 tty6

就知道，肯定和 getty 有关系。man getty 里面查到可以通过 -l 参数设置登入程序替代 /bin/login。查了一下 man login，发现可以通过 -f username 的方式不进行验证地登入。
于是我就在 /bin 下面新建了一个 autologin 文件（其实理论上放哪里都可以，不过最好要用 root 权限创建，不然可以乱改就不好了），里面写上

1
2
#!/bin/sh
/bin/login -f upsuper

给这个文件加上可执行属性，接着将 /etc/init/tty6.conf 里面刚才那一行改成

1
exec /sbin/getty -8 -l '/bin/autologin' 38400 tty6

重启。
进入 tty6 [...]]]></description>
			<content:encoded><![CDATA[<p>每当感觉到系统卡的时候，最好的方法无外乎进入 tty，登入，打开一个 top 监视。可是每次到了需要的时候才去开，打开的效率自然不敢恭维。于是便想，每次开机的时候，记起来就跑到 tty 下面去先开起来。不过这件事情总归是麻烦的，于是才有了现在的方案。</p>
<p>既然 tty 那么多，那我们就把他利用一下吧~让他开机自动在某个 tty 里面启动 top 无疑最方便了~<br />
<span id="more-1126"></span><br />
首先呢，我找到了 Ubuntu 里面 tty 配置存放的地方 /etc/init/ttyX.conf，其中的 X 便是 tty 的编号，我这里选择了 tty6.conf。打开这个文件，结构简单极了，看到里面</p>

<div class="wp_codebox"><table><tr id="p112618"><td class="line_numbers"><pre>10
</pre></td><td class="code" id="p1126code18"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>getty <span style="color: #660033;">-8</span> <span style="color: #000000;">38400</span> tty6</pre></td></tr></table></div>

<p>就知道，肯定和 getty 有关系。man getty 里面查到可以通过 -l 参数设置登入程序替代 /bin/login。查了一下 man login，发现可以通过 -f username 的方式不进行验证地登入。</p>
<p>于是我就在 /bin 下面新建了一个 autologin 文件（其实理论上放哪里都可以，不过最好要用 root 权限创建，不然可以乱改就不好了），里面写上</p>

<div class="wp_codebox"><table><tr id="p112619"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1126code19"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">login</span> <span style="color: #660033;">-f</span> upsuper</pre></td></tr></table></div>

<p>给这个文件加上可执行属性，接着将 /etc/init/tty6.conf 里面刚才那一行改成</p>

<div class="wp_codebox"><table><tr id="p112620"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1126code20"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>getty <span style="color: #660033;">-8</span> <span style="color: #660033;">-l</span> <span style="color: #ff0000;">'/bin/autologin'</span> <span style="color: #000000;">38400</span> tty6</pre></td></tr></table></div>

<p>重启。</p>
<p>进入 tty6 发现没有效果，还是提示用户名，无语……于是输入了用户名 upsuper，结果发现没有要求密码，直接进入了。我退出登入，再输入 root，发现依然没有要求密码而直接进入了 upsuper 权限。</p>
<p>再查查 man getty，发现那个请求用户名是 getty 输出的，里面提到了 -n 参数，可以消除对用户名的请求，以及 -i 参数，不输出请求前的文字（在我的 Ubuntu 里面就是“Ubuntu 9.10”）。于是上面那行被改成了</p>

<div class="wp_codebox"><table><tr id="p112621"><td class="line_numbers"><pre>10
</pre></td><td class="code" id="p1126code21"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>getty <span style="color: #660033;">-8in</span> <span style="color: #660033;">-l</span> <span style="color: #ff0000;">'/bin/autologin'</span> <span style="color: #000000;">38400</span> tty6</pre></td></tr></table></div>

<p>重新启动，发现已经可以自动进入。</p>
<p>不过我要的不是这个效果~</p>
<p>其实简单地说，我那个要实现也不难，按照现在的情况，就是在 ~/.bashrc 里面加上一行判断的事情了。不过我可不想这样。这样的话如果退出了 top 就会进入命令行。我的想法是，永远不让他进入命令行，这样看过去比较爽~</p>
<p>于是我就倒腾起了 login 程序的 FAKE_SHELL，如果在 autologin 脚本里改变环境变量，根本影响不了 login 程序，无论我改 FAKE_SHELL，还是 SHELL，都没有用，login 仍然义无反顾地进入了 bash……</p>
<p>最后我就想，唉，其实 autologin 脚本就是一正常脚本，只不过在登入的时候以 root 权限运行嘛，那我直接在里面运行 top 不久行了~考虑到权限因素，就是用 su 把权限改一下，不就解决问题了么？</p>
<p>于是最终版的 autologin 就出炉了：</p>

<div class="wp_codebox"><table><tr id="p112622"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1126code22"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'/usr/bin/top'</span> upsuper</pre></td></tr></table></div>

<p>这个最后效果是什么样的呢？就是 top 以我的用户权限运行，然后点击 q 退出就会重新启动一个 top。这就是我要得效果了~很好很强大~算是合理的利用了一个 tty 了。现在只要点击 Ctrl-Alt-F6 就可以有现成的任务管理器了~</p>
<p>其实根据这个思路，tty 可以做的事情还很多。本来那个什么 -l 啦，-n 什么的，是拿来做自定义登入验证方式的，我觉得这个也大有文章可做~最后再感叹一下，Linux 实在太强大了~</p>
<p><strong>补充：</strong></p>
<p>这篇文章被我投递到了 LinuxTOY 上面，然后下面有人提到使用 htop 代替 top，我试了一下，貌似 htop 的资源占用要比 top 高出许多，因此我最后没有替换。</p>
<p>不过 htop 貌似确实好用很多，如果需要的话，只要安装 htop 后（Ubuntu 源里是有的），然后把 autologin 里面的</p>

<div class="wp_codebox"><table><tr id="p112623"><td class="line_numbers"><pre>2
</pre></td><td class="code" id="p1126code23"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'/usr/bin/top'</span> upsuper</pre></td></tr></table></div>

<p>改成</p>

<div class="wp_codebox"><table><tr id="p112624"><td class="line_numbers"><pre>2
</pre></td><td class="code" id="p1126code24"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'/usr/bin/htop'</span> upsuper</pre></td></tr></table></div>

<p>下面只要进入那个 tty 点 q 退出当前 top，马上就会自动替换为 htop 启动了~</p>
<p>还有就是，本来想写的，但写的时候忘记了。因为昨晚 G*W 非常莫名其妙的把 Google 大规模屏蔽了，于是网上查找相关资料极其不便，于是就使用了 Linux 自己的 man。这几本上也是我第一次完全依靠 man 来解决问题~Linux 的手册也还是很强悍的嘛~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/run-top-automatical-in-tty-after-boot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>升级grub2没写进mbr囧</title>
		<link>http://blog.upsuper.org/update-to-grub2-without-writing-into-mbr/</link>
		<comments>http://blog.upsuper.org/update-to-grub2-without-writing-into-mbr/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 14:35:31 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[mbr]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=1124</guid>
		<description><![CDATA[昨天把 grub 升级成了 grub2，然后用原来的 grub 引导一次成功后，我就用 upgrade-from-grub-legacy 升级到了 grub2。当时貌似没有提示什么错误，不过今天启动的时候却不能启动。出现了 grub 提示错误。
囧了，这样看貌似 grub2 没被写进 MBR……
然后拿出装有 SystemRescueCd 的急救U盘，然后我发现那里面有 grub2-install，非常高兴！不过运行了 grub2-install /dev/sda 后提示没有找到 /boot/grub
接着我把磁盘挂载到了 /mnt/root，用 chroot /mnt/root bash，进去以后用 grub-install 也没用……囧
最后我查了一下 grub2-install 的用法，最后运行 grub2-install &#8211;root-directory=/mnt/root /dev/sda 终于成功了！
用 grub2 的启动画面还是挺不错的嘛~嗯嗯~
]]></description>
			<content:encoded><![CDATA[<p>昨天把 grub 升级成了 grub2，然后用原来的 grub 引导一次成功后，我就用 upgrade-from-grub-legacy 升级到了 grub2。当时貌似没有提示什么错误，不过今天启动的时候却不能启动。出现了 grub 提示错误。</p>
<p>囧了，这样看貌似 grub2 没被写进 MBR……</p>
<p>然后拿出装有 SystemRescueCd 的急救U盘，然后我发现那里面有 grub2-install，非常高兴！不过运行了 grub2-install /dev/sda 后提示没有找到 /boot/grub</p>
<p>接着我把磁盘挂载到了 /mnt/root，用 chroot /mnt/root bash，进去以后用 grub-install 也没用……囧</p>
<p>最后我查了一下 grub2-install 的用法，最后运行 grub2-install &#8211;root-directory=/mnt/root /dev/sda 终于成功了！</p>
<p>用 grub2 的启动画面还是挺不错的嘛~嗯嗯~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/update-to-grub2-without-writing-into-mbr/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>从 Ubuntu 中移除 CNNIC 的证书</title>
		<link>http://blog.upsuper.org/remove-cnnic-cert-from-ubuntu/</link>
		<comments>http://blog.upsuper.org/remove-cnnic-cert-from-ubuntu/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:59:26 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Chromium]]></category>
		<category><![CDATA[CNNIC]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[天朝]]></category>
		<category><![CDATA[安全]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=1007</guid>
		<description><![CDATA[有人想问为什么要移除 CNNIC 的证书吗？因为我不信任 CNNIC，就是这样。
网上流传的版本大多是关于 Windows 下的，偶然找到一个 Debian 的，正好抄过来。
首先，执行

1
sudo dpkg-reconfigure ca-certificates

第一个界面直接确定，然后找到 mozilla/Entrust.net_Secure_Server_CA.crt 一列取消它的选择，最后确定。如下图：
&#160;
然后，如果你是用 Firefox，就要进入 编辑/首选项/高级/加密，点击“查看证书”，在证书机构里面找到 Entrust.net，将其子项全部删除（特别是 CNNIC 那一项！），接着可以试一下访问 ENUM 实验平台，如果不出意外，已经不能访问了。
如果你是是用 Opera，打开 工具/首选项/高级/安全性，点击“管理证书”，在“证书颁发机构”里选择 CNNIC ROOT，点击查看，去掉“允许连接到是用此证书的网络”前的钩，重启 Opera，如果不出意外 Opera 也不能访问上面那个地址了。
至于 Chromium，似乎本来就没有加，我直接访问是访问不了的。如果遇到可以访问的，可以参考 LinuxCertManagement &#8211; chromium 进行处理。

参考资料：

Rex&#039;s blah blah blah &#187; 在 Linux 上移除 CNNIC 憑證
CNNIC，我不信任你！——从“受信任的根证书”里赶走CNNIC &#124; Felix&#039;s Blog

]]></description>
			<content:encoded><![CDATA[<p>有人想问为什么要移除 CNNIC 的证书吗？因为我不信任 CNNIC，就是这样。</p>
<p>网上流传的版本大多是关于 Windows 下的，偶然找到一个 Debian 的，正好抄过来。</p>
<p>首先，执行</p>

<div class="wp_codebox"><table><tr id="p100726"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1007code26"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> dpkg-reconfigure ca-certificates</pre></td></tr></table></div>

<p>第一个界面直接确定，然后找到 mozilla/Entrust.net_Secure_Server_CA.crt 一列取消它的选择，最后确定。如下图：</p>
<div style="text-align:center"><a href="http://blog.upsuper.org/wp-content/uploads/2010/02/Screenshot-upsuper@upsuper-desktop-.png"><img src="http://blog.upsuper.org/wp-content/uploads/2010/02/Screenshot-upsuper@upsuper-desktop--300x201.png" alt="" title="Screenshot-upsuper@upsuper-desktop: ~" width="300" height="201" class="alignnone size-medium wp-image-1008" /></a>&nbsp;<a href="http://blog.upsuper.org/wp-content/uploads/2010/02/Screenshot-upsuper@upsuper-desktop-1.png"><img src="http://blog.upsuper.org/wp-content/uploads/2010/02/Screenshot-upsuper@upsuper-desktop-1-300x201.png" alt="" title="Screenshot-upsuper@upsuper-desktop: ~-1" width="300" height="201" class="alignnone size-medium wp-image-1009" /></a></div>
<p>然后，如果你是用 Firefox，就要进入 编辑/首选项/高级/加密，点击“查看证书”，在证书机构里面找到 Entrust.net，将其子项全部删除（特别是 CNNIC 那一项！），接着可以试一下访问 <a href="https://www.enum.cn/cn/">ENUM 实验平台</a>，如果不出意外，已经不能访问了。</p>
<p>如果你是是用 Opera，打开 工具/首选项/高级/安全性，点击“管理证书”，在“证书颁发机构”里选择 CNNIC ROOT，点击查看，去掉“允许连接到是用此证书的网络”前的钩，重启 Opera，如果不出意外 Opera 也不能访问上面那个地址了。</p>
<p>至于 Chromium，似乎本来就没有加，我直接访问是访问不了的。如果遇到可以访问的，可以参考 <a href="http://code.google.com/p/chromium/wiki/LinuxCertManagement">LinuxCertManagement &#8211; chromium</a> 进行处理。<br />
<span id="more-1007"></span><br />
参考资料：</p>
<ul>
<li><a href="http://people.debian.org.tw/~chihchun/2010/02/02/remove-cnnic-cert-on-linux/">Rex&#039;s blah blah blah &raquo; 在 Linux 上移除 CNNIC 憑證</a></li>
<li><a href="http://felixcat.net/2010/01/throw-out-cnnic/">CNNIC，我不信任你！——从“受信任的根证书”里赶走CNNIC | Felix&#039;s Blog</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/remove-cnnic-cert-from-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决 Ubuntu 下 TexLive 不能正确安装的问题</title>
		<link>http://blog.upsuper.org/solve-the-problem-that-texlive-cannot-be-installed-properly-in-ubuntu/</link>
		<comments>http://blog.upsuper.org/solve-the-problem-that-texlive-cannot-be-installed-properly-in-ubuntu/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 13:47:09 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=926</guid>
		<description><![CDATA[又想弄 LaTeX 了，OpenOffice.org 和 M$ Office 果然还是有点差距的，还不如用 LaTeX……不是据说还有一个“几乎可视化”的 LaTeX 编辑器？
不过摆弄 LaTeX 果然还是不容易……真想不通，LaTeX 发展了这么长时间，为何不把这弄简单一点呢，就像 Linux 这样……

不想下载和摆弄 TexLive 了，直接从 apt 里面安装，结果安装出现了下面错误提示：

1
2
3
4
5
6
7
updmap-sys failed. Output has been stored in
/tmp/updmap.jh4rQYNc
Please include this file if you report a bug.
&#160;
Sometimes, not accepting conffile updates in /etc/texmf/updmap.d
causes updmap-sys to fail.  Please check for files with extension
.dpkg-dist or .ucf-dist in this directory

因为是 tex-common [...]]]></description>
			<content:encoded><![CDATA[<p>又想弄 LaTeX 了，OpenOffice.org 和 M$ Office 果然还是有点差距的，还不如用 LaTeX……不是据说还有一个“几乎可视化”的 LaTeX 编辑器？</p>
<p>不过摆弄 LaTeX 果然还是不容易……真想不通，LaTeX 发展了这么长时间，为何不把这弄简单一点呢，就像 Linux 这样……<br />
<span id="more-926"></span><br />
不想下载和摆弄 TexLive 了，直接从 apt 里面安装，结果安装出现了下面错误提示：</p>

<div class="wp_codebox"><table><tr id="p92628"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p926code28"><pre class="text" style="font-family:monospace;">updmap-sys failed. Output has been stored in
/tmp/updmap.jh4rQYNc
Please include this file if you report a bug.
&nbsp;
Sometimes, not accepting conffile updates in /etc/texmf/updmap.d
causes updmap-sys to fail.  Please check for files with extension
.dpkg-dist or .ucf-dist in this directory</pre></td></tr></table></div>

<p>因为是 tex-common 配置的时候出错，后面全部都不能正常安装，囧……</p>
<p>反复用 &#8211;purge 清除配置文件的方式卸载安装了好几遍，问题还是没有解决。最后我就干脆亲自排查 TexLive 的各个配置文件所在的文件夹。TexLive 似乎会用到 /usr/share/texmf、/usr/share/texmf-texlive、/var/lib/texmf 和 /etc/texmf 文件夹。开始我只知道前三个，然后发现 purge 以后就都没了，最后才知道还有个 /etc/texmf。删掉这个文件夹，再次重装，终于成功完成了！</p>
<p>我个人强烈希望能有一个简单一点的类似排版系统，LaTeX 实在太过复杂了……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/solve-the-problem-that-texlive-cannot-be-installed-properly-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>升级到 Ubuntu 9.10</title>
		<link>http://blog.upsuper.org/upgrading-to-ubuntu-karmic/</link>
		<comments>http://blog.upsuper.org/upgrading-to-ubuntu-karmic/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 23:08:56 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[琐事杂谈]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[上网本]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=904</guid>
		<description><![CDATA[观望了半个月后，发现大家好评如潮，今天终于狠下心来把我上网本上的 Ubuntu 升级到了 9.10。
本来的计划是，如果升级出现各种难以解决的神奇问题，就格了重装，附带安装一个 Intel 的 Moblin，因为看起来 Moblin 已经可以比较好的适应我的机器，并且能完成大部分上网任务了。不过因为升级后没有出现什么大问题，也就算了。

先说说升级过程。我是早上起来开的升级，升级程序就开始问问题……答完一些问题后，看他开始处理了，我就去上高数课去了。结果高数回来一看，还没开始升级呢……升级程序询问：是否现在开始升级？我晕……然后点下去，又去上班会课。下课回来再一看，又中断问我问题……无语了……
总体来说升级还是比较顺利的，唯一出问题的是 TexLive 里面的 tex-common 包配置崩溃了，我就干脆卸掉了，需要再装咯……
安装好以后，看了觉得还是蛮不错的，新 Netbook Launch 效果很好~至于那个新的 Splash 嘛，总觉得和视频上看的 Fedora 的有一定差距……启动速度没有感觉到明显提升，倒是亮度控制键失效了 _-b
去网上查了查，这个问题还是比较普遍的，比如 LaunchPad 上的 Bug #448885。10楼提到了可以通过将 BIOS 刷为最新版本解决这一问题。但问题是，三星官方提供的 BIOS 刷新工具没有 for Linux 版的！而且像这种东西 wine 出来，且不论能不能行，根本不敢用嘛……
于是就找啊找，就找到了个人，还真提取出了 NC10 的 BIOS：Smörgåsbord &#187; Flash your Samsung NC10&#8217;s BIOS from Linux 很好很强大。
在忐忑不安中备份了旧的 BIOS 后刷上了新的 BIOS，重启，发现可以了，好险啊……在进入 Ubuntu 试试亮度调节，也可以了~不过，惟一的问题是我的购买日期本来是 2009/08 的，被刷成了 2009/01……这个问题暂时尚未得到任何解决方法。
此外，Ubuntu 9.10 [...]]]></description>
			<content:encoded><![CDATA[<p>观望了半个月后，发现大家好评如潮，今天终于狠下心来把我上网本上的 Ubuntu 升级到了 9.10。</p>
<p>本来的计划是，如果升级出现各种难以解决的神奇问题，就格了重装，附带安装一个 Intel 的 Moblin，因为看起来 Moblin 已经可以比较好的适应我的机器，并且能完成大部分上网任务了。不过因为升级后没有出现什么大问题，也就算了。<br />
<span id="more-904"></span><br />
先说说升级过程。我是早上起来开的升级，升级程序就开始问问题……答完一些问题后，看他开始处理了，我就去上高数课去了。结果高数回来一看，还没开始升级呢……升级程序询问：是否现在开始升级？我晕……然后点下去，又去上班会课。下课回来再一看，又中断问我问题……无语了……</p>
<p>总体来说升级还是比较顺利的，唯一出问题的是 TexLive 里面的 tex-common 包配置崩溃了，我就干脆卸掉了，需要再装咯……</p>
<p>安装好以后，看了觉得还是蛮不错的，新 Netbook Launch 效果很好~至于那个新的 Splash 嘛，总觉得和视频上看的 Fedora 的有一定差距……启动速度没有感觉到明显提升，倒是亮度控制键失效了 _-b</p>
<p>去网上查了查，这个问题还是比较普遍的，比如 LaunchPad 上的 <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/448885">Bug #448885</a>。10楼提到了可以通过将 BIOS 刷为最新版本解决这一问题。但问题是，三星官方提供的 BIOS 刷新工具没有 for Linux 版的！而且像这种东西 wine 出来，且不论能不能行，根本不敢用嘛……</p>
<p>于是就找啊找，就找到了个人，还真提取出了 NC10 的 BIOS：<a href="http://smorgasbord.gavagai.nl/2009/05/flash-your-samsung-nc10-bios-from-linux/">Smörgåsbord &raquo; Flash your Samsung NC10&#8217;s BIOS from Linux</a> 很好很强大。</p>
<p>在忐忑不安中备份了旧的 BIOS 后刷上了新的 BIOS，重启，发现可以了，好险啊……在进入 Ubuntu 试试亮度调节，也可以了~不过，惟一的问题是我的购买日期本来是 2009/08 的，被刷成了 2009/01……这个问题暂时尚未得到任何解决方法。</p>
<p>此外，Ubuntu 9.10 让我最无语的地方莫过于移动硬盘不能在开机前就插上。由于我的 SSD 只有 16GB，我就长期挂一个外接移动硬盘作为资料储存，同时为了方便起见，我也把移动硬盘的挂载写入了 /etc/fstab。可是如果将移动硬盘那条调为 auto，插入的情况下开机自动挂载，这时候就会出现各种诡异的问题：nautilus 几乎打不开、关机或重启时卡死在 Unmounting temporary filesystems 上等等等等。如果调为 noauto，则开机时不会发生以上现象，但不能挂载！必须要拔出来再插进去才能正常挂载。不知何故。与之相关的还有另一个问题，就是即使再插进去挂载成功了，nautilus 的书签里会出现两个本应该是一个东西的项目：我在 /etc/fstab 里设置的那个挂载点和实际挂载后的项目。如图，红框中的两项本应该是一项。<br />
<a href="http://blog.upsuper.org/wp-content/uploads/2009/11/Screenshot-upsuper-文件浏览器.png"><img src="http://blog.upsuper.org/wp-content/uploads/2009/11/Screenshot-upsuper-文件浏览器-300x190.png" alt="Screenshot-upsuper - 文件浏览器" title="Screenshot-upsuper - 文件浏览器" width="300" height="190" class="alignnone size-medium wp-image-906" /></a></p>
<p>最重要的是，点击下面那项是不能打开的！会提示不能挂载。这个也只能暂时将就着用了……</p>
<p>不过要赞一下的是 Intel 的新驱动，Compiz 可以流畅开启了，现在的效果非常不错~同时，原来输入法和 Compiz 的不兼容问题也得到了解决。不错不错~</p>
<p>最后赞一下 Ubuntu 9.10 新加的那个软件中心，很方便。不过速度实在不敢恭维的说相当卡。很期待 Ubuntu Tweak 的类似作品~</p>
<p>总体来说，Ubuntu 还是越做好了~鼓励一下~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/upgrading-to-ubuntu-karmic/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CHM 查看器</title>
		<link>http://blog.upsuper.org/chm-viewer/</link>
		<comments>http://blog.upsuper.org/chm-viewer/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 02:05:26 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[CHM]]></category>
		<category><![CDATA[SSD]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=829</guid>
		<description><![CDATA[说实话，本来 CHM 的查看器很早以前就不是个问题了，但由于不记得到底哪个才是最好用的（最没有乱码的），每次都要把知道的查看器一个一个试过去，于是今天我就想把它记下来，以后直接翻我自己的日志就可以了……
目前为止试用的最好用的是：chmsee。
gnochm 在我的使用中，从索引打开显示正常，但一旦点内部链接跳转就出现乱码。至于网络上看到的 KDE 下的 kchmviewer 我就更无语了，只要是文件地址中有中文，点连接就不正常了，看来也是编码没做好。
另外，chmsee 在 ubuntu-tweak 的 PPA 列表上有，可以更新到更新的版本。更新的版本上面允许全屏，在我这个10寸的上网本上看的可爽了~当然，如果能把那个标签也去掉就更好了~
此外，这个版本（还是这个软件？）会把 chm 解压到 ~/.chmsee/bookshelf 内。不过我心疼我的 SSD，于是就想把那个目录改到 tmpfs 的 /tmp 下，但却发现那个显示解压地址的框框是不让改的，只是给你看看逗你玩罢了……如果这是在 Windows 下，特别是在非 NTFS 文件系统下，这一切就只好作罢了。但 Linux 不同，我们有符号链接！

1
2
rm -r ~/.chmsee/bookshelf
ln -s /tmp ~/.chmsee/bookshelf

解决问题。
以后 chmsee 的临时文件就全部去 tmpfs 了，应该可以有一点效率提升吧？至少不会对我的 SSD 有影响……
]]></description>
			<content:encoded><![CDATA[<p>说实话，本来 CHM 的查看器很早以前就不是个问题了，但由于不记得到底哪个才是最好用的（最没有乱码的），每次都要把知道的查看器一个一个试过去，于是今天我就想把它记下来，以后直接翻我自己的日志就可以了……</p>
<p>目前为止试用的最好用的是：chmsee。</p>
<p>gnochm 在我的使用中，从索引打开显示正常，但一旦点内部链接跳转就出现乱码。至于网络上看到的 KDE 下的 kchmviewer 我就更无语了，只要是文件地址中有中文，点连接就不正常了，看来也是编码没做好。</p>
<p>另外，chmsee 在 ubuntu-tweak 的 PPA 列表上有，可以更新到更新的版本。更新的版本上面允许全屏，在我这个10寸的上网本上看的可爽了~当然，如果能把那个标签也去掉就更好了~</p>
<p>此外，这个版本（还是这个软件？）会把 chm 解压到 ~/.chmsee/bookshelf 内。不过我心疼我的 SSD，于是就想把那个目录改到 tmpfs 的 /tmp 下，但却发现那个显示解压地址的框框是不让改的，只是给你看看逗你玩罢了……如果这是在 Windows 下，特别是在非 NTFS 文件系统下，这一切就只好作罢了。但 Linux 不同，我们有符号链接！</p>

<div class="wp_codebox"><table><tr id="p82930"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p829code30"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> ~<span style="color: #000000; font-weight: bold;">/</span>.chmsee<span style="color: #000000; font-weight: bold;">/</span>bookshelf
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>tmp ~<span style="color: #000000; font-weight: bold;">/</span>.chmsee<span style="color: #000000; font-weight: bold;">/</span>bookshelf</pre></td></tr></table></div>

<p>解决问题。</p>
<p>以后 chmsee 的临时文件就全部去 tmpfs 了，应该可以有一点效率提升吧？至少不会对我的 SSD 有影响……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/chm-viewer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>解决vim退出后终端乱码的问题</title>
		<link>http://blog.upsuper.org/solve-the-problem-of-terminal-becoming-messy-after-exit-vim/</link>
		<comments>http://blog.upsuper.org/solve-the-problem-of-terminal-becoming-messy-after-exit-vim/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 12:53:12 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=805</guid>
		<description><![CDATA[这个问题很早就有了，一直没解决，而且也不知道很多人所说的“reset”命令，每次都是关掉重开。最近几天因为编辑新首页的缘故，实在不满于这个问题，于是便想办法解决了，在这里写出来，给大家也给自己以后做个参考。
网上有很多诡异的做法，其中最诡异的莫过于在默认标题前后加上空格，而且很多人称这很有效，但我试了却没有用。找了半天，发现一个帖子有一个比较奇特的解决方法：vim编辑退出后提示符乱码解决 &#8211; LinuxSir.Org
其中提到了重设vim连接到的程序。我根据man手册里vim相关的命令给出下面几个命令：

1
2
3
4
sudo update-alternatives --config vim
sudo update-alternatives --config vi
sudo update-alternatives --config ex
sudo update-alternatives --config view

每个命令中都选择“/usr/bin/vim.basic”，结果就可以了……
看来是gvim的问题。当然，如果从来不用，直接

1
sudo apt-get remove vim-gnome

或许是最直接简便的方案~
]]></description>
			<content:encoded><![CDATA[<p>这个问题很早就有了，一直没解决，而且也不知道很多人所说的“reset”命令，每次都是关掉重开。最近几天因为编辑新首页的缘故，实在不满于这个问题，于是便想办法解决了，在这里写出来，给大家也给自己以后做个参考。</p>
<p>网上有很多诡异的做法，其中最诡异的莫过于在默认标题前后加上空格，而且很多人称这很有效，但我试了却没有用。找了半天，发现一个帖子有一个比较奇特的解决方法：<a href="http://www.linuxsir.com/bbs/thread333819.html">vim编辑退出后提示符乱码解决 &#8211; LinuxSir.Org</a></p>
<p>其中提到了重设vim连接到的程序。我根据man手册里vim相关的命令给出下面几个命令：</p>

<div class="wp_codebox"><table><tr id="p80533"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p805code33"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--config</span> <span style="color: #c20cb9; font-weight: bold;">vim</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--config</span> <span style="color: #c20cb9; font-weight: bold;">vi</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--config</span> ex
<span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--config</span> view</pre></td></tr></table></div>

<p>每个命令中都选择“/usr/bin/vim.basic”，结果就可以了……</p>
<p>看来是gvim的问题。当然，如果从来不用，直接</p>

<div class="wp_codebox"><table><tr id="p80534"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p805code34"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> remove vim-gnome</pre></td></tr></table></div>

<p>或许是最直接简便的方案~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/solve-the-problem-of-terminal-becoming-messy-after-exit-vim/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Firefox 3.5.2 装中文包记</title>
		<link>http://blog.upsuper.org/note-of-install-firefox-3-5-2-chinese-language-pack/</link>
		<comments>http://blog.upsuper.org/note-of-install-firefox-3-5-2-chinese-language-pack/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 16:08:44 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[琐事杂谈]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=792</guid>
		<description><![CDATA[这是第二次了！为 Firefox 3.5 安装中文包！上一次是转到 Firefox 3.5 的时候，这次是系统自动为它升级的时候。
上次是别人帮我找的中文包，这次自己在别人的引导下终于找到了。事实上我已经忍了 3.5.2 的英文界面很久了……
大体上实在这样的位置：http://releases.mozillaonline.com/pub/mozilla.org/firefox/releases/ 这个文件夹，到你 Firefox 的版本号所在的目录下面，找到系统和平台（这里我肯定是 linux-i686 了），然后可以看到很多很多语言……可是我们要的东西不在这一层目录……可以看到在最下面的 zh_CN 上面有一个 xpi，就是他了，点进去就看到又是好多好多语言，不过都是 .xpi 结尾的，很明显这些就是语言包了，选择 zh_CN.xpi，根据提示安装重启 Firefox 就可以了~
写这也算是对 Ubuntu 一点小小的不满，不过可能是因为 Firefox 3.5 并不是 Ubuntu 9.04 的默认浏览器的缘故吧，不过还是很不爽……
另外，既然好不容易又写了篇日志就不应该让他如此无聊……于是我也把如何用原来的狐狸图标启动 3.5 说一说吧。其实很简单就是了，就是下面语句啦：

1
2
sudo rm -f /usr/bin/firefox
sudo ln -s /usr/bin/firefox-3.5 /usr/bin/firefox

唉……最近很懒，都不想写日志怎么办……整天都看其他人写自己就越发懒了……
]]></description>
			<content:encoded><![CDATA[<p>这是第二次了！为 Firefox 3.5 安装中文包！上一次是转到 Firefox 3.5 的时候，这次是系统自动为它升级的时候。</p>
<p>上次是别人帮我找的中文包，这次自己在别人的引导下终于找到了。事实上我已经忍了 3.5.2 的英文界面很久了……</p>
<p>大体上实在这样的位置：<a href="http://releases.mozillaonline.com/pub/mozilla.org/firefox/releases/">http://releases.mozillaonline.com/pub/mozilla.org/firefox/releases/</a> 这个文件夹，到你 Firefox 的版本号所在的目录下面，找到系统和平台（这里我肯定是 linux-i686 了），然后可以看到很多很多语言……可是我们要的东西不在这一层目录……可以看到在最下面的 zh_CN 上面有一个 xpi，就是他了，点进去就看到又是好多好多语言，不过都是 .xpi 结尾的，很明显这些就是语言包了，选择 zh_CN.xpi，根据提示安装重启 Firefox 就可以了~</p>
<p>写这也算是对 Ubuntu 一点小小的不满，不过可能是因为 Firefox 3.5 并不是 Ubuntu 9.04 的默认浏览器的缘故吧，不过还是很不爽……</p>
<p>另外，既然好不容易又写了篇日志就不应该让他如此无聊……于是我也把如何用原来的狐狸图标启动 3.5 说一说吧。其实很简单就是了，就是下面语句啦：</p>

<div class="wp_codebox"><table><tr id="p79236"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p792code36"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>firefox
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>firefox-<span style="color: #000000;">3.5</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>firefox</pre></td></tr></table></div>

<p>唉……最近很懒，都不想写日志怎么办……整天都看其他人写自己就越发懒了……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/note-of-install-firefox-3-5-2-chinese-language-pack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubuntu之旅（十一）——探索VIM</title>
		<link>http://blog.upsuper.org/ubuntu-trip-11-explore-vim/</link>
		<comments>http://blog.upsuper.org/ubuntu-trip-11-explore-vim/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 10:37:50 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=772</guid>
		<description><![CDATA[很久没写日志了，前段时间本来想写一个安装 CoreAVC for Linux 的，结果它未能成功拯救我的福音战士新剧场版1080P，于是就放下了……
这次由于对 Scribes 测试版 bug 重重的不满和随时可能丢失修改的担忧，在看了一部分《开源世界旅行手册》后，毅然决定试一试传说中的 vim。

vim 在传说中是强大的，不过说起来也还是不那么容易入门的。查了很多关于 vim 配置和操作的文章。在操作方面，vim 自带的指导、开源世界旅行手册中的相关章节和 LinuxToy 上的《高效率编辑器 VIM》让我受益匪浅。vim 自带的指导只要在终端里输入 vimtutor 就可以了，一边看着指导一边操作，学得还是挺快的，只不过指导只有繁体中文，看了不大舒服，幸好还都看懂了……
至于配置，也看了不少地方，现在的配置文件大概是这样的：

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
filetype indent on
set nocompatible
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
syntax on
colorscheme freya
set shortmess=atI
set autoindent
set complete=.
set smartindent
set smarttab
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
set foldmethod=indent
set number
set ambiwidth=double
&#160;
nmap &#60;F2&#62; :tabprevious&#60;CR&#62;
nmap &#60;F3&#62; :tabnext&#60;CR&#62;

其实到处都有很多 vim 的配置文件，我现在这个还算很短的，而且很简陋的，估计还会不断增加，暂且放在这里做一个纪念吧，看看以后会到怎样的境界……
现在用 vim 慢慢适应了不用方向键的操作了，不过不知道到底是好是坏呢……只能慢慢适应咯
]]></description>
			<content:encoded><![CDATA[<p>很久没写日志了，前段时间本来想写一个安装 CoreAVC for Linux 的，结果它未能成功拯救我的福音战士新剧场版1080P，于是就放下了……</p>
<p>这次由于对 Scribes 测试版 bug 重重的不满和随时可能丢失修改的担忧，在看了一部分《<a href="http://linuxtoy.org/docs/guide/">开源世界旅行手册</a>》后，毅然决定试一试传说中的 vim。<br />
<span id="more-772"></span><br />
vim 在传说中是强大的，不过说起来也还是不那么容易入门的。查了很多关于 vim 配置和操作的文章。在操作方面，vim 自带的指导、开源世界旅行手册中的<a href="http://linuxtoy.org/docs/guide/ch24.html">相关章节</a>和 <a href="http://linuxtoy.org">LinuxToy</a> 上的《<a href="http://linuxtoy.org/archives/efficient-editing-with-vim.html">高效率编辑器 VIM</a>》让我受益匪浅。vim 自带的指导只要在终端里输入 vimtutor 就可以了，一边看着指导一边操作，学得还是挺快的，只不过指导只有繁体中文，看了不大舒服，幸好还都看懂了……</p>
<p>至于配置，也看了不少地方，现在的配置文件大概是这样的：</p>

<div class="wp_codebox"><table><tr id="p77238"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code" id="p772code38"><pre class="vim" style="font-family:monospace;"><span style="color: #804040;">filetype</span> <span style="color: #25BB4D;">indent</span> <span style="color: #25BB4D;">on</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">nocompatible</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">fileencodings</span>=utf<span style="color: #000000;">-</span><span style="color: #000000; font-weight:bold;">8</span>,ucs<span style="color: #000000;">-</span>bom,gb18030,gbk,gb2312,cp936
<span style="color: #804040;">syntax</span> <span style="color: #25BB4D;">on</span>
<span style="color: #804040;">colorscheme</span> freya
<span style="color: #804040;">set</span> <span style="color: #668080;">shortmess</span>=atI
<span style="color: #804040;">set</span> <span style="color: #668080;">autoindent</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">complete</span>=<span style="color: #000000;">.</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">smartindent</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">smarttab</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">expandtab</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">tabstop</span>=<span style="color: #000000; font-weight:bold;">2</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">softtabstop</span>=<span style="color: #000000; font-weight:bold;">2</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">shiftwidth</span>=<span style="color: #000000; font-weight:bold;">2</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">foldmethod</span>=<span style="color: #25BB4D;">indent</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">number</span>
<span style="color: #804040;">set</span> <span style="color: #668080;">ambiwidth</span>=double
&nbsp;
nmap <span style="color: #668080;">&lt;F2&gt;</span> <span style="color: #000000;">:</span>tabprevious<span style="color: #000000;">&lt;</span>CR<span style="color: #000000;">&gt;</span>
nmap <span style="color: #668080;">&lt;F3&gt;</span> <span style="color: #000000;">:</span>tabnext<span style="color: #000000;">&lt;</span>CR<span style="color: #000000;">&gt;</span></pre></td></tr></table></div>

<p>其实到处都有很多 vim 的配置文件，我现在这个还算很短的，而且很简陋的，估计还会不断增加，暂且放在这里做一个纪念吧，看看以后会到怎样的境界……</p>
<p>现在用 vim 慢慢适应了不用方向键的操作了，不过不知道到底是好是坏呢……只能慢慢适应咯</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/ubuntu-trip-11-explore-vim/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>我的 lab2（一）——Windows 下的 Linux</title>
		<link>http://blog.upsuper.org/my-lab2-1-linux-under-windows/</link>
		<comments>http://blog.upsuper.org/my-lab2-1-linux-under-windows/#comments</comments>
		<pubDate>Thu, 14 May 2009 07:02:18 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[虚拟机]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=755</guid>
		<description><![CDATA[在开源界，总是有很多不可思议的东西，在没有虚拟化技术的机子中的 Windows 下跑 Linux 可以以 Native 的速度似乎很早就已经成功了。使用的是一个叫做 coLinux 的程序，它将整个 Linux 系统当做 Windows 的一个进程，其高得惊人的执行效率伴随着是相当小的资源占用。

前面其实用过 coLinux，当时使用了官方网站上提供的 Debian 镜像，可以直接使用。但这次由于某些原因，不得不使用 Ubuntu，于是就用前一段载的 DVD 安装了一个。虽然只装了基本系统，过程还是相当艰难的……
对于没用过 coLinux 的，首先要到 SourceForge.net 上下载 coLinux-stable 和下面任意一个制作好的硬盘镜像。这些镜像除了预装系统不同外，其大小也不同，ArchLinux 的是 256MB，Debian 是 1GB，Ubuntu 是 2GB。如果空间充裕建议下 Ubuntu 版的吧，这样以后可以做的事情比较多~
接下去安装什么的都很简单了，下载的 coLinux 安装程序按照过程安好，然后把刚才载的镜像解压到安装文件夹。你还可以在这里根据你想要的大小下载一个 Swap 的镜像，同样放到那个目录。
其实编辑一下 example.conf，把对应的文件名填上就可以打开了。不过这样不好玩，不是么？
现在准备好 Ubuntu 9.04 DVD 的 ISO 镜像，新建一个文件叫做 ubuntu.conf，然后从 ISO 当中的 install 目录提取出 initrd.gz，备份安装文件夹中的同名文件备用。接下来新建一个文件叫做 ubuntu.conf，内容按照如下模版填写：

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# c:\coLinux 换成你的安装目录
kernel=&#34;c:\coLinux\vmlinux&#34;
# 这里写上你下载的镜像的文件名
cobd0=&#34;ubuntu.ext3.1gb&#34;
# 这是 [...]]]></description>
			<content:encoded><![CDATA[<p>在开源界，总是有很多不可思议的东西，在没有虚拟化技术的机子中的 Windows 下跑 Linux 可以以 Native 的速度似乎很早就已经成功了。使用的是一个叫做 coLinux 的程序，它将整个 Linux 系统当做 Windows 的一个进程，其高得惊人的执行效率伴随着是相当小的资源占用。<br />
<span id="more-755"></span><br />
前面其实用过 coLinux，当时使用了官方网站上提供的 Debian 镜像，可以直接使用。但这次由于某些原因，不得不使用 Ubuntu，于是就用前一段载的 DVD 安装了一个。虽然只装了基本系统，过程还是相当艰难的……</p>
<p>对于没用过 coLinux 的，首先要到 <a href="http://sourceforge.net/project/showfiles.php?group_id=98788">SourceForge.net</a> 上下载 coLinux-stable 和下面任意一个制作好的硬盘镜像。这些镜像除了预装系统不同外，其大小也不同，ArchLinux 的是 256MB，Debian 是 1GB，Ubuntu 是 2GB。如果空间充裕建议下 Ubuntu 版的吧，这样以后可以做的事情比较多~</p>
<p>接下去安装什么的都很简单了，下载的 coLinux 安装程序按照过程安好，然后把刚才载的镜像解压到安装文件夹。你还可以在<a href="http://gniarf.nerim.net/colinux/swap/">这里</a>根据你想要的大小下载一个 Swap 的镜像，同样放到那个目录。</p>
<p>其实编辑一下 example.conf，把对应的文件名填上就可以打开了。不过这样不好玩，不是么？</p>
<p>现在准备好 Ubuntu 9.04 DVD 的 ISO 镜像，新建一个文件叫做 ubuntu.conf，然后从 ISO 当中的 install 目录提取出 initrd.gz，备份安装文件夹中的同名文件备用。接下来新建一个文件叫做 ubuntu.conf，内容按照如下模版填写：</p>

<div class="wp_codebox"><table><tr id="p75548"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p755code48"><pre class="text" style="font-family:monospace;"># c:\coLinux 换成你的安装目录
kernel=&quot;c:\coLinux\vmlinux&quot;
# 这里写上你下载的镜像的文件名
cobd0=&quot;ubuntu.ext3.1gb&quot;
# 这是 swap 区的镜像的文件名，没有就可以不写了
cobd1=&quot;swap_256Mb&quot;
# 这个是 DVD 镜像的位置
cobd2=&quot;d:\share\ubuntu-9.04-dvd-i386.iso&quot;
# 以光盘启动
root=/dev/cobd2
ro
initrd=&quot;initrd.gz&quot;
#内存大小，单位 MB，如果内存大的可以适量加大，我这里总物理内存只有 256，所以才给这么些
mem=64
# 安装之前先不要启用网络，否则就后果自负了……
#eth0=pcap-bridge, &quot;colinux&quot;</pre></td></tr></table></div>

<p>接下去执行 colinux-daemon.exe @ubuntu.conf，进入安装。</p>
<p>由于 Ubuntu 的安装程序不能正确格式化磁盘，因此我们要先帮它格式化好。先点 Alt+F2 进入控制台，输入下面命令预格式化：</p>

<div class="wp_codebox"><table><tr id="p75549"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p755code49"><pre class="bash" style="font-family:monospace;">mke2fs <span style="color: #660033;">-j</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>cobd0
mkswap <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>cobd1</pre></td></tr></table></div>

<p>重启在此进入安装，此时根据提示安装即可。但有几个地方需要注意，一是可能遇到说找不到光驱，此时选择不加载外部驱动，手动指定，然后输入 /dev/cobd2 加载 DVD 镜像；问是否不加载内核模块而继续时选是；在划分磁盘时选择手动，将刚刚格式化过的 /dev/cobd0 选择使用为 ext3，保留数据挂载为 /。安装的时候最好什么额外的包都不要选，特别是 Desktop 那些，先安个基本系统就好了。最后，不要安装 grub 和 lilo，装了也会出错……所以就直接忽略就好了。</p>
<p>安装过程可能持续相当的时间，如果刚才不禁掉网络可能就跟囧了……</p>
<p>安装好以在 Monitor 菜单中选择 Power off 关机。编辑 ubuntu.conf，将 root=/dev/cobd2 修改为 root=/dev/cobd0，去掉 eth0=pcap-bridge, &#8220;colinux&#8221; 前的注释符，并把刚才备份的 initrd.gz 覆盖从 ISO 中提取出来的文件。在此执行 colinux-daemon.exe @ubuntu.conf，至此就进入了 Ubuntu 9.04。</p>
<p>登入，下面先设置更新源。我发现，如果设置了 DVD 作为更新源，绝大多数常用的软件包都不需要上网下载。现在我们知道，DVD 已经被在 /dev/cobd2 上了。现在，执行下面命令，添加 DVD 源：</p>

<div class="wp_codebox"><table><tr id="p75550"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p755code50"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>cobd2 <span style="color: #000000; font-weight: bold;">/</span>cdrom
<span style="color: #c20cb9; font-weight: bold;">sudo</span> apt-cdrom add</pre></td></tr></table></div>

<p>然后就 sudo apt-get update 一下就可以用了~</p>
<p>因为我个人习惯于是用 vim 而非 nano，因此我必经这步安装了个 vim，然后开始编辑网络。</p>

<div class="wp_codebox"><table><tr id="p75551"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p755code51"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>network<span style="color: #000000; font-weight: bold;">/</span>interfaces</pre></td></tr></table></div>

<p>在其中写入相关的网络配置：</p>

<div class="wp_codebox"><table><tr id="p75552"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p755code52"><pre class="text" style="font-family:monospace;">auto eth0
iface eth0 inet static
	address IP地址
	netmask 255.255.255.0
	gateway 网关</pre></td></tr></table></div>

<p>由于我们选择了桥接模式，现在这个虚拟机和你的宿主机在网络上是平级的，因此可根据自己的网络配置设置。如果有需要设置 DNS 服务器的话，应该新建 /etc/resolv.conf，并按照下面格式添加 DNS 服务器：</p>

<div class="wp_codebox"><table><tr id="p75553"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p755code53"><pre class="text" style="font-family:monospace;">nameserver 218.85.157.99
nameserver 202.101.98.55</pre></td></tr></table></div>

<p>下面就运行下面的命令重开网络：</p>

<div class="wp_codebox"><table><tr id="p75554"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p755code54"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ifdown</span> eth0
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ifup</span> eth0</pre></td></tr></table></div>

<p>就可以使用了。</p>
<p>安装东西的时刻来临了！</p>
<p>不过还有一个需要的东西，就是 Xming。有了这个，你就可以实现在 Windows 下无缝使用 Linux 的界面程序了！首先要在虚拟机中安装 xterm，并在 Windows 下从<a href="http://www.straightrunning.com/XmingNotes/">这个地方</a>下载 Xming 和 Xming-fonts 并安装。</p>
<p>完成 Xming 的安装后，进入其安装目录，编辑 X0.hosts 文件，在 localhost 下面再加一行你的虚拟机的 IP 地址，最后启动 Xming。</p>
<p>在 Linux 下，你必须在输入下面命令：</p>

<div class="wp_codebox"><table><tr id="p75555"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p755code55"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">DISPLAY</span>=IP地址:<span style="color: #000000;">0</span>
xterm <span style="color: #000000; font-weight: bold;">&amp;</span></pre></td></tr></table></div>

<p>其中 IP 地址为你宿主机的 IP 地址。这时你将看到一个白色背景的终端窗口，这说明你已经成功了！现在运行任何有界面的程序，就可以在 Windows 下看到看似原生环境的界面了。</p>
<p>当然，在疯狂的安装过程中，可能会发现空间变得越来越紧张，特别是像我这样一开始选用了 1GB 的镜像来安装 Ubuntu 的人……</p>
<p>要扩大镜像文件，首先需要一个叫做 mkFile.exe 的程序，因为似乎不好找，所以就自己预编译了一个，可以点击这里下载：<a href="http://down.upsuper.org/mkFile.rar">mkFile.rar</a> (326.57KB)</p>
<p>在关闭虚拟机的情况下，执行“mkFile.exe -r -g 你的镜像文件 2”就可以将镜像文件扩大到 2GB。重新开启虚拟机，在虚拟机中执行</p>

<div class="wp_codebox"><table><tr id="p75556"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p755code56"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> resize2fs <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>cobd0</pre></td></tr></table></div>

<p>稍等片刻就完成了。</p>
<p>下面是一张我在 coLinux 中编译安装并运行出 Scribes 的截图~其实我今天做这番事最根本的动机是为了在 Windows 下看看 Scribes 的……其实还是很完美的~虽然慢了一点……<br />
<a href="http://blog.upsuper.org/wp-content/uploads/2009/05/scribes_in_colinux.png"><img src="http://blog.upsuper.org/wp-content/uploads/2009/05/scribes_in_colinux-300x225.png" alt="scribes_in_colinux" title="scribes_in_colinux" width="300" height="225" class="alignnone size-medium wp-image-757" /></a></p>
<hr />
<p>参考：<a href="http://blog.csdn.net/jnstone3/archive/2008/10/02/3010040.aspx">CoLinux入门教程</a>、<a href="http://sheng.javaeye.com/blog/360766">在coLinux上安装Ubuntu8.04</a>、<a href="http://blog.frosty-geek.net/2009/04/ext3-online-resize-with-ubuntu-810.html">ext3 online resize with Ubuntu 8.10 Intrepid</a>、<a href="http://www.oklinux.cn/html/Basic/jyjq/20081011/62040.html">将Ubuntu DVD做软件源</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/my-lab2-1-linux-under-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>体验 Ubuntu 9.04 之配置</title>
		<link>http://blog.upsuper.org/ubuntu-904-experience-configuration/</link>
		<comments>http://blog.upsuper.org/ubuntu-904-experience-configuration/#comments</comments>
		<pubDate>Sat, 02 May 2009 15:22:58 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[输入法]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=724</guid>
		<description><![CDATA[Ubuntu 安装完要让他好用，最重要的莫过于配置了，要把 Ubuntu 配置成一个好用的系统虽说不难，不过也并不简单。
开机的第一个感觉，就是 9.04 的启动速度确实有一定提升，而且整个系统的效率感觉也相当不错，不过这个应该很大程度是由于新装系统东西少的缘故吧……不知道像原来的系统用那么久以后能不能保持。

照例是用 apt。先按照 Ubuntu 中文 Wiki 上的 9.04 的源列表配置好源。我照例选择了网易、LUPA 和台湾的源。配置完本想安装那些软件的，可 Ubuntu 自己先开始了升级大业，一大列的升级列表，足以说明 Ubuntu 9.04 发布之仓储，短短一周就有如此多的更新，不知道下面还要有多少更新。而且近一段时间，各个源的速度都不快，估计是由于新版本刚发布，各个源压力都很大的缘故，连网易这样原来可以上 MB/s 级的源也只有每秒 50kB 这样。不过最可怕的还是我使用了 ibus 在 PPA 上的源升级！那个 ibus-pinyin 下了我几个小时，在此期间完全不能打中文（没想去用 scim……），幸好 Google 对拼音的识别还是相当不错的，找资料没有遇到太大的困难，同时在这个过程中还断断续续安装了不少其他软件。
由于怕麻烦，这次没有安装 blubuntu，因为发现安装 blubuntu 要卸掉好多东西……接下来，按照很多地方的指示，在 /etc/sysctl.conf 文件最后添加一行 vm.swappiness = 5 以进一步减小交换区的使用频率。
这里推荐一个很好的文本编辑器——scribes，我强烈推荐用这个软件代替 gedit。它不仅有代码高亮、缩进这些 gedit 的功能，而且还有智能的代码补全和完善的模板系统。不过要用这个东西还有点麻烦，和 geany 一样的，如果已经打开了一个 scribes，如果再双击用 scribes 开一个文件，窗口列表里就会出现“打开 ***”，即使已经打开了也要很长时间才会消掉，最讨厌的是鼠标也会变成忙碌。这个解决的办法就是编辑 /usr/share/applications/scribes.desktop 文件，将 StartupNotify=true 改成 StartupNotify=false [...]]]></description>
			<content:encoded><![CDATA[<p>Ubuntu 安装完要让他好用，最重要的莫过于配置了，要把 Ubuntu 配置成一个好用的系统虽说不难，不过也并不简单。</p>
<p>开机的第一个感觉，就是 9.04 的启动速度确实有一定提升，而且整个系统的效率感觉也相当不错，不过这个应该很大程度是由于新装系统东西少的缘故吧……不知道像原来的系统用那么久以后能不能保持。<br />
<span id="more-724"></span><br />
照例是用 apt。先按照 <a href="http://wiki.ubuntu.org.cn/">Ubuntu 中文 Wiki</a> 上的 <a href="http://wiki.ubuntu.org.cn/index.php?title=Template:9.04source">9.04 的源列表</a>配置好源。我照例选择了网易、LUPA 和台湾的源。配置完本想安装那些软件的，可 Ubuntu 自己先开始了升级大业，一大列的升级列表，足以说明 Ubuntu 9.04 发布之仓储，短短一周就有如此多的更新，不知道下面还要有多少更新。而且近一段时间，各个源的速度都不快，估计是由于新版本刚发布，各个源压力都很大的缘故，连网易这样原来可以上 MB/s 级的源也只有每秒 50kB 这样。不过最可怕的还是我使用了 ibus 在 PPA 上的源升级！那个 ibus-pinyin 下了我几个小时，在此期间完全不能打中文（没想去用 scim……），幸好 Google 对拼音的识别还是相当不错的，找资料没有遇到太大的困难，同时在这个过程中还断断续续安装了不少其他软件。</p>
<p>由于怕麻烦，这次没有安装 blubuntu，因为发现安装 blubuntu 要卸掉好多东西……接下来，按照很多地方的指示，在 /etc/sysctl.conf 文件最后添加一行 vm.swappiness = 5 以进一步减小交换区的使用频率。</p>
<p>这里推荐一个很好的文本编辑器——scribes，我强烈推荐用这个软件代替 gedit。它不仅有代码高亮、缩进这些 gedit 的功能，而且还有智能的代码补全和完善的模板系统。不过要用这个东西还有点麻烦，和 geany 一样的，如果已经打开了一个 scribes，如果再双击用 scribes 开一个文件，窗口列表里就会出现“打开 ***”，即使已经打开了也要很长时间才会消掉，最讨厌的是鼠标也会变成忙碌。这个解决的办法就是编辑 /usr/share/applications/scribes.desktop 文件，将 StartupNotify=true 改成 StartupNotify=false 保存，就可以了。这样就可以设定它在所有文本类型的文件上代替 gedit 了~</p>
<p>接下去又是 smplayer，这个是功能十分强大的播放器前端，远比 Ubuntu 自带的 totem 强多了，我建议直接把 totem 全部卸掉就行了，然后安装 smplayer，这样各个影像格式就不会自动用 totem 了。还有，推荐用 Deluge 代替 Ubuntu 自带的 Transmission 作为 BT 客户端。</p>
<p><strong>请不要尝试下面内容，可能造成无法关机！</strong></p>
<p><del datetime="2009-05-13T11:23:29+00:00">然后又配置了 zhcon。原来在 8.10 的时候不知什么缘故，zhcon 十分异常，但这次配置却十分成功。我参考了<a href="http://chenjihua.javaeye.com/blog/240014">Ubuntu下配置tty全过程</a>，首先在 /etc/initramfs-tools/modules 文件末尾添加了三行：</p>

<div class="wp_codebox"><table><tr id="p72461"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p724code61"><pre class="text" style="font-family:monospace;">fbcon
vesafb
vga16fb</pre></td></tr></table></div>

<p>接下来注释掉了 /etc/modprobe.d/blacklist-framebuffer 文件中的</p>

<div class="wp_codebox"><table><tr id="p72462"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p724code62"><pre class="text" style="font-family:monospace;"># blacklist vesafb
# blacklist vga16fb</pre></td></tr></table></div>

<p>接下来，在 bash 中执行</p>

<div class="wp_codebox"><table><tr id="p72463"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p724code63"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> update-initramfs <span style="color: #660033;">-u</span></pre></td></tr></table></div>

<p>跟新自动加载的模块。</p>
<p>最后在 ~/.bashrc 最后一行添加</p>

<div class="wp_codebox"><table><tr id="p72464"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p724code64"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>tty<span style="color: #7a0874; font-weight: bold;">&#41;</span> == \<span style="color: #000000; font-weight: bold;">/</span>dev\<span style="color: #000000; font-weight: bold;">/</span>tty<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> zhcon</pre></td></tr></table></div>

<p>以在 tty 中自动启动。</p>
<p>关于 tty 分辨率的问题，我还没有做更多实验，有了结果再来这里更新。</del></p>
<p>这个时候突然发现输入法不能用了……不管我怎么按 Ctrl+Space 都调不出我的 ibus，换成 scim 也不行，试了好久，注销、重启了几次也没有解决。因为当时 zhcon 已经配置好了，我在 tty1 下写下“这是怎样的一种觉悟&#8230;”……在图形界面输入不了中文在文字界面却可以……最后想到可能是语言支持没有安装完全，就在 系统/系统管理/语言支持 里面取消了“使用输入法引擎”又再次选中，果然提示安装一个包！安装完注销、重新进入，就可以输入了。</p>
<p>剩下的部分 Ubuntu 中文 Wiki 上的<a href="http://wiki.ubuntu.org.cn/index.php?title=Qref/Jaunty">速配指南</a>和<a href="http://wiki.ubuntu.org.cn/index.php?title=Qref/More">热门设置</a>还是相当完善的，我的很多软件还是按照这两个里面提供的参考配置的。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/ubuntu-904-experience-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>体验 Ubuntu 9.04 之安装</title>
		<link>http://blog.upsuper.org/ubuntu-904-experience-installation/</link>
		<comments>http://blog.upsuper.org/ubuntu-904-experience-installation/#comments</comments>
		<pubDate>Fri, 01 May 2009 15:42:34 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=722</guid>
		<description><![CDATA[虽然 Ubuntu 9.04 在4月23日就出来了，而且当天我就用 BT 下载了 9.04 的 x86 desktop 的 iso，不过我还是没有去装的。主要是考虑到上次安装 8.10 的时候诡异的不能关机的 bug，说明 Ubuntu 的新版本总是问题多多的。虽然说这个不好，不过事实是这样，说句实话，我觉得 Ubuntu 的一个正式版大概相当于 Windows 的一个 RC 什么的，而 LTS 还比较像样一点。算起来，其实时间也差不多……
闲话不说了，还是说说我的 Ubuntu 9.04 吧。
前几天用 eMule 下载了 Ubuntu 9.04 的 DVD，信息中心的老师很大方的给了我一张 DVD+R 的盘并提供刻录机。说实话，这是我第一次刻录 DVD，在 Windows 下用 Nero 刻录的，刻录过程相当顺利，比我第一次刻 CDR 还顺利，几分钟就好了。我很早就在校内上的状态说5月再装 9.04。不过显然我是那种耐不住性子的人，不过一言既出驷马难追，所以还是等到今天——5月的第一天，就迫不及待的安装了。
昨晚花了很长时间把主目录下的资料备份到新买的移动硬盘里。我这次完全重装的很大原因也是因为第一次装不懂，结果就分了一个区挂载在根文件夹，这是非常不好的，也因此我不得不找一个移动硬盘来备份。高达 7GB 多的资料拷了近两个小时！昨晚关机的时候，我就在想：这个系统见不到明天的太阳了。

第二天一开机，就把 DVD 盘塞进去，开始了 Ubuntu 9.04 之旅。按照我的习惯，我都会选择体验而不安装，然后进入图形界面慢慢安装，顺便上上网查查资料什么的。一点就看到当年那个熟悉的提示，原来仍然没有解决 noapic 的问题啊……重新启动，在光盘引导的第一个页面按下 F6 修改启动选项，突然发现变成菜单式的了！选中里面的 [...]]]></description>
			<content:encoded><![CDATA[<p>虽然 Ubuntu 9.04 在4月23日就出来了，而且当天我就用 BT 下载了 9.04 的 x86 desktop 的 iso，不过我还是没有去装的。主要是考虑到上次安装 8.10 的时候诡异的不能关机的 bug，说明 Ubuntu 的新版本总是问题多多的。虽然说这个不好，不过事实是这样，说句实话，我觉得 Ubuntu 的一个正式版大概相当于 Windows 的一个 RC 什么的，而 LTS 还比较像样一点。算起来，其实时间也差不多……</p>
<p>闲话不说了，还是说说我的 Ubuntu 9.04 吧。</p>
<p>前几天用 eMule 下载了 Ubuntu 9.04 的 DVD，信息中心的老师很大方的给了我一张 DVD+R 的盘并提供刻录机。说实话，这是我第一次刻录 DVD，在 Windows 下用 Nero 刻录的，刻录过程相当顺利，比我第一次刻 CDR 还顺利，几分钟就好了。我很早就在校内上的状态说5月再装 9.04。不过显然我是那种耐不住性子的人，不过一言既出驷马难追，所以还是等到今天——5月的第一天，就迫不及待的安装了。</p>
<p>昨晚花了很长时间把主目录下的资料备份到新买的移动硬盘里。我这次完全重装的很大原因也是因为第一次装不懂，结果就分了一个区挂载在根文件夹，这是非常不好的，也因此我不得不找一个移动硬盘来备份。高达 7GB 多的资料拷了近两个小时！昨晚关机的时候，我就在想：这个系统见不到明天的太阳了。<br />
<span id="more-722"></span><br />
第二天一开机，就把 DVD 盘塞进去，开始了 Ubuntu 9.04 之旅。按照我的习惯，我都会选择体验而不安装，然后进入图形界面慢慢安装，顺便上上网查查资料什么的。一点就看到<a href="http://blog.upsuper.org/ubuntu-trip-3-fully-into-the-ubuntu/">当年那个熟悉的提示</a>，原来仍然没有解决 noapic 的问题啊……重新启动，在光盘引导的第一个页面按下 F6 修改启动选项，突然发现变成菜单式的了！选中里面的 noapic 就可以正常启动了，除了速度慢一点，其他还是很正常的。光盘嘛，还是可以理解的。关于这个菜单式的启动选项，我觉得非常不错，不过我觉得能够无障碍自动识别要有什么选项就更好了。</p>
<p>进入光盘引导的系统，觉得背景相当漂亮。我点“系统/系统管理/系统测试中”对系统兼容性进行了一次测试，发现适应得相当好，Compiz 的特效也自动开到正常水平，效率相当 OK。这次奇怪的是，安装不在桌面上！？我很惊奇，不过最后还是在系统管理当中看到了，于是我开始了安装。当安到一半，突然系统黑屏，完全没反应了！我不知道是怎么回事，只得重启。这次选择了安装。进入图形安装界面，运行到一半又出了奇奇怪怪的问题。无奈最后选择了文字界面安装。</p>
<p>这是我第一次用文字界面安装系统。一步一步按着提示，看到了许多从未见过的选项，如是否加密主文件夹，是否安装grub2等等……好复杂……害得我一边安装一边用另一台机子查到底那些是什么意思……第一次安装是失败的，原因是没有断网……<strong>在中国这种网络环境下用文字界面安装一定要断网，不然就等着安装 Ubuntu 的时候停在那里吧。</strong>我觉得，Ubuntu 依赖网络，本来不是件坏事，但在一个宽带网络还不够发达的地方过度依赖网络，必然成为后退。第二次安装断了网，一直到进入了一个软件包选择的界面，我把光标移动到 Ubuntu Desktop，然后不小心按下回车，框框消失，开始安装。我就想，不会给我安装了一个空系统吧？结果安装完，还真是个空系统，连图形界面都没有……直接再次重新安装。</p>
<p>这次更奇怪了，速度奇慢无比。实在等不下去了，觉得不对劲，把光盘拿出来，用眼睛布擦了擦，觉得盘很烫，就放在旁边凉。过了一会儿等光盘凉下来了，再次放回光驱，这次一切正常，终于安装完成了。</p>
<p>现在说说我的分区。我这次用了自以为相当完美的分区模式，5分区的方式，第一个分区 200MB，ext3 格式，这是出于稳定的需要，即使系统完全 broken 了，至少还有个启动器（_-b，如果系统真 broken 了，要个启动器干什么……），第二个分区 20GB，ext4 挂载根文件夹，因为据说 ext4 的效率好过 ext3，并可以加快启动速度，放在根文件夹这种地方最好了。下面是挂载 /tmp 的分区，2GB，reiserfs，因为我感觉在 Linux 下 tmp 其实比 Swap 更经常访问，就把它放在了前面，而且 tmp 是不需要太好的稳定性，不需要保存资料，但对小文件一类的处理需要比较好的效率，因此选择了 reiserfs。然后就是 swap 区了，1GB（和我的内存一样大，这样我还可以启用休眠）。最后剩下的所有空间全部给了 /home，还是 ext3，这种地方，稳定胜过一切啊。</p>
<p>再说说前面遇到的那些奇怪的选项，加密主文件夹，我看还是算了。虽然说我开始是觉得怕如果系统坏了就再也解不开那个密了，不过更重要的是我看到了 <a href="http://www.phoronix.com/scan.php?page=article&#038;item=ubuntu_jaunty_encrypt&#038;num=1">Phoronix 上的一份性能测试</a>，虽然前面几页的结果都表明性能损失不大，但看到<a href="http://www.phoronix.com/scan.php?page=article&#038;item=ubuntu_jaunty_encrypt&#038;num=4">第四页的数据</a>，发现差异极其明显，最终打消了我使用的念头，更况且 Ubuntu 默认也是不选择的。至于 grub2，安装程序自己都提示了还是试验性的，当然直接不敢安装了。平时使用的系统，当然还是稳定一些比较好，不要整天出奇怪的问题……</p>
<p>今天先写这么多了……总体上说，今天对 Ubuntu 9.04 安装程序的稳定性有一些失望，不过安完感觉还是不错的，这个就留到明天写啦~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/ubuntu-904-experience-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 下直接挂载 iso</title>
		<link>http://blog.upsuper.org/mount-iso-directly-on-ubuntu/</link>
		<comments>http://blog.upsuper.org/mount-iso-directly-on-ubuntu/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 03:11:50 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[小程序]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=680</guid>
		<description><![CDATA[感觉挂载 iso 每次要建文件夹、挂载，用完还要删除、删文件夹，很麻烦。在网上找了一个帖子：用于使用 鼠标右键 挂载iso的脚本!，觉得看起来不错，不过好像不能自动卸载。经过一番学习，给出了如下自动挂载/卸载脚本：

1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
&#91; $UID == 0 &#93; &#124;&#124; cmd=&#34;gksu&#34;
if &#91; ! -f $1 &#93;; then
	exit 2
fi
dir=&#34;/media/`basename $1 .iso`&#34;
if &#91; ! -d $dir &#93;; then
	$cmd &#34;mkdir $dir&#34;
	$cmd &#34;mount -t iso9660 -o loop $1 $dir&#34;
else
	$cmd &#34;umount $dir&#34;
	$cmd &#34;rm -r $dir&#34;
fi

写的很短很简陋，如果把 cmd= 后面改成 kdesudo 就可以在 KDE 下用了。
我把这个设置为 iso 文件的默认打开方式，这样以后双击 iso 文件，马上挂载，再双击，自动卸载，太方便了！用 Linux 的都可以试试~
]]></description>
			<content:encoded><![CDATA[<p>感觉挂载 iso 每次要建文件夹、挂载，用完还要删除、删文件夹，很麻烦。在网上找了一个帖子：<a href="http://forum.ubuntu.org.cn/viewtopic.php?f=21&#038;t=58745">用于使用 鼠标右键 挂载iso的脚本!</a>，觉得看起来不错，不过好像不能自动卸载。经过一番学习，给出了如下自动挂载/卸载脚本：</p>

<div class="wp_codebox"><table><tr id="p68066"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p680code66"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> == <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #007800;">cmd</span>=<span style="color: #ff0000;">&quot;gksu&quot;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">2</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #007800;">dir</span>=<span style="color: #ff0000;">&quot;/media/<span style="color: #780078;">`basename $1 .iso`</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$dir</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #007800;">$cmd</span> <span style="color: #ff0000;">&quot;mkdir <span style="color: #007800;">$dir</span>&quot;</span>
	<span style="color: #007800;">$cmd</span> <span style="color: #ff0000;">&quot;mount -t iso9660 -o loop $1 <span style="color: #007800;">$dir</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
	<span style="color: #007800;">$cmd</span> <span style="color: #ff0000;">&quot;umount <span style="color: #007800;">$dir</span>&quot;</span>
	<span style="color: #007800;">$cmd</span> <span style="color: #ff0000;">&quot;rm -r <span style="color: #007800;">$dir</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>写的很短很简陋，如果把 cmd= 后面改成 kdesudo 就可以在 KDE 下用了。</p>
<p><img src="http://blog.upsuper.org/wp-content/uploads/2009/02/e68c82e8bdbde58db8e8bdbdiso-300x227.png" alt="e68c82e8bdbde58db8e8bdbdiso" title="e68c82e8bdbde58db8e8bdbdiso" width="300" height="227" class="alignright size-medium wp-image-681" />我把这个设置为 iso 文件的默认打开方式，这样以后双击 iso 文件，马上挂载，再双击，自动卸载，太方便了！用 Linux 的都可以试试~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/mount-iso-directly-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>我的 lab1（二）——编译安装 PHP 5.3</title>
		<link>http://blog.upsuper.org/my-lab1-b-compile-and-install-php-53/</link>
		<comments>http://blog.upsuper.org/my-lab1-b-compile-and-install-php-53/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 07:14:12 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[我的计划]]></category>
		<category><![CDATA[探究学习]]></category>
		<category><![CDATA[JeOS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=657</guid>
		<description><![CDATA[昨天把 JeOS 给弄好了，今天就开始弄 PHP 5.3 了……

把刚刚下好的 php-5.3.0beta1.tar.bz2 上传到 lab1 里面，准备解压。发现 JeOS 里面没有 bzip2……又 apt 了个……
用 tar jxvf php-5.3.0beta1.tar.bz2 解压了文件，进入文件夹，开始 configure。
刚刚 configure 没一会儿，提示找不到 C 编译器。冷了，连 gcc 什么的都没装。又 apt 了个 gcc 和 g++。再 configure，提示没找到 libxml2。apt 了 libxml2，还是找不到，去网上一查，发现还要 libxml2-dev，又 apt 了下来。
最后终于 configure 过了，开始 make。提示没有 make。其实这早在我的意料之中……apt 了 make 和 automake，开始 make，make 完提示说别忘了 make test，我就 make test……等他 test 完告诉我提交报告，那就提交报告吧……麻烦……提交完我就开始 sudo [...]]]></description>
			<content:encoded><![CDATA[<p>昨天把 JeOS 给弄好了，今天就开始弄 PHP 5.3 了……<br />
<span id="more-657"></span><br />
把刚刚下好的 php-5.3.0beta1.tar.bz2 上传到 lab1 里面，准备解压。发现 JeOS 里面没有 bzip2……又 apt 了个……</p>
<p>用 tar jxvf php-5.3.0beta1.tar.bz2 解压了文件，进入文件夹，开始 configure。</p>
<p>刚刚 configure 没一会儿，提示找不到 C 编译器。冷了，连 gcc 什么的都没装。又 apt 了个 gcc 和 g++。再 configure，提示没找到 libxml2。apt 了 libxml2，还是找不到，<a href="http://blog.sina.com.cn/s/blog_54ee3de50100btjv.html" target="_blank">去网上一查</a>，发现还要 libxml2-dev，又 apt 了下来。</p>
<p>最后终于 configure 过了，开始 make。提示没有 make。其实这早在我的意料之中……apt 了 make 和 automake，开始 make，make 完提示说别忘了 make test，我就 make test……等他 test 完告诉我提交报告，那就提交报告吧……麻烦……提交完我就开始 sudo make install。安装完，试一下 cli 的 php，可以使用了。很兴奋的回到外面在浏览器输入 phpinfo 的页面，结果提示下载……</p>
<p>失败了……在网上又一整查找，看到一篇<a href="http://blog.sina.com.cn/s/blog_54ee3de50100btjv.html" target="_blank"> Ubuntu 下编译安装 5.2.8 的</a>，里面的编译参数看不懂 _-b 所以我就一个都没敢加……不过我觉得实在费解，为什么要编译安装 5.2.8 呢……5.2.8 似乎没什么新特性，而且 Ubuntu 自带的 PHP 5.2.6 是加了 Suhosin Patch 的，安全！最后找到 PHP 的<a href="http://cn2.php.net/manual/en/install.unix.apache2.php" target="_blank">官方文档</a>才明白，那个 &#8211;with-apxs2 是表示 Apache2 的……</p>
<p>用 find |grep &#8216;apxs&#8217; 发现我饿 apxs2 在 /usr/bin/apxs2，就又重新开始 configure 了。这次 configure 倒也顺利（因为改装的都装好了），本想也顺便 &#8211;with-mysql 个，结果发现 mysql 没装……而且装了还是不过，就干脆不要了。</p>
<p>configure 完成后，照例是 make、make test、sudo make install。这或许就像 Windows 里的下一步一样。不过在 Ubuntu 的 apt 下，连这个都省了，我也被惯懒了……</p>
<p>sudo make install 果然出错了，提示 httpd.conf 至少应该有一个 LoadModule。想起上面那篇编译 5.2.8 的里面也写了这些东西，遍在 httpd.conf 里面加入了</p>

<div class="wp_codebox"><table><tr id="p65768"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p657code68"><pre class="apache" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># Dummy LoadModule directive to aid module installations</span>
<span style="color: #adadad; font-style: italic;"># LoadModule dummy_module /usr/lib/apache2/modules/mod_dummy.so</span></pre></td></tr></table></div>

<p>竟然真的过了 _-b 电脑还真好骗……</p>
<p><img src="http://blog.upsuper.org/wp-content/uploads/2009/01/phpinfo_1233299380831-300x293.png" alt="phpinfo_1233299380831" title="phpinfo_1233299380831" width="300" height="293" class="alignright size-medium wp-image-658" />安装完成后，再次重启 apache2，打开浏览器，查看 phpinfo。终于出来了，我的 PHP 5.3！</p>
<p>真是辛苦……本来以为用了这么久 Ubuntu 对 Linux 还算有点了解了，经过这么一折腾，发现自己原来连门都还没入……</p>
<p>好吧，PHP 5.3 的测试就再说吧……今天就这样了……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/my-lab1-b-compile-and-install-php-53/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>我的 lab1（一）——Just enough 的 JeOS</title>
		<link>http://blog.upsuper.org/my-lab1-1-just-enough-of-jeos/</link>
		<comments>http://blog.upsuper.org/my-lab1-1-just-enough-of-jeos/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 15:17:53 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[JeOS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[虚拟机]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=655</guid>
		<description><![CDATA[为了想提早试验 PHP 5.3 （昨晚下了个 Alpha，今天发现变成 Beta 了……），我在 VMware 下建立了个实验室，因为据说 JeOS 是有为虚拟机优化的，所以用了 Ubuntu JeOS 8.04.1，取名叫 upsuper-lab1。

话说 VMware 6.5 还着实智能，识别出了 JeOS 的 iso 里面是 Ubuntu 8.04，不过可惜他智能过头了，自己弄了个安装程序准备介入，结果安装失败了……我把 VMware 额外加载的光驱干掉，再安一次就好了。
安装 JeOS 是文字界面（至少不是 LiveCD 那样的界面……），而且，Ubuntu 的文字界面安装有一大囧处，就是会检测 apt！JeOS 的安装确实两次卡在检测 apt 上……根据某次在学校安装 Alternate 的经验，赶快把网卡禁用掉，然后重新安装，所有不该有的东西成功跳过。
随后，系统启动进入 Ubuntu。我突然发现，这真是一个 Just enough 的系统，连图形界面都没有……囧……我第一个想法是，用 apt 弄一个 apache2 先。结果当我启动 apt 的时候，蓦然想起，网络还没弄好。如果在图形界面，肯定是瞬间就可以解决的问题（Ubuntu 有带些强大的网络管理程序），可是在文字界面……
幸好是在虚拟机，回到外面，在网上找到了网络配置的方法，用 vim 打开 /etc/network/interfaces，然后将其修改为

1
2
3
auto lo eth0
iface lo inet [...]]]></description>
			<content:encoded><![CDATA[<p>为了想提早试验 PHP 5.3 （昨晚下了个 Alpha，今天发现变成 Beta 了……），我在 VMware 下建立了个实验室，因为据说 JeOS 是有为虚拟机优化的，所以用了 Ubuntu JeOS 8.04.1，取名叫 upsuper-lab1。<br />
<span id="more-655"></span><br />
话说 VMware 6.5 还着实智能，识别出了 JeOS 的 iso 里面是 Ubuntu 8.04，不过可惜他智能过头了，自己弄了个安装程序准备介入，结果安装失败了……我把 VMware 额外加载的光驱干掉，再安一次就好了。</p>
<p>安装 JeOS 是文字界面（至少不是 LiveCD 那样的界面……），而且，Ubuntu 的文字界面安装有一大囧处，就是会检测 apt！JeOS 的安装确实两次卡在检测 apt 上……根据某次在学校安装 Alternate 的经验，赶快把网卡禁用掉，然后重新安装，所有不该有的东西成功跳过。</p>
<p>随后，系统启动进入 Ubuntu。我突然发现，这真是一个 Just enough 的系统，连图形界面都没有……囧……我第一个想法是，用 apt 弄一个 apache2 先。结果当我启动 apt 的时候，蓦然想起，网络还没弄好。如果在图形界面，肯定是瞬间就可以解决的问题（Ubuntu 有带些强大的网络管理程序），可是在文字界面……</p>
<p>幸好是在虚拟机，回到外面，在网上找到了<a href="http://www.blogjava.net/aoxj/archive/2008/04/18/194103.html" target="_blank">网络配置的方法</a>，用 vim 打开 /etc/network/interfaces，然后将其修改为</p>

<div class="wp_codebox"><table><tr id="p65572"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p655code72"><pre class="text" style="font-family:monospace;">auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp</pre></td></tr></table></div>

<p>最后</p>

<div class="wp_codebox"><table><tr id="p65573"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p655code73"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>networking restart</pre></td></tr></table></div>

<p>成功的找到了网络。接着就是 Ubuntu 都需要的配置过程——改 apt 源。</p>
<p>还是 vim 打开 /etc/apt/sources.list<br />
将里面 cn.achieve.ubuntu.com 全部改成 tw.achieve.ubuntu.com 或 mirror.lupaworld.com，保存。</p>
<p>终于可以用 apt 了，真是欣慰。</p>
<p>运行 apt 发现中文都是菱形？！又在网上查找了一翻，找到一篇<a href="http://www.linuxdiyf.com/viewarticle.php?id=79931" target="_blank">相关的文章</a>，修改了 /etc/default/locale 文件的相关内容，重启。</p>
<p>把 apache2 安装好了，并把 VMware 的网络设置从 NAT 设置为 Bridge，然后在主机的浏览器输入 IP 地址，看到了那个著名的 It works!</p>
<p>下面是 ftp 服务器。因为我在自己的机子上都没做过 ftp，所以自然是不知道怎么弄的。去网上先是看到一个传说中很好的 ftp 服务器，叫做 wu-ftp，结果弄了半天配置不出来，就放弃了。换了个叫 vsftp 的。网上资料似乎很多，就是没有能让我配置成功的。最后我只得找到他的 <a href="http://vsftpd.beasts.org/vsftpd_conf.html" target="_blank">Manpage</a>，按着里面的说法配置。配出来恐怕安全性不高，不过足够易用就好了……下面是我的配置文件：</p>

<div class="wp_codebox"><table><tr id="p65574"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code" id="p655code74"><pre class="text" style="font-family:monospace;">anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_upload_enable=YES
anon_world_readable_only=NO
anonymous_enable=YES
connect_from_port_20=YES
dirmessage_enable=YES
listen=YES
local_enable=YES
no_anon_password=YES
write_enable=YES
xferlog_enable=YES
xferlog_std_format=YES
accept_timeout=3600
connect_timeout=3600
file_open_mode=0777
anon_root=/var/www</pre></td></tr></table></div>

<p>匿名倒是没登上去，用我在 JeOS 里的用户名密码倒是登上去，而且可以直接查看整个文件系统（相关权限还在就是了）。</p>
<p>不管了，反正能用就行了，这是 lab 嘛……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/my-lab1-1-just-enough-of-jeos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决 MPlayer 的无法播放</title>
		<link>http://blog.upsuper.org/solution-to-the-mplayer-unable-to-play/</link>
		<comments>http://blog.upsuper.org/solution-to-the-mplayer-unable-to-play/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 11:33:39 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[动画]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=632</guid>
		<description><![CDATA[今天又是一个 rmvb 在 SMPlayer 不能播放，让我很无奈……因为实在无法忍受 RealPlayer 的画质和可操作性，就去寻找解决办法……
用 MPlayer 打开后，提示“error opening/initializing the selected video_out (-vo) device”，然后在 Ubuntu 论坛上发现一个帖子，根据二楼的说明，将 ~/.mplayer/gui.conf 文件中的 vo_driver 修改为 x11：

2
vo_driver = &#34;x11&#34;

再开就成功了！然后在播 CLANNAD 的第 8 集，也可以了！
RealPlayer，你可以走了~o(∩_∩)o&#8230;哈哈
]]></description>
			<content:encoded><![CDATA[<p>今天又是一个 rmvb 在 SMPlayer 不能播放，让我很无奈……因为实在无法忍受 RealPlayer 的画质和可操作性，就去寻找解决办法……</p>
<p>用 MPlayer 打开后，提示“error opening/initializing the selected video_out (-vo) device”，然后在 Ubuntu 论坛上发现一个<a href="http://ubuntuforums.org/showthread.php?t=20039" target="_blank">帖子</a>，根据二楼的说明，将 ~/.mplayer/gui.conf 文件中的 vo_driver 修改为 x11：</p>

<div class="wp_codebox"><table><tr id="p63276"><td class="line_numbers"><pre>2
</pre></td><td class="code" id="p632code76"><pre class="text" style="font-family:monospace;">vo_driver = &quot;x11&quot;</pre></td></tr></table></div>

<p>再开就成功了！然后在播 CLANNAD 的第 8 集，也可以了！</p>
<p>RealPlayer，你可以走了~o(∩_∩)o&#8230;哈哈</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/solution-to-the-mplayer-unable-to-play/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu 也调 CPU 频率</title>
		<link>http://blog.upsuper.org/ubuntu-also-tune-the-frequency-of-cpu/</link>
		<comments>http://blog.upsuper.org/ubuntu-also-tune-the-frequency-of-cpu/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 08:47:38 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[节能]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=625</guid>
		<description><![CDATA[其实问题是源自想解决 Wine 出的 eMule 及其 Mod 一旦一段时间不使用电脑，速度迅速下降的问题。虽然最终这个问题没解决……不过却弄出了另外一件事情，就是自动调节 CPU 频率。
Ubuntu 下自带了一个叫 powernowd 的东西，可以自动调节 CPU 频率到需要的水平，不过看起来本来我的系统并不知道如何调我的 CPU。我是 Intel Pentium D 的处理器，在网上查到使用powernowd为CPU降降温！这样一篇文章，但它列出的模块列表中并没有 PD CPU 的模块类型……我就直接载了 P4 的……

首先

1
sudo modprobe p4-clockmod

随后执行

1
sudo powernowd

提示我有两个 CPU 可以变频

1
2
3
4
powernowd: PowerNow Daemon v1.00, (c) 2003-2008 John Clemens
powernowd: Found 2 scalable units:  -- 1 'CPU' per scalable unit
powernowd:   cpu0: 333Mhz - 2666Mhz (8 steps)
powernowd: [...]]]></description>
			<content:encoded><![CDATA[<p>其实问题是源自想解决 Wine 出的 eMule 及其 Mod 一旦一段时间不使用电脑，速度迅速下降的问题。虽然最终这个问题没解决……不过却弄出了另外一件事情，就是自动调节 CPU 频率。</p>
<p>Ubuntu 下自带了一个叫 powernowd 的东西，可以自动调节 CPU 频率到需要的水平，不过看起来本来我的系统并不知道如何调我的 CPU。我是 Intel Pentium D 的处理器，在网上查到<a href="http://hi.baidu.com/pro711/blog/item/aa96c83530db161491ef3965.html" target="_blank">使用powernowd为CPU降降温！</a>这样一篇文章，但它列出的模块列表中并没有 PD CPU 的模块类型……我就直接载了 P4 的……<br />
<span id="more-625"></span><br />
首先</p>

<div class="wp_codebox"><table><tr id="p62581"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p625code81"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> modprobe p4-clockmod</pre></td></tr></table></div>

<p>随后执行</p>

<div class="wp_codebox"><table><tr id="p62582"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p625code82"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> powernowd</pre></td></tr></table></div>

<p>提示我有两个 CPU 可以变频</p>

<div class="wp_codebox"><table><tr id="p62583"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p625code83"><pre class="text" style="font-family:monospace;">powernowd: PowerNow Daemon v1.00, (c) 2003-2008 John Clemens
powernowd: Found 2 scalable units:  -- 1 'CPU' per scalable unit
powernowd:   cpu0: 333Mhz - 2666Mhz (8 steps)
powernowd:   cpu1: 333Mhz - 2666Mhz (8 steps)</pre></td></tr></table></div>

<p>在面板上添加了 CPU 频率监视，发现频率不断变化，说明 powernowd 启动成功了！</p>
<p>接着，在 /etc/modules 文件最后一行加入</p>

<div class="wp_codebox"><table><tr id="p62584"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p625code84"><pre class="text" style="font-family:monospace;">p4-clockmod</pre></td></tr></table></div>

<p>就可以开机自动调节了~</p>
<p>一起动自动调节，瞬间风扇的声音小了下来~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/ubuntu-also-tune-the-frequency-of-cpu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>VMware Workstation 6.5.1 in Ubuntu</title>
		<link>http://blog.upsuper.org/vmware-workstation-6-5-1-in-ubuntu/</link>
		<comments>http://blog.upsuper.org/vmware-workstation-6-5-1-in-ubuntu/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 00:34:27 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VeryCD]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[虚拟机]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=611</guid>
		<description><![CDATA[在升级 Ubuntu 8.10 之后，由于内核的更新，原来编译安装的 VMware 6.0 已经不能用了，也没有兴趣再 config 一次，想到 6.5 已经出了，就干脆用 vmware-uninstall.pl 卸了……但是网上一直找不到 VMware 6.5，连 VeryCD 上都没有……
今天又搜了一遍，发现 VMware 出了 6.5.1……最终到 VMware 的官方网站注册并下载了 VMware Workstation 6.5.1 for linux，准备发到 VeryCD 上去~
下载来的，是一个 .bundle 的文件，不知道怎么开，网上看到Ubuntu 下安装bundle文件。原来只要把 .bundle 文件的权限添加“可以以程序执行文件”，然后直接运行就可以了。
将其权限加好后，在 sudo 下执行，发现下面的错误：

Extracting VMware Installer&#8230;done.
Launching a SCIM daemon with Socket FrontEnd&#8230;
Loading simple Config module &#8230;
Creating backend &#8230;
Traceback (most recent call last):
  [...]]]></description>
			<content:encoded><![CDATA[<p>在升级 Ubuntu 8.10 之后，由于内核的更新，原来编译安装的 VMware 6.0 已经不能用了，也没有兴趣再 config 一次，想到 6.5 已经出了，就干脆用 vmware-uninstall.pl 卸了……但是网上一直找不到 VMware 6.5，连 VeryCD 上都没有……</p>
<p>今天又搜了一遍，发现 VMware 出了 6.5.1……最终到 VMware 的官方网站注册并下载了 VMware Workstation 6.5.1 for linux，准备发到 VeryCD 上去~</p>
<p>下载来的，是一个 .bundle 的文件，不知道怎么开，网上看到<a href="http://hi.baidu.com/leemuhe/blog/item/af67cb1b13c400fcae513305.html" target="_blank">Ubuntu 下安装bundle文件</a>。原来只要把 .bundle 文件的权限添加“可以以程序执行文件”，然后直接运行就可以了。</p>
<p>将其权限加好后，在 sudo 下执行，发现下面的错误：</p>
<blockquote><p>
Extracting VMware Installer&#8230;done.<br />
Launching a SCIM daemon with Socket FrontEnd&#8230;<br />
Loading simple Config module &#8230;<br />
Creating backend &#8230;<br />
Traceback (most recent call last):<br />
  File &#8220;/usr/share/scim-python/engine/__init__.py&#8221;, line 26, in <module><br />
    import scim<br />
ImportError: No module named scim<br />
ImportError: No module named engine<br />
/tmp/vmis.P26669/install/vmware-installer/vmware-installer: line 27: 26725 段错误               &#8220;$PYTHON&#8221; &#8220;$VMWARE_INSTALLER&#8221;/vmware-installer.py &#8220;$@&#8221;
</p></blockquote>
<p>不知道这是什么错误……我把 pkill 了 scim，没用，把 scim-python 文件夹重命名，还是没用……又是一番搜索，发现 Ubuntu 中文论坛上似乎有同样的问题：<a href="http://forum.ubuntu.org.cn/viewtopic.php?p=988933" target="_blank">安装VMware6.5错误，内附错误信息，请大家给我看看该怎么办。</a>根据下面一个人回复的提示，我将 /usr/share/scim-python/engine/__init__.py 文件中的 import scim 注释掉，可以正常安装。但去掉注释并没有像那人所说的依然可以安装。因此我将 import scim 的注释保留到安装完成。</p>
<p>安好后，就是注册的问题。因为 VMware 是可以先试用的，虽然 keygen 是 Windows 下的，我也 wine 不起来（好像以前可以……），于是就干脆先装了一个 Windows 在里面，然后在那里面跑 keygen，把注册码填进去。这实在不能不说是一种讽刺啊……</p>
<p>经过试用，这个版本相对原来的 6.0 在速度上有很大改进，对于我很关注的新加入的 Unity 原生窗口支持，倒是并没有期待中那么好。我主要是觉得有些地方还是不够方便，比如我的电脑等对于 Windows 很关键的东西在 Unity 中并没有出现，因此操作起来时不时还要切换回去。同时，Unity 的速度实在不敢恭维……特别是在 Compiz 下，类似迅雷那种有很多奇怪的窗口就比较累一点（因为那些提示性的“窗口”也要像普通窗口那样炫一下……）因此还是乖乖继续用原来的方式，期待 VMware 的继续改进……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/vmware-workstation-6-5-1-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu 下 Stellarium 星空之旅</title>
		<link>http://blog.upsuper.org/stellarium-star-tour-under-ubuntu/</link>
		<comments>http://blog.upsuper.org/stellarium-star-tour-under-ubuntu/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 05:13:00 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Compiz]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[开源软件]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=581</guid>
		<description><![CDATA[昨天安装了一个叫做 Stellarium 的 3D 星空模拟软件，相当不错，据说数据什么的都是根据天文台观测的真实数据，可以用来学习天文知识什么的……下次晚上拿他来对天上的星星~
安装还是比较简单的（开始我还跑到它官方网站去下源代码……结果发现 apt 可以安装……白下了……），直接用 apt-get：

1
sudo apt-get install stellarium

包有一点大……不过昨晚用 cn99 的源还是很快就下好了。
安装完有两个小小的问题，首先是文字的问题。因为自动识别为中文却不能显示……所有的中文都是框框……在红联上看到一篇文章介绍 Stellarium，并附了如何解决中文不能显示的问题。我就是用这篇文章的方法解决的，虽然它推荐用宋体，不过我更喜欢文泉驿正黑……

1
2
3
4
5
cd /usr/share/stellarium/data
sudo mv DejaVuSans.ttf DejaVuSans.ttf_backup
sudo mv DejaVuSansMono.ttf DejaVuSansMono.ttf_backup
sudo ln -sf /usr/share/fonts/truetype/wqy/wqy-zenhei.ttf DejaVuSans.ttf
sudo ln -sf /usr/share/fonts/truetype/wqy/wqy-zenhei.ttf DejaVuSansMono.ttf

打开 Stellarium，中文正常。
话说另外一种方法给大家参考一下，就是 Stellarium 官方 Wiki 上的如何在Stellarium中正确显示中文，我就不试了……前面那方法用得很好……
另一个问题就是开起来就不断闪烁的问题。我一下就猜到是 Compiz 的问题……禁用了 Compiz 再起动就不闪了……可是当我重新开启 Compiz 时发现原来设置全部没了……不好……在网上找了一下让 Stellarium 和　Compiz 并存的办法……找到了这么一帖，2楼给出了一个方法，6楼给出了个脚本。不过那个脚本似乎有一点点小小的问题，我改了一下，写在这里：

1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash
# gamestart.sh
# Usage: gamestart application
# turn compiz off for application
if &#91; `ps -A [...]]]></description>
			<content:encoded><![CDATA[<p>昨天安装了一个叫做 Stellarium 的 3D 星空模拟软件，相当不错，据说数据什么的都是根据天文台观测的真实数据，可以用来学习天文知识什么的……下次晚上拿他来对天上的星星~</p>
<p>安装还是比较简单的（开始我还跑到它<a href="http://www.stellarium.org/zh/" target="_blank">官方网站</a>去下源代码……结果发现 apt 可以安装……白下了……），直接用 apt-get：</p>

<div class="wp_codebox"><table><tr id="p58189"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p581code89"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> stellarium</pre></td></tr></table></div>

<p>包有一点大……不过昨晚用 <a href="http://ubuntu.cn99.com" target="_blank">cn99</a> 的源还是很快就下好了。</p>
<p>安装完有两个小小的问题，首先是文字的问题。因为自动识别为中文却不能显示……所有的中文都是框框……在红联上看到<a href="http://www.linuxdiyf.com/viewarticle.php?id=73537" target="_blank">一篇文章</a>介绍 Stellarium，并附了如何解决中文不能显示的问题。我就是用这篇文章的方法解决的，虽然它推荐用宋体，不过我更喜欢文泉驿正黑……</p>

<div class="wp_codebox"><table><tr id="p58190"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p581code90"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>stellarium<span style="color: #000000; font-weight: bold;">/</span>data
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> DejaVuSans.ttf DejaVuSans.ttf_backup
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> DejaVuSansMono.ttf DejaVuSansMono.ttf_backup
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>fonts<span style="color: #000000; font-weight: bold;">/</span>truetype<span style="color: #000000; font-weight: bold;">/</span>wqy<span style="color: #000000; font-weight: bold;">/</span>wqy-zenhei.ttf DejaVuSans.ttf
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>fonts<span style="color: #000000; font-weight: bold;">/</span>truetype<span style="color: #000000; font-weight: bold;">/</span>wqy<span style="color: #000000; font-weight: bold;">/</span>wqy-zenhei.ttf DejaVuSansMono.ttf</pre></td></tr></table></div>

<p>打开 Stellarium，中文正常。</p>
<p>话说另外一种方法给大家参考一下，就是 Stellarium 官方 Wiki 上的<a href="http://www.stellarium.org/wiki/index.php/%E5%A6%82%E4%BD%95%E5%9C%A8Stellarium%E4%B8%AD%E6%AD%A3%E7%A1%AE%E6%98%BE%E7%A4%BA%E4%B8%AD%E6%96%87" target="_blank">如何在Stellarium中正确显示中文</a>，我就不试了……前面那方法用得很好……</p>
<p>另一个问题就是开起来就不断闪烁的问题。我一下就猜到是 Compiz 的问题……禁用了 Compiz 再起动就不闪了……可是当我重新开启 Compiz 时发现原来设置全部没了……不好……在网上找了一下让 Stellarium 和　Compiz 并存的办法……找到了<a href="http://ubuntuforums.org/archive/index.php/t-518227.html" target="_blank">这么一帖</a>，2楼给出了一个方法，6楼给出了个脚本。不过那个脚本似乎有一点点小小的问题，我改了一下，写在这里：</p>

<div class="wp_codebox"><table><tr id="p58191"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p581code91"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># gamestart.sh</span>
<span style="color: #666666; font-style: italic;"># Usage: gamestart application</span>
<span style="color: #666666; font-style: italic;"># turn compiz off for application</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-A</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;compiz&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #660033;">-gt</span> <span style="color: #ff0000;">'0'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
metacity <span style="color: #660033;">--replace</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
<span style="color: #007800;">$1</span>
compiz <span style="color: #660033;">--replace</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #007800;">$1</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>把他保存到 /usr/bin/gamestart 文件里，然后设置一下属性：</p>

<div class="wp_codebox"><table><tr id="p58192"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p581code92"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gamestart</pre></td></tr></table></div>

<p>最后在菜单项里修改 Stellarium 的属性，改为 gamestart stellarium。</p>
<p>再启动，所有窗体闪烁了一下，Stellarium 成功正常无闪烁启动！一番遨游后，关掉 Stellarium，所有的窗体又闪烁了一下，Compiz 的效果都还在！高兴~</p>
<p>强烈推荐 Stellarium，很优秀的软件！开源界果然是优秀软件辈出的地方……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/stellarium-star-tour-under-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>解决 Mathematica 与 Composite 并存的问题</title>
		<link>http://blog.upsuper.org/solution-of-running-mathematica-with-composite/</link>
		<comments>http://blog.upsuper.org/solution-of-running-mathematica-with-composite/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 06:12:02 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Mathematica]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=574</guid>
		<description><![CDATA[为了运行 Mathematica，我在原来的一篇日志介绍过，要通过编辑 /etc/X11/xorg.conf 禁用 Composite。但是这样就没有任何效果了，Ubuntu 最华美的东西不能体现出来，有些可惜~但如果不禁用掉，Mathematica 开起来打任何字进去看起来都是一片空白……看着其他人的 Ubuntu 那么漂亮……我想，先恢复 Composite 试试？说不定可以了。
恢复后，打开 Mathematica，输入几个字符，没东西显示……还是那样……
不甘心……又经过在英文网站的查找，发现了这样一篇帖子（Ubuntu 论坛果然是个好地方）。里面介绍的方法是在运行 Mathematica 的时候在后面加上 -defaultvisual 参数。把 Composite 解禁后，我试了这个参数，果然 Mathematica 可以用了。可是新的问题又出现了，一下出来好几个没用的空白窗口。再看下面的回复，发现还要再调一个配置：进入 Mathematica，点击 Format 菜单里的 Options Inspector，在打开窗口最上面的下拉列表中选择 Global Preferences，在左边的列表中选择 Notebook Options 下的 Window Preferences，再在右边的框中找到 WindowFrame，把它设置为 Generic。这时，Mathematica 闪了一下，没用的窗口全部消失！
把 -defaultvisual 加入到我放在面板上的启动器中，再运行，除了启动的时候会闪过几个窗口，完全没有问题了！至此，我的 Mathematica 的问题完美解决了！Ubuntu 的华美效果也可以回来了~
体验了一下 3D 桌面~哈哈~
]]></description>
			<content:encoded><![CDATA[<p>为了运行 Mathematica，我在原来的<a href="http://blog.upsuper.org/ubuntu-trip-5-meet-mathematica-again/">一篇日志</a>介绍过，要通过编辑 /etc/X11/xorg.conf 禁用 Composite。但是这样就没有任何效果了，Ubuntu 最华美的东西不能体现出来，有些可惜~但如果不禁用掉，Mathematica 开起来打任何字进去看起来都是一片空白……看着其他人的 Ubuntu 那么漂亮……我想，先恢复 Composite 试试？说不定可以了。</p>
<p>恢复后，打开 Mathematica，输入几个字符，没东西显示……还是那样……</p>
<p>不甘心……又经过在英文网站的查找，发现了<a href="http://ph.ubuntuforums.com/showthread.php?p=4505437" target="_blank">这样一篇帖子</a>（Ubuntu 论坛果然是个好地方）。里面介绍的方法是在运行 Mathematica 的时候在后面加上 -defaultvisual 参数。把 Composite 解禁后，我试了这个参数，果然 Mathematica 可以用了。可是新的问题又出现了，一下出来好几个没用的空白窗口。再看下面的回复，发现还要再调一个配置：进入 Mathematica，点击 Format 菜单里的 Options Inspector，在打开窗口最上面的下拉列表中选择 Global Preferences，在左边的列表中选择 Notebook Options 下的 Window Preferences，再在右边的框中找到 WindowFrame，把它设置为 Generic。这时，Mathematica 闪了一下，没用的窗口全部消失！</p>
<p>把 -defaultvisual 加入到我放在面板上的启动器中，再运行，除了启动的时候会闪过几个窗口，完全没有问题了！至此，我的 Mathematica 的问题完美解决了！Ubuntu 的华美效果也可以回来了~</p>
<p>体验了一下 3D 桌面~哈哈~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/solution-of-running-mathematica-with-composite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu之旅（十）</title>
		<link>http://blog.upsuper.org/ubuntu-trip-10/</link>
		<comments>http://blog.upsuper.org/ubuntu-trip-10/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 02:49:48 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[音频]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=459</guid>
		<description><![CDATA[这次是隔了好久了，因为已经很好的融入了 Ubuntu，似乎没什么好写的了，不过还是有可以写的。

今天解决了两个小问题，一个是开机出现“Unable to set system clock”的问题，虽无大碍，不过总觉得看了不爽。在参考了 Ubuntu 论坛上的一个帖子，用 root 权限修改 /etc/init.d/hwclock.sh 文件：

31
HWCLOCKPARS=

改为：

31
HWCLOCKPARS=--directisa

就解决了。
另一个是在使用了 Blubuntu 主题后，每次用命令行启动什么 GTK 程序的时候都会出现：

1
/usr/share/themes/Blubuntu/gtk-2.0/gtkrc:169: Clearlooks configuration option &#34;progressbarstyle&#34; is not supported and will be ignored.

在网上查找了一下，发现一种方法，就是编辑 /usr/share/themes/Blubuntu/gtk-2.0/gtkrc 文件

167
engine &#34;clearlooks&#34;

改为

167
engine &#34;ubuntulooks&#34;

看过去是没有问题了。但是很快问题就出现了！
我运行 Firefox，发现进度条变了！我不是很喜欢那种进度条风格，因此最后决定将第 167 行注释掉……反正本来是被忽略的，注释掉也无所谓。重启 Firefox，进度条恢复。
另外就是我的藏歌，最近开始大规模的整为 aac 的格式，也稍微说一下吧。
这次的转换应该说是相当严格的，基本上都是采用无损音源（APE 或 FLAC）。对于整个的 APE 和 FLAC，我采取的方法是 shntool 分割，再用音频魔方转换，至于单个的就直接转咯……然后就是 Tag，应为 EasyTag 很会死……莫名其妙的……就换了 Ex Falso 好像是可以用 apt 安装的，这个软件也很好用，就不详述了，仅作推荐。不过还要说的是，这个软件仍然是不支持 .aac 扩展名，看起来 .m4a [...]]]></description>
			<content:encoded><![CDATA[<p>这次是隔了好久了，因为已经很好的融入了 Ubuntu，似乎没什么好写的了，不过还是有可以写的。<br />
<span id="more-459"></span><br />
今天解决了两个小问题，一个是开机出现“Unable to set system clock”的问题，虽无大碍，不过总觉得看了不爽。在参考了 <a href="http://ubuntuforums.org/showthread.php?t=594031" target="_blank">Ubuntu 论坛上的一个帖子</a>，用 root 权限修改 /etc/init.d/hwclock.sh 文件：</p>

<div class="wp_codebox"><table><tr id="p45999"><td class="line_numbers"><pre>31
</pre></td><td class="code" id="p459code99"><pre class="sh" style="font-family:monospace;">HWCLOCKPARS=</pre></td></tr></table></div>

<p>改为：</p>

<div class="wp_codebox"><table><tr id="p459100"><td class="line_numbers"><pre>31
</pre></td><td class="code" id="p459code100"><pre class="sh" style="font-family:monospace;">HWCLOCKPARS=--directisa</pre></td></tr></table></div>

<p>就解决了。</p>
<p>另一个是在使用了 Blubuntu 主题后，每次用命令行启动什么 GTK 程序的时候都会出现：</p>

<div class="wp_codebox"><table><tr id="p459101"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p459code101"><pre class="text" style="font-family:monospace;">/usr/share/themes/Blubuntu/gtk-2.0/gtkrc:169: Clearlooks configuration option &quot;progressbarstyle&quot; is not supported and will be ignored.</pre></td></tr></table></div>

<p>在网上查找了一下，发现一种方法，就是编辑 /usr/share/themes/Blubuntu/gtk-2.0/gtkrc 文件</p>

<div class="wp_codebox"><table><tr id="p459102"><td class="line_numbers"><pre>167
</pre></td><td class="code" id="p459code102"><pre class="text" style="font-family:monospace;">engine &quot;clearlooks&quot;</pre></td></tr></table></div>

<p>改为</p>

<div class="wp_codebox"><table><tr id="p459103"><td class="line_numbers"><pre>167
</pre></td><td class="code" id="p459code103"><pre class="text" style="font-family:monospace;">engine &quot;ubuntulooks&quot;</pre></td></tr></table></div>

<p>看过去是没有问题了。但是很快问题就出现了！</p>
<p>我运行 Firefox，发现进度条变了！我不是很喜欢那种进度条风格，因此最后决定将第 167 行注释掉……反正本来是被忽略的，注释掉也无所谓。重启 Firefox，进度条恢复。</p>
<p>另外就是我的藏歌，最近开始大规模的整为 aac 的格式，也稍微说一下吧。</p>
<p>这次的转换应该说是相当严格的，基本上都是采用无损音源（APE 或 FLAC）。对于整个的 APE 和 FLAC，我采取的方法是 shntool 分割，再用音频魔方转换，至于单个的就直接转咯……然后就是 Tag，应为 EasyTag 很会死……莫名其妙的……就换了 Ex Falso 好像是可以用 apt 安装的，这个软件也很好用，就不详述了，仅作推荐。不过还要说的是，这个软件仍然是不支持 .aac 扩展名，看起来 .m4a 才是王道……</p>
<p>因为又解决一个小问题，所以过来补充一下。今天转一个 APE 的时候 shntool 提示：</p>

<div class="wp_codebox"><table><tr id="p459104"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p459code104"><pre class="text" style="font-family:monospace;">shntool [split]: error: value not in bytes, m:ss, m:ss.ff, or m:ss.nnn format: []</pre></td></tr></table></div>

<p>不知道怎么回事，搜索到一个<a href="http://forum.ubuntu.org.cn/viewtopic.php?t=97695" target="_blank">同样的问题</a>没有人解答（后来我去解答了……），又发现一个 <a href="http://iwool.wordpress.com/2008/05/21/convert-ape-to-flac-and-split-by-cue-on-ubuntu-804/" target="_blank">Wordpress.com 里的博客</a>，里面说，如果遇到这种情况，检查你的 cue，建议在第一行加上 REM。我在 cue 的第一行加入了一个 REM DATE 2004，再用 shntool 就可以了 _-b 怎么会有这种要求……</p>
<p>再加一个……今天又遇到一个同样错误的，结果是去掉了第一行的 REM DATE 2004 就可以了……看来以后 REM 行可增增减减试试看……最后感叹一下……shntool 这是什么软件啊！！！</p>
<p>另外就是 tor 的速度慢得惊人……同样在那个博客里看到了一个软件 JAP……很好很强大……这软件速度极快，稍微推荐一下，比 tor 快多了……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/ubuntu-trip-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu下实战切割ape</title>
		<link>http://blog.upsuper.org/actual-combat-spliting-ape-under-ubuntu/</link>
		<comments>http://blog.upsuper.org/actual-combat-spliting-ape-under-ubuntu/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 00:48:56 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[音频]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=283</guid>
		<description><![CDATA[虽然其实并不难，不过还是想写一写，以备以后忘记掉……
这个其实我从昨晚就开始研究了，不过没研究出个所以然来。不过知道了一件事，那就是如何用 Audacious 播放带 cue 的 ape。似乎要把首选项里音频下的格式检测里的两项全部去掉，而且我根据惯例把 cue 转成了 UTF-8 的。

今天早上找到了这么一篇文章：ubuntu 下基本命令行方式刻录 ape 和 flac 全记录。文章的最后提到切割的方法：

1
cuebreakpoints -i cue CDImage.cue&#124;shnsplit CDImage.ape

我先是试了一下，马上提示没有安装 cuetools，至于 shnsplit，我昨晚就安装好了 shntool，所以没有提示吧。这些都是可以通过 apt 直接安装的，这里也不多说了。安装好以后，再执行，提示：

1
2
3
4
5
6
shnsplit: warning: failed to read data from input file using format: [ape]
shnsplit:          + you may not have permission to read file: [CDImage.ape]
shnsplit:  [...]]]></description>
			<content:encoded><![CDATA[<p>虽然其实并不难，不过还是想写一写，以备以后忘记掉……</p>
<p>这个其实我从昨晚就开始研究了，不过没研究出个所以然来。不过知道了一件事，那就是如何用 Audacious 播放带 cue 的 ape。似乎要把首选项里音频下的格式检测里的两项全部去掉，而且我根据惯例把 cue 转成了 UTF-8 的。<br />
<span id="more-283"></span><br />
今天早上找到了这么一篇文章：<a href="http://hi.baidu.com/tomshi/blog/item/365d09fa9cbef19758ee9052.html" target="_blank">ubuntu 下基本命令行方式刻录 ape 和 flac 全记录</a>。文章的最后提到切割的方法：</p>

<div class="wp_codebox"><table><tr id="p283108"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p283code108"><pre class="bash" style="font-family:monospace;">cuebreakpoints <span style="color: #660033;">-i</span> cue CDImage.cue<span style="color: #000000; font-weight: bold;">|</span>shnsplit CDImage.ape</pre></td></tr></table></div>

<p>我先是试了一下，马上提示没有安装 cuetools，至于 shnsplit，我昨晚就安装好了 shntool，所以没有提示吧。这些都是可以通过 apt 直接安装的，这里也不多说了。安装好以后，再执行，提示：</p>

<div class="wp_codebox"><table><tr id="p283109"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p283code109"><pre class="text" style="font-family:monospace;">shnsplit: warning: failed to read data from input file using format: [ape]
shnsplit:          + you may not have permission to read file: [CDImage.ape]
shnsplit:          + arguments may be incorrect for decoder: [mac]
shnsplit:          + verify that the decoder is installed and in your PATH
shnsplit:          + this file may be unsupported, truncated or corrupt
shnsplit: error: cannot continue due to error(s) shown above</pre></td></tr></table></div>

<p>怎么这么麻烦……又去找那个解码器，试了半天才发现源上根本没有那些玩意……最后在 Ubuntu 中文论坛上的一个帖子里发现了几个解码器：<a href="http://forum.ubuntu.org.cn/viewtopic.php?t=19211">[分享] monkeys-audio package</a>。下载下三个解码器后，要先安装 libmac2 和  libmac-dev 最后安装 monkeys-audio，不然好像依赖关系不能满足。这个安装就很简单了咯，直接双击就可以了。</p>
<p>接下去终于可以用上面的命令分割了，只不过分割成的文件都是形如 split-track??.wav 的样子，又是不带标签的 wav，看得我很不爽……因为这意味着我要一个一个加标签改文件名！</p>
<p>不过不小心又在<a href="http://hi.baidu.com/onleadzzwen/blog/item/437960d5593cf9c051da4b80.html" target="_blank">这个帖子</a>看到了一种方法，很高兴，就把刚才生成的 wav 全部被我删掉了。</p>
<p>现在好了，只要用下面这个命令：</p>

<div class="wp_codebox"><table><tr id="p283110"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p283code110"><pre class="bash" style="font-family:monospace;">shntool <span style="color: #c20cb9; font-weight: bold;">split</span> <span style="color: #660033;">-f</span> CDImage.cue <span style="color: #660033;">-t</span> <span style="color: #ff0000;">'%n.%t'</span> <span style="color: #660033;">-o</span> wav CDImage.ape</pre></td></tr></table></div>

<p>就可以直接把分割后的文件按照 cue 中的轨道信息写文件名了！原文中 -o 后面是 flac，不过我反正最后要转成 aac，而 shntool 又不支持 aac，干脆转成 wav，一会儿用 audio-convert-mod 转的时候还不用解码。稍微注意一下，因为我一开始用的就是 UTF-8 的 cue，如果遇到奇怪的问题可以先试试把 cue 转成 UTF-8 的，因为网络上的貌似大多是 GB2313 的。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/actual-combat-spliting-ape-under-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu之旅（九）</title>
		<link>http://blog.upsuper.org/ubuntu-trip-9/</link>
		<comments>http://blog.upsuper.org/ubuntu-trip-9/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 15:03:40 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[AAC]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[正则表达式]]></category>
		<category><![CDATA[音乐]]></category>
		<category><![CDATA[音频]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=197</guid>
		<description><![CDATA[很久没继续，因为前一段时间迷恋 CLANNAD + 信息组培训……
话说这次因为要收新歌，所以研究了一下 Ubuntu 下的音频相关，发现了一个不错的小工具 Audio-convert-mod 音频魔方，安装有一点不同，参见上一篇日志。
安装好以后发现我不得不放弃以前收集时采用的 wma 格式，因为 Linux 下似乎很难找到转为 wma 的方法（虽然最后还是被我找到了，见此处，不过不想采用），而且经过网上一番查找对比，最终选定了 AAC 格式作为新一批的收录标准格式。AAC 的优点我在这里就不多阐述了，反正好像 wma 和 mp3 和它是没得比的，唯独就是 mpc 需要考量。
完成了标准格式的选定，我还需要符合我收藏标准的标签和文件命名方式。标签方面，用 Audacious 不能修改 AAC 的标签，而传说中强大的 Kid3 修改后，就不能播放了……今天下午刚刚发现一个很好的软件 EasyTAG （可直接用 apt 安装），声称支持 AAC。不过弄了半天一直不能现实出 .aac 的文件。开始以为是没有安装依赖的 libmp4v2，不过安装了还是没有。在官方的手册上看了一会儿，突然发现那里面只提到用 mpeg4ip 以兼容 mp4！！！我把扩展名改为 .mp4，EasyTAG 可以找到了，修改后重命名回去也可以正常播放。成功了哈~

最后是关于命名的问题。我的命名一向是“轨道编号-歌曲名”的方式命名的，但是网上下载的歌曲却多是“轨道编号.歌曲名”的。以前在 Windows 下用一个叫做拖把更名器的东西，还是很好用的。于是就在想 Linux 下有没有这样的东西呢？经过查找，发现了 rename 这个命令。这个命令支持 Perl 的正则表达式，因此功能变得十分强大，比如我的问题只要

1
rename 's/(\d{2})\.(.*)/$1\-$2/' *

就可以了。其中

1
s/(\d{2})\.(.*)/$1\-$2/

就是 Perl 的正则表达式，具体的使用方法可以参看Perl正则表达式详解，不过要特别注意的是，rename 推荐使用“$1”、“$2”这样的形式代替“\1”、“\2”，这似乎和 [...]]]></description>
			<content:encoded><![CDATA[<p>很久没继续，因为前一段时间迷恋 CLANNAD + 信息组培训……</p>
<p>话说这次因为要收新歌，所以研究了一下 Ubuntu 下的音频相关，发现了一个不错的小工具 Audio-convert-mod 音频魔方，安装有一点不同，参见<a href="http://blog.upsuper.org/installation-of-audio-convert-mod/">上一篇日志</a>。</p>
<p>安装好以后发现我不得不放弃以前收集时采用的 wma 格式，因为 Linux 下似乎很难找到转为 wma 的方法（虽然最后还是被我找到了，见<a href="http://semson.blogspot.com/2008/05/linux-audoi-wma.html" target="_blank">此处</a>，不过不想采用），而且经过网上一番查找对比，最终选定了 AAC 格式作为新一批的收录标准格式。AAC 的优点我在这里就不多阐述了，反正好像 wma 和 mp3 和它是没得比的，唯独就是 mpc 需要考量。</p>
<p>完成了标准格式的选定，我还需要符合我收藏标准的标签和文件命名方式。标签方面，用 Audacious 不能修改 AAC 的标签，而传说中强大的 Kid3 修改后，就不能播放了……今天下午刚刚发现一个很好的软件 EasyTAG （可直接用 apt 安装），声称支持 AAC。不过弄了半天一直不能现实出 .aac 的文件。开始以为是没有安装依赖的 libmp4v2，不过安装了还是没有。在官方的手册上看了一会儿，突然发现那里面只提到用 mpeg4ip 以兼容 mp4！！！我把扩展名改为 .mp4，EasyTAG 可以找到了，修改后重命名回去也可以正常播放。成功了哈~<br />
<span id="more-197"></span><br />
最后是关于命名的问题。我的命名一向是“轨道编号-歌曲名”的方式命名的，但是网上下载的歌曲却多是“轨道编号.歌曲名”的。以前在 Windows 下用一个叫做拖把更名器的东西，还是很好用的。于是就在想 Linux 下有没有这样的东西呢？经过查找，发现了 rename 这个命令。这个命令支持 Perl 的正则表达式，因此功能变得十分强大，比如我的问题只要</p>

<div class="wp_codebox"><table><tr id="p197113"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p197code113"><pre class="bash" style="font-family:monospace;">rename <span style="color: #ff0000;">'s/(\d{2})\.(.*)/$1\-$2/'</span> <span style="color: #000000; font-weight: bold;">*</span></pre></td></tr></table></div>

<p>就可以了。其中</p>

<div class="wp_codebox"><table><tr id="p197114"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p197code114"><pre class="regular" style="font-family:monospace;">s/(\d{2})\.(.*)/$1\-$2/</pre></td></tr></table></div>

<p>就是 Perl 的正则表达式，具体的使用方法可以参看<a href="http://blog.csdn.net/dreamnear/archive/2007/11/08/1872965.aspx" target="_blank">Perl正则表达式详解</a>，不过要特别注意的是，rename 推荐使用“$1”、“$2”这样的形式代替“\1”、“\2”，这似乎和 Perl 不大一样？</p>
<p>后面的 * 就是尝试对每一个文件重命名咯，很简单的。不过正则表达式可能要学一点时间，另外推荐我看的正则表达式的教程：<a href="http://unibetter.com/deerchao/zhengzhe-biaodashi-jiaocheng-se.htm" target="_blank">正则表达式30分钟入门教程</a>，写得比较不错，虽然和 Perl 的有些许不同，不过大同小异，学学也无妨。况且这个写得比较容易入门的说~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/ubuntu-trip-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>安装Audio-convert-mod</title>
		<link>http://blog.upsuper.org/installation-of-audio-convert-mod/</link>
		<comments>http://blog.upsuper.org/installation-of-audio-convert-mod/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 14:30:06 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[音乐]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=158</guid>
		<description><![CDATA[今天下了 CLANNAD 的原声碟，想要转换格式进入我的音乐收藏。因为废掉了 Windows，在 Ubuntu 下也需要找一个好的转换软件代替。在网上查找了一番，发现一个很方便的东西 Audio-convert-mod，不过安装它不是那么一帆风顺的。
首先，从官方网站下载了源码包，因为没有提供 deb 包……然后解压后，在里面运行

1
2
3
sudo ./configure --prefix=/usr
sudo make
sudo make install

安装完成（我本来是没有用 sudo 和那个 &#8211;prefix 参数的，结果怎么弄都弄不清楚）。
在 bash 中执行 audio-convert-mod 提示：

1
python: can't open file '/usr/share/local/share/audio-convert-mod/acm-runapp.pyw': [Errno 2] No such file or directory

经过调查，发现 acm-runapp.pyw 出现在 /usr/share/audio-convert-mod 里，而根本不存在 /usr/share/local 这个目录……于是我就突发奇想，把 /usr 链接到 /usr/share/local 上，结果就可以了：

1
sudo ln -s /usr /usr/share/local

唉……有些东西还真是麻烦……
]]></description>
			<content:encoded><![CDATA[<p>今天下了 CLANNAD 的原声碟，想要转换格式进入我的音乐收藏。因为废掉了 Windows，在 Ubuntu 下也需要找一个好的转换软件代替。在网上查找了一番，发现一个很方便的东西 Audio-convert-mod，不过安装它不是那么一帆风顺的。</p>
<p>首先，从<a href="http://www.diffingo.com/content/view/13/47/lang,en/" target="_blank">官方网站</a>下载了源码包，因为没有提供 deb 包……然后解压后，在里面运行</p>

<div class="wp_codebox"><table><tr id="p158118"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p158code118"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>安装完成（我本来是没有用 sudo 和那个 &#8211;prefix 参数的，结果怎么弄都弄不清楚）。</p>
<p>在 bash 中执行 audio-convert-mod 提示：</p>

<div class="wp_codebox"><table><tr id="p158119"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p158code119"><pre class="text" style="font-family:monospace;">python: can't open file '/usr/share/local/share/audio-convert-mod/acm-runapp.pyw': [Errno 2] No such file or directory</pre></td></tr></table></div>

<p>经过调查，发现 acm-runapp.pyw 出现在 /usr/share/audio-convert-mod 里，而根本不存在 /usr/share/local 这个目录……于是我就突发奇想，把 /usr 链接到 /usr/share/local 上，结果就可以了：</p>

<div class="wp_codebox"><table><tr id="p158120"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p158code120"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span></pre></td></tr></table></div>

<p>唉……有些东西还真是麻烦……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/installation-of-audio-convert-mod/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>解决aMule不起动的问题</title>
		<link>http://blog.upsuper.org/solve-the-problem-that-cannot-run-amule/</link>
		<comments>http://blog.upsuper.org/solve-the-problem-that-cannot-run-amule/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 12:37:09 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[下载]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=127</guid>
		<description><![CDATA[今天想继续昨天昨天用 aMule 下载的东西（话说昨天下载的速度好快，可以和迅雷媲美了！），结果运行不起来！用终端输入“amule”提示

Initialising aMule
Checking if there is an instance already running&#8230;
There is an instance of aMule already running
Raising current running instance.

但是无论是系统监视器还是 ps 都找不到 aMule 已经运行的影子……在网上发现一篇和我经历类似的帖子，其中的 6 楼介绍说，aMule 有使用自己的锁文件（lock file），只要删掉就可以了。这个锁文件是“~/.aMule/muleLock”，如果遇到这样的情况只要直接删除这个文件就可以了！
]]></description>
			<content:encoded><![CDATA[<p>今天想继续昨天昨天用 aMule 下载的东西（话说昨天下载的速度好快，可以和迅雷媲美了！），结果运行不起来！用终端输入“amule”提示</p>
<blockquote><p>
Initialising aMule<br />
Checking if there is an instance already running&#8230;<br />
There is an instance of aMule already running<br />
Raising current running instance.
</p></blockquote>
<p>但是无论是系统监视器还是 ps 都找不到 aMule 已经运行的影子……在网上发现一篇<a href="http://ubuntuforums.org/showthread.php?t=257081" target="_blank">和我经历类似的帖子</a>，其中的 6 楼介绍说，aMule 有使用自己的锁文件（lock file），只要删掉就可以了。这个锁文件是“~/.aMule/muleLock”，如果遇到这样的情况只要直接删除这个文件就可以了！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/solve-the-problem-that-cannot-run-amule/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu之旅（八）——Hello World! Hello Anjuta!</title>
		<link>http://blog.upsuper.org/ubuntu-trip-8-hello-world-hello-anjuta/</link>
		<comments>http://blog.upsuper.org/ubuntu-trip-8-hello-world-hello-anjuta/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 04:58:31 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[Anjuta]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=125</guid>
		<description><![CDATA[昨天完成了 ujudger-base 0.1 的编写，今天就开始有点想试试写一个有界面的测评程序了！首选当然 Anjuta。
按照原来在 Windows 下的习惯，一个不错的 IDE 应该生成一个可以正常编译执行的空的工程，我想 Anjuta 应该也能做到。创建了一个 GTKmm 的 C++ 工程后果然出现一个蛮完整的空工程，只不过“生成”菜单中只有“Run Autogenerate”和“Execute Program&#8230;”两个是亮着的。我点击“Execute Program&#8230;”，说找不到程序……点击“Run Autogenerate”，保留空参数，开始执行。
第一次 Autogenerate 失败，提示找不到 intltool 和 libtool，于是我用 apt-get 很快的安好了这两个东西，再试一次。第二次 Autogenerate 还是失败，提示找不到 gtkmm-2.4 和 libglademm-2.4 ……又用 apt-get 安转了 gtkmm-2.4-* 和 libglademm-2.4-* ，终于能成功 Autogenerate 了！
然后“生成工程”，点击“Execute Program&#8230;”。出现了！终于出现了一个窗口！Hello World！


]]></description>
			<content:encoded><![CDATA[<p>昨天完成了 ujudger-base 0.1 的编写，今天就开始有点想试试写一个有界面的测评程序了！首选当然 Anjuta。</p>
<p>按照原来在 Windows 下的习惯，一个不错的 IDE 应该生成一个可以正常编译执行的空的工程，我想 Anjuta 应该也能做到。创建了一个 GTKmm 的 C++ 工程后果然出现一个蛮完整的空工程，只不过“生成”菜单中只有“Run Autogenerate”和“Execute Program&#8230;”两个是亮着的。我点击“Execute Program&#8230;”，说找不到程序……点击“Run Autogenerate”，保留空参数，开始执行。</p>
<p>第一次 Autogenerate 失败，提示找不到 intltool 和 libtool，于是我用 apt-get 很快的安好了这两个东西，再试一次。第二次 Autogenerate 还是失败，提示找不到 gtkmm-2.4 和 libglademm-2.4 ……又用 apt-get 安转了 gtkmm-2.4-* 和 libglademm-2.4-* ，终于能成功 Autogenerate 了！</p>
<p>然后“生成工程”，点击“Execute Program&#8230;”。出现了！终于出现了一个窗口！Hello World！<br />
<span id="more-125"></span><br />
<a href='http://blog.upsuper.org/wp-content/uploads/2008/06/screenshot-hello-world.png'><img src="http://blog.upsuper.org/wp-content/uploads/2008/06/screenshot-hello-world.png" alt="" title="screenshot-hello-world" width="500" height="421" class="alignnone size-full wp-image-126" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/ubuntu-trip-8-hello-world-hello-anjuta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ujudger-base 0.1 Released</title>
		<link>http://blog.upsuper.org/ujudger-base-0-1-released/</link>
		<comments>http://blog.upsuper.org/ujudger-base-0-1-released/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 14:45:21 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[我的计划]]></category>
		<category><![CDATA[C/C++/C#]]></category>
		<category><![CDATA[GPL]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ujudger]]></category>
		<category><![CDATA[源代码]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=122</guid>
		<description><![CDATA[经过我许多的资料查找和编写，终于完成了ujudger-base的第一个版本！
ujudger 是我准备编写的基于 Linux 的测评程序，采用 GPL 协议。由于一直以来找不到 Linux 下的测评程序，因此准备自己写一个。ujudger 的 u 既是取我网名的第一个字母，也是 ubuntu 的第一个字母，表示这个程序应该会在 ubuntu 下完成编写。而 ujudger-base 是 ujudger 的基础程序，表现 ujudger 的测评核心，即耗时和内存耗用的取得。使用 time 命令和系统监视器监视器的资料对比一下，ujudger-base 获得的信息还是比较体现程序的真实情况的。

ujudger-base 并不复杂，不过也不简单（自少我这么觉得）。在编写的过程中，开始不知道 Linux 下的进程控制，后来知道了 fork() 函数。开始觉得很奇怪，后来也就慢慢明白了。不就是返回两次么，有什么了不起的~然后就是exec族的函数，成功了就不返回了_-b
然后就是等待的办法。网上有些人是直接用 wait4 快速返回来等待，但我觉得这样很影响速度，因此采用了 usleep 等待 100ms（有没有一点像 Cena 的方法？）。
同时，我还查找了有关程序运行数据读取的相关问题，最后采用的是读取 /proc/&#60;pid&#62;/stat 文件的方法。具体采用的一些技术层的资料我准备明天发一篇来讲。
除此之外就是几乎第一次大规模的采用 C++ 的推荐风格编写程序（以前写OI的程序，为了效率不得不放弃许多 C++ 优美的特性），因此有写丑的地方也请多多指教。
里面的注释很多了，由于我的英语水平有限（My English is limited!），如果注释有什么语法错误，也请多多指教！
点击这里下载源代码：ujudger-base-0.1.cpp (3.6 KB)
]]></description>
			<content:encoded><![CDATA[<p>经过我许多的资料查找和编写，终于完成了ujudger-base的第一个版本！</p>
<p>ujudger 是我准备编写的基于 Linux 的测评程序，采用 GPL 协议。由于一直以来找不到 Linux 下的测评程序，因此准备自己写一个。ujudger 的 u 既是取我网名的第一个字母，也是 ubuntu 的第一个字母，表示这个程序应该会在 ubuntu 下完成编写。而 ujudger-base 是 ujudger 的基础程序，表现 ujudger 的测评核心，即耗时和内存耗用的取得。使用 time 命令和系统监视器监视器的资料对比一下，ujudger-base 获得的信息还是比较体现程序的真实情况的。<br />
<span id="more-122"></span><br />
ujudger-base 并不复杂，不过也不简单（自少我这么觉得）。在编写的过程中，开始不知道 Linux 下的进程控制，后来知道了 fork() 函数。开始觉得很奇怪，后来也就慢慢明白了。不就是返回两次么，有什么了不起的~然后就是exec族的函数，成功了就不返回了_-b</p>
<p>然后就是等待的办法。网上有些人是直接用 wait4 快速返回来等待，但我觉得这样很影响速度，因此采用了 usleep 等待 100ms（有没有一点像 Cena 的方法？）。</p>
<p>同时，我还查找了有关程序运行数据读取的相关问题，最后采用的是读取 /proc/&lt;pid&gt;/stat 文件的方法。具体采用的一些技术层的资料我准备明天发一篇来讲。</p>
<p>除此之外就是几乎第一次大规模的采用 C++ 的推荐风格编写程序（以前写OI的程序，为了效率不得不放弃许多 C++ 优美的特性），因此有写丑的地方也请多多指教。</p>
<p>里面的注释很多了，由于我的英语水平有限（My English is limited!），如果注释有什么语法错误，也请多多指教！</p>
<p>点击这里下载源代码：<a href="http://ujudger.upsuper.org/src/ujudger-base-0.1.cpp">ujudger-base-0.1.cpp</a> (3.6 KB)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/ujudger-base-0-1-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu之旅（七）——LaTeX归来</title>
		<link>http://blog.upsuper.org/ubuntu-trip-7-latex-return/</link>
		<comments>http://blog.upsuper.org/ubuntu-trip-7-latex-return/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 04:12:03 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[探究学习]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[TexLive]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=119</guid>
		<description><![CDATA[今天最主要的成绩就是终于把LaTeX环境给弄好了！主要参考了这些资料：TeXLive 2007 CJK Chinese Howto、TeXLive 2007中文配置指南 #18，似乎是同一个人的，很厉害的说！

原来是想依赖apt-get的，但是看到要下载大达500MB+的文件，而且最近源的速度似乎很慢，下了几个包就放弃了。想起原来看到过的TexLive光盘，可以下载来看看。因为知道那个也有900MB+大，就开VMware到Windows下开迅雷下（Wine下的迅雷我始终不能正常使用，不知何故）。开始的时候下的也很慢，不过后来不知什么时候突然蹿到1MB+/s，下了大约半个小时就下完了，比起源里面那个一会儿告诉我半小时一会儿告诉我17小时要好多了……
下载后解压，然后

1
2
3
4
sudo mkdir /media/texlive
sudo mount -o loop texlive2007-live-20070212.iso /media/texlive
cd /media/texlive
sudo ./install-tl

然后按I开始安装。安装过程是全自动化的，不需要动什么，不过在安装的过程中可以预先做下一步。
为了使之能正常使用，需要编辑/etc/environment，在PATH的最前面加上“/usr/local/texlive/2007/bin/i386-linux:”，我的改完以后看起来像这样：

1
PATH=&#34;/usr/local/texlive/2007/bin/i386-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games&#34;

现在重启一下。
重启后试了一下已经好的LaTeX环境：

1
2
3
4
\documentclass{article}
\begin{document}
	Hello World!
\end{document}


1
pdflatex test.tex

可以看到那些熟悉的文件，特别是那个PDF。打开看，“Hello World!”
接下来来中文支持。
看到先人们说那篇“Howto”的方法太慢，又查到了一个快的方法，就是用mkfont脚本。需要的话可以点击这里下载：mkfont.tar.gz (96.83 KB)
解压后把需要的字体文件逐个拷贝到mkfont所在文件夹，然后执行mkfont。具体的我以楷体为例：

1
time ./mkfont.sh simkai.ttf simkai kai

前面那个time是用来计时的，我看了一下，在我的机上，一个字体大概需要用2分半左右生成。
另外就是宋体，宋体必须要用Windows 98所带的宋体，不然不支持。如果手头有Windows 98的安装盘可以找到很多cab的那个目录，执行：

1
cabextract -F simsun.ttf cab目录/Win98_58.cab

即可获得可用的宋体。如果实在没有，可以点击这里下载：simsun.ttf.7z (4.8 MB)
接下来与楷体一样的，执行

1
time ./mkfont.sh simsun.ttf simsun song

同样的方法我还转换了黑体和仿宋。
最后找到主文件夹下有一个“texmf”文件夹，将里面的东西拷贝到“~/.texlive2007/texmf-var”文件夹下即可。
下面来测试一下各个字体：

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK*}{UTF8}{song}
你好!
\end{CJK*}
\begin{CJK*}{UTF8}{kai}
你好!
\end{CJK*}
\begin{CJK*}{UTF8}{hei}
你好!
\end{CJK*}
\begin{CJK*}{UTF8}{fang}
你好!
\end{CJK*}
\end{document}

成功了！而且还可以正常复制中文，在Windows下也可以正常查看！
]]></description>
			<content:encoded><![CDATA[<p>今天最主要的成绩就是终于把LaTeX环境给弄好了！主要参考了这些资料：<a href="http://mailboxpublic.googlepages.com/texlive2007cjkchinesehowto" target="_blank">TeXLive 2007 CJK Chinese Howto</a>、<a href="http://bbs.ctex.org/viewthread.php?tid=38043&#038;page=2#pid288649" target="_blank">TeXLive 2007中文配置指南 #18</a>，似乎是同一个人的，很厉害的说！</p>
<p><span id="more-119"></span></p>
<p>原来是想依赖apt-get的，但是看到要下载大达500MB+的文件，而且最近源的速度似乎很慢，下了几个包就放弃了。想起原来看到过的TexLive光盘，可以下载来看看。因为知道那个也有900MB+大，就开VMware到Windows下开迅雷下（Wine下的迅雷我始终不能正常使用，不知何故）。开始的时候下的也很慢，不过后来不知什么时候突然蹿到1MB+/s，下了大约半个小时就下完了，比起源里面那个一会儿告诉我半小时一会儿告诉我17小时要好多了……</p>
<p>下载后解压，然后</p>

<div class="wp_codebox"><table><tr id="p119129"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p119code129"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>texlive
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> loop texlive2007-live-<span style="color: #000000;">20070212</span>.iso <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>texlive
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>texlive
<span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>install-tl</pre></td></tr></table></div>

<p>然后按I开始安装。安装过程是全自动化的，不需要动什么，不过在安装的过程中可以预先做下一步。</p>
<p>为了使之能正常使用，需要编辑/etc/environment，在PATH的最前面加上“/usr/local/texlive/2007/bin/i386-linux:”，我的改完以后看起来像这样：</p>

<div class="wp_codebox"><table><tr id="p119130"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p119code130"><pre class="text" style="font-family:monospace;">PATH=&quot;/usr/local/texlive/2007/bin/i386-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games&quot;</pre></td></tr></table></div>

<p>现在重启一下。</p>
<p>重启后试了一下已经好的LaTeX环境：</p>

<div class="wp_codebox"><table><tr id="p119131"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p119code131"><pre class="latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><span style="color: #800000;">documentclass</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">article</span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span>
	Hello World!
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span></pre></td></tr></table></div>


<div class="wp_codebox"><table><tr id="p119132"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p119code132"><pre class="bash" style="font-family:monospace;">pdflatex test.tex</pre></td></tr></table></div>

<p>可以看到那些熟悉的文件，特别是那个PDF。打开看，“Hello World!”</p>
<p>接下来来中文支持。</p>
<p>看到先人们说那篇“Howto”的方法太慢，又查到了一个快的方法，就是用mkfont脚本。需要的话可以点击这里下载：<a href="http://down.upsuper.org/mkfont.tar.gz">mkfont.tar.gz</a> (96.83 KB)</p>
<p>解压后把需要的字体文件逐个拷贝到mkfont所在文件夹，然后执行mkfont。具体的我以楷体为例：</p>

<div class="wp_codebox"><table><tr id="p119133"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p119code133"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">time</span> .<span style="color: #000000; font-weight: bold;">/</span>mkfont.sh simkai.ttf simkai kai</pre></td></tr></table></div>

<p>前面那个time是用来计时的，我看了一下，在我的机上，一个字体大概需要用2分半左右生成。</p>
<p>另外就是宋体，宋体必须要用Windows 98所带的宋体，不然不支持。如果手头有Windows 98的安装盘可以找到很多cab的那个目录，执行：</p>

<div class="wp_codebox"><table><tr id="p119134"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p119code134"><pre class="bash" style="font-family:monospace;">cabextract <span style="color: #660033;">-F</span> simsun.ttf cab目录<span style="color: #000000; font-weight: bold;">/</span>Win98_58.cab</pre></td></tr></table></div>

<p>即可获得可用的宋体。如果实在没有，可以点击这里下载：<a href="http://down.upsuper.org/simsun.ttf.7z">simsun.ttf.7z</a> (4.8 MB)</p>
<p>接下来与楷体一样的，执行</p>

<div class="wp_codebox"><table><tr id="p119135"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p119code135"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">time</span> .<span style="color: #000000; font-weight: bold;">/</span>mkfont.sh simsun.ttf simsun song</pre></td></tr></table></div>

<p>同样的方法我还转换了黑体和仿宋。</p>
<p>最后找到主文件夹下有一个“texmf”文件夹，将里面的东西拷贝到“~/.texlive2007/texmf-var”文件夹下即可。</p>
<p>下面来测试一下各个字体：</p>

<div class="wp_codebox"><table><tr id="p119136"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p119code136"><pre class="latex" style="font-family:monospace;"><span style="color: #E02020; ">\</span><span style="color: #800000;">documentclass</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">article</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">CJKutf8</span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">CJK*</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">UTF8</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">song</span><span style="color: #E02020; ">}</span>
你好!
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">CJK*</span></span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">CJK*</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">UTF8</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">kai</span><span style="color: #E02020; ">}</span>
你好!
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">CJK*</span></span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">CJK*</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">UTF8</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">hei</span><span style="color: #E02020; ">}</span>
你好!
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">CJK*</span></span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">CJK*</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">UTF8</span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">fang</span><span style="color: #E02020; ">}</span>
你好!
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">CJK*</span></span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span></pre></td></tr></table></div>

<p>成功了！而且还可以正常复制中文，在Windows下也可以正常查看！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/ubuntu-trip-7-latex-return/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
