<?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; shell</title>
	<atom:link href="http://bluehua.org/tag/shell/feed" rel="self" type="application/rss+xml" />
	<link>http://bluehua.org</link>
	<description>分享所学,backup一切~</description>
	<lastBuildDate>Wed, 23 Nov 2011 08:43:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>乱马～</title>
		<link>http://bluehua.org/2011/04/22/1624.html</link>
		<comments>http://bluehua.org/2011/04/22/1624.html#comments</comments>
		<pubDate>Fri, 22 Apr 2011 06:15:59 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[soft]]></category>
		<category><![CDATA[mxmlc]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tree]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=1624</guid>
		<description><![CDATA[~/.bashrc #flex sdk在ubuntu上好好的，到了mac os下就乱码了～～！ mxmlc&#40;&#41; &#123; /Users/hualu/opt/flex_sdk_4.1.0.16076/bin/mxmlc $* &#124; iconv -f gb2312 -t utf-8 &#125; &#160; #tree,一条基本不用的命令，给同学发目录列表用过一次，中文会被编码 tree&#40;&#41; &#123; /opt/local/bin/tree $* &#124; ascii2uni -aK &#125;]]></description>
			<content:encoded><![CDATA[<p>~/.bashrc</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#flex sdk在ubuntu上好好的，到了mac os下就乱码了～～！</span>
mxmlc<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>hualu<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>flex_sdk_4.1.0.16076<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mxmlc <span style="color: #007800;">$*</span> <span style="color: #000000; font-weight: bold;">|</span> iconv <span style="color: #660033;">-f</span> gb2312 <span style="color: #660033;">-t</span> utf-<span style="color: #000000;">8</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#tree,一条基本不用的命令，给同学发目录列表用过一次，中文会被编码</span>
<span style="color: #c20cb9; font-weight: bold;">tree</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">tree</span> <span style="color: #007800;">$*</span> <span style="color: #000000; font-weight: bold;">|</span> ascii2uni <span style="color: #660033;">-aK</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2011/04/22/1624.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>shell下批量标记mp3标签</title>
		<link>http://bluehua.org/2010/12/19/1500.html</link>
		<comments>http://bluehua.org/2010/12/19/1500.html#comments</comments>
		<pubDate>Sun, 19 Dec 2010 10:21:34 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tag]]></category>

		<guid isPermaLink="false">http://bluehua.org/2010/12/19/1500.html</guid>
		<description><![CDATA[#设置歌手 mid3v2 -a &#34;歌手&#34; *.mp3 #设置专辑名 mid3v2 -A &#34;专辑名&#34; *.mp3 #用文件名标记mp3的title find -name &#34;*.mp3&#34; &#124; while read file;do mid3v2 -t &#34;`echo $file&#124;sed -e 's/^\.\///g' -e 's/.mp3$//g'`&#34; &#34;$file&#34;;done &#8212;&#8212;&#8212;&#8211; post by gmail~]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#设置歌手</span>
mid3v2 <span style="color: #660033;">-a</span> <span style="color: #ff0000;">&quot;歌手&quot;</span> <span style="color: #000000; font-weight: bold;">*</span>.mp3
<span style="color: #666666; font-style: italic;">#设置专辑名</span>
mid3v2 <span style="color: #660033;">-A</span> <span style="color: #ff0000;">&quot;专辑名&quot;</span> <span style="color: #000000; font-weight: bold;">*</span>.mp3
<span style="color: #666666; font-style: italic;">#用文件名标记mp3的title</span>
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.mp3&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">file</span>;<span style="color: #000000; font-weight: bold;">do</span> mid3v2 <span style="color: #660033;">-t</span> <span style="color: #ff0000;">&quot;<span style="color: #780078;">`echo $file|sed -e 's/^\.\///g' -e 's/.mp3$//g'`</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$file</span>&quot;</span>;<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>&#8212;&#8212;&#8212;&#8211;<br />
post by gmail~</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2010/12/19/1500.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>简单的blog增量备份shell</title>
		<link>http://bluehua.org/2010/04/11/1100.html</link>
		<comments>http://bluehua.org/2010/04/11/1100.html#comments</comments>
		<pubDate>Sun, 11 Apr 2010 08:57:43 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[other]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=1100</guid>
		<description><![CDATA[blog内容越来越多,完全备份已经玩不起了,终于用到了tar的增量备份功能~~ 这个简单的备份脚本需要安装mutt(用来发mail) : sudo apt-get install mutt 或者 yum install mutt #!/bin/sh #blog根目录 dir=&#34;/home/hualu/blog&#34; #本地备份目录 backdir=&#34;/var/backup/bluehua/&#34; #将备份发送到email mail=&#34;emptyhua+backup@gmail.com&#34; dbname=&#34;数据库名&#34; dbuser=&#34;mysql用户名&#34; dbpass=&#34;mysql密码&#34; file=&#34;${backdir}backup-`date \&#34;+%Y-%m-%d\&#34;`.tar.gz&#34; sql=&#34;./sql_backup_${RANDOM}.sql&#34; cd &#34;$dir&#34; mysqldump --user=${dbuser} --password=${dbpass} ${dbname} &#62; ${sql} #增量打包,第一次运行会打包全部,以后都只会打包修改和新增的文件 #由于启用了cache插件,所以将cache目录排除在外 tar -g ${backdir}cookie -zcvf ${file} --exclude=./wp-content/cache* ./ rm -f ${sql} #将备份发送到mail echo &#34;blog备份&#34; &#124; mutt -s &#34;blog备份 `date \&#34;+%Y-%m-%d\&#34;`&#34; -a ${file} [...]]]></description>
			<content:encoded><![CDATA[<p>blog内容越来越多,完全备份已经玩不起了,终于用到了tar的增量备份功能~~<br />
这个简单的备份脚本需要安装mutt(用来发mail) : sudo apt-get install mutt 或者 yum install mutt</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#blog根目录</span>
<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dir</span></span>=<span style="color: #ff0000;">&quot;/home/hualu/blog&quot;</span>
<span style="color: #666666; font-style: italic;">#本地备份目录</span>
<span style="color: #007800;">backdir</span>=<span style="color: #ff0000;">&quot;/var/backup/bluehua/&quot;</span>
<span style="color: #666666; font-style: italic;">#将备份发送到email</span>
<span style="color: #007800;">mail</span>=<span style="color: #ff0000;">&quot;emptyhua+backup@gmail.com&quot;</span>
<span style="color: #007800;">dbname</span>=<span style="color: #ff0000;">&quot;数据库名&quot;</span>
<span style="color: #007800;">dbuser</span>=<span style="color: #ff0000;">&quot;mysql用户名&quot;</span>
<span style="color: #007800;">dbpass</span>=<span style="color: #ff0000;">&quot;mysql密码&quot;</span>
<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">file</span></span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${backdir}</span>backup-<span style="color: #780078;">`date \&quot;+%Y-%m-%d\&quot;`</span>.tar.gz&quot;</span>
<span style="color: #007800;">sql</span>=<span style="color: #ff0000;">&quot;./sql_backup_<span style="color: #007800;">${RANDOM}</span>.sql&quot;</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$dir</span>&quot;</span> 
mysqldump <span style="color: #660033;">--user</span>=<span style="color: #800000;">${dbuser}</span> <span style="color: #660033;">--password</span>=<span style="color: #800000;">${dbpass}</span> <span style="color: #800000;">${dbname}</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #800000;">${sql}</span> 
<span style="color: #666666; font-style: italic;">#增量打包,第一次运行会打包全部,以后都只会打包修改和新增的文件</span>
<span style="color: #666666; font-style: italic;">#由于启用了cache插件,所以将cache目录排除在外</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-g</span> <span style="color: #800000;">${backdir}</span>cookie <span style="color: #660033;">-zcvf</span> <span style="color: #800000;">${file}</span> <span style="color: #660033;">--exclude</span>=.<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">*</span> .<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #800000;">${sql}</span> 
<span style="color: #666666; font-style: italic;">#将备份发送到mail</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;blog备份&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> mutt <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;blog备份 <span style="color: #780078;">`date \&quot;+%Y-%m-%d\&quot;`</span>&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #800000;">${file}</span> <span style="color: #800000;">${mail}</span></pre></div></div>

<p><a href="http://bluehua.org/wp-content/uploads/2010/04/screenshot_061.png"><img src="http://bluehua.org/wp-content/uploads/2010/04/screenshot_061.png" alt="" title="screenshot_061" width="299" height="154" class="alignnone size-full wp-image-1109" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2010/04/11/1100.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>纯sed压缩css文件</title>
		<link>http://bluehua.org/2009/12/01/701.html</link>
		<comments>http://bluehua.org/2009/12/01/701.html#comments</comments>
		<pubDate>Tue, 01 Dec 2009 12:20:34 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=701</guid>
		<description><![CDATA[额,如果不考虑用java,还是可以考虑考虑这个&#8230; #!/bin/sh #&#34;^M&#34;用来代替显示win下的换行符,直接复制这段脚本是不能用滴 cat $1 &#124; sed -e 's/^M//g;s/^\xef\xbb\xbf//g;s/\([^0-9]\)0p[xt]/\10/g' -e 's/\/\*.*\*\///g' &#124; sed -e '/^[\t ]*\/\*/,/\*\/[\t ]*$/d' &#124; sed -e '/^[\t ]*$/d' -e 's/^[\t ]*//g' -e 's/;[\t ]*/;/g' -e 's/}[\t ]*/}/g' -e 's/\([^,\{;\}]\)$/\1;/g' -e 's/};/}/g' &#124; sed -e :a -e '/[,;{][\t ]*$/{N;s/\n/ /;ba}' &#62; /tmp/lala_css mv /tmp/lala_css $1 压缩规则较简单.. 删除注释 删除不必要的空白 删除window的utf BOM标记,删除win下的换行符 每条规则压成一行 0px [...]]]></description>
			<content:encoded><![CDATA[<p>额,如果不考虑用java,还是可以考虑考虑这个&#8230;</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#&quot;^M&quot;用来代替显示win下的换行符,直接复制这段脚本是不能用滴</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> $<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/^M//g;s/^\xef\xbb\xbf//g;s/\([^0-9]\)0p[xt]/\10/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/\/\*.*\*\///g'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/^[\t ]*\/\*/,/\*\/[\t ]*$/d'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/^[\t ]*$/d'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/^[\t ]*//g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/;[\t ]*/;/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/}[\t ]*/}/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/\([^,\{;\}]\)$/\1;/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/};/}/g'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> :a <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/[,;{][\t ]*$/{N;s/\n/ /;ba}'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>lala_css
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>lala_css $<span style="color: #000000;">1</span></pre></div></div>

<p>压缩规则较简单..</p>
<ul>
<li>删除注释</li>
<li>删除不必要的空白</li>
<li>删除window的utf BOM标记,删除win下的换行符</li>
<li>每条规则压成一行</li>
<li>0px -&gt; 0</li>
</ul>
<p>压缩效果如下,比yuicompressor差一点:</p>
<pre> 72344 2009-12-01 19:57 layout.css
 69626 2009-12-01 19:52 layout-mini-sed.css
 68720 2009-12-01 19:56 layout-mini-yui.css</pre>
<p><a href="http://bluehua.org/wp-content/uploads/2009/12/compress-css.zip">文件下载点这里:compress-css.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/12/01/701.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>批量替换css里图片的相对路径为绝对路径</title>
		<link>http://bluehua.org/2009/12/01/686.html</link>
		<comments>http://bluehua.org/2009/12/01/686.html#comments</comments>
		<pubDate>Tue, 01 Dec 2009 09:37:51 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=686</guid>
		<description><![CDATA[最近好像总是发些shell的东西,木办法,最近没怎么写js的样子&#8230; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; 恩,之所以要替换成绝对路径,是因为css和图片host在不同域的server上,写完刚在站里的静态跑过,好像木啥大问题~ 效果: /img/a.gif 会被替换成 http://domain/img/a.gif ../img/a.gif 会被替换成类似 http://domain/parent/img/a.gif 使用方法如下(linux only) #直接跟目录就好了 sh r2a.sh /opt/static 脚本下载点这里:r2a.zip 贴出shell的源码,便于不想下载又想看看shell的同学,还有个python脚本,就不贴了,没啥含量 #!/bin/sh #@author emptyhua@gmail.com &#160; #本地根目录 LROOT=&#34;/home/hualu/work/static&#34; #远程根目录 RROOT=&#34;http://myimgdomain.cn&#34; #要处理目录的绝对路径 CP=&#34;`cd $1;pwd`&#34; #用于转换相对路径为绝对路径的python脚本的路径 PY=&#34;/home/hualu/bin/get_sed_rule.py&#34; LROOTR=&#34;`echo ${LROOT} &#124; sed 's/\\//\\\\\//g;s/\\./\\\\\\./g'`&#34; RROOTR=&#34;`echo ${RROOT} &#124; sed 's/\\//\\\\\//g;s/\\./\\\\\\./g'`&#34; &#160; echo &#34;执行路径${CP}&#34; find ${CP} -name &#34;*.css&#34; &#62; /tmp/_r2a_css_files &#160; cat /tmp/_r2a_css_files &#124; while [...]]]></description>
			<content:encoded><![CDATA[<p>最近好像总是发些shell的东西,木办法,最近没怎么写js的样子&#8230;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
恩,之所以要替换成绝对路径,是因为css和图片host在不同域的server上,写完刚在站里的静态跑过,好像木啥大问题~<br />
效果:</p>
<pre>
/img/a.gif 会被替换成 http://domain/img/a.gif
../img/a.gif 会被替换成类似 http://domain/parent/img/a.gif
</pre>
<p>使用方法如下(linux only)</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#直接跟目录就好了</span>
<span style="color: #c20cb9; font-weight: bold;">sh</span> r2a.sh <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>static</pre></div></div>

<p><a href='http://bluehua.org/wp-content/uploads/2009/12/r2a.zip'>脚本下载点这里:r2a.zip</a><br />
贴出shell的源码,便于不想下载又想看看shell的同学,还有个python脚本,就不贴了,没啥含量</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#@author emptyhua@gmail.com</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#本地根目录</span>
<span style="color: #007800;">LROOT</span>=<span style="color: #ff0000;">&quot;/home/hualu/work/static&quot;</span>
<span style="color: #666666; font-style: italic;">#远程根目录</span>
<span style="color: #007800;">RROOT</span>=<span style="color: #ff0000;">&quot;http://myimgdomain.cn&quot;</span>
<span style="color: #666666; font-style: italic;">#要处理目录的绝对路径</span>
<span style="color: #007800;">CP</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`cd $1;pwd`</span>&quot;</span>
<span style="color: #666666; font-style: italic;">#用于转换相对路径为绝对路径的python脚本的路径</span>
<span style="color: #007800;">PY</span>=<span style="color: #ff0000;">&quot;/home/hualu/bin/get_sed_rule.py&quot;</span>
<span style="color: #007800;">LROOTR</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`echo ${LROOT} | sed 's/\\//\\\\\//g;s/\\./\\\\\\./g'`</span>&quot;</span>
<span style="color: #007800;">RROOTR</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`echo ${RROOT} | sed 's/\\//\\\\\//g;s/\\./\\\\\\./g'`</span>&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;执行路径<span style="color: #007800;">${CP}</span>&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #800000;">${CP}</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.css&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_css_files 
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_css_files <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> f;<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;处理:<span style="color: #007800;">${f}</span>&quot;</span>
    <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">dir</span></span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`dirname \&quot;${f}\&quot;`</span>&quot;</span>
<span style="color: #666666; font-style: italic;">#获取css文件所在的发布目录</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${dir}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/<span style="color: #007800;">${LROOTR}</span>/<span style="color: #007800;">${RROOTR}</span>/&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_remote_path
    <span style="color: #007800;">remote_path</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`cat /tmp/_r2a_remote_path`</span>&quot;</span>
<span style="color: #666666; font-style: italic;">#收集要处理的图片路径</span>
    <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$f</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print NR,&quot;####&quot;,$0}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;url([<span style="color: #000099; font-weight: bold;">\&quot;</span>\']*\.\{1,2\}&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_file
    <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_file <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/url([<span style="color: #000099; font-weight: bold;">\&quot;</span>\']*\(\.\.[^\)]*\)[<span style="color: #000099; font-weight: bold;">\&quot;</span>\']*)/开始\1始开/g&quot;</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/####[^始]*开始/:/;s/始开[^始]*$/:/;s/始开[^始]*开始/:/g&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_cssimage
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">''</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_sed_rule
<span style="color: #666666; font-style: italic;">#将相对路径转换为绝对路径,并生成sed语句</span>
    <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_cssimage <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> r;<span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #007800;">rule</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`python \&quot;${PY}\&quot; \&quot;${r}\&quot; \&quot;${remote_path}\&quot;`</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${rule}</span>;&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_sed_rule 
    <span style="color: #000000; font-weight: bold;">done</span>
    <span style="color: #007800;">sed_rule</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`cat /tmp/_r2a_sed_rule | tr -d '\\n'`</span>&quot;</span>
<span style="color: #666666; font-style: italic;">#利用sed处理文件</span>
    <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$sed_rule</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${f}</span>&quot;</span>
    <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;s/url(\([<span style="color: #000099; font-weight: bold;">\&quot;</span>\']*\)\//url(\1<span style="color: #007800;">${RROOTR}</span>\//g&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${f}</span>&quot;</span> 
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_css_files
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_remote_path
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_file
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_cssimage
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_r2a_sed_rule</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/12/01/686.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>恶作剧脚本..</title>
		<link>http://bluehua.org/2009/09/19/570.html</link>
		<comments>http://bluehua.org/2009/09/19/570.html#comments</comments>
		<pubDate>Sat, 19 Sep 2009 03:07:58 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[other]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=570</guid>
		<description><![CDATA[昨晚公司开颁奖晚会(日子选的很别扭),偶们改的状态会实时显示在状态墙上.彩排完毕超市购物间隙跟强哥想到一个恶搞的方法&#8211;刷屏.具体来说就是用偶们几个人滴号不停的改状态刷状态墙.于是立刻找到一个网吧实施罪恶的行为. 我写脚本,强哥写用来刷屏的状态,额,用shell改状态就两句话,不过放在公司的机器上,没办法,还得现查curl,最终在入场之前还是把脚本写完了&#8230; #!/bin/sh &#160; #所有的状态放到status.txt中,然后用这个函数循环取 get_status&#40;&#41; &#123; #取第一行状态 head -1 status.txt #第一行移动到最后一行 sed -i -e '1{h;d};$G' status.txt &#125; &#160; #该状态的函数,两个参数:用户名,密码 send_status&#40;&#41; &#123; user=$1 pass=$2 word=&#34;`get_status`&#34; word=&#34;`perl -MURI::Escape -e &#34;print uri_escape('${word}');&#34;`&#34; curl -A &#34;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&#34; -D /tmp/cookies -d &#34;email=${user}&#38;password=${pass}&#34; http://login.renren.com/login.do curl -e &#34;http://renren.com/Home.do&#34; -A &#34;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>昨晚公司开颁奖晚会(日子选的很别扭),偶们改的状态会实时显示在状态墙上.彩排完毕超市购物间隙跟强哥想到一个恶搞的方法&#8211;刷屏.具体来说就是用偶们几个人滴号不停的改状态刷状态墙.于是立刻找到一个网吧实施罪恶的行为<img class="xemotion" src="http://bluehua.org/wp-content/plugins/x-emotions/emotions/msn/bofu2_18.gif" border="0" alt="" />.</p>
<p>我写脚本,强哥写用来刷屏的状态,额,用shell改状态就两句话,不过放在公司的机器上,没办法,还得现查curl,最终在入场之前还是把脚本写完了&#8230;</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#所有的状态放到status.txt中,然后用这个函数循环取</span>
get_status<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #666666; font-style: italic;">#取第一行状态</span>
    <span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-1</span> status.txt
    <span style="color: #666666; font-style: italic;">#第一行移动到最后一行</span>
    <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'1{h;d};$G'</span> status.txt
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#该状态的函数,两个参数:用户名,密码</span>
send_status<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">user</span>=$<span style="color: #000000;">1</span>
    <span style="color: #007800;">pass</span>=$<span style="color: #000000;">2</span>
    <span style="color: #007800;">word</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`get_status`</span>&quot;</span>
    <span style="color: #007800;">word</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`perl -MURI::Escape -e &quot;print uri_escape('${word}');&quot;`</span>&quot;</span>
    curl <span style="color: #660033;">-A</span> <span style="color: #ff0000;">&quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&quot;</span> <span style="color: #660033;">-D</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>cookies <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;email=<span style="color: #007800;">${user}</span>&amp;password=<span style="color: #007800;">${pass}</span>&quot;</span> http:<span style="color: #000000; font-weight: bold;">//</span>login.renren.com<span style="color: #000000; font-weight: bold;">/</span>login.do
    curl <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;http://renren.com/Home.do&quot;</span> <span style="color: #660033;">-A</span> <span style="color: #ff0000;">&quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)&quot;</span> <span style="color: #660033;">-b</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>cookies <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;c=<span style="color: #007800;">${word}</span>&amp;raw=<span style="color: #007800;">${word}</span>&quot;</span> http:<span style="color: #000000; font-weight: bold;">//</span>status.renren.com<span style="color: #000000; font-weight: bold;">/</span>doing<span style="color: #000000; font-weight: bold;">/</span>update.do 
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#main</span>
send_all<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;s&quot;</span>=<span style="color: #ff0000;">&quot;s&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;<span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #666666; font-style: italic;">#on_off.txt是个开关文件,如果存在时才会发状态</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;/tmp/on_off.txt&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;<span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #666666; font-style: italic;">#用户名和密码都存在user.txt里</span>
            <span style="color: #666666; font-style: italic;">#跟状态一样也是轮着来</span>
            <span style="color: #007800;">u_p</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`head -1 user.txt`</span>&quot;</span>
            <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'1{h;d};$G'</span> user.txt
            <span style="color: #007800;">user</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`echo &quot;${u_p}&quot; | cut -d: -f 1`</span>&quot;</span>
            <span style="color: #007800;">password</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`echo &quot;${u_p}&quot; | cut -d: -f 2`</span>&quot;</span>
            <span style="color: #666666; font-style: italic;">#改状态了</span>
            send_status <span style="color: #007800;">$user</span> <span style="color: #007800;">$password</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
        <span style="color: #666666; font-style: italic;">#五秒钟发一次</span>
        <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">5</span>
    <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
send_all</pre></div></div>

<p>脚本写完了,但是怎么启动呢,我的手机上有个putty,但是登server太慢了,于是又写了一个开关的php</p>

<div class="wp_syntax"><div class="code overflow"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/tmp/on_off.txt'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/tmp/on_off.txt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>   
    <span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/tmp/on_off.txt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'w'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'ooxx'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>这样就比较方便了,shell在server上运行,只要用手机浏览器访问这个开关的php就可以了~</p>
<p>后来使用中遇到点问题,手机浏览器的缓存实在太强了!!!!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/09/19/570.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>谷歌音乐shell版</title>
		<link>http://bluehua.org/2009/08/24/389.html</link>
		<comments>http://bluehua.org/2009/08/24/389.html#comments</comments>
		<pubDate>Mon, 24 Aug 2009 13:47:58 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=389</guid>
		<description><![CDATA[2009.10.15 update 其实需要两个包支持 sudo apt-get install uni2ascii sudo apt-get install gawk &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; 一个可以快速听歌的东东,虽说是练手之作,但是当特别想听某首歌硬盘里又没的时候还是挺方便的~ 这个脚本可以将谷歌音乐的的搜索结果显示到终端(支持关键词高亮和分页),选择某一歌曲的序号之后,脚本会获取该曲目的播放地址,并调用播放器播放,咔咔,就是这么简单 脚本运行需要uni2ascii这个包的支持,没有可以apt-get一下,播放器调用ubuntu自带的rhythmbox,可以根据情况修改 #使用方法 google_music.sh &#34;周杰伦 花海&#34; 下载点这里 截图:]]></description>
			<content:encoded><![CDATA[<p>2009.10.15 update<br />
其实需要两个包支持</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> uni2ascii
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">gawk</span></pre></div></div>

<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
一个可以快速听歌的东东,虽说是练手之作,但是当特别想听某首歌硬盘里又没的时候还是挺方便的~</p>
<p>这个脚本可以将谷歌音乐的的搜索结果显示到终端(支持关键词高亮和分页),选择某一歌曲的序号之后,脚本会获取该曲目的播放地址,并调用播放器播放,咔咔,就是这么简单<img class="xemotion" src="http://bluehua.org/wp-content/plugins/x-emotions/emotions/msn/bofu1_10.gif" border="0" alt="" /></p>
<p>脚本运行需要uni2ascii这个包的支持,没有可以apt-get一下,播放器调用ubuntu自带的rhythmbox,可以根据情况修改</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#使用方法</span>
google_music.sh <span style="color: #ff0000;">&quot;周杰伦 花海&quot;</span></pre></div></div>

<p><a href="http://sites.google.com/site/sharemyidea09/google-music-shell-ban" target="_blank">下载点这里</a></p>
<p>截图:</p>
<p><a href="http://bluehua.org/wp-content/uploads/2009/08/2009-8-23-13-43-01.png"></a><a href="http://bluehua.org/wp-content/uploads/2009/08/2009-8-23-13-43-01.png"><img class="alignnone size-full wp-image-390" title="2009-8-23 13-43-01" src="http://bluehua.org/wp-content/uploads/2009/08/2009-8-23-13-43-01.png" alt="2009-8-23 13-43-01" width="790" height="463" /></a><a href="http://bluehua.org/wp-content/uploads/2009/08/2009-8-23-13-43-01.png"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/08/24/389.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>shell:批量网页截图</title>
		<link>http://bluehua.org/2009/08/04/363.html</link>
		<comments>http://bluehua.org/2009/08/04/363.html#comments</comments>
		<pubDate>Tue, 04 Aug 2009 12:09:16 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[screenshot]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=363</guid>
		<description><![CDATA[强哥的籲求：把一個目錄內所有的模板截圖并生成一個索引html 咔咔，原来小企鹅输繁体这么溜。。 极其ft的是，晚上问传业这事，丫直接给我看了某人的相册，四十多张人家早就手工截完了。。 脚本附上，暂不支持滚动截图，如果页面比较长就只能看半截 原理十分的简单，全屏一个浏览器，然后截屏 webshot.sh 使用方法： #直接跟目录名,有些参数需要修改webshot.sh webshot.sh ~/webdemos]]></description>
			<content:encoded><![CDATA[<p><a href="http://zerodaily.cn/blog/" target="_blank">强哥</a>的籲求：把一個目錄內所有的模板截圖并生成一個索引html</p>
<p>咔咔，原来小企鹅输繁体这么溜<img class="xemotion" src="http://bluehua.org/wp-content/plugins/x-emotions/emotions/daola/dora_manzu.png" border="0" alt="" />。。</p>
<p>极其ft的是，晚上问<a href="http://wchuanye.blogbus.com/" target="_blank">传业</a>这事，丫直接给我看了某人的相册，四十多张人家早就手工截完了。。</p>
<p>脚本附上，暂不支持滚动截图，如果页面比较长就只能看半截<br />
原理十分的简单，全屏一个浏览器，然后截屏</p>
<p><a href="http://sites.google.com/site/sharemyidea09/Home/web-screenshot-1" target="_blank">webshot.sh</a></p>
<p>使用方法：</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#直接跟目录名,有些参数需要修改webshot.sh</span>
webshot.sh ~<span style="color: #000000; font-weight: bold;">/</span>webdemos</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/08/04/363.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>svn diff 增强版</title>
		<link>http://bluehua.org/2009/07/31/355.html</link>
		<comments>http://bluehua.org/2009/07/31/355.html#comments</comments>
		<pubDate>Fri, 31 Jul 2009 02:11:21 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=355</guid>
		<description><![CDATA[以前xp上用小乌龟，diff的时候只需要ctrl选一下两个版本，然后就哦了，先在命令行下面是现svn log查log,记下两个版本,然后两个版本都cat下来，然后vimdiff两个文件。由于记性不是很好，每次cat完一个，就忘了下一个版本号。。，所以俺整了一个增强版,只需要记住版本号的最后一位或几位数。 下载 #比较修改版本与最新版本的差异 svndiff.sh base.js &#160; #比较修改版本与10782版本的差异 svndiff.sh base.js 10782 &#160; #比较修改版本与最新的以数字56结尾的版本的差异 svndiff.sh --lazy base.js 56 &#160; #比较10732与10783两个版本的差异 svndiff.sh base.js 10732 10783 &#160; #比较两个最新的以12和03结尾的版本的差异 svndiff.sh --lazy base.js 12 03]]></description>
			<content:encoded><![CDATA[<p>以前xp上用小乌龟，diff的时候只需要ctrl选一下两个版本，然后就哦了，先在命令行下面是现svn log查log,记下两个版本,然后两个版本都cat下来，然后vimdiff两个文件。由于记性不是很好，每次cat完一个，就忘了下一个版本号。。，所以俺整了一个增强版,只需要记住版本号的最后一位或几位数。</p>
<p><a href="http://sites.google.com/site/sharemyidea09/Home/svn-diff-plus" target="_blank">下载</a></p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#比较修改版本与最新版本的差异</span>
svndiff.sh base.js
&nbsp;
<span style="color: #666666; font-style: italic;">#比较修改版本与10782版本的差异</span>
svndiff.sh base.js <span style="color: #000000;">10782</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#比较修改版本与最新的以数字56结尾的版本的差异</span>
svndiff.sh <span style="color: #660033;">--lazy</span> base.js <span style="color: #000000;">56</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#比较10732与10783两个版本的差异</span>
svndiff.sh base.js <span style="color: #000000;">10732</span> <span style="color: #000000;">10783</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#比较两个最新的以12和03结尾的版本的差异</span>
svndiff.sh <span style="color: #660033;">--lazy</span> base.js <span style="color: #000000;">12</span> 03</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/07/31/355.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>shell:mpc播放第一首匹配关键词的曲目</title>
		<link>http://bluehua.org/2009/05/05/290.html</link>
		<comments>http://bluehua.org/2009/05/05/290.html#comments</comments>
		<pubDate>Tue, 05 May 2009 03:51:21 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[soft]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mpc]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=290</guid>
		<description><![CDATA[2010.1.18 更正 mpc play `mpc playlist &#124; sed -n '/周杰伦/{=;q}'` &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; 虽然习惯随机&#8230; mpc play `mpc listall &#124; sed -n '/周杰伦/{=;q}'`]]></description>
			<content:encoded><![CDATA[<p>2010.1.18 更正</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;">mpc play <span style="color: #000000; font-weight: bold;">`</span>mpc playlist <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">'/周杰伦/{=;q}'</span><span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
虽然习惯随机&#8230;</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;">mpc play <span style="color: #000000; font-weight: bold;">`</span>mpc listall <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">'/周杰伦/{=;q}'</span><span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/05/05/290.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.171 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-05 03:24:34 -->

