<?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>Tommy's Blog &#187; Linux</title>
	<atom:link href="http://tommy.net.cn/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://tommy.net.cn</link>
	<description>Tommy 的自留地</description>
	<lastBuildDate>Mon, 27 Dec 2010 08:57:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>QNAP TS-219P 设置 3322 动态域名</title>
		<link>http://tommy.net.cn/2010/12/24/setup-3322-ddns-for-qnap-ts-219p/</link>
		<comments>http://tommy.net.cn/2010/12/24/setup-3322-ddns-for-qnap-ts-219p/#comments</comments>
		<pubDate>Fri, 24 Dec 2010 08:50:30 +0000</pubDate>
		<dc:creator>Tommy</dc:creator>
				<category><![CDATA[互联网络]]></category>
		<category><![CDATA[操作系统]]></category>
		<category><![CDATA[3322]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[DDNS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[NAS]]></category>
		<category><![CDATA[QNAP]]></category>
		<category><![CDATA[TS-219P]]></category>

		<guid isPermaLink="false">http://tommy.net.cn/?p=279</guid>
		<description><![CDATA[背景 虽然 QNAP TS-219P 本身自带有 3322 的 DDNS 功能，不过在使用的过程中，发现经常出现更新 IP 出错的情况。查看它的使用机制，是先获取外网 IP，将外网 IP 与之前保存的外网 IP 进行比较，如果两者不同则更新 DDNS，否则，不做任何操作。 而在使用过程中，偶尔会出现，检测外网 IP 不同，并申请更新 DDNS 的情况。在更新失败的情况，QNAP 还是会保存新的外网 IP，这就导致到，3322 的 DDNS 在下次更换 IP 之前不会被更新。由于平时写程序，很多代码都放在 QNAP 的服务器上，不能访问的话，着实很郁闷！！！所以需要找一种不用 QNAP 自带方式，但是可以更新 IP 的办法。 解决办法 1) 挂载启动盘符到 /tmp/config mount -t ext2 /dev/mtdblock5 /tmp/config 2) 创建启动盘上的 autorun.sh 文件 touch /tmp/config/autorun.sh 3) 将文件的内容修改为如下： #!/bin/sh /share/HDA_DATA/.qpkg/autorun.sh 4) [...]]]></description>
			<content:encoded><![CDATA[<h2>背景</h2>
<p>虽然 <a href="http://www.qnap.com/" target="_blank">QNAP</a> <a href="http://www.qnap.com/pro_detail_feature.asp?p_id=122" target="_blank">TS-219P</a> 本身自带有 <a href="http://www.3322.org/" target="_blank">3322</a> 的 <a href="http://en.wikipedia.org/wiki/Dynamic_DNS" target="_blank">DDNS</a> 功能，不过在使用的过程中，发现经常出现更新 IP 出错的情况。查看它的使用机制，是先获取外网 IP，将外网 IP 与之前保存的外网 IP 进行比较，如果两者不同则更新 DDNS，否则，不做任何操作。</p>
<p>而在使用过程中，偶尔会出现，检测外网 IP 不同，并申请更新 DDNS 的情况。在更新失败的情况，QNAP 还是会保存新的外网 IP，这就导致到，3322 的 DDNS 在下次更换 IP 之前不会被更新。由于平时写程序，很多代码都放在 QNAP 的服务器上，不能访问的话，着实很郁闷！！！所以需要找一种不用 QNAP 自带方式，但是可以更新 IP 的办法。</p>
<h2>解决办法</h2>
<p>1) 挂载启动盘符到 /tmp/config</p>
<blockquote><p>mount -t ext2 /dev/mtdblock5 /tmp/config</p></blockquote>
<p>2) 创建启动盘上的 autorun.sh 文件</p>
<blockquote><p>touch /tmp/config/autorun.sh</p></blockquote>
<p>3) 将文件的内容修改为如下：</p>
<blockquote><p>#!/bin/sh<br />
/share/HDA_DATA/.qpkg/autorun.sh</p></blockquote>
<p>4) 保存文件，并设置可执行权限</p>
<blockquote><p>chmod +x /tmp/config/autorun.sh</p></blockquote>
<p>5) 在 /share/HDA_DATA/.qpkg/ 路径下创建 autorun.sh 文件</p>
<blockquote><p>/share/HDA_DATA/.qpkg/autorun.sh</p></blockquote>
<p>6) 设置可执行属性</p>
<blockquote><p>chmod +x /share/HDA_DATA/.qpkg/autorun.sh</p></blockquote>
<p>7) 修改 /share/HDA_DATA/.qpkg/autorun.sh 文件，添加我们需要的计划任务</p>
<blockquote><p>#!/bin/sh<br />
tmpfile=/tmp/crontab.tmp<br />
crontab -l | grep -vi “wget” &gt; $tmpfile<br />
echo “*/10 * * * * /usr/bin/wget -c -O /dev/null http://username:password@www.3322.org/dyndns/update?hostname=username.3322.org” &gt;&gt; $tmpfile<br />
crontab $tmpfile<br />
rm $tmpfile<br />
/etc/init.d/crond.sh restart</p></blockquote>
<p>8) 重新启动设备，执行如下命令查看设置是否生效</p>
<blockquote><p>crontab -l</p></blockquote>
<h2>参考资料</h2>
<p><a href="http://wiki.qnap.com/wiki/Autorun.sh" target="_blank">http://wiki.qnap.com/wiki/Autorun.sh</a><br />
<a href="http://wiki.qnap.com/wiki/Add_items_to_crontab" target="_blank"> http://wiki.qnap.com/wiki/Add_items_to_crontab</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tommy.net.cn/2010/12/24/setup-3322-ddns-for-qnap-ts-219p/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>体验腾讯 Linux QQ</title>
		<link>http://tommy.net.cn/2009/03/02/tencent-linux-qq/</link>
		<comments>http://tommy.net.cn/2009/03/02/tencent-linux-qq/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 15:10:06 +0000</pubDate>
		<dc:creator>Tommy</dc:creator>
				<category><![CDATA[互联网络]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[QQ]]></category>
		<category><![CDATA[Tencent]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://tommy.net.cn/?p=99</guid>
		<description><![CDATA[最近在网上看了很多关于 MacOS X Leopard 的资料，看得有点心血来潮，有点想装 MacOS 的冲动。不过冲动归冲动，看完了以后发现，要想安装 MacOS X Leopard 还真有点麻烦，因为驱动着实是一个大问题，而且貌似 Intel 3945ABG 现在还无解，得更换无线网卡才行。但还是不死心，每天乐此不疲的翻看如何安装 MacOS 的资料，结果又发现了很多关于一台机安装 Vista + Ubuntu + Leopard 的教程。于是乎，又跑去翻看 Ubuntu 的资料，结果在搜索的时候，发现了 Linux QQ。没想到 Tencent 现在竟然真的推出 Linux 版本的 QQ 了。 话说当年，大家都鄙视 Tencent 为什么不出一个 Linux 下面的版本，现在终于有了。赶紧试用了一下，感觉还是很不错的。基本的聊天通信功能都有了，个人和群组也都支持。不过一些高级的功能还不完善，不过总的来说还是很好的。现在这个版本，跟 TM 比较类似，希望能尽快增加一下群共享，备注这些功能。 附：安装步骤 去腾讯的官方网站，下载最新的 Linux QQ 1.0 Beta1。因为我自己用的是 Ubuntu 8.10，所以，下载了一个 DEB 的软件包。 下载完成后，双击运行，按照提示安装。 在菜单中选择互联网，腾讯QQ 是的，现在在 Ubuntu 下用QQ就是这么简单。赶紧把 MacOS [...]]]></description>
			<content:encoded><![CDATA[<p>最近在网上看了很多关于 <a href="http://zh.wikipedia.org/wiki/Mac_OS_X_v10.5" target="_blank">MacOS X Leopard</a> 的资料，看得有点心血来潮，有点想装 MacOS 的冲动。不过冲动归冲动，看完了以后发现，要想安装 MacOS X Leopard 还真有点麻烦，因为驱动着实是一个大问题，而且貌似 Intel 3945ABG 现在还无解，得更换无线网卡才行。但还是不死心，每天乐此不疲的翻看如何安装 MacOS 的资料，结果又发现了很多关于一台机安装 Vista + Ubuntu + Leopard 的<a href="http://tianyi.it168.com/thread-532391-1-2.html" target="_blank">教程</a>。于是乎，又跑去翻看 Ubuntu 的资料，结果在搜索的时候，发现了 Linux QQ。没想到 Tencent 现在竟然真的推出 Linux 版本的 QQ 了。</p>
<p>话说当年，大家都鄙视 Tencent 为什么不出一个 Linux 下面的版本，现在终于有了。赶紧试用了一下，感觉还是很不错的。基本的聊天通信功能都有了，个人和群组也都支持。不过一些高级的功能还不完善，不过总的来说还是很好的。现在这个版本，跟 TM 比较类似，希望能尽快增加一下群共享，备注这些功能。</p>
<p>附：安装步骤</p>
<ol>
<li>去<a href="http://im.qq.com/qq/linux/ " target="_blank">腾讯的官方网站</a>，下载最新的 <a href="http://im.qq.com/qq/linux/download.shtml" target="_blank">Linux QQ 1.0 Beta1</a>。因为我自己用的是 Ubuntu 8.10，所以，下载了一个 <a href="http://dl_dir.qq.com/linuxqq/linuxqq_v1.0.2-beta1_i386.deb" target="_self">DEB 的软件包</a>。</li>
<li>下载完成后，双击运行，按照提示安装。</li>
<li>在菜单中选择互联网，腾讯QQ</li>
</ol>
<p>是的，现在在 Ubuntu 下用QQ就是这么简单。赶紧把 MacOS X Leopard 弄好，就可以体验一下 Mac QQ 了。：）</p>
]]></content:encoded>
			<wfw:commentRss>http://tommy.net.cn/2009/03/02/tencent-linux-qq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>将 YoMax 移植到 Linux 平台</title>
		<link>http://tommy.net.cn/2008/08/20/porting-yomax-to-linux-platform/</link>
		<comments>http://tommy.net.cn/2008/08/20/porting-yomax-to-linux-platform/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 08:55:11 +0000</pubDate>
		<dc:creator>Tommy</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[DJMax]]></category>
		<category><![CDATA[Hardy]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Porting]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[YoMax]]></category>

		<guid isPermaLink="false">http://tommy.net.cn/?p=36</guid>
		<description><![CDATA[今天把 YoMax 移植到 Linux 平台了，还算顺利，一切都进行的不错。感觉很好，很开心。在 Linux 下面跑的速度很快，效果很好。 其中有几个地方修改了一下： 1）_strnicmp，在 Linux 的标准 C 库里面没有这个函数，用 strncasecmp 替换就可以了 2）_mkdir，同样，Linux 下的 C 库也没有这个函数，需要使用 mkdir。需要用到头文件 &#60;sys/stat.h&#62;，而且还要设置权限，跟 Windows 平台下不大一样。详细的使用说明，可以参考 GNU C Library 手册中创建目录部分的内容。 3）还有就是简单的类型定义之类的细节不同了，以及 main 入口函数的声明不大一样 具体的参数和环境： Windows 平台 Windows XP with Service Pack 3 Visual Studio 2005 with Service Pack 1 Linux 平台 Ubuntu 8.04.1 (Hardy Heron) with 2.6.24-19-generic g++ [...]]]></description>
			<content:encoded><![CDATA[<p>今天把 YoMax 移植到 Linux 平台了，还算顺利，一切都进行的不错。感觉很好，很开心。在 Linux 下面跑的速度很快，效果很好。</p>
<p>其中有几个地方修改了一下：</p>
<p>1）_strnicmp，在 Linux 的标准 C 库里面没有这个函数，用 strncasecmp 替换就可以了</p>
<p>2）_mkdir，同样，Linux 下的 C 库也没有这个函数，需要使用 mkdir。需要用到头文件 &lt;sys/stat.h&gt;，而且还要设置权限，跟 Windows 平台下不大一样。详细的使用说明，可以参考 <a title="The GNU C Library" href="http://www.gnu.org/software/libc/manual/" target="_blank">GNU C Library 手册</a>中<a title="Creating Directories" href="http://www.gnu.org/software/libc/manual/html_node/Creating-Directories.html" target="_blank">创建目录</a>部分的内容。</p>
<p>3）还有就是简单的类型定义之类的细节不同了，以及 main 入口函数的声明不大一样</p>
<p>具体的参数和环境：</p>
<ul>
<li>Windows 平台</li>
</ul>
<ol>
<li>
<ul>
<li>Windows XP with Service Pack 3</li>
<li>Visual Studio 2005 with Service Pack 1</li>
</ul>
</li>
</ol>
<ul>
<li>Linux 平台</li>
</ul>
<ol>
<li>
<ul>
<li>Ubuntu 8.04.1 (Hardy Heron) with 2.6.24-19-generic</li>
<li>g++ v4.2.3 (Ubuntu 4.2.3-2ubuntu7)</li>
</ul>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://tommy.net.cn/2008/08/20/porting-yomax-to-linux-platform/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>将 GBK 编码的 MP3 标签转换为 UNICODE</title>
		<link>http://tommy.net.cn/2008/08/18/convert-gbk-encoded-mp3-id3-tags-to-unicode/</link>
		<comments>http://tommy.net.cn/2008/08/18/convert-gbk-encoded-mp3-id3-tags-to-unicode/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 08:19:23 +0000</pubDate>
		<dc:creator>Tommy</dc:creator>
				<category><![CDATA[媒体应用]]></category>
		<category><![CDATA[GBK]]></category>
		<category><![CDATA[Hardy]]></category>
		<category><![CDATA[ID3 Tag]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MP3]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Unicode]]></category>

		<guid isPermaLink="false">http://tommy.net.cn/?p=33</guid>
		<description><![CDATA[因为在 Linux 下，大部分处理 MP3 的程序，都是用了 libid3tag 来处理 MP3 文件的 ID3 标签的。而因为安装的系统的问题，大部分人都会使用 UTF-8 编码。这样就导致到 GB2312/GB18030/GBK 编码的 MP3 文件在 Linux 下显示都是乱码。如果文件不多的话，手动修改也没有什么大碍，但是有鉴于本人比较懒，所以再次请出 Google，上网搜索解决方案。 经过一番搜索之后，找到了周枫的个人主页，以及他网站上公布的一个叫做 ID3iconv 的小工具。使用这个小工具，可以进行 ID3 编码的转换。需要注意的是，这个程序是用 Java 编写的。所以我们还需要安装一个 Java Runtime： sudo apt-get install sun-java6-jre 安装完成后可以用如下命令来运行该程序： java -jar id3iconv-0.2.1.jar 这里我们使用 -e 和 -remove1 两个参数，其中 -e 用来指定原始的编码格式，-removev1 用来移除 v1 版本的标签： java -jar id3iconv-0.2.1.jar -e gbk -removev1 *.mp3 如果连子目录内的文件也需要转换的话，使用如下命令： [...]]]></description>
			<content:encoded><![CDATA[<p>因为在 Linux 下，大部分处理 MP3 的程序，都是用了 libid3tag 来处理 MP3 文件的 ID3 标签的。而因为安装的系统的问题，大部分人都会使用 UTF-8 编码。这样就导致到 GB2312/GB18030/GBK 编码的 MP3 文件在 Linux 下显示都是乱码。如果文件不多的话，手动修改也没有什么大碍，但是有鉴于本人比较懒，所以再次请出 Google，上网搜索解决方案。</p>
<p>经过一番搜索之后，找到了<a title="周枫的主页" href="http://www.zhoufeng.net/" target="_blank">周枫的个人主页</a>，以及他网站上公布的一个叫做 <a title="ID3iconv" href="http://www.zhoufeng.net/eng/id3iconv/" target="_blank">ID3iconv</a> 的小工具。使用这个小工具，可以进行 ID3 编码的转换。需要注意的是，这个程序是用 Java 编写的。所以我们还需要安装一个 Java Runtime：</p>
<p><code>sudo apt-get install sun-java6-jre</code></p>
<p>安装完成后可以用如下命令来运行该程序：</p>
<p><code>java -jar id3iconv-0.2.1.jar</code></p>
<p>这里我们使用 -e 和 -remove1 两个参数，其中 -e 用来指定原始的编码格式，-removev1 用来移除 v1 版本的标签：</p>
<p><code>java -jar id3iconv-0.2.1.jar -e gbk -removev1 *.mp3</code></p>
<p>如果连子目录内的文件也需要转换的话，使用如下命令：</p>
<p><code>find . -iname "*.mp3" -execdir java -jar id3iconv-0.2.1.jar -e gbk -removev1 {} \;</code></p>
<p>这个转换工作在 Ubuntu Hardy 8.04 上测试通过。</p>
]]></content:encoded>
			<wfw:commentRss>http://tommy.net.cn/2008/08/18/convert-gbk-encoded-mp3-id3-tags-to-unicode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

