<?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>Cai Feng's Blog &#187; Linux</title>
	<atom:link href="http://blog.caifeng.me/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.caifeng.me</link>
	<description>Paw trace ...</description>
	<lastBuildDate>Tue, 19 Oct 2010 16:53:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>&#8220;Resource temporarily unavailable&#8221; on the whm host</title>
		<link>http://blog.caifeng.me/2009/04/04/resource-temporarily-unavailable-on-the-whm-host/</link>
		<comments>http://blog.caifeng.me/2009/04/04/resource-temporarily-unavailable-on-the-whm-host/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 18:30:29 +0000</pubDate>
		<dc:creator>ljpsfree</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.caifeng.me/blog/?p=58</guid>
		<description><![CDATA[Today, following a document to tune the security of our whm hosting, I enabled &#8220;Shell fork bomb protection&#8221; in &#8220;Security Center&#8221;. But I&#8217;m 100% sure what I did. Then when I try to run the apache process of the user, the exception &#8220;bash: fork Resource temporarily unavailable&#8221; raised. It took me a lot of time [...]]]></description>
			<content:encoded><![CDATA[<p>Today, following a document to tune the security of our whm hosting, I enabled &#8220;Shell fork bomb protection&#8221; in &#8220;Security Center&#8221;. But I&#8217;m 100% sure what I did. Then when I try to run the apache process of the user, the exception &#8220;bash: fork Resource temporarily unavailable&#8221; raised. It took me a lot of time to find why this happen. Finally I got this document: http://www.eddieoneverything.com/linux/linux-whm-cpanel-resource-temporarily-unavailable.php</p>
<p>It&#8217;s because &#8220;Shell fork bomb protection&#8221; will enable the limitation for each user, the limitation is defined with ulimit command. The default limitation is 100 open files with 20 processes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.caifeng.me/2009/04/04/resource-temporarily-unavailable-on-the-whm-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>分析日志常用到的几个shell工具</title>
		<link>http://blog.caifeng.me/2009/03/31/%e5%88%86%e6%9e%90%e6%97%a5%e5%bf%97%e5%b8%b8%e7%94%a8%e5%88%b0%e7%9a%84%e5%87%a0%e4%b8%aashell%e5%b7%a5%e5%85%b7/</link>
		<comments>http://blog.caifeng.me/2009/03/31/%e5%88%86%e6%9e%90%e6%97%a5%e5%bf%97%e5%b8%b8%e7%94%a8%e5%88%b0%e7%9a%84%e5%87%a0%e4%b8%aashell%e5%b7%a5%e5%85%b7/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 03:03:40 +0000</pubDate>
		<dc:creator>ljpsfree</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.caifeng.me/blog/2009/03/31/%e5%88%86%e6%9e%90%e6%97%a5%e5%bf%97%e5%b8%b8%e7%94%a8%e5%88%b0%e7%9a%84%e5%87%a0%e4%b8%aashell%e5%b7%a5%e5%85%b7/</guid>
		<description><![CDATA[一个不错的例子: http://nunojob.wordpress.com/2008/04/12/history-awk-print-2-sort-uniq-c-sort-rn-head/

httpd.log &#124; awk '{print $2}' \  &#124; sort &#124; uniq -c &#124; sort -rn &#124; head

解释:
httpd.log : 要分析的日志
awk : 用来取出某一特定的列。简单的也可以用cut来代替
sort : 用来排序(第一次排序是用来为后面的uniq服务的。uniq对于没有排序的内容工作不正确)
uniq : 用来uniq有序的内容，-c参数会把重复次数带上
sort -rn : 用来安重复次数倒序排列
head : 用来去前几条数据，默认是10.
]]></description>
			<content:encoded><![CDATA[<p>一个不错的例子: http://nunojob.wordpress.com/2008/04/12/history-awk-print-2-sort-uniq-c-sort-rn-head/</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">httpd.log <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span> \  <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">uniq</span> <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-rn</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">head</span></pre></div></div>

<p>解释:<br />
httpd.log : 要分析的日志<br />
awk : 用来取出某一特定的列。简单的也可以用cut来代替<br />
sort : 用来排序(第一次排序是用来为后面的uniq服务的。uniq对于没有排序的内容工作不正确)<br />
uniq : 用来uniq有序的内容，-c参数会把重复次数带上<br />
sort -rn : 用来安重复次数倒序排列<br />
head : 用来去前几条数据，默认是10.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.caifeng.me/2009/03/31/%e5%88%86%e6%9e%90%e6%97%a5%e5%bf%97%e5%b8%b8%e7%94%a8%e5%88%b0%e7%9a%84%e5%87%a0%e4%b8%aashell%e5%b7%a5%e5%85%b7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convert MP3 Id3 tag encoding</title>
		<link>http://blog.caifeng.me/2009/03/12/convert-mp3-id3-tag-encoding/</link>
		<comments>http://blog.caifeng.me/2009/03/12/convert-mp3-id3-tag-encoding/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 07:41:12 +0000</pubDate>
		<dc:creator>ljpsfree</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[id3]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.caifeng.me/blog/?p=43</guid>
		<description><![CDATA[It&#8217;s a long time pain for my mp3 files. I tried a lot of kinds way to convert my mp3 files&#8217; id3 tag encoding. But every time when I need to convert the tag, I can&#8217;t remembered what I did last time. Now I&#8217;m going to record some way to do this.
I used amarok. Since [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a long time pain for my mp3 files. I tried a lot of kinds way to convert my mp3 files&#8217; id3 tag encoding. But every time when I need to convert the tag, I can&#8217;t remembered what I did last time. Now I&#8217;m going to record some way to do this.</p>
<p>I used amarok. Since the developers os amarok hate to deal with various kinds of encoding, they determined to use unicode which required id3v2.4 tag. This decision makes a lot of Chinese music displayed like a mess in the amarok because most of Chinese music used old version, different encode id3 tags.</p>
<p>I found some good ways to convert your music id3 tags here: <a href="http://wiki.linuxmce.org/index.php/Converting_MP3_Tags_To_UTF-8">http://wiki.linuxmce.org/index.php/Converting_MP3_Tags_To_UTF-8</a></p>
<p>The most way I like is mid3iconv</p>
<p>I used it like this:</p>
<p>For a single file</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">$mid3iconv</span> <span style="color: #660033;">-e</span> gb2312 a.mp3 <span style="color: #660033;">--remove-v1</span> <span style="color: #660033;">-dp</span></pre></div></div>

<p>For a directory</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">$find</span> . <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.mp3&quot;</span> <span style="color: #660033;">-exec</span> mid3iconv <span style="color: #660033;">-e</span> gb2312 <span style="color: #660033;">--remove-v1</span> <span style="color: #660033;">-dp</span> <span style="color: #ff0000;">&quot;{}&quot;</span> \;</pre></div></div>

</pre>
<p>-p option means dry-run, so if you really want to convert, remove this option.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.caifeng.me/2009/03/12/convert-mp3-id3-tag-encoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

