<?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; Linux</title>
	<atom:link href="http://www.nimab.org/tags/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.nimab.org</link>
	<description>穷困潦倒</description>
	<lastBuildDate>Mon, 29 Aug 2011 02:53:07 +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>用Mplayer播放高清电影(蓝光原盘)</title>
		<link>http://www.nimab.org/2008/05/10/40.html</link>
		<comments>http://www.nimab.org/2008/05/10/40.html#comments</comments>
		<pubDate>Sat, 10 May 2008 10:15:56 +0000</pubDate>
		<dc:creator>Kafeifei</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacosX]]></category>
		<category><![CDATA[mplayer]]></category>

		<guid isPermaLink="false">http://www.nimab.org/?p=40</guid>
		<description><![CDATA[前提还是你的cpu必须强劲，默认情况下mplayer是单线程的，所以显得力不从心，如果你的cpu是双核或支持超线程，那么试试加上一下参数： -lavdopts threads=8 或者，来自这里：http://ubuntuforums.org/showthread.php?t=629701 -vfm ffmpeg -lavdopts lowres=2:fast:skiploopfilter=all:threads=8 --------- 蓝光原盘抓出来的文件一般以 .ts 结尾 h264 标准 ------- update ------ mac下，mplayer的性能明显差很多，经过大量测试，发现问题主要在音频驱动上，我的配置： −vf scale=-2 -lavdopts lowres=1,1400:fast:skiploopfilter=all:threads=8 -ao openal -vo macosx 播放《汽车总动员》时勉强不卡！或许因为ntfs-3g的性能不佳吧，另外lowres这个配置未生效。 −vf scale=-2 可以修正字幕被拉扁的问题（视频质量未见异常）。]]></description>
			<content:encoded><![CDATA[<p>前提还是你的cpu必须强劲，默认情况下mplayer是单线程的，所以显得力不从心，如果你的cpu是双核或支持超线程，那么试试加上一下参数：</p>
<div class="hl-surround" style="height:28px;"><div class="hl-main"><pre>-lavdopts threads=8</pre></div></div>
<p>或者，来自这里：<a href="http://ubuntuforums.org/showthread.php?t=629701">http://ubuntuforums.org/showthread.php?t=629701</a></p>
<div class="hl-surround" style="height:28px;"><div class="hl-main"><pre>-vfm ffmpeg -lavdopts lowres=2:fast:skiploopfilter=all:threads=8</pre></div></div>
<p>---------<br />
蓝光原盘抓出来的文件一般以 .ts 结尾 h264 标准<br />
------- update ------<br />
mac下，mplayer的性能明显差很多，经过大量测试，发现问题主要在音频驱动上，我的配置：</p>
<div class="hl-surround" style="height:28px;"><div class="hl-main"><pre>−vf scale=-2 -lavdopts lowres=1,1400:fast:skiploopfilter=all:threads=8 -ao openal -vo macosx</pre></div></div>
<p>播放《汽车总动员》时勉强不卡！或许因为ntfs-3g的性能不佳吧，另外lowres这个配置未生效。<br />
−vf scale=-2 可以修正字幕被拉扁的问题（视频质量未见异常）。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nimab.org/2008/05/10/40.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dpkg-divert</title>
		<link>http://www.nimab.org/2007/04/01/19.html</link>
		<comments>http://www.nimab.org/2007/04/01/19.html#comments</comments>
		<pubDate>Sun, 01 Apr 2007 12:40:11 +0000</pubDate>
		<dc:creator>Kafeifei</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.nimab.org/2007/04/01/19.html</guid>
		<description><![CDATA[换了显卡 ati(fglrx) -> nvidia 安装 deb 包 提示错误 ： I too am having major pains installing the nvidia drivers. Now, it's partially my fault, as I had an ATI card in and changed them out. But aside from that, whenever I try to do 'apt-get install nvidia-glx', I get the following error: dpkg-divert: `diversion of [...]]]></description>
			<content:encoded><![CDATA[<p>换了显卡 ati(fglrx) -> nvidia</p>
<p>安装 deb 包 提示错误 ：</p>
<blockquote><p>
I too am having major pains installing the nvidia drivers. Now, it's partially my fault, as I had an ATI card in and changed them out. But aside from that, whenever I try to do 'apt-get install nvidia-glx', I get the following error:</p>
<p>dpkg-divert: `diversion of /usr/lib/libGL.so.1 to /usr/lib/nvidia/libGL.so.1.xlibmesa by nvidia-glx' clashes with `diversion of /usr/lib/libGL.so.1 to /usr/lib/fglrx/libGL.so.1.xlibmesa by xorg-driver-fglrx'<br />
dpkg: error processing /var/cache/apt/archives/nvidia-glx_1.0.8774+2.6.17.5-11_i386.deb (--unpack):<br />
subprocess pre-installation script returned error exit status 2<br />
Errors were encountered while processing:<br />
/var/cache/apt/archives/nvidia-glx_1.0.8774+2.6.17.5-11_i386.deb<br />
E: Sub-process /usr/bin/dpkg returned an error code (1)
</p></blockquote>
<p>使用</p>
<blockquote><p>
dpkg-divert --remove /usr/lib/libGL.so.1<br />
dpkg-divert --remove /usr/X11R6/lib/libGL.so.1</p></blockquote>
<p>解决问题</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nimab.org/2007/04/01/19.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>都是dash惹的祸</title>
		<link>http://www.nimab.org/2007/03/06/18.html</link>
		<comments>http://www.nimab.org/2007/03/06/18.html#comments</comments>
		<pubDate>Tue, 06 Mar 2007 10:10:04 +0000</pubDate>
		<dc:creator>Kafeifei</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[Bsd]]></category>
		<category><![CDATA[dash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacosX]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.nimab.org/2007/03/06/18.html</guid>
		<description><![CDATA[困扰我一个春天的问题！ Ubuntu 某天下了一个nerolinux，然后安装 安装失败，提示某脚本出错，看上去是语法错误 出错嘛就删除了哦 结果删除失败，提示同样的错误 导致使用apt-get任何时候都提示这个错误 几经搞整以后造成“新立得”无法正常运行 准备好光盘准备重装了 同时继续寻找希望，搜编google没有正解 其中错误包括： dpkg (子进程)：无法执行新的 post-removal script: No such file or directory dpkg: 作下列清理工作时发生错误: 子进程·post-removal script·返回了错误号·2 在处理时有错误发生： ------------------------------------- 软件包nerolinux 需要重新安装，但是我无法找到相应的安装文件。 仔细看了一下错误文件 /var/lib/dpkg/info/nerolinux.xxx 打开一看，语法好像不太寻常，我看到了 function 字样 再看头部 #!/bin/sh 改为 #!/bin/bash 后解决问题 ls -l /bin/sh 这个东西是链接到 dash 而不是 bash的 自从ubuntu 6.10 开始就是这样，很让人头痛，很多脚本运行有问题 见过有人为了装一个软件先把 bash->sh 装完了再 dash->sh 回去 妈B的，不改回去了，也没见哪个脚本运行不正常的！ 最后，不知道这个dash是啥东东，本来想大骂一顿的，不过…… [...]]]></description>
			<content:encoded><![CDATA[<p>困扰我一个春天的问题！<br />
Ubuntu<br />
某天下了一个nerolinux，然后安装<br />
安装失败，提示某脚本出错，看上去是语法错误<br />
出错嘛就删除了哦<br />
结果删除失败，提示同样的错误<br />
导致使用apt-get任何时候都提示这个错误<br />
几经搞整以后造成“新立得”无法正常运行<br />
准备好光盘准备重装了<br />
同时继续寻找希望，搜编google没有正解<br />
其中错误包括：</p>
<blockquote><p>
dpkg (子进程)：无法执行新的 post-removal script: No such file or directory<br />
dpkg: 作下列清理工作时发生错误:<br />
子进程·post-removal script·返回了错误号·2<br />
在处理时有错误发生：<br />
-------------------------------------<br />
软件包nerolinux 需要重新安装，但是我无法找到相应的安装文件。
</p></blockquote>
<p>仔细看了一下错误文件<br />
/var/lib/dpkg/info/nerolinux.xxx<br />
打开一看，语法好像不太寻常，我看到了 function 字样<br />
再看头部 #!/bin/sh<br />
改为 #!/bin/bash 后解决问题<br />
ls -l /bin/sh 这个东西是链接到 dash 而不是 bash的<br />
自从ubuntu 6.10 开始就是这样，很让人头痛，很多脚本运行有问题<br />
见过有人为了装一个软件先把 bash->sh 装完了再 dash->sh 回去</p>
<p>妈B的，不改回去了，也没见哪个脚本运行不正常的！<br />
最后，不知道这个dash是啥东东，本来想大骂一顿的，不过…… 还是算了……</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nimab.org/2007/03/06/18.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>ssh SendEnv 问题</title>
		<link>http://www.nimab.org/2007/03/05/17.html</link>
		<comments>http://www.nimab.org/2007/03/05/17.html#comments</comments>
		<pubDate>Mon, 05 Mar 2007 03:26:24 +0000</pubDate>
		<dc:creator>Kafeifei</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacosX]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.nimab.org/2007/03/05/17.html</guid>
		<description><![CDATA[远程主机不支持 zh_CN.UTF-8 我机器确是 ssh时: debug1: Sending environment. debug1: Sending env LANG = zh_CN.UTF-8 debug1: Sending env LC_CTYPE = zh_CN.UTF-8 造成远程很多程序不能运行 我认为既是远程，就不管那么多了，语言环境随它去比较好 修改 /etc/ssh/ssh_config 注销掉 SendEnv LANG LC_* 即可]]></description>
			<content:encoded><![CDATA[<p>远程主机不支持 zh_CN.UTF-8 我机器确是<br />
ssh时:</p>
<blockquote><p>debug1: Sending environment.<br />
debug1: Sending env LANG = zh_CN.UTF-8<br />
debug1: Sending env LC_CTYPE = zh_CN.UTF-8</p></blockquote>
<p>造成远程很多程序不能运行</p>
<p>我认为既是远程，就不管那么多了，语言环境随它去比较好</p>
<p>修改<br />
/etc/ssh/ssh_config<br />
注销掉 SendEnv LANG LC_*<br />
即可</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nimab.org/2007/03/05/17.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>再谈 jre / ZendStudio 中文字体问题</title>
		<link>http://www.nimab.org/2007/01/23/12.html</link>
		<comments>http://www.nimab.org/2007/01/23/12.html#comments</comments>
		<pubDate>Mon, 22 Jan 2007 17:55:14 +0000</pubDate>
		<dc:creator>Kafeifei</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.nimab.org/2007/01/23/12.html</guid>
		<description><![CDATA[找了若干资料，终于有了结果 原来如此简单： 把 Courier New 的几个字体文件 copy 到 jre/lib/fonts/ cd xxx/jre/lib/fonts mkfontscale cp fonts.scale fonts.dir cd ../ cp fontconfig.properties.src fontconfig.properties vi fontconfig.properties 修改相关位置： monospaced.plain.latin-1=-monotype-courier new-medium-r-normal--0-0-0-0-m-0-iso8859-1 monospaced.bold.latin-1=-monotype-courier new-bold-r-normal--0-0-0-0-m-0-iso8859-1 monospaced.italic.latin-1=-monotype-courier new-medium-i-normal--0-0-0-0-m-0-iso8859-1 monospaced.bolditalic.latin-1=-monotype-courier new-bold-i-normal--0-0-0-0-m-0-iso8859-1 最后再 cp 一个你喜欢的中文字体到 xxx/jre/fonts/fallback/ 打开 ZDE，设置字体为 monospaced 这下爽了，我顶你个肺！ 注意：此方法只在 Ubuntu 下测试通过，另外 Windows 是不适用的，如果是suse或者redhat之类的系统，主意看 xxx/jre/lib 下面的fontconfig.xxxx 文件，与当前系统相关做相应的修改就可以（没试过） 相关网址：http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html]]></description>
			<content:encoded><![CDATA[<p>找了若干资料，终于有了结果<br />
原来如此简单：</p>
<p>把 Courier New 的几个字体文件 copy 到 jre/lib/fonts/ </p>
<blockquote><p>
cd xxx/jre/lib/fonts<br />
mkfontscale<br />
cp fonts.scale fonts.dir<br />
cd ../<br />
cp fontconfig.properties.src fontconfig.properties<br />
vi fontconfig.properties
</p></blockquote>
<p>修改相关位置：</p>
<blockquote><p>
monospaced.plain.latin-1=-monotype-courier new-medium-r-normal--0-0-0-0-m-0-iso8859-1<br />
monospaced.bold.latin-1=-monotype-courier new-bold-r-normal--0-0-0-0-m-0-iso8859-1<br />
monospaced.italic.latin-1=-monotype-courier new-medium-i-normal--0-0-0-0-m-0-iso8859-1<br />
monospaced.bolditalic.latin-1=-monotype-courier new-bold-i-normal--0-0-0-0-m-0-iso8859-1
</p></blockquote>
<p>最后再 cp 一个你喜欢的中文字体到 xxx/jre/fonts/fallback/<br />
打开 ZDE，设置字体为 monospaced<br />
这下爽了，我顶你个肺！</p>
<p>注意：此方法只在 Ubuntu 下测试通过，另外 Windows 是不适用的，如果是suse或者redhat之类的系统，主意看 xxx/jre/lib 下面的fontconfig.xxxx 文件，与当前系统相关做相应的修改就可以（没试过）</p>
<p>相关网址：<a href="http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html">http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nimab.org/2007/01/23/12.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>再说关于jre的字体问题</title>
		<link>http://www.nimab.org/2007/01/22/11.html</link>
		<comments>http://www.nimab.org/2007/01/22/11.html#comments</comments>
		<pubDate>Mon, 22 Jan 2007 14:33:32 +0000</pubDate>
		<dc:creator>Kafeifei</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacosX]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.nimab.org/2007/01/22/11.html</guid>
		<description><![CDATA[其实最简单的解决ZendStudio中文问题方法就是： (ZDE自带了JRE) Zendxxx/jre/lib/fonts/ 目录下面建一个叫 fallback 的目录，然后 ln 或干脆 cp 一个中文字体进去就OK了，以前还去改什么字体配置文件，真傻B了！ 同样sun-jre也是一样的，建立 fallback 目录。 这种方法对 jre1.5 一上版本有效，其他版本据说要修改 lib 下面某个 font开头的文件。 另外说一下，jre1.6 对文字的处理看上去好像调用了操作系统的东西，例如平滑效果。 不知道有没有高人能把 ZendStudio 里的文字效果做成和平果一样的，Courier New 的英文，黑体中文，平滑处理。平果唯一让我怀念的就是这个东西，写代码的时候心情高很多。]]></description>
			<content:encoded><![CDATA[<p>其实最简单的解决ZendStudio中文问题方法就是：<br />
(ZDE自带了JRE)<br />
Zendxxx/jre/lib/fonts/<br />
目录下面建一个叫 fallback 的目录，然后 ln 或干脆 cp 一个中文字体进去就OK了，以前还去改什么字体配置文件，真傻B了！<br />
同样sun-jre也是一样的，建立 fallback 目录。<br />
这种方法对 jre1.5 一上版本有效，其他版本据说要修改 lib 下面某个 font开头的文件。</p>
<p>另外说一下，jre1.6 对文字的处理看上去好像调用了操作系统的东西，例如平滑效果。</p>
<p>不知道有没有高人能把 ZendStudio 里的文字效果做成和平果一样的，Courier New 的英文，黑体中文，平滑处理。平果唯一让我怀念的就是这个东西，写代码的时候心情高很多。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nimab.org/2007/01/22/11.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 6.10 Edgy 下ZendStudio不能运行的问题。</title>
		<link>http://www.nimab.org/2006/10/29/7.html</link>
		<comments>http://www.nimab.org/2006/10/29/7.html#comments</comments>
		<pubDate>Sun, 29 Oct 2006 06:01:33 +0000</pubDate>
		<dc:creator>Kafeifei</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.nimab.org/2006/10/29/7.html</guid>
		<description><![CDATA[升级完发现系统速度居然比6.06更快！ 其他都还不错，只是ZDE不能运行了，出现以下错误信息： Configuring the installer for this system's environment... nawk: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory /bin/ls: error while loading shared libraries: librt.so.1: cannot open shared object file: [...]]]></description>
			<content:encoded><![CDATA[<p>升级完发现系统速度居然比6.06更快！<br />
其他都还不错，只是ZDE不能运行了，出现以下错误信息：</p>
<blockquote><p>Configuring the installer for this system's environment...<br />
nawk: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory<br />
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory<br />
/bin/ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory<br />
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory<br />
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory<br />
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory<br />
hostname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory</p>
<p>Launching installer...</p>
<p>grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory<br />
/tmp/install.dir.9288/Linux/resource/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory</p></blockquote>
<p>尝试手动链接 /usr/lib/ 下的文件也不行，发现原来这些文件在 /lib/ 下都是存在的，google以后找到<a href="http://blog.eshangrao.com/index.php/2006/09/08/275-ubuntu-edgycoldfusion702">问题所在</a>，然后看到 <a href="http://192.150.14.120/cfusion/knowledgebase/index.cfm?id=tn_18831">http://192.150.14.120/cfusion/knowledgebase/index.cfm?id=tn_18831</a>  写的好像是叫修改版本号，具体的搞不懂 echo $LD_ASSUME_KERNEL 也是空的，最后还是注释刁解决问题：</p>
<p>修改 ZDE 把第1488行注释掉（可能是其他行）。</p>
<blockquote><p>1448 #export LD_ASSUME_KERNEL=2.2.5</p></blockquote>
<p>另外安装文件也有同样的问题，看引用文写了个脚本：</p>
<blockquote><p>
#!/bin/bash<br />
if [ "x$1" == "x" ]<br />
then<br />
        echo "usage: $0 filename";<br />
fi<br />
newfile="new_$1";<br />
cat $1 | sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > $newfile;<br />
chmod +x $newfile;<br />
echo $newfile;
</p></blockquote>
<p>保存为例如 newglibc</p>
<blockquote><p>$chmod +x newglibc</p></blockquote>
<p>以后遇到这种问题直接：</p>
<blockquote><p>$ ./glibcFix ZendStudio-xxx.bin<br />
new_ZendStudio-xxx.bin<br />
$ ./new_ZendStudio-xxx.bin
</p></blockquote>
<p>就可以运行了</p>
<p>好像写得有点白痴，太无聊了吧，想多写两个字。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nimab.org/2006/10/29/7.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>bash 中的正则表达式</title>
		<link>http://www.nimab.org/2006/09/13/4.html</link>
		<comments>http://www.nimab.org/2006/09/13/4.html#comments</comments>
		<pubDate>Wed, 13 Sep 2006 13:18:30 +0000</pubDate>
		<dc:creator>Kafeifei</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.nimab.org/2006/09/13/4.html</guid>
		<description><![CDATA[类似 $ps ax &#124; grep -v grep &#124; grep httpd &#124; tr -s ' ' &#124; cut -d ' ' -f1 的方法来取得pid确实还挺好用的，不过今天要取得这个程序执行了多长时间，这个就麻烦了，因为时间中间有空格 翻了半天的man还是没好的解决方案，换了台机器，ubuntu 的，发现 ps 有不小的区别，可以这样： $ps -eo pid,lstart,args &#124; grep httpd &#124; grep -v grep 2374 Wed Sep 13 00:41:59 2006 /usr/local/httpd/bin/httpd -k restart 2469 Wed Sep 13 00:42:03 2006 /usr/local/httpd/bin/httpd -k restart 22470 [...]]]></description>
			<content:encoded><![CDATA[<p>类似</p>
<blockquote><p>$ps ax | grep -v grep | grep httpd | tr -s ' ' | cut -d ' ' -f1</p></blockquote>
<p>的方法来取得pid确实还挺好用的，不过今天要取得这个程序执行了多长时间，这个就麻烦了，因为时间中间有空格<br />
翻了半天的man还是没好的解决方案，换了台机器，ubuntu 的，发现 ps 有不小的区别，可以这样：</p>
<blockquote><p>$ps -eo pid,lstart,args | grep httpd | grep -v grep<br />
 2374 Wed Sep 13 00:41:59 2006 /usr/local/httpd/bin/httpd -k restart<br />
 2469 Wed Sep 13 00:42:03 2006 /usr/local/httpd/bin/httpd -k restart<br />
22470 Wed Sep 13 00:42:03 2006 /usr/local/httpd/bin/httpd -k restart<br />
22472 Wed Sep 13 00:42:03 2006 /usr/local/httpd/bin/httpd -k restart<br />
22474 Wed Sep 13 00:42:03 2006 /usr/local/httpd/bin/httpd -k restart</p></blockquote>
<p>其中最前面的数字是pid 中间 Wed Sep 13 00:41:59 2006 是开始时间，后面的所有是"args" (linux下面的ps有lstart这个参数)<br />
这个就麻烦了，args自然只是为了匹配进程特征，中间的时间才是我要的东西。<br />
再找找关于grep的说明（这些小工具都强到一种境界，据说一个sed就写了一本书），一个 -o 参数搞定</p>
<blockquote><p>$pid=ps -eo pid,lstart,args | grep httpd | grep -v grep | egrep -o ^\ ?[0-9]+\ </p></blockquote>
<p>注意最后有一个空格 "\ " 这样比较保险一点<br />
发现出来的内容</p>
<blockquote><p>
 2374<br />
 2469<br />
22470<br />
22472<br />
22474
</p></blockquote>
<p>有空格，加一个 tr：</p>
<blockquote><p>$pid=ps -eo pid,lstart,args | grep httpd | grep -v grep | egrep -o ^\ ?[0-9]+\ | tr -d ' '</p></blockquote>
<p>同理时间也就简单了：</p>
<blockquote><p>$ps -eo pid,lstart,args | grep httpd | grep -v grep | egrep -o \ [A-Z][a-zA-Z0-9\ :]+\ [0-9]{4}</p></blockquote>
<p>转换成时间戳：</p>
<blockquote><p>$ps -eo pid,lstart,args | grep httpd | grep -v grep | egrep -o \ [A-Z][a-zA-Z0-9\ :]+\ [0-9]{4} | ......</p></blockquote>
<p>操，卡住了，做的时候都是传的变量。。。</p>
<p>幸好高人(hightman)指点</p>
<blockquote><p>$ps -eo pid,lstart,args | grep httpd | grep -v grep | egrep -o \ [A-Z][a-zA-Z0-9\ :]+\ [0-9]{4} | xargs -ishit date -d "shit" +%s<br />
1157349945<br />
1158050727<br />
1158144618<br />
1158145964<br />
1158147191
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.nimab.org/2006/09/13/4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在MacosX安装fontconfig-2遇到的问题</title>
		<link>http://www.nimab.org/2006/09/11/3.html</link>
		<comments>http://www.nimab.org/2006/09/11/3.html#comments</comments>
		<pubDate>Mon, 11 Sep 2006 07:28:15 +0000</pubDate>
		<dc:creator>Kafeifei</dc:creator>
				<category><![CDATA[Bsd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacosX]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.nimab.org/wp/?p=3</guid>
		<description><![CDATA[make install 遇到这样的提示 dyld: Symbol not found: _FSPathMakeRef Referenced from: /usr/local/lib/libfreetype.6.dylib Expected in: flat namespace 实际上是运行 fc-cache 时出现的问题，实际上就是freetype没有安装好，只要重新安装一次freetype，在 ./configure 加上一句 --with-old-mac-fonts 然后 make clean;make;make install 搞定。 我是看这里找到的解决方法： http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/28/0019.html]]></description>
			<content:encoded><![CDATA[<p>make install 遇到这样的提示</p>
<blockquote><p>
dyld: Symbol not found: _FSPathMakeRef<br />
Referenced from: /usr/local/lib/libfreetype.6.dylib<br />
Expected in: flat namespace
</p></blockquote>
<p>实际上是运行 fc-cache 时出现的问题，实际上就是freetype没有安装好，只要重新安装一次freetype，在 ./configure 加上一句 --with-old-mac-fonts 然后 make clean;make;make install 搞定。</p>
<p>我是看这里找到的解决方法：<br />
<a href="http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/28/0019.html">http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/28/0019.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nimab.org/2006/09/11/3.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

