<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>無銘小鎮</title>
	<atom:link href="http://nooope.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nooope.wordpress.com</link>
	<description>淡泊以明志，寜靜以致遠</description>
	<lastBuildDate>Sat, 24 Sep 2011 13:39:09 +0000</lastBuildDate>
	<language>zh-cn</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nooope.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>無銘小鎮</title>
		<link>http://nooope.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nooope.wordpress.com/osd.xml" title="無銘小鎮" />
	<atom:link rel='hub' href='http://nooope.wordpress.com/?pushpress=hub'/>
		<item>
		<title>linux ssh密鑰的生成、配置小筆記</title>
		<link>http://nooope.wordpress.com/2011/09/08/linux-ssh%e5%af%86%e9%91%b0%e7%9a%84%e7%94%9f%e6%88%90%e3%80%81%e9%85%8d%e7%bd%ae%e5%b0%8f%e7%ad%86%e8%a8%98/</link>
		<comments>http://nooope.wordpress.com/2011/09/08/linux-ssh%e5%af%86%e9%91%b0%e7%9a%84%e7%94%9f%e6%88%90%e3%80%81%e9%85%8d%e7%bd%ae%e5%b0%8f%e7%ad%86%e8%a8%98/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 06:27:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[skill]]></category>

		<guid isPermaLink="false">http://nooope.wordpress.com/?p=1219</guid>
		<description><![CDATA[密碼登陸太麻煩了，使用密鑰簡單。更安全？也許。 生成密鑰，依提示來做。 ssh-keygen 在~/.ssh目錄得到兩個文件（密鑰對） id_rsa id_rsa.pub 其中，.pub是公鑰，另外一個是私鑰。 公鑰放服務器上 ssh-copy-id -i id_rsa.pub user@foo.fffo.com 完成上面命令後，會在服務器的~/.ssh下發現文件authorized_keys，內含id_rsa.pub之內容 私鑰放本地，權限為600，否則登陸可能會出現類似下面的提示。 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0644 for &#8216;/home/ewrwer/.ssh/id_rsa&#8217; are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: /home/ewrwer/.ssh/id_rsa ewrwer@fewrwrw&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1219&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>密碼登陸太麻煩了，使用密鑰簡單。更安全？也許。<br />
生成密鑰，依提示來做。<br />
<code>ssh-keygen</code></p>
<p>在~/.ssh目錄得到兩個文件（密鑰對）</p>
<blockquote><p>id_rsa id_rsa.pub</p></blockquote>
<p>其中，.pub是公鑰，另外一個是私鑰。</p>
<p>公鑰放服務器上</p>
<p><code>ssh-copy-id -i id_rsa.pub user@foo.fffo.com</code><br />
完成上面命令後，會在服務器的~/.ssh下發現文件authorized_keys，內含id_rsa.pub之內容</p>
<p>私鑰放本地，權限為600，否則登陸可能會出現類似下面的提示。</p>
<blockquote><p>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br />
@         WARNING: UNPROTECTED PRIVATE KEY FILE!               @<br />
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br />
Permissions 0644 for &#8216;/home/ewrwer/.ssh/id_rsa&#8217; are too open.<br />
It is required that your private key files are NOT accessible by others.<br />
This private key will be ignored.<br />
bad permissions: ignore key: /home/ewrwer/.ssh/id_rsa<br />
ewrwer@fewrwrw&#8217;s password:
</p></blockquote>
<p>本地配置~/.ssh/config內容類似下面</p>
<blockquote><p>Host HostA<br />
     HostName HostA.domain.net<br />
     User useratA<br />
     IdentityFile  ~/.ssh/id_rsa.HostA</p>
<p> Host HostB<br />
     HostName HostB.domain.net<br />
     User useratB<br />
     IdentityFile  ~/.ssh/id_rsa.HostB</p></blockquote>
<p>然後就可以通過下面命令來登陸ssh了。<br />
<code>ssh HostA</code></p>
<p>參考資料：</p>
<ul>
<li><a href="http://bbs.chinaunix.net/viewthread.php?tid=1776861" title="SSH 密钥 认证 多台机器">SSH 密钥 认证 多台机器</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nooope.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nooope.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nooope.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nooope.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nooope.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nooope.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nooope.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nooope.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nooope.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nooope.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nooope.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nooope.wordpress.com/1219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nooope.wordpress.com/1219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nooope.wordpress.com/1219/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1219&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nooope.wordpress.com/2011/09/08/linux-ssh%e5%af%86%e9%91%b0%e7%9a%84%e7%94%9f%e6%88%90%e3%80%81%e9%85%8d%e7%bd%ae%e5%b0%8f%e7%ad%86%e8%a8%98/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7af2d4849f4d2c39036f2a6840147ee5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wumingxiaozhen</media:title>
		</media:content>
	</item>
		<item>
		<title>以通知方式显示论坛最近回复主题</title>
		<link>http://nooope.wordpress.com/2011/08/26/%e4%bb%a5%e9%80%9a%e7%9f%a5%e6%96%b9%e5%bc%8f%e6%98%be%e7%a4%ba%e8%ae%ba%e5%9d%9b%e6%9c%80%e8%bf%91%e5%9b%9e%e5%a4%8d%e4%b8%bb%e9%a2%98/</link>
		<comments>http://nooope.wordpress.com/2011/08/26/%e4%bb%a5%e9%80%9a%e7%9f%a5%e6%96%b9%e5%bc%8f%e6%98%be%e7%a4%ba%e8%ae%ba%e5%9d%9b%e6%9c%80%e8%bf%91%e5%9b%9e%e5%a4%8d%e4%b8%bb%e9%a2%98/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 08:35:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://nooope.wordpress.com/?p=1226</guid>
		<description><![CDATA[以通知方式显示论坛最近回复主题/新主题 测试地址 http://forum.ubuntu.org.cn/viewforum.php?f=21 因为是最近回复/新主题,所以把年份和日期去掉,只保留时间.在合并数据时遇到麻烦,数据行数相同的情况下,卻把第二组数据添加到第一组数据相应的行末,像vim里的 Ctrl+V 的块选择模式一样,把后面的数据以块形式直接添加到前面来.或者可以把这个问题描述为: 在第一组数据各行末添加第二组数据 在想不到其它办法的情况下,我只好通过下面的方法来. 输出第一组数据第1行到文件line1.dat,追加第二组数据第1行到文件line1.dat(把换行符\n替换成034) 034为ASCII中以八进制记录的字符034 重复,直到最后数据读完.这样得到line[1-5].dat五个文件. cat line?.dat shell脚本可以在... name'034'请教shell排序问... name'034'初学者写脚本，高手指... name'034'find 查找一个随... name'034'这是我的vsftpd... name'034' 合并文件,把034替换成换行符\n 通知显示文本格式如下 title(取前十个字符)&#8230;作者@时间 shell脚本可以在&#8230;name@14:36 请教shell排序问&#8230;name@12:46 初学者写脚本，高手指&#8230;name@12:24 find 查找一个随&#8230;name@11:36 这是我的vsftpd&#8230;name@0:04 最近完成版本 &#60;&#60;&#60; 可以不使用变量。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1226&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>以通知方式显示论坛最近回复主题/新主题<br />
测试地址 http://forum.ubuntu.org.cn/viewforum.php?f=21<br />
因为是最近回复/新主题,所以把年份和日期去掉,只保留时间.在合并数据时遇到麻烦,数据行数相同的情况下,卻把第二组数据添加到第一组数据相应的行末,像vim里的 Ctrl+V 的块选择模式一样,把后面的数据以块形式直接添加到前面来.或者可以把这个问题描述为: <strong>在第一组数据各行末添加第二组数据</strong><br />
在想不到其它办法的情况下,我只好通过下面的方法来.<br />
<strong>输出第一组数据第1行到文件line1.dat,追加第二组数据第1行到文件line1.dat(把换行符\n替换成034)<br />
<strong>034为ASCII中以八进制记录的字符034<br />
重复,直到最后数据读完.</strong>这样得到line[1-5].dat五个文件.</p>
<pre>
cat line?.dat
shell脚本可以在...
name'034'请教shell排序问...
name'034'初学者写脚本，高手指...
name'034'find 查找一个随...
name'034'这是我的vsftpd...
name'034'</pre>
<p><strong>合并文件,把034替换成换行符\n</strong></p>
<p><strong>通知显示文本格式如下</strong><br />
title(取前十个字符)&#8230;作者@时间</p>
<blockquote><p>shell脚本可以在&#8230;name@14:36<br />
请教shell排序问&#8230;name@12:46<br />
初学者写脚本，高手指&#8230;name@12:24<br />
find 查找一个随&#8230;name@11:36<br />
这是我的vsftpd&#8230;name@0:04</p></blockquote>
<pre class="brush: plain;">
#!/bin/zsh
old=''
cd /tmp/test
while :
do
curl -s &quot;http://forum.ubuntu.org.cn/viewforum.php?f=21&quot; 2&gt;/dev/null &gt;forum.dat
data=`cat forum.dat`
title=`echo &quot;$data&quot; | grep -oP '[^ ]*topictitle.*' | perl -pe 's|.*title&quot;\&gt;(.*?)\&lt;\/a&gt;.*|\1|' | sed -n '6,$p' | head -5 | sed -r 's/^(.{10}).*/\1\.../'`
name=`echo $data | grep 'class=&quot;topicdetails&quot;&gt;&lt;a'|perl -pe 's|.*\&gt;(.*?)\&lt;.*|\1|' | sed -n '6,$p' | head -5`
last=`echo $data | grep '&quot;topicdetails&quot; style'|perl -pe 's|.*\&gt;(.*?)\&lt;.*|\1|' | sed '1~2d' | sed -n '6,$p' | head -5 | awk '{print &quot;@&quot;$2}'`
for i in {1..5};do echo $title |sed -n &quot;${i}p&quot;&gt;line$i.dat;echo $name | sed -n &quot;${i}p&quot; |tr '\n' '&#092;&#048;34' &gt;&gt;line$i.dat;done;
titlename=`cat line?.dat | tr -d '\n'|tr '&#092;&#048;34' '\n'`
for i in {1..5};do echo ${titlename} |sed -n &quot;${i}p&quot;&gt;line$i.dat;echo $last | sed -n &quot;${i}p&quot; |tr '\n' '&#092;&#048;34' &gt;&gt;line$i.dat;done;
new=`cat line?.dat | tr -d '\n'|tr '&#092;&#048;34' '\n'`
[ &quot;$new&quot; = &quot;$old&quot; ] || notify-send &quot;$new&quot;
old=$new
sleep 300
done
</pre>
<p>最近完成版本</p>
<pre class="brush: plain;">
#!/bin/bash
[ -f ~/.forumstatus.dat ] || touch ~/.forumstatus.dat
old=`cat ~/.forumstatus.dat`
[ -d /tmp/forumshell ] || mkdir /tmp/forumshell
cd /tmp/forumshell
while : ; do
curl -s &quot;http://forum.ubuntu.org.cn/viewforum.php?f=21&quot; 2&gt;/dev/null &gt;forum.dat
delnum=$(expr $(grep -cP 'styles\/.*\/imageset\/announce_.*' forum.dat )  + $(grep -cP 'styles\/.*\/imageset\/sticky_.*' forum.dat ) - 2)
shownum=5
begin=`expr $delnum + 1`
end=`expr $delnum + $shownum`
sed -rn 's/.*&quot;topictitle&quot;&gt;(.{1,10}).*&lt;\/a&gt;.*/\1\.../p' forum.dat | sed -n &quot;$begin,$end&quot;p &gt; title.dat
sed -nr 's/.*class=&quot;topicdetails&quot;&gt;&lt;.*&gt;(.*)&lt;\/a&gt;$/\1/p' forum.dat | sed -n &quot;$begin,$end&quot;p  &gt;name.dat
sed -nr 's/.*&quot;topicdetails&quot; style.* (.*)&lt;\/p&gt;/@\1/p' forum.dat |  sed '1~2d' | sed -n &quot;$begin,$end&quot;p  &gt;last.dat
new=`paste title.dat name.dat last.dat |tr -d '\t'`
[ &quot;$new&quot; = &quot;$old&quot; ] || notify-send &quot;$new&quot;
old=&quot;$new&quot;
echo &quot;$old&quot; &gt;~/.forumstatus.dat
sleep 300
done
</pre>
<p>&lt;&lt;&lt; 可以不使用变量。</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nooope.wordpress.com/1226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nooope.wordpress.com/1226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nooope.wordpress.com/1226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nooope.wordpress.com/1226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nooope.wordpress.com/1226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nooope.wordpress.com/1226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nooope.wordpress.com/1226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nooope.wordpress.com/1226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nooope.wordpress.com/1226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nooope.wordpress.com/1226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nooope.wordpress.com/1226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nooope.wordpress.com/1226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nooope.wordpress.com/1226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nooope.wordpress.com/1226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1226&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nooope.wordpress.com/2011/08/26/%e4%bb%a5%e9%80%9a%e7%9f%a5%e6%96%b9%e5%bc%8f%e6%98%be%e7%a4%ba%e8%ae%ba%e5%9d%9b%e6%9c%80%e8%bf%91%e5%9b%9e%e5%a4%8d%e4%b8%bb%e9%a2%98/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7af2d4849f4d2c39036f2a6840147ee5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wumingxiaozhen</media:title>
		</media:content>
	</item>
		<item>
		<title>保留两个关键词之间的内容&#8211;单行或者多行</title>
		<link>http://nooope.wordpress.com/2011/08/19/%e4%bf%9d%e7%95%99%e4%b8%a4%e4%b8%aa%e5%85%b3%e9%94%ae%e8%af%8d%e4%b9%8b%e9%97%b4%e7%9a%84%e5%86%85%e5%ae%b9-%e5%8d%95%e8%a1%8c%e6%88%96%e8%80%85%e5%a4%9a%e8%a1%8c/</link>
		<comments>http://nooope.wordpress.com/2011/08/19/%e4%bf%9d%e7%95%99%e4%b8%a4%e4%b8%aa%e5%85%b3%e9%94%ae%e8%af%8d%e4%b9%8b%e9%97%b4%e7%9a%84%e5%86%85%e5%ae%b9-%e5%8d%95%e8%a1%8c%e6%88%96%e8%80%85%e5%a4%9a%e8%a1%8c/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 15:11:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://nooope.wordpress.com/?p=1215</guid>
		<description><![CDATA[几经修改，最后得到是代码是下面几行。算法不变：先并行，再行分，使用贪婪匹配 x.*y<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1215&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre class="brush: plain;">
#!/bin/bash
# 能不能先并行（使用一个没有出现过特殊字符串作为结束标记），再分行？
# file1.txt
#&quot;abcxdefgaxcdyeafgxyxabefght...&quot;
#&quot;fewewretgjkjk543yeafgxy4534ght...&quot;
# 处理 删除第一个x前的内容和最后一个y后面的内容
# 预期结果
#defgaxcdyeafgxyxabefght...&quot;
#&quot;fewewretgjkjk543yeafgx
# 合并行
# &quot;公平&quot;就是传说中的标记
sed 's/$/公平/g' tex1.txt | tr -d '\n' | sed 's/公平$//'&gt;file1.txt
i=`sed 's/x.*$/x/' file1.txt`
j=`sed 's/^.*y/y/' file1.txt`
echo $i $j | sed -e &quot;s/$i//&quot; -e &quot;s/$j$//&quot; file1.txt | sed 's/公平/\n/g'
</pre>
<p>几经修改，最后得到是代码是下面几行。算法不变：先并行，再行分，使用贪婪匹配 x.*y</p>
<pre class="brush: plain;">
#!/bin/bash
for i in text*.txt
do
cat $i | tr '\n' '&#092;&#048;34' | grep -oP 'x.*y' | sed -e 's/^x//;s/y$//' | tr '&#092;&#048;34' '\n' | tee out-$i
done
exit 0
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nooope.wordpress.com/1215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nooope.wordpress.com/1215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nooope.wordpress.com/1215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nooope.wordpress.com/1215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nooope.wordpress.com/1215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nooope.wordpress.com/1215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nooope.wordpress.com/1215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nooope.wordpress.com/1215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nooope.wordpress.com/1215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nooope.wordpress.com/1215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nooope.wordpress.com/1215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nooope.wordpress.com/1215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nooope.wordpress.com/1215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nooope.wordpress.com/1215/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1215&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nooope.wordpress.com/2011/08/19/%e4%bf%9d%e7%95%99%e4%b8%a4%e4%b8%aa%e5%85%b3%e9%94%ae%e8%af%8d%e4%b9%8b%e9%97%b4%e7%9a%84%e5%86%85%e5%ae%b9-%e5%8d%95%e8%a1%8c%e6%88%96%e8%80%85%e5%a4%9a%e8%a1%8c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7af2d4849f4d2c39036f2a6840147ee5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wumingxiaozhen</media:title>
		</media:content>
	</item>
		<item>
		<title>deadbeef显示歌词shell script补充</title>
		<link>http://nooope.wordpress.com/2011/08/07/deadbeef%e6%98%be%e7%a4%ba%e6%ad%8c%e8%af%8dshell-script%e8%a1%a5%e5%85%85/</link>
		<comments>http://nooope.wordpress.com/2011/08/07/deadbeef%e6%98%be%e7%a4%ba%e6%ad%8c%e8%af%8dshell-script%e8%a1%a5%e5%85%85/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 14:18:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://nooope.wordpress.com/?p=1207</guid>
		<description><![CDATA[添加了几行代码，以便在使用xterm执行这个脚本时，显示当前曲目。 添加在函数 ShowLyric() 和下载函数 “# 两种方式都搜索不到”之后 GetInfo; echo -ne "33]0;$SONG-$ARTIST07" 代码合并，两个文件管理起来麻烦，所以就合并了。 在启动时可以这样 代码: xterm -e "foo.sh" 对xterm启动参数进行具体设定。 xterm -bg "#e0e0ef" -fg "#a00fcf" -geometry 37x4+1092+202 -e "/media/Dropbox/lyric4deadbeef/db.sh" 然后，就会显示当前播放曲目在标题了。 就不上图了。麻烦。 参考资料 如何變更 xterm 的主題<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1207&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>添加了几行代码，以便在使用xterm执行这个脚本时，显示当前曲目。<br />
添加在函数 ShowLyric() 和下载函数 “# 两种方式都搜索不到”之后<br />
<code><br />
   GetInfo;<br />
   echo -ne "33]0;$SONG-$ARTIST07"<br />
</code><br />
代码合并，两个文件管理起来麻烦，所以就合并了。<br />
在启动时可以这样<br />
代码:<br />
<code>xterm -e "foo.sh"</code><br />
对xterm启动参数进行具体设定。<br />
<code>xterm -bg "#e0e0ef" -fg "#a00fcf" -geometry 37x4+1092+202 -e "/media/Dropbox/lyric4deadbeef/db.sh"</code></p>
<p>然后，就会显示当前播放曲目在标题了。<br />
就不上图了。麻烦。</p>
<pre class="brush: plain;">

#!/bin/bash
######  include functions
######  Getstatus() GetInfo()  ShowLyric() Download() Wait()

# modified from mpdlyric by wiewi,lwldcr@gmail.com
# Show lyric when playing music with deadbeef
# 2011/07/17
# contributor wiewi,lwldcr@gmail.com
# 2011/08/06
# modified by Danny Chow, xizhengbing \A\T gmail.com
# Download function!!
# Finished on July 20,Wednesday
# Last modifed August 7,Sunday

Getstatus(){
before=$(deadbeef --nowplaying  %e 2&gt;/dev/null)
after=$(sleep 1;deadbeef --nowplaying  %e 2&gt;/dev/null)
[ $before != $after ] &amp;&amp; STATUS=&quot;playing&quot;
echo $STATUS
}

GetInfo(){
# Song info
SONG=$(deadbeef --nowplaying %t 2&gt;/dev/null)
ARTIST=$(deadbeef --nowplaying %a 2&gt;/dev/null)
NAME=$SONG
# LRC file
FILE=$LYRIC/`echo $NAME | tr -d ' '`.lrc
}

Download(){
    # 从gougou搜索歌词文件并下载
    #gougou will lead to the site used below

    GetInfo;

    PERIOD=''
    [ -f &quot;$SEARCH&quot; ] &amp;&amp; rm -f $SEARCH

    # “歌曲名 歌手” 搜索  管道写法参考lrcdis脚本
    wget -c -T 10 &quot;http://www.lrc123.com/?keyword=$NAME $ARTIST&amp;&quot; -O $SEARCH &gt; /dev/null 2&gt;&amp;1 |  iconv -f GBK

    URL=`cat $SEARCH | grep -B1 '下载' | grep color | sed -n '1p'| sed 's/&lt;[^&gt;]*&gt;//g' | tr -d ' '|sed 's/\\r//'`

    # 第一种方式搜索不到，使用“歌曲名” 搜索
    if [ -z &quot;$URL&quot; ];then
        wget -c -T 10 &quot;http://www.lrc123.com/?keyword=$NAME&amp;&quot; -O $SEARCH &gt; /dev/null 2&gt;&amp;1 | iconv -f GBK
    fi
    URL=`cat $SEARCH | grep -B1 '下载' | grep color | sed -n '1p'| sed 's/&lt;[^&gt;]*&gt;//g' | tr -d ' '|sed 's/\\r//'`

    if [ -z &quot;$URL&quot; ];then
    # 两种方式都搜索不到
        echo &quot;LRC not found!&quot; # &amp;&amp;  exit 1
        GetInfo;
        echo -ne &quot;&#092;&#048;33]0;$SONG-$ARTIST&#092;&#048;07&quot;
        SONG_PREV=$(deadbeef --nowplaying %t 2&gt;/dev/null)
        Wait;

    else
    # 有搜索结果，那么下载歌词文件
        wget -c -T 10 $URL -O &quot;$FILE&quot; &gt; /dev/null 2&gt;&amp;1| iconv -f GBK
    fi

}

Wait(){
    # 对于下载不到歌词的曲目，每隔1秒重新读取播放器信息，一旦切换到下首，则重新尝试Download歌词
while :
do
   sleep 1
   GetInfo
   if [ &quot;$SONG_PREV&quot; != &quot;$SONG&quot; ];then
       SONG_PREV=$SONG
       [ -f &quot;$FILE&quot; ] || Download;
       ShowLyric;
   fi
done
}
ShowLyric(){
#       [ -f &quot;$FILE&quot; ] || Download;
       #eval &quot;$CMD&quot; &quot;\n$NAME - $ARTIST\n&quot;
       GetInfo;
       echo -ne &quot;&#092;&#048;33]0;$SONG-$ARTIST&#092;&#048;07&quot;
       echo -e &quot;\n$NAME - $ARTIST\n&quot;
       notify-send &quot;$NAME - $ARTIST&quot;
       while :
       do
       if [ ! &quot;`file $FILE | grep -i utf-8`&quot; ];then
            iconv -f GBK -t UTF-8 $FILE -o $FILE
       fi
       TIME=$(deadbeef --nowplaying %e 2&gt;/dev/null)
       TEXT=$(cat &quot;$FILE&quot; | grep $TIME | sed 's/\[[^]]*]//g')
       CURRENT=$(deadbeef --nowplaying %t 2&gt;/dev/null)

       if [ -z &quot;$PREV&quot; -o &quot;$CURRENT&quot; = &quot;$PREV&quot; ];then
         PREV=$CURRENT

         # 换到下一句歌词
         if [ -n &quot;$TEXT&quot; -a &quot;$TEXT&quot; != &quot;$TEXT_PREV&quot; ];then
# Notify 方式有问题，歌词更新太慢，即使指定了timeout问题依旧
#       notify-send -t $TIMEOUT -- &quot;$TEXT&quot;
#              echo $TEXT
              sleep 0.8
              eval &quot;$CMD&quot;
              TEXT_PREV=&quot;$TEXT&quot;
         fi
       # 歌曲切换
       else
              PREV=''
              GetInfo
             # eval &quot;$CMD&quot; &quot;\n$NAME - $ARTIST\n&quot;
              echo -ne &quot;&#092;&#048;33]0;$SONG-$ARTIST&#092;&#048;07&quot;
              echo -e &quot;\n$NAME - $ARTIST\n&quot;
              notify-send &quot;$NAME - $ARTIST&quot;

              [ -f &quot;$FILE&quot; ] || Download;
              continue
       fi
         sleep 0.3
       done
}
# Lyric dir
 [ -d $HOME/.lyrics ] || mkdir $HOME/.lyrics -v

LYRIC=$HOME/.lyrics

# Temp files
[ -d $HOME/tmp ] || mkdir $HOME/tmp -v
SEARCH=$HOME/tmp/search

# Notify timeout
TIMEOUT=1000
case $1 in
    -n) CMD='notify-send -t $TIMEOUT --  $TEXT'
        ;;
    *)  CMD='echo $TEXT'
        ;;
esac

Getstatus
while :
do
case $STATUS in
    playing) GetInfo
             [ -f &quot;$FILE&quot; ] || Download;
             ShowLyric;;
    *) echo &quot;Deadbeef is not running!&quot; &amp;&amp; exit 1;;
esac
done
</pre>
<p>参考资料<a href="http://www.linux.org.tw/CLDP/MiniHOWTO/app/Xterm-Title/Xterm-Title-3.html"> 如何變更 xterm 的主題</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nooope.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nooope.wordpress.com/1207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nooope.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nooope.wordpress.com/1207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nooope.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nooope.wordpress.com/1207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nooope.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nooope.wordpress.com/1207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nooope.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nooope.wordpress.com/1207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nooope.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nooope.wordpress.com/1207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nooope.wordpress.com/1207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nooope.wordpress.com/1207/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1207&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nooope.wordpress.com/2011/08/07/deadbeef%e6%98%be%e7%a4%ba%e6%ad%8c%e8%af%8dshell-script%e8%a1%a5%e5%85%85/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7af2d4849f4d2c39036f2a6840147ee5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wumingxiaozhen</media:title>
		</media:content>
	</item>
		<item>
		<title>show lyric for deadbeef 显示歌词</title>
		<link>http://nooope.wordpress.com/2011/08/06/show-lyric-for-deadbeef-%e6%98%be%e7%a4%ba%e6%ad%8c%e8%af%8d/</link>
		<comments>http://nooope.wordpress.com/2011/08/06/show-lyric-for-deadbeef-%e6%98%be%e7%a4%ba%e6%ad%8c%e8%af%8d/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 10:57:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://nooope.wordpress.com/?p=1202</guid>
		<description><![CDATA[修改自 http://forum.ubuntu.org.cn/viewtopic.php?f=21&#38;t=339043 1楼 感谢wiewi 为简洁起见，我把主体和函数分开了。 我只是修改很少的一部分。函数我还没看完呢。:-( 比较难的可能是如何获取播放状态吧。 下面是 Deadbeef music player 的一个问题。 I haven&#8217;t looked at DeaDBeeF&#8217;s command line options, but is there one that will output its status? Then you&#8217;d just need a script with an if conditional: !#/bin/bash if `deadbeef &#8211;state` = &#8220;PLAY&#8221; #replace this with whatever code is necessary to find out [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1202&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>修改自 http://forum.ubuntu.org.cn/viewtopic.php?f=21&amp;t=339043 1楼 感谢wiewi<br />
为简洁起见，我把主体和函数分开了。<br />
我只是修改很少的一部分。函数我还没看完呢。:-(<br />
比较难的可能是如何获取播放状态吧。<br />
下面是<a href="http://crunchbanglinux.org/forums/topic/8229/deadbeef-music-player/"> Deadbeef music player</a> 的一个问题。</p>
<blockquote><p>I haven&#8217;t looked at DeaDBeeF&#8217;s command line options, but is there one that will output its status?  Then you&#8217;d just need a script with an if conditional:</p>
<p>!#/bin/bash<br />
if `deadbeef &#8211;state` = &#8220;PLAY&#8221; #replace this with whatever code is necessary to find out if DeaDBeeF is playing<br />
    deadbeef &#8211;pause<br />
else<br />
    deadbeef &#8211;play<br />
endif</p>
<p>&#8230;and that&#8217;s your play/pause toggle.</p></blockquote>
<p>我自己想办法解决了。</p>
<blockquote><p>Chow Daniel<br />
我真是笨啊。檢查播放狀態不一定要直接從程序給出的命令行中得出​。如果1秒前的播放位置和現在不同，那麽它就是“正在播放”<br />
about an hour ago ·</p></blockquote>
<p><strong>主体部分<br />
文件名 lyric4deadbeef.sh</strong></p>
<pre class="brush: plain;">
#!/bin/bash
# modified from mpdlyric by wiewi,lwldcr@gmail.com
# Show lyric when playing music with deadbeef
# 2011/07/17
# contributor wiewi,lwldcr@gmail.com
# 2011/08/06
# modified by Danny Chow, xizhengbing \A\Tgmail.com
# Download function!!
# Finished on July 20,Wednesday
# Last modifed August 6,Saturday
. functions.main
# Lyric dir
 [ -d $HOME/.lyrics ] || mkdir $HOME/.lyrics -v

LYRIC=$HOME/.lyrics

# Temp files
[ -d $HOME/tmp ] || mkdir $HOME/tmp -v
SEARCH=$HOME/tmp/search

# Notify timeout
TIMEOUT=1000
case $1 in
    -n) CMD='notify-send -t $TIMEOUT --  $TEXT'
        ;;
    *)  CMD='echo $TEXT'
        ;;
esac

Getstatus
while :
do
case $STATUS in
    playing) GetInfo
             [ -f &quot;$FILE&quot; ] || Download;
             ShowLyric;;
    *) echo &quot;Deadbeef is not running!&quot; &amp;&amp; exit 1;;
esac
done
</pre>
<p><strong>函数部分<br />
文件名 functions.main</strong></p>
<pre class="brush: plain;">
#!/bin/bash
# functions for lyric4deadbeef

######	include functions										######
######	Getstatus() GetInfo()  ShowLyric() Download() Wait()	###### 

# modified from mpdlyric by wiewi,lwldcr@gmail.com
# Show lyric when playing music with deadbeef
# 2011/07/17
# contributor wiewi,lwldcr@gmail.com
# 2011/08/06
# modified by Danny Chow, xizhengbing \A\T gmail.com
# Download function!!
# Finished on July 20,Wednesday
# Last modifed August 6,Saturday
Getstatus(){
before=$(deadbeef --nowplaying  %e 2&gt;/dev/null)
after=$(sleep 1;deadbeef --nowplaying  %e 2&gt;/dev/null)
[ $before != $after ] &amp;&amp; STATUS=&quot;playing&quot;
echo $STATUS
}
GetInfo(){

# Song info
SONG=$(deadbeef --nowplaying %t 2&gt;/dev/null)
ARTIST=$(deadbeef --nowplaying %a 2&gt;/dev/null)
NAME=$SONG

# LRC file
FILE=$LYRIC/`echo $NAME | tr -d ' '`.lrc
}

Download(){
    # 从gougou搜索歌词文件并下载
    #gougou will lead to the site used below

    GetInfo;

    PERIOD=''
    [ -f &quot;$SEARCH&quot; ] &amp;&amp; rm -f $SEARCH

    # “歌曲名 歌手” 搜索  管道写法参考lrcdis脚本
    wget -c -T 10 &quot;http://www.lrc123.com/?keyword=$NAME $ARTIST&amp;&quot; -O $SEARCH &gt; /dev/null 2&gt;&amp;1 |  iconv -f GBK

    URL=`cat $SEARCH | grep -B1 '下载' | grep color | sed -n '1p'| sed 's/&lt;[^&gt;]*&gt;//g' | tr -d ' '|sed 's/\\r//'`

    # 第一种方式搜索不到，使用“歌曲名” 搜索
    if [ -z &quot;$URL&quot; ];then
        wget -c -T 10 &quot;http://www.lrc123.com/?keyword=$NAME&amp;&quot; -O $SEARCH &gt; /dev/null 2&gt;&amp;1 | iconv -f GBK
    fi
    URL=`cat $SEARCH | grep -B1 '下载' | grep color | sed -n '1p'| sed 's/&lt;[^&gt;]*&gt;//g' | tr -d ' '|sed 's/\\r//'`

    if [ -z &quot;$URL&quot; ];then
    # 两种方式都搜索不到
        echo &quot;LRC not found!&quot; # &amp;&amp;  exit 1
        SONG_PREV=$(deadbeef --nowplaying %t 2&gt;/dev/null)
        Wait;

    else
    # 有搜索结果，那么下载歌词文件
        wget -c -T 10 $URL -O &quot;$FILE&quot; &gt; /dev/null 2&gt;&amp;1| iconv -f GBK
    fi

}

Wait(){
    # 对于下载不到歌词的曲目，每隔1秒重新读取播放器信息，一旦切换到下首，则重新尝试Download歌词
while :
do
   sleep 1
   GetInfo
   if [ &quot;$SONG_PREV&quot; != &quot;$SONG&quot; ];then
       SONG_PREV=$SONG
       [ -f &quot;$FILE&quot; ] || Download;
       ShowLyric;
   fi
done
}
ShowLyric(){
#       [ -f &quot;$FILE&quot; ] || Download;
       #eval &quot;$CMD&quot; &quot;\n$NAME - $ARTIST\n&quot;
       echo -e &quot;\n$NAME - $ARTIST\n&quot;
       notify-send &quot;$NAME - $ARTIST&quot;
       while :
       do
       if [ ! &quot;`file $FILE | grep -i utf-8`&quot; ];then
            iconv -f GBK -t UTF-8 $FILE -o $FILE
       fi
       TIME=$(deadbeef --nowplaying %e 2&gt;/dev/null)
       TEXT=$(cat &quot;$FILE&quot; | grep $TIME | sed 's/\[[^]]*]//g')
       CURRENT=$(deadbeef --nowplaying %t 2&gt;/dev/null)

       if [ -z &quot;$PREV&quot; -o &quot;$CURRENT&quot; = &quot;$PREV&quot; ];then
         PREV=$CURRENT

         # 换到下一句歌词
         if [ -n &quot;$TEXT&quot; -a &quot;$TEXT&quot; != &quot;$TEXT_PREV&quot; ];then
# Notify 方式有问题，歌词更新太慢，即使指定了timeout问题依旧
#       notify-send -t $TIMEOUT -- &quot;$TEXT&quot;
#              echo $TEXT
              sleep 0.8
              eval &quot;$CMD&quot;
              TEXT_PREV=&quot;$TEXT&quot;
         fi
       # 歌曲切换
       else
              PREV=''
              GetInfo
             # eval &quot;$CMD&quot; &quot;\n$NAME - $ARTIST\n&quot;
              echo -e &quot;\n$NAME - $ARTIST\n&quot;
              notify-send &quot;$NAME - $ARTIST&quot;

              [ -f &quot;$FILE&quot; ] || Download;
              continue
       fi
         sleep 0.3
       done
}
</pre>
<p>时间紧，暂时到此。水平有限，可能修改得不够好。</p>
<p>使用办法<br />
把前面的代码保存为 lyric4deadbeef.sh 或者你喜欢的名字<br />
后面的代码保存为 functions.main (和 lyric4deadbeef.sh同一个目录下)<br />
然后</p>
<pre class="brush: plain;">chmod +x  lyric4deadbeef.sh  functions.main</pre>
<p>当然，不想分开也是可以的。把函数部分并在lyric4deadbeef.sh中的 #!/bin/bash 后面，去掉行  . functions.main </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nooope.wordpress.com/1202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nooope.wordpress.com/1202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nooope.wordpress.com/1202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nooope.wordpress.com/1202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nooope.wordpress.com/1202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nooope.wordpress.com/1202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nooope.wordpress.com/1202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nooope.wordpress.com/1202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nooope.wordpress.com/1202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nooope.wordpress.com/1202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nooope.wordpress.com/1202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nooope.wordpress.com/1202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nooope.wordpress.com/1202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nooope.wordpress.com/1202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1202&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nooope.wordpress.com/2011/08/06/show-lyric-for-deadbeef-%e6%98%be%e7%a4%ba%e6%ad%8c%e8%af%8d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7af2d4849f4d2c39036f2a6840147ee5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wumingxiaozhen</media:title>
		</media:content>
	</item>
		<item>
		<title>fceux/xmame没有声音之dsp解决之道</title>
		<link>http://nooope.wordpress.com/2011/08/06/fceux-xmame%e6%b2%a1%e6%9c%89%e5%a3%b0%e9%9f%b3/</link>
		<comments>http://nooope.wordpress.com/2011/08/06/fceux-xmame%e6%b2%a1%e6%9c%89%e5%a3%b0%e9%9f%b3/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 05:15:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://nooope.wordpress.com/?p=1198</guid>
		<description><![CDATA[fceux/xmame 这两个的特点都是使用SDL引擎。 本人目前使用的声音架构是ALSA+puleaudio 我在~/.zshrc里配置了以下内容。 export SDL_AUDIODRIVER=dsp 设定使用/dev/dsp，结果找不到设备，搜索。找到解决之道。要添加模块snd-pcm-oss， 默认没有添加 在/etc/rc.conf载入模块设定里添加snd-pcm-oss，修改后的内容为 MODULES=(fuse snd-pcm-oss !usblp) 立即生效的做法 参考资料: http://wiki.debian.org/SoundFAQ Error: audio: /dev/dsp: No such file or directory If the audio mixer application is reporting that no mixer is available, or gives an error: audio: /dev/dsp: No such file or directory It is necessary to load the snd-pcm-oss module.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1198&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>fceux/xmame 这两个的特点都是使用SDL引擎。<br />
本人目前使用的声音架构是ALSA+puleaudio<br />
我在~/.zshrc里配置了以下内容。</p>
<blockquote><p>export SDL_AUDIODRIVER=dsp</p></blockquote>
<p>设定使用/dev/dsp，结果找不到设备，搜索。找到解决之道。要添加模块snd-pcm-oss， 默认没有添加<br />
在/etc/rc.conf载入模块设定里添加snd-pcm-oss，修改后的内容为</p>
<blockquote><p>
MODULES=(fuse snd-pcm-oss !usblp)
</p></blockquote>
<p>立即生效的做法</p>
<pre class="brush: plain;">modprobe snd-pcm-oss</pre>
<p>参考资料: <a href="http://wiki.debian.org/SoundFAQ" title="SoundFAQ">http://wiki.debian.org/SoundFAQ</a></p>
<blockquote><p>
Error: audio: /dev/dsp: No such file or directory</p>
<p>If the audio mixer application is reporting that no mixer is available, or gives an error:</p>
<p>    audio: /dev/dsp: No such file or directory </p>
<p>It is necessary to load the snd-pcm-oss module. </p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nooope.wordpress.com/1198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nooope.wordpress.com/1198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nooope.wordpress.com/1198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nooope.wordpress.com/1198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nooope.wordpress.com/1198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nooope.wordpress.com/1198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nooope.wordpress.com/1198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nooope.wordpress.com/1198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nooope.wordpress.com/1198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nooope.wordpress.com/1198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nooope.wordpress.com/1198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nooope.wordpress.com/1198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nooope.wordpress.com/1198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nooope.wordpress.com/1198/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1198&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nooope.wordpress.com/2011/08/06/fceux-xmame%e6%b2%a1%e6%9c%89%e5%a3%b0%e9%9f%b3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7af2d4849f4d2c39036f2a6840147ee5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wumingxiaozhen</media:title>
		</media:content>
	</item>
		<item>
		<title>sed替换指定多行关键词</title>
		<link>http://nooope.wordpress.com/2011/08/03/sed%e6%9b%bf%e6%8d%a2%e6%8c%87%e5%ae%9a%e5%a4%9a%e8%a1%8c%e7%89%b9%e5%ae%9a%e5%85%b3%e9%94%ae%e8%af%8d/</link>
		<comments>http://nooope.wordpress.com/2011/08/03/sed%e6%9b%bf%e6%8d%a2%e6%8c%87%e5%ae%9a%e5%a4%9a%e8%a1%8c%e7%89%b9%e5%ae%9a%e5%85%b3%e9%94%ae%e8%af%8d/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 09:34:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[skill]]></category>

		<guid isPermaLink="false">http://nooope.wordpress.com/?p=1190</guid>
		<description><![CDATA[本来的问题不是&#8221;替换指定多行关键词&#8221; 这么抽象的。本来的问题是：注释含有关键词 “foo” 的行， 注释符是 % 经过本人的思考，就转化变成前面的问题。 在百度里也有人提过这个问题，可惜问题关闭了。 用vi命令替换1到10行，或者替换当前行到某行，这个都会，但是如果我想要替换1-10行，18，20行，这样怎么写？ 下面是实现代码 解释一下 for i in ;do ;done 经典的for 循环 grep -n &#8216;foo&#8217; foo.ps &#124; awk -F &#8220;:&#8221; &#8216;{print $1}&#8217; 获取关键词所在行号 echo $i&#124;sed -i &#8220;${i}s/^/%/&#8221; 传递shell变量给sed, 并替换指定行$i 的关键词^(行首)为%(注释) 代码虽短，但并不意味着写出这段代码容易和省时间。 目前只知道种方法，至于其它方法，God knows.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1190&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>本来的问题不是&#8221;替换指定多行关键词&#8221; 这么抽象的。本来的问题是：注释含有关键词 “foo” 的行， 注释符是 %<br />
经过本人的思考，就转化变成前面的问题。<br />
在百度里也有人提过<a href="http://zhidao.baidu.com/question/43587469.html">这个问题</a>，可惜问题关闭了。</p>
<blockquote><p>用vi命令替换1到10行，或者替换当前行到某行，这个都会，但是如果我想要替换1-10行，18，20行，这样怎么写？</p></blockquote>
<p>下面是实现代码</p>
<pre class="brush: plain;">for i in  `grep -n 'foo' foo.ps | awk -F &quot;:&quot; '{print $1}'`;
do echo $i|sed -i &quot;${i}s/^/%/&quot; foo.ps ;done</pre>
<p><strong>解释一下</strong></p>
<ul>
<li>for i in ;do ;done 经典的for 循环</li>
<li>grep -n &#8216;foo&#8217; foo.ps | awk -F &#8220;:&#8221; &#8216;{print $1}&#8217; 获取关键词所在行号</li>
<li>echo $i|sed -i &#8220;${i}s/^/%/&#8221;  传递shell变量给sed, 并替换指定行$i 的关键词^(行首)为%(注释)</li>
</ul>
<p>代码虽短，但并不意味着写出这段代码容易和省时间。<br />
目前只知道种方法，至于其它方法，God knows.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nooope.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nooope.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nooope.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nooope.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nooope.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nooope.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nooope.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nooope.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nooope.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nooope.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nooope.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nooope.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nooope.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nooope.wordpress.com/1190/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1190&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nooope.wordpress.com/2011/08/03/sed%e6%9b%bf%e6%8d%a2%e6%8c%87%e5%ae%9a%e5%a4%9a%e8%a1%8c%e7%89%b9%e5%ae%9a%e5%85%b3%e9%94%ae%e8%af%8d/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7af2d4849f4d2c39036f2a6840147ee5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wumingxiaozhen</media:title>
		</media:content>
	</item>
		<item>
		<title>pdf去水印&#8211;使用xdotool实现大量的重复点击</title>
		<link>http://nooope.wordpress.com/2011/08/02/pdf%e5%8e%bb%e6%b0%b4%e5%8d%b0-%e4%bd%bf%e7%94%a8xdotool%e5%ae%9e%e7%8e%b0%e5%a4%a7%e9%87%8f%e7%9a%84%e9%87%8d%e5%a4%8d%e7%82%b9%e5%87%bb/</link>
		<comments>http://nooope.wordpress.com/2011/08/02/pdf%e5%8e%bb%e6%b0%b4%e5%8d%b0-%e4%bd%bf%e7%94%a8xdotool%e5%ae%9e%e7%8e%b0%e5%a4%a7%e9%87%8f%e7%9a%84%e9%87%8d%e5%a4%8d%e7%82%b9%e5%87%bb/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 17:20:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://nooope.wordpress.com/?p=1180</guid>
		<description><![CDATA[pdf去水印&#8211;使用xdotool实现大量的重复点击 下载了pdf文档，可惜有水印影响阅读，去之。手动去掉的话，工作量那是相当的大。 重复的事情交给程序做。程序只会做重复的事情。 参考了这篇文章的想法后，开始实施。下面的是那个想法的实现。 所用工具 wine Foxit PDF Editor xdotool linux下的按键精灵 首先安装xdotool 其次获取光标要到达的所有位置 移动光标到目标位置，然后执行下面命令，获得当前光标所在位置坐标 因为水印的位置不同，并且窗口位置也不同。所以，光标的位置不大相同。不过，也可以使用相对坐标（好复杂）。 某个pdf文档去水印的光标操作代码 有一个问题，为什么脚本运行结束后，会有字符输出的？ 如 ^[[5~% 去水印算是逆向操作。当水印分布不规则时，那是比较麻烦的。 参考资料: 网页转PDF及PDF去水印 - [技术杂烩] http://liquid-galaxy.googlecode.com/svn-history/r282/trunk/gnu_linux/home/lg/bin/streetview<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1180&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>pdf去水印&#8211;使用xdotool实现大量的重复点击</h1>
<p>下载了pdf文档，可惜有水印影响阅读，去之。手动去掉的话，工作量那是相当的大。</p>
<blockquote><p>重复的事情交给程序做。程序只会做重复的事情。</p></blockquote>
<p>参考了<a href="http://pheyoung.blogbus.com/logs/72115899.html" title="pdf批量去水印" target="_blank">这篇文章的想法</a>后，开始实施。下面的是那个想法的实现。</p>
<ul><strong>所用工具</strong></p>
<li>wine</li>
<li>Foxit PDF Editor</li>
<li>xdotool linux下的按键精灵</li>
</ul>
<ul>
<li>首先安装xdotool</li>
<pre class="brush: plain;">#pacman -Sy xdotool</pre>
<li>其次获取光标要到达的所有位置</li>
<p>移动光标到目标位置，然后执行下面命令，获得当前光标所在位置坐标</p>
<pre class="brush: plain;">xdotool getmouselocation 2&gt;/dev/null |awk -F &quot;:&quot; '{print $2,$3}' |awk '{print $1,$3}'</pre>
<p>因为水印的位置不同，并且窗口位置也不同。所以，光标的位置不大相同。不过，也可以使用相对坐标（好复杂）。</ul>
<p>某个pdf文档去水印的光标操作代码</p>
<pre class="brush: plain;">
#!/bin/bash
# remove mark
# pages
var=247
while [ $var -gt 0 ];do
## select
xdotool mousemove 1316 141
xdotool keydown Prior
xdotool mousemove 1416 243
xdotool keyup Prior
xdotool mousemove 1362 184
xdotool sleep 1
xdotool click 1
## del
xdotool mousemove 1057  120
xdotool sleep 1
xdotool click 1
## next page
xdotool mousemove 1268  855
xdotool click 1
var=`expr $var - 1`
done
exit 0
</pre>
<p>有一个问题，为什么脚本运行结束后，会有字符输出的？ 如 ^[[5~%<br />
去水印算是逆向操作。当水印分布不规则时，那是比较麻烦的。<br />
<strong>参考资料:</strong></p>
<ul>
<li><a href="http://pheyoung.blogbus.com/logs/72115899.html">网页转PDF及PDF去水印 - [技术杂烩]</a></li>
<li><a href="http://liquid-galaxy.googlecode.com/svn-history/r282/trunk/gnu_linux/home/lg/bin/streetview">http://liquid-galaxy.googlecode.com/svn-history/r282/trunk/gnu_linux/home/lg/bin/streetview</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nooope.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nooope.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nooope.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nooope.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nooope.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nooope.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nooope.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nooope.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nooope.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nooope.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nooope.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nooope.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nooope.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nooope.wordpress.com/1180/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1180&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nooope.wordpress.com/2011/08/02/pdf%e5%8e%bb%e6%b0%b4%e5%8d%b0-%e4%bd%bf%e7%94%a8xdotool%e5%ae%9e%e7%8e%b0%e5%a4%a7%e9%87%8f%e7%9a%84%e9%87%8d%e5%a4%8d%e7%82%b9%e5%87%bb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7af2d4849f4d2c39036f2a6840147ee5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wumingxiaozhen</media:title>
		</media:content>
	</item>
		<item>
		<title>已保护：perl正则表达式</title>
		<link>http://nooope.wordpress.com/2011/08/01/perl%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f/</link>
		<comments>http://nooope.wordpress.com/2011/08/01/perl%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 12:19:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://nooope.wordpress.com/?p=1167</guid>
		<description><![CDATA[被密码保护的日志没有摘录。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1167&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>这篇文章已经经过密码保护，您需要密码才可继续阅读。</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nooope.wordpress.com/1167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nooope.wordpress.com/1167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nooope.wordpress.com/1167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nooope.wordpress.com/1167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nooope.wordpress.com/1167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nooope.wordpress.com/1167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nooope.wordpress.com/1167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nooope.wordpress.com/1167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nooope.wordpress.com/1167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nooope.wordpress.com/1167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nooope.wordpress.com/1167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nooope.wordpress.com/1167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nooope.wordpress.com/1167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nooope.wordpress.com/1167/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1167&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nooope.wordpress.com/2011/08/01/perl%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7af2d4849f4d2c39036f2a6840147ee5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wumingxiaozhen</media:title>
		</media:content>
	</item>
		<item>
		<title>conky在kde下透明背景</title>
		<link>http://nooope.wordpress.com/2011/08/01/conky%e5%9c%a8kde%e4%b8%8b%e9%80%8f%e6%98%8e%e8%83%8c%e6%99%af/</link>
		<comments>http://nooope.wordpress.com/2011/08/01/conky%e5%9c%a8kde%e4%b8%8b%e9%80%8f%e6%98%8e%e8%83%8c%e6%99%af/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 03:14:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://nooope.wordpress.com/?p=1162</guid>
		<description><![CDATA[在kde 下，conky背景不透明了。google之，结果找到解决方案。用feh再设定一次kde设定的壁纸为背景，有点绕。因为kde设定壁纸的分辨率不是1440&#215;900，就是1920&#215;1200，所以下面的也就是这两个分辨率。我把它写成script了。在这里，学会使用流程控制 if ;then elif ;then else fi 效果图 参考资料 http://krisko210.blogspot.com/2011/05/kde-and-transparent-conky.html<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1162&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>在kde 下，conky背景不透明了。google之，结果找到解决方案。用feh再设定一次kde设定的壁纸为背景，有点绕。因为kde设定壁纸的分辨率不是1440&#215;900，就是1920&#215;1200，所以下面的也就是这两个分辨率。我把它写成script了。在这里，学会使用流程控制 </p>
<blockquote><p>if ;then<br />
elif ;then<br />
else<br />
fi</p></blockquote>
<pre class="brush: plain;">
#!/bin/bash
killall conky
sleep 10
GOT=$(grep 'wallpaper=' ~/.kde4/share/config/plasma-desktop-appletsrc | tail -n 1 |awk -F '=' '{print $2}')
BG1=${GOT}contents/images/1440x900.jpg
BG2=${GOT}contents/images/1920x1200.jpg
echo &quot;$BG1\n$BG2&quot;
if [ -f $BG1 ] ; then
	feh --bg-scale $BG1
elif [ -f $BG2 ] ; then
	feh --bg-scale $BG2
fi
conky
exit 0
</pre>
<p>效果图</p>
<p><img alt="" src="http://farm7.static.flickr.com/6021/5996196535_4061ffd9c0_z.jpg" title="conky in kde " class="alignnone" width="209" height="210" /></p>
<p><strong>参考资料</strong><br />
<a href="http://krisko210.blogspot.com/2011/05/kde-and-transparent-conky.html" title="kde-and-transparent-conky">http://krisko210.blogspot.com/2011/05/kde-and-transparent-conky.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nooope.wordpress.com/1162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nooope.wordpress.com/1162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nooope.wordpress.com/1162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nooope.wordpress.com/1162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nooope.wordpress.com/1162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nooope.wordpress.com/1162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nooope.wordpress.com/1162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nooope.wordpress.com/1162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nooope.wordpress.com/1162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nooope.wordpress.com/1162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nooope.wordpress.com/1162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nooope.wordpress.com/1162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nooope.wordpress.com/1162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nooope.wordpress.com/1162/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nooope.wordpress.com&amp;blog=25641422&amp;post=1162&amp;subd=nooope&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nooope.wordpress.com/2011/08/01/conky%e5%9c%a8kde%e4%b8%8b%e9%80%8f%e6%98%8e%e8%83%8c%e6%99%af/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7af2d4849f4d2c39036f2a6840147ee5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wumingxiaozhen</media:title>
		</media:content>

		<media:content url="http://farm7.static.flickr.com/6021/5996196535_4061ffd9c0_z.jpg" medium="image">
			<media:title type="html">conky in kde </media:title>
		</media:content>
	</item>
	</channel>
</rss>
