<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>蓝色的华 &#187; linux</title>
	<atom:link href="http://bluehua.org/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://bluehua.org</link>
	<description>分享所学,backup一切~</description>
	<lastBuildDate>Fri, 13 Apr 2012 14:08:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>定制一个Debian Live启动盘</title>
		<link>http://bluehua.org/2012/03/21/1761.html</link>
		<comments>http://bluehua.org/2012/03/21/1761.html#comments</comments>
		<pubDate>Wed, 21 Mar 2012 08:32:08 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[iso]]></category>
		<category><![CDATA[live]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=1761</guid>
		<description><![CDATA[这blog都快荒了～～,前些日子自己做了一个debian live的启动盘，把制作过程分享一下。文章适合喜欢linux并有使用经验的用户。 我做的debian live镜像有136M,包含一个firefox浏览器，一些网卡驱动和一个xterm.它的目标很明确，就是给使用者一个可以上网的环境。 窗口管理器采用了openbox，最开始用gnome,生成的镜像已经500多M了。。自带了一堆小软件，精简起来是个麻烦事。下面的任务栏使用tint2,输入法使用scim,网络管理使用wicd.关于这些软件的配置后面会介绍。 下面开始介绍制作和精简过程： 首先要有一个debian环境，俺用的是虚拟机里装的Debian6.02.有个真机版，但是已经被霸占。 第一步: 安装live制作工具live-build，实际使用的版本是2.0.12-1: sudo apt-get install live-build 第二步：创建工作目录，生成初始配置文件 mkdir ~/live cd ~/live lb config 这时会生成一些默认配置，很多，但是用到的就几个 . ├── auto │   ├── functions │   └── scripts └── config ├── binary ├── binary_debian-installer ├── binary_debian-installer-includes ├── binary_grub ├── binary_local-debs ├── binary_local-hooks ├── binary_local-includes ├── binary_local-packageslists ├── binary_local-udebs ├── binary_rootfs ├── binary_syslinux ├── [...]]]></description>
			<content:encoded><![CDATA[<p>这blog都快荒了～～,前些日子自己做了一个debian live的启动盘，把制作过程分享一下。文章适合喜欢linux并有使用经验的用户。</p>
<p>我做的debian live镜像有136M,包含一个firefox浏览器，一些网卡驱动和一个xterm.它的目标很明确，就是给使用者一个可以上网的环境。</p>
<p><a href="http://bluehua.org/wp-content/uploads/2012/03/debian-live.png"><img src="http://bluehua.org/wp-content/uploads/2012/03/debian-live.png" alt="" title="debian-live" width="548" height="454" class="alignnone size-full wp-image-1790" /></a></p>
<p>窗口管理器采用了openbox，最开始用gnome,生成的镜像已经500多M了。。自带了一堆小软件，精简起来是个麻烦事。下面的任务栏使用tint2,输入法使用scim,网络管理使用wicd.关于这些软件的配置后面会介绍。</p>
<p>下面开始介绍制作和精简过程：</p>
<p>首先要有一个debian环境，俺用的是虚拟机里装的Debian6.02.有个真机版，但是已经被霸占。</p>
<p>第一步: 安装live制作工具live-build，实际使用的版本是2.0.12-1:</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> live-build</pre></div></div>

<p>第二步：创建工作目录，生成初始配置文件</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>live
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>live
lb config</pre></div></div>

<p>这时会生成一些默认配置，很多，但是用到的就几个</p>
<pre>
.
├── auto
│   ├── functions
│   └── scripts
└── config
    ├── binary
    ├── binary_debian-installer
    ├── binary_debian-installer-includes
    ├── binary_grub
    ├── binary_local-debs
    ├── binary_local-hooks
    ├── binary_local-includes
    ├── binary_local-packageslists
    ├── binary_local-udebs
    ├── binary_rootfs
    ├── binary_syslinux
    ├── bootstrap
    ├── chroot
    ├── chroot_apt
    ├── chroot_local-hooks
    ├── chroot_local-includes
    ├── chroot_local-packages
    ├── chroot_local-packageslists
    ├── chroot_local-patches
    ├── chroot_local-preseed
    ├── chroot_sources
    ├── common
    ├── includes
    ├── source
    └── templates
</pre>
<p>第三步:修改默认配置文件<br />
修改config/common,</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">LB_APT_RECOMMENDS</span>=<span style="color: #ff0000;">&quot;false&quot;</span>
<span style="color: #666666; font-style: italic;">#禁用apt-get的推荐功能</span>
<span style="color: #666666; font-style: italic;">#使用apt-get安装软件时会附带一些它觉的有必要一块装的东西，这无疑会安装一些不必要的软件增大生成live的尺寸</span>
<span style="color: #007800;">LB_CACHE_INDICES</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
<span style="color: #666666; font-style: italic;">#是否缓存apt的软件索引，默认是false,如果网络比较好，建议不要缓存，但是我的网络比较差，不想每次都下载软件包索引</span></pre></div></div>

<p>修改config/bootstrap,live-build在bootstrap阶段会构建一个最基本的debian系统，将会读取该配置文件</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">LB_ARCHITECTURE</span>=<span style="color: #ff0000;">&quot;amd64&quot;</span> 
<span style="color: #666666; font-style: italic;">#amd64-&gt;64位版本</span>
<span style="color: #666666; font-style: italic;">#i386 -&gt; 32版本</span>
<span style="color: #666666; font-style: italic;">#这里选64位，现在内存普遍超越4G了</span>
<span style="color: #007800;">LB_DISTRIBUTION</span>=<span style="color: #ff0000;">&quot;squeeze&quot;</span>
<span style="color: #666666; font-style: italic;">#指定debian的发行版本，这里使用最新的稳定版本squeeze</span>
<span style="color: #007800;">LB_ARCHIVE_AREAS</span>=<span style="color: #ff0000;">&quot;main contrib non-free&quot;</span>
<span style="color: #666666; font-style: italic;">#由于要安装一些nonfree的软件，要修改一下apt的“尺度”,默认是 main</span>
<span style="color: #666666; font-style: italic;">#其他还有软件源的配置，我这里用cdn.debian.net反而比163的快</span></pre></div></div>

<p>修改config/chroot, live-build将会在构建live的文件系统时使用该配置</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">LB_HOOKS</span>=<span style="color: #ff0000;">&quot;minimal&quot;</span>
<span style="color: #666666; font-style: italic;">#制定一个钩子脚本，lb将在构建完根目录后调用，默认为空</span>
<span style="color: #666666; font-style: italic;">#minimal将会调用/usr/share/live/build/hooks/minimal这个清理脚本</span>
<span style="color: #666666; font-style: italic;">#minimal将会清理apt缓存，删除/var/log下的一些无用文件，但是清理力度</span>
<span style="color: #666666; font-style: italic;">#依然不够，后面我们会添加自己的清理脚本</span>
<span style="color: #007800;">LB_PACKAGES_LISTS</span>=<span style="color: #ff0000;">&quot;bluehua&quot;</span>
<span style="color: #666666; font-style: italic;">#指定我们要安装的软件列表 </span>
<span style="color: #666666; font-style: italic;">#bluehua代表了config/chroot_local-packageslists/bluehua.list这个文件</span></pre></div></div>

<p>然后继续修改config/binary,来定制我们要生成的介质类型</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">LB_BINARY_IMAGES</span>=<span style="color: #ff0000;">&quot;iso-hybrid&quot;</span>
<span style="color: #666666; font-style: italic;">#usb-hdd生成可以写入usb的镜像</span>
<span style="color: #666666; font-style: italic;">#iso-hybrid生成可以写入光盘的镜像</span>
<span style="color: #007800;">LB_BOOTAPPEND_LIVE</span>=<span style="color: #ff0000;">&quot;locales=zh_CN.UTF-8&quot;</span>
<span style="color: #666666; font-style: italic;">#定制linux启动参数，这里我们指定一下系统的语言</span>
<span style="color: #007800;">LB_MEMTEST</span>=<span style="color: #ff0000;">&quot;none&quot;</span>
<span style="color: #666666; font-style: italic;">#为了减小尺寸，不要包含memtest</span></pre></div></div>

<p>第四步:定制自己的软件列表<br />
直接给出我的软件列表<br />
config/chroot_local-packageslists/bluehua.list</p>
<pre>
xinit
xserver-xorg
x11-xserver-utils
#基本的X系统

user-setup
#可以在系统启动时自动创建一个用户

locales
#本地化信息

xfonts-wqy
#文泉驿的中文字体

openbox
#openbox窗口管理器

tint2
#任务栏

feh
#feh用来设置桌面壁纸

iceweasel
iceweasel-l10n-zh-cn
#firefox和中文语言包

flashplugin-nonfree
#浏览器的flash插件

wicd-gtk
#网络管理软件

xterm
#简单的终端软件

sudo
#没有sudo的系统怎么可以呢

scim
scim-pinyin
scim-gtk2-immodule
#scim中文输入法

hicolor-icon-theme
#一些常用的图标

alsa-base
alsa-utils
#让系统可以发出声音

firmware-bnx2
firmware-bnx2x
firmware-brcm80211
firmware-iwlwifi
firmware-linux
firmware-linux-free
firmware-linux-nonfree
firmware-ralink
firmware-realtek
#尽可能多的网卡驱动
</pre>
<p>到这里lb build运行一下，已经可以出来一个live的镜像文件，但是结果并不如您所愿，启动起来只是一个丑陋的默认X桌面。<br />
我们要继续对安装的软件进行配置,下面给出部分配置。</p>
<p>首先我们要让openbox代替那个丑陋的默认X桌面</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> config<span style="color: #000000; font-weight: bold;">/</span>chroot_local-includes<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>skel
<span style="color: #666666; font-style: italic;">#通过chroot_local-includes这个目录你可以向生成的live系统的文件系统里追加覆盖文件</span>
<span style="color: #666666; font-style: italic;">#比如新建一个config/chroot_local-includes/test.txt</span>
<span style="color: #666666; font-style: italic;">#那么当启动生成的live系统后，你会在根目录/找到test.txt这个文件</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#/etc/skel这个目录里保存了新建用户目录的默认内容</span>
<span style="color: #666666; font-style: italic;">#比如 sudo echo &quot;set nu&quot; &gt; /etc/skel/.vimrc</span>
<span style="color: #666666; font-style: italic;">#然后通过useradd -m testuser 增加一个新用户</span>
<span style="color: #666666; font-style: italic;">#然后你会找到/home/testuser/.vimrc这个文件</span></pre></div></div>

<p>新建 config/chroot_local-includes/etc/skel/.xinitrc<br />
内容如下</p>
<pre>
exec openbox-session
</pre>
<p>OK,这样openbox就可以启动起来了(至于为什么，请google搜索x系统的启动过程)，然后我们继续配置openbox<br />
新建 config/chroot_local-includes/etc/skel/.config/openbox/autostart.sh 内容如下:</p>
<pre>
#!/bin/sh
export XMODIFIERS="@im=SCIM"
export XIM="SCIM"
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"
scim -d &#038;
#启动输入法
tint2 &#038;
#启动任务栏
(sleep 2 &#038;&#038; iceweasel) &#038;
#启动浏览器
(sleep 2 &#038;&#038; wicd-gtk) &#038;
#启动网络管理器
feh --bg-scale /usr/share/wallpagers/debian.png
#设置一张壁纸
#已经事先放到config/chroot_local-includes/usr/share/wallpagers/debian.png 了
</pre>
<p>之后不要忘了加执行权限</p>
<p>费了这么大功夫，终于算差不多了，运行一下lb build，喝杯茶的功夫再回来，应该看到有生成的binary-hybrid.so,但是大小应该接近200M的样子.下面将介绍我们的清理脚本,清理脚本应该放到config/chroot_local-hooks。这个目录下的脚本，将在live系统的文件系统构建完成之后执行。<br />
cat config/chroot_local-hooks/03-remove-docs.sh 内容如下</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: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;remove unused packages&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> remove <span style="color: #660033;">-y</span> <span style="color: #660033;">--purge</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> remove <span style="color: #660033;">-y</span> <span style="color: #660033;">--purge</span> libg11-mesa-dri
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> remove <span style="color: #660033;">-y</span> <span style="color: #660033;">--purge</span> <span style="color: #c20cb9; font-weight: bold;">nano</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> remove <span style="color: #660033;">-y</span> <span style="color: #660033;">--purge</span> manpages
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> remove <span style="color: #660033;">-y</span> <span style="color: #660033;">--purge</span> openbox-themes 
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> remove <span style="color: #660033;">-y</span> <span style="color: #660033;">--purge</span> iptables 
&nbsp;
<span style="color: #666666; font-style: italic;">#上面将删除一些用不到的软件，man手册比较大</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-y</span> autoremove
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-y</span> clean 
&nbsp;
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span>flash<span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #666666; font-style: italic;">#删除flash插件安装过程中下载的临时文件</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;remvoe all docs&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/*</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc-base<span style="color: #000000; font-weight: bold;">/*</span>
<span style="color: #666666; font-style: italic;">#删除所有文档</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;remove all man docs&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>man<span style="color: #000000; font-weight: bold;">/*</span>
<span style="color: #666666; font-style: italic;">#删除自带的一些man文档</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;remove apt lists&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>lists<span style="color: #000000; font-weight: bold;">/*</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;remove apt cache&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/*</span>.bin
<span style="color: #666666; font-style: italic;">#删除apt缓存</span>
&nbsp;
locale-gen
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>locale;<span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #c20cb9; font-weight: bold;">ls</span> -<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> zh_CN<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> locale<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #ff0000;">&quot;{}&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#删除除了zh_CN之外的所有本地化信息</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#remove some driver</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/*/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>isdn
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/*/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>media
<span style="color: #666666; font-style: italic;">#删除不常用的驱动</span></pre></div></div>

<p>同样不要忘了加执行权限，有了这个神奇的脚本，live的尺寸就可以降到136M～</p>
<p>总结如下:</p>
<p>1 简单的三个命令 lb config 生成默认配置,lb build 构建live系统，lb clean 清理。<br />
2 需要安装的软件列表放到config/chroot_local-packageslists/xxxx.list,并在config/chroot里通LB_PACKAGES_LISTS指定<br />
3 需要覆盖到生成系统中的文件放到config/chroot_local-includes<br />
4 用户home目录的默认配置文件放到config/chroot_local-includes/etc/skel<br />
5 需要在系统构建完成之后执行的动作放到config/chroot_local-hooks</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2012/03/21/1761.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>postfix出错一则</title>
		<link>http://bluehua.org/2011/11/05/1734.html</link>
		<comments>http://bluehua.org/2011/11/05/1734.html#comments</comments>
		<pubDate>Sat, 05 Nov 2011 09:12:42 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=1734</guid>
		<description><![CDATA[能收到邮件但是发不出去 错误日志如下 Nov 4 20:32:21 localhost postfix/cleanup[4853]: warning: 51CCA2E129: virtual_alias_maps map lookup probl em for xxxx@gmail.com Nov 4 20:33:21 localhost postfix/pickup[4851]: 587A12F5F5: uid=0 from= Nov 4 20:33:21 localhost postfix/cleanup[4853]: warning: connect to mysql server localhost: Can't connec t to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 原因是之前配置了基于mysql的地址映射 virtual_alias_maps = mysql:/etc/postfix/mysql-alias.cf 当一些在chroot环境中运行的postfix组建试图通过/var/run/mysqld/mysqld.sock连接数据库时就报错了，在master.cf里禁用smtp,rewrite,cleanup的chroot即可 smtp inet n - [...]]]></description>
			<content:encoded><![CDATA[<p>能收到邮件但是发不出去</p>
<p>错误日志如下</p>
<pre>
Nov  4 20:32:21 localhost postfix/cleanup[4853]: warning: 51CCA2E129: virtual_alias_maps map lookup probl         em for xxxx@gmail.com
Nov  4 20:33:21 localhost postfix/pickup[4851]: 587A12F5F5: uid=0 from=<root>
Nov  4 20:33:21 localhost postfix/cleanup[4853]: warning: connect to mysql server localhost: Can't connec         t to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
</pre>
<p>原因是之前配置了基于mysql的地址映射</p>
<pre>
virtual_alias_maps = mysql:/etc/postfix/mysql-alias.cf
</pre>
<p>当一些在chroot环境中运行的postfix组建试图通过/var/run/mysqld/mysqld.sock连接数据库时就报错了，在master.cf里禁用smtp,rewrite,cleanup的chroot即可</p>
<pre>
smtp      inet  n       -       n       -       -       smtpd
rewrite   unix  -       -       n       -       -       trivial-rewrite
cleanup   unix  n       -       n       -       0       cleanup
</pre>
<p>#这是一种不安全的fix方法，另一种解决方法是修改my.conf同过3306端口访问mysql，也可以解决问题。</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2011/11/05/1734.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bash拼音补齐靠谱版本</title>
		<link>http://bluehua.org/2011/09/28/1705.html</link>
		<comments>http://bluehua.org/2011/09/28/1705.html#comments</comments>
		<pubDate>Wed, 28 Sep 2011 09:11:32 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=1705</guid>
		<description><![CDATA[之前玩ubuntu的时候写过一个，功能和代码都较丑，用的拼音库也很烂。正好为项目抓了一个靠谱的拼音库，顺便把这个bash补齐又重新实现了下，Mac上也可以用了～ 项目:http://code.google.com/p/bash-pinyin-completion/ ==特性== * 支持拼音首字母匹配和完全匹配 * 支持多音字匹配 安装 ubuntu 支持10.04,10.10,11.04版本从ppa安装，如果之前安装过那个chs-completion先卸载之。 sudo add-apt-repository ppa:emptyhua/toolbox sudo apt-get update sudo apt-get install bash-pinyin-completion 然后新开一个终端，就可以使用拼音补齐了 Mac OS X 对于mac需要先安装 bash-completion sudo port install bash-completion 然后编辑~/.bash_profile,把下面的代码贴进去 if [ -f /opt/local/etc/bash_completion ]; then . /opt/local/etc/bash_completion fi 下载源码包http://code.google.com/p/bash-pinyin-completion/downloads/list unzip bash-pinyin-completion-xxx.zip cd bash-pinyin* make sudo make install 然后新开一个终端，就可以使用拼音补齐了]]></description>
			<content:encoded><![CDATA[<p>之前玩ubuntu的时候<a href="http://forum.ubuntu.org.cn/viewtopic.php?f=21&#038;t=302712&#038;start=0">写过一个</a>，功能和代码都较丑，用的拼音库也很烂。正好为项目抓了一个靠谱的拼音库，顺便把这个bash补齐又重新实现了下，Mac上也可以用了～</p>
<p>项目:<a href="http://code.google.com/p/bash-pinyin-completion/">http://code.google.com/p/bash-pinyin-completion/</a></p>
<p>==特性==<br />
  * 支持拼音首字母匹配和完全匹配<br />
  * 支持多音字匹配</p>
<h3>安装</h3>
<h4>ubuntu</h4>
<p>支持10.04,10.10,11.04版本从ppa安装，<strong>如果之前安装过那个chs-completion先卸载之</strong>。</p>
<pre>
sudo add-apt-repository ppa:emptyhua/toolbox
sudo apt-get update
sudo apt-get install bash-pinyin-completion
</pre>
<p>然后新开一个终端，就可以使用拼音补齐了</p>
<h4>Mac OS X</h4>
<p>对于mac需要先安装 bash-completion</p>
<pre>
sudo port install bash-completion
</pre>
<p>然后编辑~/.bash_profile,把下面的代码贴进去</p>
<pre>
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
</pre>
<p>下载源码包<a href="http://code.google.com/p/bash-pinyin-completion/downloads/list">http://code.google.com/p/bash-pinyin-completion/downloads/list</a></p>
<pre>
unzip bash-pinyin-completion-xxx.zip
cd bash-pinyin*
make
sudo make install
</pre>
<p>然后新开一个终端，就可以使用拼音补齐了</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2011/09/28/1705.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>linux中tty设备名的由来</title>
		<link>http://bluehua.org/2011/09/20/1696.html</link>
		<comments>http://bluehua.org/2011/09/20/1696.html#comments</comments>
		<pubDate>Tue, 20 Sep 2011 10:51:19 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tty]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=1696</guid>
		<description><![CDATA[tty是teletypewriter（电传打字机）的简称，电传打字机是一种老式的通信工具，类似于传真，它有一个用于输入的键盘和用于输出接收信息的纸带打印设备。当按下按键后，电传机会把对应的键码编码成电流脉冲发送给接收方。对方收到脉冲后解码，并将对应的字符打印到纸带上。 早期的一些计算机便使用电传机来做输入输出设备。用户通过电传机向计算机输入指令，并通过纸带打印计算机的反馈结果,这便是最原始的command line interface(命令行交互)。 unix系统会为所有设备在/dev目录下生成对应的文件，电传机便被命名为/dev/tty#(#代表数字序号)。虽然现在的计算机早已经不再使用电传机做IO设备，但是tty的命名依然沿用至今。 links: http://www.linfo.org/teletype.html http://baike.baidu.com/view/1773688.htm]]></description>
			<content:encoded><![CDATA[<p>tty是teletypewriter（电传打字机）的简称，电传打字机是一种老式的通信工具，类似于传真，它有一个用于输入的键盘和用于输出接收信息的纸带打印设备。当按下按键后，电传机会把对应的键码编码成电流脉冲发送给接收方。对方收到脉冲后解码，并将对应的字符打印到纸带上。</p>
<p><a href="http://bluehua.org/wp-content/uploads/2011/09/电传打字机.jpg"><img class="alignnone size-full wp-image-1701" title="电传打字机" src="http://bluehua.org/wp-content/uploads/2011/09/电传打字机.jpg" alt="" width="200" height="150" /></a></p>
<p>早期的一些计算机便使用电传机来做输入输出设备。用户通过电传机向计算机输入指令，并通过纸带打印计算机的反馈结果,这便是最原始的command line interface(命令行交互)。</p>
<p>unix系统会为所有设备在/dev目录下生成对应的文件，电传机便被命名为/dev/tty#(#代表数字序号)。虽然现在的计算机早已经不再使用电传机做IO设备，但是tty的命名依然沿用至今。</p>
<p>links:<br />
<a href="http://www.linfo.org/teletype.html">http://www.linfo.org/teletype.html</a><br />
<a href="http://baike.baidu.com/view/1773688.htm">http://baike.baidu.com/view/1773688.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2011/09/20/1696.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>找到Flash Media Server的替代品~</title>
		<link>http://bluehua.org/2010/08/08/1412.html</link>
		<comments>http://bluehua.org/2010/08/08/1412.html#comments</comments>
		<pubDate>Sun, 08 Aug 2010 00:48:10 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[soft]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[FMS]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[record]]></category>
		<category><![CDATA[rtmp]]></category>
		<category><![CDATA[rtmplite]]></category>

		<guid isPermaLink="false">http://bluehua.org/2010/08/08/1412.html</guid>
		<description><![CDATA[很早之前就想实现一个在线录音的功能，无奈一直没有找到FMS的替代品。以前用”flash 录音”两个关键词，结果大多是FMS实现，还有个开源的Red5，java实现的，还是算了，vps上跑java。。偶尔换了个高级点的关键词”python rtmp”立刻找到我想要的:http://code.google.com/p/rtmplite/ 。rtmplite实现了一个简单的RTMP server,而且只用了3个python文件，(Red5都有三十几兆。。) ls -lh amf.py multitask.py rtmp.py -rwxr-xr-x 1 lu lu 17K 2010-07-30 12:31 amf.py -rwxr-xr-x 1 lu lu 41K 2010-06-29 07:28 multitask.py -rwxr-xr-x 1 lu lu 51K 2010-07-30 09:42 rtmp.py 实现的在线录音功能:http://v.hua.lu &#8212;&#8212;&#8212;&#8211; post by gmail~]]></description>
			<content:encoded><![CDATA[<p>很早之前就想实现一个在线录音的功能，无奈一直没有找到FMS的替代品。以前用”flash 录音”两个关键词，结果大多是FMS实现，还有个开源的Red5，java实现的，还是算了，vps上跑java。。偶尔换了个高级点的关键词”python rtmp”立刻找到我想要的:<a href="http://code.google.com/p/rtmplite/">http://code.google.com/p/rtmplite/</a> 。rtmplite实现了一个简单的RTMP server,而且只用了3个python文件，(Red5都有三十几兆。。)</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-lh</span> amf.py multitask.py rtmp.py 
<span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> lu lu 17K <span style="color: #000000;">2010</span>-07-<span style="color: #000000;">30</span> <span style="color: #000000;">12</span>:<span style="color: #000000;">31</span> amf.py
<span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> lu lu 41K <span style="color: #000000;">2010</span>-06-<span style="color: #000000;">29</span> 07:<span style="color: #000000;">28</span> multitask.py
<span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> lu lu 51K <span style="color: #000000;">2010</span>-07-<span style="color: #000000;">30</span> 09:<span style="color: #000000;">42</span> rtmp.py</pre></div></div>

<p>实现的在线录音功能:<a href="http://v.hua.lu">http://v.hua.lu</a></p>
<p>&#8212;&#8212;&#8212;&#8211;<br />
post by gmail~</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2010/08/08/1412.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>remuco，一个linux平台的播放器遥控软件</title>
		<link>http://bluehua.org/2010/05/23/1296.html</link>
		<comments>http://bluehua.org/2010/05/23/1296.html#comments</comments>
		<pubDate>Sun, 23 May 2010 12:49:16 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[soft]]></category>
		<category><![CDATA[media player]]></category>
		<category><![CDATA[mobile phone]]></category>
		<category><![CDATA[remote control]]></category>
		<category><![CDATA[remuco]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=1296</guid>
		<description><![CDATA[看书的时候一般不会听音乐，因为一旦冒出一个不想听的就想去换一首。今天找到了remuco (http://code.google.com/p/remuco/)这个牛b的开源软件，可以用手机通过蓝牙或者wifi遥控linux上的播放器。 上面是E71上控制端的截图，控制我本子上的mpd播放器。除了mpd，还支持Amarok ，Audacious ，Banshee ， Exaile  ， MPlayer，Rhythmbox  ， Songbird ， Totem  ，TVtime ，VLC ， XMMS2。控制端是用java写的，一般支持java的手机应该都可以用。很佩服这个软件的作者，一个小众的开源软件能做到这么强大。 写下mpd服务端安装步骤： #安装依赖 sudo apt-get install python-bluetooth python-mpd tar -zxvf remuco-0.9.2.tar.gz cd remuco-0.9.2 #安装mpd服务端 sudo make install-mpd #运行服务端 sudo remuco-mpd]]></description>
			<content:encoded><![CDATA[<p>看书的时候一般不会听音乐，因为一旦冒出一个不想听的就想去换一首。今天找到了<a href="http://code.google.com/p/remuco/">remuco</a> (<a href="http://code.google.com/p/remuco/">http://code.google.com/p/remuco/</a>)这个牛b的开源软件，可以用手机通过蓝牙或者wifi遥控linux上的播放器。</p>
<p><a href="http://bluehua.org/wp-content/uploads/2010/05/SuperScreenshot0020.jpg"><img class="alignnone size-full wp-image-1297" title="SuperScreenshot0020" src="http://bluehua.org/wp-content/uploads/2010/05/SuperScreenshot0020.jpg" alt="" width="320" height="240" /></a></p>
<p>上面是E71上控制端的截图，控制我本子上的mpd播放器。除了mpd，还支持Amarok ，Audacious ，Banshee ， Exaile  ， MPlayer，Rhythmbox  ， Songbird ， Totem  ，TVtime ，VLC ， XMMS2。控制端是用java写的，一般支持java的手机应该都可以用。很佩服这个软件的作者，一个小众的开源软件能做到这么强大。</p>
<p>写下mpd服务端安装步骤：</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;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python-bluetooth python-mpd
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvf</span> remuco-0.9.2.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> remuco-0.9.2
<span style="color: #666666; font-style: italic;">#安装mpd服务端</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> install-mpd
<span style="color: #666666; font-style: italic;">#运行服务端</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> remuco-mpd</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2010/05/23/1296.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>terminal里看农历的东西</title>
		<link>http://bluehua.org/2010/05/03/1170.html</link>
		<comments>http://bluehua.org/2010/05/03/1170.html#comments</comments>
		<pubDate>Mon, 03 May 2010 13:14:05 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[liblunar]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[农历]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=1170</guid>
		<description><![CDATA[曾经装了一个 liblunar ,用来在gnome panel里显示农历日历，今天升级到10.04，发现不灵了。由于liblunar提供了python的lib，于是简单写了一个命令行版的前端，顺便保持对python的熟悉程度。最近接触的语言有点杂，码代码时经常会搞混。。。 下载：zhcal.zip 使用之前需要安装liblunar,编译选项 ./configure --prefix=/usr --enable-python make sudo make install &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; 另：分享一个firefox插件default full zoom level, 可以设置页面的默认缩放级别，对于高分屏的同学会有帮助～ 现在终端的字体我已经调到16，浏览器默认缩放120%，基本上回到1024时代~]]></description>
			<content:encoded><![CDATA[<p>曾经装了一个<a href="http://code.google.com/p/liblunar/"> liblunar</a> ,用来在gnome panel里显示农历日历，今天升级到10.04，发现不灵了。由于liblunar提供了python的lib，于是简单写了一个命令行版的前端，顺便保持对python的熟悉程度。最近接触的语言有点杂，码代码时经常会搞混。。。</p>
<p><a href="http://bluehua.org/wp-content/uploads/2010/05/_001.png"><img src="http://bluehua.org/wp-content/uploads/2010/05/截取选区_001.png" alt="" title="zhcal" width="693" height="469" class="alignnone size-full wp-image-1171" /></a></p>
<p>下载：<a href='http://bluehua.org/wp-content/uploads/2010/05/zhcal.zip'>zhcal.zip</a></p>
<p>使用之前需要安装liblunar,编译选项</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-python</span>
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
另：分享一个firefox插件<a href="https://addons.mozilla.org/zh-CN/firefox/addon/6965">default full zoom level</a>, 可以设置页面的默认缩放级别，对于高分屏的同学会有帮助～<br />
现在终端的字体我已经调到16，浏览器默认缩放120%，基本上回到1024时代~ </p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2010/05/03/1170.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>更聪明的pidgin</title>
		<link>http://bluehua.org/2010/01/12/796.html</link>
		<comments>http://bluehua.org/2010/01/12/796.html#comments</comments>
		<pubDate>Tue, 12 Jan 2010 14:56:03 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[soft]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[NetworkManager]]></category>
		<category><![CDATA[pidgin]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=796</guid>
		<description><![CDATA[pidgin里有个类似情景模式的功能，除了可用、离线等几个状态之外还可以自定义状态，对不同的im使用不同的状态。我义了两个”at home”和”work”,分别再家里和公司使用。 于是想搞个能够根据网络自动切换两个状态的小脚本，到家能自动切到“at home”，上班时自动切到“work”，终于在上周末搞定了，用了两天，很好用。。 下面是用到的相关脚本： 第一个文件 : status_filectl.pl : status_filectl.0.1 这是个用perl实现的pidgin插件，功能很简单，通过生成~/.purple/cstatus 文件来改变pidgin的状态，需要放到~/.purple/plugins目录，并到插件里启用。 装完插件就可以下面这样修改状态了 echo "at home" &#62; ~/.purple/cstatus 这么简单的功能本来想用dbus实现，但是pidgin的dbus接口不够，不能根据title查找已存状态。。。 第二个文件 : smart_pidgin.sh smart_pidgin.zip 这个文件用来根据网络判断使用不同的状态，需要自定义，放到/etc/NetworkManager/dispatcher.d目录即可 恩，以上，就可以更懒一点了~~]]></description>
			<content:encoded><![CDATA[<p>pidgin里有个类似情景模式的功能，除了可用、离线等几个状态之外还可以自定义状态，对不同的im使用不同的状态。我义了两个”at home”和”work”,分别再家里和公司使用。</p>
<p><a href="http://bluehua.org/wp-content/uploads/2010/01/screenshot_030.png"><img class="alignnone size-full wp-image-797" title="screenshot_030" src="http://bluehua.org/wp-content/uploads/2010/01/screenshot_030.png" alt="" width="537" height="278" /></a></p>
<p><a href="http://bluehua.org/wp-content/uploads/2010/01/screenshot_031.png"><img class="alignnone size-full wp-image-798" title="screenshot_031" src="http://bluehua.org/wp-content/uploads/2010/01/screenshot_031.png" alt="" width="739" height="498" /></a></p>
<p>于是想搞个能够根据网络自动切换两个状态的小脚本，到家能自动切到“at home”，上班时自动切到“work”，终于在上周末搞定了，用了两天，很好用。。</p>
<p>下面是用到的相关脚本：</p>
<p>第一个文件 : status_filectl.pl : <a href="http://bluehua.org/wp-content/uploads/2010/01/status_filectl.0.1.zip">status_filectl.0.1</a></p>
<p>这是个用perl实现的pidgin插件，功能很简单，通过生成~/.purple/cstatus 文件来改变pidgin的状态，需要放到~/.purple/plugins目录，并到插件里启用。</p>
<p>装完插件就可以下面这样修改状态了</p>
<pre>echo "at home" &gt; ~/.purple/cstatus
</pre>
<p>这么简单的功能本来想用dbus实现，但是pidgin的dbus接口不够，不能根据title查找已存状态。。。</p>
<p>第二个文件 : smart_pidgin.sh <a href="http://bluehua.org/wp-content/uploads/2010/01/smart_pidgin.zip">smart_pidgin.zip</a></p>
<p>这个文件用来根据网络判断使用不同的状态，需要自定义，放到/etc/NetworkManager/dispatcher.d目录即可</p>
<p>恩，以上，就可以更懒一点了~~</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2010/01/12/796.html/feed</wfw:commentRss>
		<slash:comments>1</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>
	</channel>
</rss>

<!-- Dynamic page generated in 0.745 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-22 08:57:23 -->

