<?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>haojii &#187; Unix/Linux</title>
	<atom:link href="http://www.haojii.com/category/unix-linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.haojii.com</link>
	<description>一个专注于技术的IT男</description>
	<lastBuildDate>Thu, 19 Apr 2012 07:58:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>MacOS下安装wget</title>
		<link>http://www.haojii.com/2010/11/how-to-install-wget-under-mac-os/</link>
		<comments>http://www.haojii.com/2010/11/how-to-install-wget-under-mac-os/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 09:56:03 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[杂项]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=444</guid>
		<description><![CDATA[Mac下的应用程序默认在/Application目录下，且看上去都是以.app结尾的目录，里面有一个binary可执行文件 所有感觉和一般的Linux系统有点不一样，若遵循一般的Linux软件安装流程，有点没有把握的。 实践证明通常的Linux安装软件的方法在此其实也是可以安装成功的： 1. 在gnu下载wget的最新版本压缩包 http://ftp.gnu.org/gnu/wget/ 2. $ cd wget-1.12 3. $ configure 4. $ make all 5. $ sudo make install 6. $ which wget /usr/local/bin/wget 新接触MacOS的人估计和我一样会发现/usr/local/bin之前差不多是空目录，感觉不像Linux原本就存在不少可执行文件，成功之后觉得不是那么理所当然，有点怪怪的感觉。。。 还有一种办法是通过DarwinPorts来安装，这是个类似于ubuntu的包管理器，貌似很容易的样子，目前还么强烈的需求要尝试这玩意。<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1" color="#FF0000" style="display: block !important; padding: 20px 0 5px !important;">其他文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F09%2Fa-terminal-style-on-mac%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F11%2Fhow-to-install-wget-under-mac-os%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">调节一下Mac下的Terminal配置，省点眼神</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F01%2Fplay-tomcat-cluster-in-macos%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F11%2Fhow-to-install-wget-under-mac-os%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">MacOS下玩tomcat cluster有点折腾啊</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F06%2Finstall-nodejs-express-on-virtual-linux%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F11%2Fhow-to-install-wget-under-mac-os%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">Linux虚拟机下安装nodejs+express</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fubuntu-mplayer-install-problem%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F11%2Fhow-to-install-wget-under-mac-os%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">ubuntu安装mplayer遇到的一些问题及解决办法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Mac下的应用程序默认在/Application目录下，且看上去都是以.app结尾的目录，里面有一个binary可执行文件</p>
<p>所有感觉和一般的Linux系统有点不一样，若遵循一般的Linux软件安装流程，有点没有把握的。</p>
<p>实践证明通常的Linux安装软件的方法在此其实也是可以安装成功的：</p>
<p>1. 在gnu下载wget的最新版本压缩包 http://ftp.gnu.org/gnu/wget/</p>
<p>2. $ cd wget-1.12</p>
<p>3. $ configure</p>
<p>4. $ make all</p>
<p>5. $ sudo make install</p>
<p>6. $ which wget</p>
<p>/usr/local/bin/wget</p>
<div></div>
<div>新接触MacOS的人估计和我一样会发现/usr/local/bin之前差不多是空目录，感觉不像Linux原本就存在不少可执行文件，成功之后觉得不是那么理所当然，有点怪怪的感觉。。。</div>
<div></div>
<p>还有一种办法是通过DarwinPorts来安装，这是个类似于ubuntu的包管理器，貌似很容易的样子，目前还么强烈的需求要尝试这玩意。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1" color="#FF0000" style="display: block !important; padding: 20px 0 5px !important;">其他文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F09%2Fa-terminal-style-on-mac%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F11%2Fhow-to-install-wget-under-mac-os%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">调节一下Mac下的Terminal配置，省点眼神</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F01%2Fplay-tomcat-cluster-in-macos%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F11%2Fhow-to-install-wget-under-mac-os%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">MacOS下玩tomcat cluster有点折腾啊</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F06%2Finstall-nodejs-express-on-virtual-linux%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F11%2Fhow-to-install-wget-under-mac-os%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">Linux虚拟机下安装nodejs+express</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fubuntu-mplayer-install-problem%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F11%2Fhow-to-install-wget-under-mac-os%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">ubuntu安装mplayer遇到的一些问题及解决办法</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/11/how-to-install-wget-under-mac-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用户的输入总是很有创意的</title>
		<link>http://www.haojii.com/2010/06/shell-user-input-sometimes-breaks-the-system/</link>
		<comments>http://www.haojii.com/2010/06/shell-user-input-sometimes-breaks-the-system/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 09:37:25 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[用户输入]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=347</guid>
		<description><![CDATA[有时候看似天衣无缝的代码遇到极具创意的用户是不得不低头的 且看下面一段简单的shell代码，检查用户输入如果是合法的文件，然后做一个copy -r 测试文件存在且可读 -d 检测是否是目录 如果文件存在且可读而且不是目录，（这里不关心文件内容），那么这个输入是否合法呢？ 用户如何break这个貌似天衣无缝的条件检测的？ 如果 /home/user/.licenses/lic* 匹配多个文件的情况下，-r 和 -d 判断都能通过，接下来运行到cp 就杯具了 会报下面这个错： 真的佩服用户输入的创意啊，为了避免匹配多个文件的情况，不得不用下面的代码来修bug<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1" color="#FF0000" style="display: block !important; padding: 20px 0 5px !important;">其他文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F09%2Fedianping-user-experience-analyse%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fshell-user-input-sometimes-breaks-the-system%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">E店评的用户体验分析</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F06%2Finstall-nodejs-express-on-virtual-linux%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fshell-user-input-sometimes-breaks-the-system%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">Linux虚拟机下安装nodejs+express</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2009%2F03%2Fguarantee-only-one-running-shell-script-process%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fshell-user-input-sometimes-breaks-the-system%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">如何保证sh脚本只有一个进程在运行</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F04%2Feverything-about-css-text-break%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fshell-user-input-sometimes-breaks-the-system%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">CSS文字折行与省略号</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><strong>有时候看似天衣无缝的代码遇到极具创意的用户是不得不低头的</strong></p>
<p>且看下面一段简单的shell代码，检查用户输入如果是合法的文件，然后做一个copy</p>
<p>-r 测试文件存在且可读</p>
<p>-d 检测是否是目录</p>
<p>如果文件存在且可读而且不是目录，（这里不关心文件内容），那么这个输入是否合法呢？</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/sh
echo &quot;Enter the name of the new licence key file&quot;
echo &quot;licencekeyfile=\c&quot;
read _afile

if [ ! -r $_afile ]
then
	echo &quot;File does not exist&quot;
	exit 1
fi

if [ -d $_afile ]
then
	echo &quot;Licence key file must be a regular file&quot;
	exit 1
fi

#Copy new licenceKey to /var/sog/etc/.licenses/licenseKey
if [ &quot;$_afile&quot; != &quot;/var/sog/etc/.licenses/licenseKey&quot; ]
then
	cp $_afile /var/sog/etc/.licenses/licenseKey
fi

...
</pre>
<p>用户如何break这个貌似天衣无缝的条件检测的？</p>
<pre class="brush: bash; title: ; notranslate">
Enter the name of the new licence key file
licencekeyfile=/home/user/.licenses/lic*
</pre>
<p>如果 <span style="color: #ff0000;">/home/user/.licenses/lic*</span> 匹配多个文件的情况下，-r 和 -d 判断都能通过，接下来运行到cp 就杯具了</p>
<p>会报下面这个错：</p>
<pre class="brush: bash; title: ; notranslate">

cp: Target /var/sog/etc/.licenses/licenseKey must be a directory
Usage: cp [-f] [-i] [-p] [-@] f1 f2
 cp [-f] [-i] [-p] [-@] f1 ... fn d1
 cp -r|-R [-H|-L|-P] [-f] [-i] [-p] [-@] d1 ... dn-1 dn
</pre>
<p><strong>真的佩服用户输入的创意啊</strong>，为了避免匹配多个文件的情况，不得不用下面的代码来修bug</p>
<pre class="brush: bash; title: ; notranslate">

matches=`ls $_afile | wc -l | sed 's/ //g'`
if [ $matches != 1 ]
then
 echo &quot;Your input of the new licence key file is not valid, it matches $matches files :&quot;
 ls $_afile
 exit 1
fi
</pre>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1" color="#FF0000" style="display: block !important; padding: 20px 0 5px !important;">其他文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F09%2Fedianping-user-experience-analyse%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fshell-user-input-sometimes-breaks-the-system%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">E店评的用户体验分析</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F06%2Finstall-nodejs-express-on-virtual-linux%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fshell-user-input-sometimes-breaks-the-system%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">Linux虚拟机下安装nodejs+express</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2009%2F03%2Fguarantee-only-one-running-shell-script-process%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fshell-user-input-sometimes-breaks-the-system%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">如何保证sh脚本只有一个进程在运行</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F10%2Fturkey-turkey%2F&from=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fshell-user-input-sometimes-breaks-the-system%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">Turkey turkey</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/06/shell-user-input-sometimes-breaks-the-system/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[高手必备]-screen</title>
		<link>http://www.haojii.com/2009/12/proficient-screen/</link>
		<comments>http://www.haojii.com/2009/12/proficient-screen/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 05:54:45 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[高手必备]]></category>

		<guid isPermaLink="false">http://haojii.com/?p=11</guid>
		<description><![CDATA[自诩为一个Geek，一个高手，不知道screen是啥有点说不过去。。。 <a href="http://www.haojii.com/2009/12/proficient-screen/">继续阅读 <span class="meta-nav">&#8594;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1" color="#FF0000" style="display: block !important; padding: 20px 0 5px !important;">其他文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F08%2Ftip-download-a-bitcomet-only-torrent-file-with-thunder%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F12%2Fproficient-screen%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">技巧-用迅雷打开某些打不开的种子文件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fjquery-tips-pass-more-parameters-into-ajax-callback%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F12%2Fproficient-screen%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">jQuery Tips : 给AJAX回调函数传递额外参数</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2008%2F10%2Fservlet-jsp-paging%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F12%2Fproficient-screen%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">Servlet+JSP分页的一个例子</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F01%2Fplacehold-it%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F12%2Fproficient-screen%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">placehold.it</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>自诩为一个Geek，一个高手，不知道screen是啥有点说不过去。。。</p>
<p>好歹现在开发和维护的产品也是运行在强大的Solaris上的，我还一直很土的用putty建多个连接到server上去看这看那，自鸣得意的把putty拖成几个方块，不同的窗口不同的功能，有的看日志，有的杀进程，有的检查coredump文件，无奈windows的DHCP导致PC机的IP总是在第二天上班的时候变了，可怜了我苦心建立起来的多个session，又得吭哧吭哧再连一遍，效率啊。。。</p>
<p>好歹咱也是学过《卓有成效的程序员》的人，于是决定不能再这么土下去了，终于决定走上正途，用screen</p>
<p><strong>使用screen开始一个会话</strong></p>
<p>screen</p>
<p><strong>在screen会话中开启一个新的窗口</strong></p>
<p>连续技: <span style="color: #ff0000;">Ctrl+a c</span></p>
<p><strong>查看当前会话中的窗口列表</strong></p>
<p>连续技: <span style="color: #ff0000;">Ctrl+a w</span></p>
<p><strong>暂时退出当前会话</strong></p>
<p>连续技: <span style="color: #ff0000;">Ctrl+a d </span></p>
<div>
<div>
<table id="qxv-" border="1" cellspacing="0" cellpadding="3" width="100%" bgcolor="#cfe2f3" bordercolor="#000000">
<tbody>
<tr>
<td width="100%">~<br />
~<br />
“tmp.txt” [New file]<br />
[detached]<br />
1372#</td>
</tr>
</tbody>
</table>
</div>
</div>
<p><strong>查看之前的screen会话</strong><br />
<span style="color: #ff0000;">screen -list<br />
</span></p>
<div>
<table id="y972" border="1" cellspacing="0" cellpadding="3" width="100%" bgcolor="#cfe2f3" bordercolor="#000000">
<tbody>
<tr>
<td width="100%">1372# screen -list<br />
There is a screen on:<br />
25618.pts-1.ema1372     (Detached)<br />
1 Socket in /tmp/screens/S-root.</td>
</tr>
</tbody>
</table>
<p><strong>删除无法连接的screen会话</strong><br />
<span style="color: #ff0000;">screen -wipe</span></p>
<div>
<table id="jr1j" border="1" cellspacing="0" cellpadding="3" width="100%" bgcolor="#cfe2f3" bordercolor="#000000">
<tbody>
<tr>
<td width="100%">1372# screen -wipe<br />
There is a screen on:<br />
25618.pts-1.ema1372     (Detached)<br />
1 Socket in /tmp/screens/S-root.</td>
</tr>
</tbody>
</table>
</div>
<p><strong>重现连接之前的会话</strong><br />
<span style="color: #ff0000;">screen -r 25618</span></p>
<table id="p:1g" border="1" cellspacing="0" cellpadding="3" width="100%" bgcolor="#cfe2f3" bordercolor="#000000">
<tbody>
<tr>
<td width="100%">1372# screen -r 25618Ctrl+a w<br />
~<br />
0-$ sh  1*$ sh</td>
</tr>
</tbody>
</table>
<p><strong>重命名会话中的窗口</strong><br />
连续技: <span style="color: #ff0000;">Ctrl+a A</span></p>
<table id="lmhe" border="1" cellspacing="0" cellpadding="3" width="100%" bgcolor="#cfe2f3" bordercolor="#000000">
<tbody>
<tr>
<td width="100%">Set window&#8217;s title to: new_title</td>
</tr>
</tbody>
</table>
<div><strong>快捷键帮助</strong><br />
连续技: <span style="color: #ff0000;">Ctrl+a ?</span></div>
<div><span style="color: #ff0000;"> </span></div>
<div><span style="color: #ff0000;"> </span></div>
<div><span style="color: #000000;">另可参考：</span></div>
<div><span style="color: #ff0000;"><a title="linux 技巧：使用 screen 管理你的远程会话" href="https://www.ibm.com/developerworks/cn/linux/l-cn-screen/">https://www.ibm.com/developerworks/cn/linux/l-cn-screen/</a></span></div>
<div><span style="color: #ff0000;"> </span></div>
<div><span style="color: #ff0000;"> </span></div>
<div><span style="color: #0000ff;">补充:</span></div>
<div><span style="color: #0000ff;">使用过程中如果发现screen死掉了，可以试试Ctrl+Q，原因可能是你不小心按下了Ctrl+S锁了屏幕</span></div>
<div><span style="color: #ff0000;"><span style="color: #0000ff;">（我就是不小心按了Ctrl+S,又土了一把,还用kill -9 杀了screen，后来才想起来shell的这个小陷阱）</span></span></div>
<div><span style="color: #ff0000;"><span style="color: #0000ff;"> </span></span></div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1" color="#FF0000" style="display: block !important; padding: 20px 0 5px !important;">其他文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F08%2Ftip-download-a-bitcomet-only-torrent-file-with-thunder%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F12%2Fproficient-screen%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">技巧-用迅雷打开某些打不开的种子文件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fjquery-tips-pass-more-parameters-into-ajax-callback%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F12%2Fproficient-screen%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">jQuery Tips : 给AJAX回调函数传递额外参数</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F01%2Fcss_background_image_positioning%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F12%2Fproficient-screen%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">CSS分割背景图片的技巧</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F09%2Fedianping-user-experience-analyse%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F12%2Fproficient-screen%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">E店评的用户体验分析</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2009/12/proficient-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何保证sh脚本只有一个进程在运行</title>
		<link>http://www.haojii.com/2009/03/guarantee-only-one-running-shell-script-process/</link>
		<comments>http://www.haojii.com/2009/03/guarantee-only-one-running-shell-script-process/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 06:52:45 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=184</guid>
		<description><![CDATA[<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1" color="#FF0000" style="display: block !important; padding: 20px 0 5px !important;">其他文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fshell-user-input-sometimes-breaks-the-system%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F03%2Fguarantee-only-one-running-shell-script-process%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">用户的输入总是很有创意的</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F03%2Fa-notable-day-in-history-update%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F03%2Fguarantee-only-one-running-shell-script-process%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">互联网历史上的这一天值得标记一下（更新）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2009%2F12%2Fjavascript-lyrics-show%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F03%2Fguarantee-only-one-running-shell-script-process%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">javascript-lyrics-show</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F01%2Favatar%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F03%2Fguarantee-only-one-running-shell-script-process%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">AVATAR</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>#!/usr/bin/sh</p>
<p>LOCKFILE=jihao.lock<br />
if [ -f ${LOCKFILE} ] &amp;&amp; kill -0 `cat ${LOCKFILE}`; then<br />
    echo &quot;filecollector is already running&quot;<br />
    exit<br />
fi</p>
<p># make sure the lockfile is removed when we exit and then claim it<br />
trap &quot;rm -f ${LOCKFILE}; exit&quot; INT TERM EXIT<br />
echo $$ &gt; ${LOCKFILE}</p>
<p>sleep 100<br />
rm -f ${LOCKFILE}</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1" color="#FF0000" style="display: block !important; padding: 20px 0 5px !important;">其他文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F06%2Fshell-user-input-sometimes-breaks-the-system%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F03%2Fguarantee-only-one-running-shell-script-process%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">用户的输入总是很有创意的</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F01%2Fwhat-is-ajp%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F03%2Fguarantee-only-one-running-shell-script-process%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">What is AJP?</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2008%2F10%2Fservlet-jsp-paging%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F03%2Fguarantee-only-one-running-shell-script-process%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">Servlet+JSP分页的一个例子</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2010%2F10%2Fturkey-turkey%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F03%2Fguarantee-only-one-running-shell-script-process%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">Turkey turkey</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2009/03/guarantee-only-one-running-shell-script-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu安装mplayer遇到的一些问题及解决办法</title>
		<link>http://www.haojii.com/2009/02/ubuntu-mplayer-install-problem/</link>
		<comments>http://www.haojii.com/2009/02/ubuntu-mplayer-install-problem/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 15:52:14 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[小问题]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=170</guid>
		<description><![CDATA[关于ubuntu安装mplayer网上已经有很多的文章，我也装的时候也参照了一下下面两个链接。这篇文章主要是为了记录我安装的时候遇到的问题及解决办法。 http://www.mplayerhq.hu/DOCS/README http://linux.chinaunix.net/docs/2008-01-24/4725.shtml http://tech.ccidnet.com/art/3089/20090106/1652395_1.html  安装有五个步骤，我下载了Subversion snapshot的源文件，以及其他几个文件之后，   先配置codecs目录，权限如下   hao@hao-desktop:/usr/lib$ ls -al &#124; grep codecs drwxr-xr-x   2 root root     4096 2009-02-11 23:22 codecs drwxr-xr-x   2 root root     4096 2007-10-07 22:07 wincodecs   之后在解压完的source目录下运行了如下命令： ./configure &#8211;prefix=/usr/local/mplayer/ &#8211;enable-gui &#8211;enable-freetype &#8211;codecsdir=/usr/lib/codecs/ &#8211;win32codecsdir=/usr/lib/wincodecs/ &#8211;language=zh_CN &#8230; <a href="http://www.haojii.com/2009/02/ubuntu-mplayer-install-problem/">继续阅读 <span class="meta-nav">&#8594;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1" color="#FF0000" style="display: block !important; padding: 20px 0 5px !important;">其他文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F06%2Finstall-nodejs-express-on-virtual-linux%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fubuntu-mplayer-install-problem%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">Linux虚拟机下安装nodejs+express</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2008%2F09%2Fjsp-include-encoding-problem%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fubuntu-mplayer-install-problem%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">jsp:include 乱码问题的解决办法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2008%2F11%2Fservlet-request-getparameter-encoding-problem%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fubuntu-mplayer-install-problem%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">再次小结ServletRequest.getParameter乱码问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fjndi-problem-in-jboss%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fubuntu-mplayer-install-problem%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">使用JNDI查找JBOSS内配置好的数据源遇到的问题</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>关于ubuntu安装mplayer网上已经有很多的文章，我也装的时候也参照了一下下面两个链接。这篇文章主要是为了记录我安装的时候遇到的问题及解决办法。</p>
<div><a href="http://www.mplayerhq.hu/DOCS/README">http://www.mplayerhq.hu/DOCS/README</a><br />
<a id="tj97" title="http://linux.chinaunix.net/docs/2008-01-24/4725.shtml" href="http://linux.chinaunix.net/docs/2008-01-24/4725.shtml">http://linux.chinaunix.net/docs/2008-01-24/4725.shtml</a> <a id="re8k" title="http://tech.ccidnet.com/art/3089/20090106/1652395_1.html" href="http://tech.ccidnet.com/art/3089/20090106/1652395_1.html">http://tech.ccidnet.com/art/3089/20090106/1652395_1.html</a> </div>
<p>安装有五个步骤，我下载了Subversion snapshot的源文件，以及其他几个文件之后，</p>
<div> </div>
<div>先配置codecs目录，权限如下</div>
<div> </div>
<div><span style="background-color: #888888;">hao@hao-desktop:/usr/lib$ ls -al | grep codecs<br />
drwxr-xr-x   2 root root     4096 2009-02-11 23:22 codecs<br />
drwxr-xr-x   2 root root     4096 2007-10-07 22:07 wincodecs</span></div>
<div> </div>
<div>之后在解压完的source目录下运行了如下命令：</div>
<div><span style="background-color: #888888;">./configure &#8211;prefix=/usr/local/mplayer/ &#8211;enable-gui &#8211;enable-freetype &#8211;codecsdir=/usr/lib/codecs/ &#8211;win32codecsdir=/usr/lib/wincodecs/ &#8211;language=zh_CN</span></div>
<div> </div>
<div><strong>错误一：</strong> 很不幸没有一次性成功，错误提示如下：</div>
<div><span style="color: #ff0000;">Error: The GUI requires libavcodec with PNG support (needs zlib).<br />
Check “configure.log” if you do not understand why it failed.</span></div>
<div>
<p><strong>解决办法：</strong> google了一下发现我需要libavcodec这个东东，但是在我检查了一下明明以及装过了的，同时发现还有下面这个包没有装过，看了一下这个包的说明，猜想了一下觉得应该把它装上，这里要说的说ubuntu真的很方便，这个<strong>(Synaptic Package Manager) 新立得包管理器</strong>简直就是一个神器啊！在<strong>Synaptic Package Manager</strong>里选中这个包，它会把depend的其他包都自动下载安装，爽死了。</p>
<p>libavcodec-dev</p>
<p>    development files for libavcodec<br />
    This is the codec library from the ffmpeg project. It supports most existing<br />
    encoding formats (MPEG, DivX, MPEG4, AC3, DV&#8230;).</p>
<p>    This package contains the header files and static libraries needed to<br />
    compile applications or shared objects that use libavcodec.</p>
<div> </div>
<div><strong>错误二：</strong> 这个问题搞定之后，重新运行上面的configure命令，又得到一个新的错误提示：</div>
<div> </div>
<div><span style="color: #ff0000;">Error: X11 support required for GUI compilation.<br />
Check “configure.log” if you do not understand why it failed.</span></div>
<p><strong>解决办法：</strong> 继续google发现这次的解决办法是要安装下面两个包，还是用<strong>Synaptic Package Manager</strong></p>
<p>libgladeui-1-7<br />
    GTK+ User Interface Build core library</p>
<p>libgladeui-1-dev</p>
<p>    GTK+ User Interface Build core library (development files)<br />
    Glade is a RAD tool to enable quick and easy development of user<br />
    interfaces for the GTK+ 2 toolkit.</p>
<p>    Glade is, since its “3.0&#8243; major version, highly modular, and composed<br />
    of widgets which can be used by other applications to integrate<br />
    functionality similar to the one provided by the Glade application<br />
    itself.</p>
<div>然后继续运行configure终于成功了，当然不排除你运行这个的时候遇到别的问题，解决办法就是<strong>google+Synaptic Package Manager</strong></div>
<div>然后就可以安装啦<br />
hao@hao-desktop:~/downloaded/mplayer-export-2009-02-11$ sudo make install<br />
[sudo] password for hao:<br />
install -d /usr/local/mplayer//bin /usr/local/mplayer//etc/mplayer /usr/local/mplayer//lib<br />
install -m 755 -s mplayer /usr/local/mplayer//bin<br />
ln -sf mplayer /usr/local/mplayer//bin/gmplayer<br />
install -d /usr/local/mplayer//share/mplayer/skins /usr/local/mplayer//share/pixmaps /usr/local/mplayer//share/applications<br />
install -m 644 etc/mplayer.xpm /usr/local/mplayer//share/pixmaps/<br />
install -m 644 etc/mplayer.desktop /usr/local/mplayer//share/applications/<br />
install -m 755 -s mencoder /usr/local/mplayer//bin<br />
install -d /usr/local/mplayer//share/man/zh_CN/man1<br />
install -m 644 DOCS/man/zh_CN/mplayer.1 /usr/local/mplayer//share/man/zh_CN/man1/<br />
cd /usr/local/mplayer//share/man/zh_CN/man1 &amp;&amp; ln -sf mplayer.1 mencoder.1<br />
<a href="mailto:hao@hao-desktop:~/downloaded/mplayer-export-2009-02-11$">hao@hao-desktop:~/downloaded/mplayer-export-2009-02-11$</a></div>
<div> </div>
<div> </div>
<div>
<p>最后还需要安装字体和皮肤，很简单的活，没遇到问题。</p>
<p><span style="color: #ff0000;">Q：ubuntu如何安装deb格式的包？</span></p>
<div><span style="color: #ff0000;">A：sudo dpkg -i xxxx.<em>deb</em></span></div>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1" color="#FF0000" style="display: block !important; padding: 20px 0 5px !important;">其他文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2011%2F06%2Finstall-nodejs-express-on-virtual-linux%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fubuntu-mplayer-install-problem%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">Linux虚拟机下安装nodejs+express</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2008%2F09%2Fjsp-include-encoding-problem%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fubuntu-mplayer-install-problem%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">jsp:include 乱码问题的解决办法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2008%2F11%2Fservlet-request-getparameter-encoding-problem%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fubuntu-mplayer-install-problem%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">再次小结ServletRequest.getParameter乱码问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fjndi-problem-in-jboss%2F&from=http%3A%2F%2Fwww.haojii.com%2F2009%2F02%2Fubuntu-mplayer-install-problem%2F">
                        <font size="-1" color="#667FFA" style="line-height: 1.65em; font-size: 12px !important;">使用JNDI查找JBOSS内配置好的数据源遇到的问题</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2009/02/ubuntu-mplayer-install-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

