<?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>Live in code &#187; linux</title>
	<atom:link href="http://www.agatezone.cn/code/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.agatezone.cn/code</link>
	<description>agate&#039;s tech blog</description>
	<lastBuildDate>Tue, 20 Jul 2010 05:35:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[APT] 使用 PROXY 设置</title>
		<link>http://www.agatezone.cn/code/archives/553</link>
		<comments>http://www.agatezone.cn/code/archives/553#comments</comments>
		<pubDate>Mon, 04 Jan 2010 00:42:39 +0000</pubDate>
		<dc:creator>agate</dc:creator>
				<category><![CDATA[系统操作]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.agatezone.cn/code/?p=553</guid>
		<description><![CDATA[出于中国某种不可抗拒的力量所致, 我们很多的 apt 源都无法正常访问. 所以使用代理翻墙是必不可免的. 可是如何让 apt 也同样使用这个代理有很多人不是很清楚. 其实有两种方法:
1. apt 配置修改法 (推荐)
编辑 /etc/apt/apt.conf
$ sudo vi /etc/apt/apt.conf
Acquire::http::Proxy "http://server:port/";
2. 给 bash 设定 http_proxy 和 ftp_proxy
$ export http_proxy=http://server:port/
$ export ftp_proxy=http://server:port/
现在只要执行 apt 的各个命令就是通过 proxy 走了.
]]></description>
			<content:encoded><![CDATA[<p>出于中国某种不可抗拒的力量所致, 我们很多的 apt 源都无法正常访问. 所以使用代理翻墙是必不可免的. 可是如何让 apt 也同样使用这个代理有很多人不是很清楚. 其实有两种方法:</p>
<p>1. apt 配置修改法 (推荐)<br />
编辑 /etc/apt/apt.conf</p>
<blockquote><p>$ sudo vi /etc/apt/apt.conf<br />
<code>Acquire::http::Proxy "http://server:port/";</code></p></blockquote>
<p>2. 给 bash 设定 http_proxy 和 ftp_proxy</p>
<blockquote><p>$ export http_proxy=http://server:port/<br />
$ export ftp_proxy=http://server:port/</p></blockquote>
<p>现在只要执行 apt 的各个命令就是通过 proxy 走了.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agatezone.cn/code/archives/553/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fitx: Linux 下优秀的输入法</title>
		<link>http://www.agatezone.cn/code/archives/485</link>
		<comments>http://www.agatezone.cn/code/archives/485#comments</comments>
		<pubDate>Mon, 17 Aug 2009 01:02:47 +0000</pubDate>
		<dc:creator>agate</dc:creator>
				<category><![CDATA[软件使用]]></category>
		<category><![CDATA[fitx]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://www.agatezone.cn/code/?p=485</guid>
		<description><![CDATA[Fitx 这个开源的优秀输入法让我在 linux 下体会到如同 windows 下搜狗输入法那样的舒服. 良好的速度, 流畅的输入体验, 完整的用户词库导出导入功能. 我觉得在 linux 下, 没有什么输入法能让我如此着迷的了.
Fitx 是 http://fit.coollittlethings.com/ 出品的. 同样地, 也有 mac 版本. 同样是好用得不得了. 但是可惜的是目前免费的 MAC 版本官方已经不再更新了. 我想估计是资金问题吧. 不过如果好用的话, 我会考虑购买一个的.
不过说回来, 我还是喜欢免费的午餐. 特别是 linux 下. 我们可以通过 svn 导出 http://code.google.com/p/fitx/ 里头的源文件. 然后自行编译安装.
具体步骤如下.
1. $ svn co http://fitx.googlecode.com/svn/branches/fitx-autotool fitx-autotool
2. $ cd fitx-autotool
3. $ ./autogen.sh
4. $ make deb &#038;&#038; sudo dpkg -i ../fitx_*.deb
其中遇到任何错误基本是没有安装完整的编译工具导致. [...]]]></description>
			<content:encoded><![CDATA[<p>Fitx 这个开源的优秀输入法让我在 linux 下体会到如同 windows 下搜狗输入法那样的舒服. 良好的速度, 流畅的输入体验, 完整的用户词库导出导入功能. 我觉得在 linux 下, 没有什么输入法能让我如此着迷的了.</p>
<p>Fitx 是 <a href="http://fit.coollittlethings.com/" onclick="pageTracker._trackPageview('/outgoing/fit.coollittlethings.com/?referer=');">http://fit.coollittlethings.com/</a> 出品的. 同样地, 也有 mac 版本. 同样是好用得不得了. 但是可惜的是目前免费的 MAC 版本官方已经不再更新了. 我想估计是资金问题吧. 不过如果好用的话, 我会考虑购买一个的.</p>
<p>不过说回来, 我还是喜欢免费的午餐. 特别是 linux 下. 我们可以通过 svn 导出 <a href="http://code.google.com/p/fitx/" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/fitx/?referer=');">http://code.google.com/p/fitx/</a> 里头的源文件. 然后自行编译安装.</p>
<p>具体步骤如下.<br />
1. $ svn co http://fitx.googlecode.com/svn/branches/fitx-autotool fitx-autotool<br />
2. $ cd fitx-autotool<br />
3. $ ./autogen.sh<br />
4. $ make deb &#038;& sudo dpkg -i ../fitx_*.deb</p>
<p>其中遇到任何错误基本是没有安装完整的编译工具导致. 请查看 log 并安装对应的编译帮助工具即可.<br />
最后执行那个生成的 deb 安装包就 ok 咯!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agatezone.cn/code/archives/485/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby: no such file to load -- net/https</title>
		<link>http://www.agatezone.cn/code/archives/384</link>
		<comments>http://www.agatezone.cn/code/archives/384#comments</comments>
		<pubDate>Sun, 05 Apr 2009 01:36:12 +0000</pubDate>
		<dc:creator>agate</dc:creator>
				<category><![CDATA[开发环境]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.agatezone.cn/code/?p=384</guid>
		<description><![CDATA[今天在新的 Ubuntu 上面安装 rails 的时候碰到了这样的问题:
`require_frameworks': no such file to load -- net/https (RuntimeError)
原来是缺少 libopenssl-ruby library:
解决方案:
$sudo apt-get install libopenssl-ruby
本文作为 Ubuntu下部署rbuy on rails开发环境 补充
]]></description>
			<content:encoded><![CDATA[<p>今天在新的 Ubuntu 上面安装 rails 的时候碰到了这样的问题:</p>
<blockquote><p>`require_frameworks': no such file to load -- net/https (RuntimeError)</p></blockquote>
<p>原来是缺少 libopenssl-ruby library:<br />
解决方案:<br />
<code>$sudo apt-get install libopenssl-ruby</code><br />
本文作为 <a href="http://www.agatezone.cn/code/archives/61">Ubuntu下部署rbuy on rails开发环境</a> 补充</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agatezone.cn/code/archives/384/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>swap your Escape and CapsLock keys for VIM</title>
		<link>http://www.agatezone.cn/code/archives/313</link>
		<comments>http://www.agatezone.cn/code/archives/313#comments</comments>
		<pubDate>Sun, 07 Dec 2008 00:18:08 +0000</pubDate>
		<dc:creator>agate</dc:creator>
				<category><![CDATA[开发环境]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[xmodmap]]></category>

		<guid isPermaLink="false">http://www.agatezone.cn/code/?p=313</guid>
		<description><![CDATA[i feel uncomfortable while i using vim and having to move way up to reach Escape key. so i swaped the Escape and CapsLock keys by under steps:
first, open your terminal. and type:
$vim ~/.xmodmap
second, add under statements into ./xmodmap file.
remove Lock = Caps_Lock
keysym Caps_Lock = Escape
keysym Escape = Caps_Lock
add Lock = Caps_Lock
last, restart your X [...]]]></description>
			<content:encoded><![CDATA[<p>i feel uncomfortable while i using vim and having to move way up to reach Escape key. so i swaped the Escape and CapsLock keys by under steps:</p>
<p>first, open your terminal. and type:<br />
<code>$vim ~/.xmodmap</code></p>
<p>second, add under statements into ./xmodmap file.<br />
<code>remove Lock = Caps_Lock<br />
keysym Caps_Lock = Escape<br />
keysym Escape = Caps_Lock<br />
add Lock = Caps_Lock</code></p>
<p>last, restart your X env.<br />
(maybe you can use CTRL + ALT + BackSpace)</p>
<p>after these configurations, i found it's easier than move way up to reach Esc while using vim.</p>
<p>ps. thanks forrest, thanks leon! i found i fell in love with vim!!! it's really powerful!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agatezone.cn/code/archives/313/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>去掉 Ubuntu 下那烦人的 &quot;嘟嘟嘟&quot;</title>
		<link>http://www.agatezone.cn/code/archives/298</link>
		<comments>http://www.agatezone.cn/code/archives/298#comments</comments>
		<pubDate>Sat, 15 Nov 2008 01:03:43 +0000</pubDate>
		<dc:creator>agate</dc:creator>
				<category><![CDATA[系统操作]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.agatezone.cn/code/?p=298</guid>
		<description><![CDATA[不知道大家有没有觉得在默认情况下, 我们的 Ubuntu 在出现警告音的时候不是像 windows 那样亲切地 "叮叮叮", 而是才用 PC 的蜂鸣器来大声地 "嘟嘟嘟". 特别是在我们使用 shell 不全, 或者 vim 在行首/尾时候也会出现这个愤恨的声音. google 了一下找到了解决方法.
1. 就是干脆把 x 环境和 shell 环境通通关闭声音.
方法就是编辑你的 ~/.bashrc 文件, 加入
xset b off
2. 如果你像我一样只是烦恼 shell 下开发烦人问题的话, 就只要把 gnome-terminal 的 profile 中的那个 "终端响铃" 去掉就好了!
]]></description>
			<content:encoded><![CDATA[<p>不知道大家有没有觉得在默认情况下, 我们的 Ubuntu 在出现警告音的时候不是像 windows 那样亲切地 "叮叮叮", 而是才用 PC 的蜂鸣器来大声地 "嘟嘟嘟". 特别是在我们使用 shell 不全, 或者 vim 在行首/尾时候也会出现这个愤恨的声音. google 了一下找到了解决方法.<br />
1. 就是干脆把 x 环境和 shell 环境通通关闭声音.<br />
方法就是编辑你的 ~/.bashrc 文件, 加入<br />
<code>xset b off</code><br />
2. 如果你像我一样只是烦恼 shell 下开发烦人问题的话, 就只要把 gnome-terminal 的 profile 中的那个 "终端响铃" 去掉就好了!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agatezone.cn/code/archives/298/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xfce 让我的老古董正常地跑起来</title>
		<link>http://www.agatezone.cn/code/archives/296</link>
		<comments>http://www.agatezone.cn/code/archives/296#comments</comments>
		<pubDate>Sun, 09 Nov 2008 14:45:19 +0000</pubDate>
		<dc:creator>agate</dc:creator>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xfce]]></category>

		<guid isPermaLink="false">http://www.agatezone.cn/code/?p=296</guid>
		<description><![CDATA[一直使用的是 ubuntu 的 linux 系统. 都说 linux 比 windows 快, 可是我就没有发现出来. 开了 firefox 感觉卡得要死了! 反正感觉都很慢... 无意间看到一个叫做 xfce 的东西, 就装了. 根据配置使用之后发现就是一个和 gnome/kde 一样的 X 环境. 不过我的机器从此"正常"的跑起来了. 内存占用及其小, 开什么都很顺畅, firefox 也没有过去卡了! 也许 firefox 针对 win 下真的做过很大的优化! 反正感觉就是好多了!
ubuntu 下使用 apt-get 安装 xubuntu 就完事了!
$sudo apt-get install xubuntu-desktop
]]></description>
			<content:encoded><![CDATA[<p>一直使用的是 ubuntu 的 linux 系统. 都说 linux 比 windows 快, 可是我就没有发现出来. 开了 firefox 感觉卡得要死了! 反正感觉都很慢... 无意间看到一个叫做 xfce 的东西, 就装了. 根据配置使用之后发现就是一个和 gnome/kde 一样的 X 环境. 不过我的机器从此"正常"的跑起来了. 内存占用及其小, 开什么都很顺畅, firefox 也没有过去卡了! 也许 firefox 针对 win 下真的做过很大的优化! 反正感觉就是好多了!<br />
ubuntu 下使用 apt-get 安装 xubuntu 就完事了!<br />
<code>$sudo apt-get install xubuntu-desktop</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.agatezone.cn/code/archives/296/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>thunar+xarchiver OR nautilus+fileroller</title>
		<link>http://www.agatezone.cn/code/archives/292</link>
		<comments>http://www.agatezone.cn/code/archives/292#comments</comments>
		<pubDate>Sun, 09 Nov 2008 03:36:08 +0000</pubDate>
		<dc:creator>agate</dc:creator>
				<category><![CDATA[系统操作]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[xfce]]></category>

		<guid isPermaLink="false">http://www.agatezone.cn/code/?p=292</guid>
		<description><![CDATA[nautilus 是 gnome 中默认的文件管理器, file-roller 是 gnome 中默认的压缩解压缩软件图形前端.
thunar 是 xfce 中默认的文件管理器, xarchiver 是 xfce 中默认的压缩解压缩软件图形前端.
所以, 在 gnome 的终端下输入 nautilus 便会启动文件管理器. 在 xfce 的终端下输入 thunar 同样效果.
]]></description>
			<content:encoded><![CDATA[<p>nautilus 是 gnome 中默认的文件管理器, file-roller 是 gnome 中默认的压缩解压缩软件图形前端.<br />
thunar 是 xfce 中默认的文件管理器, xarchiver 是 xfce 中默认的压缩解压缩软件图形前端.</p>
<p>所以, 在 gnome 的终端下输入 nautilus 便会启动文件管理器. 在 xfce 的终端下输入 thunar 同样效果.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agatezone.cn/code/archives/292/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gnome 下使用 root 权限在 GUI 环境下操作</title>
		<link>http://www.agatezone.cn/code/archives/285</link>
		<comments>http://www.agatezone.cn/code/archives/285#comments</comments>
		<pubDate>Sun, 09 Nov 2008 00:55:25 +0000</pubDate>
		<dc:creator>agate</dc:creator>
				<category><![CDATA[系统操作]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.agatezone.cn/code/?p=285</guid>
		<description><![CDATA[常常在 Ubuntu 这种使用 Gnome 的操作西统辖打开一个文件夹, 可是不能往里头添加东西, 或者删除东西等等. 这个是因为我们的权限不够.
在终端下我们可以
1. 单独一个命令
$sudo 命令
2. 长效权限
$sudo -s
但是这些都是终端下的, 很多时候我们喜欢在 GUI 环境中寻找东西并修改/删除/添加. 这里给出多种解决方案:
1. 使用终端命令:
$sudo nautilus
2. 使用 nautilus-scripts 扩展右键, 在 ~/.gnome2/nautilus-scripts 下建立一个名为 "作为ROOT浏览" 的文件. 内容如下:
#!/bin/bash
script-worker browse $NAUTILUS_SCRIPT_SELECTED_URIS root
然后把这个文件改为可执行的属性.(在属性中改, 或者在终端中 chmod +x 都可以)
3. 干脆直接安装帮助扩展
sudo apt-get install nautilus-gksu
安装后会多出 "以管理员打开"
]]></description>
			<content:encoded><![CDATA[<p>常常在 Ubuntu 这种使用 Gnome 的操作西统辖打开一个文件夹, 可是不能往里头添加东西, 或者删除东西等等. 这个是因为我们的权限不够.</p>
<p>在终端下我们可以<br />
1. 单独一个命令<br />
<code>$sudo 命令</code><br />
2. 长效权限<br />
<code>$sudo -s</code></p>
<p>但是这些都是终端下的, 很多时候我们喜欢在 GUI 环境中寻找东西并修改/删除/添加. 这里给出多种解决方案:<br />
1. 使用终端命令:<br />
<code>$sudo nautilus</code><br />
2. 使用 nautilus-scripts 扩展右键, 在 ~/.gnome2/nautilus-scripts 下建立一个名为 "作为ROOT浏览" 的文件. 内容如下:<br />
<code>#!/bin/bash<br />
script-worker browse $NAUTILUS_SCRIPT_SELECTED_URIS root</code><br />
然后把这个文件改为可执行的属性.(在属性中改, 或者在终端中 chmod +x 都可以)<br />
3. 干脆直接安装帮助扩展<br />
<code>sudo apt-get install nautilus-gksu</code><br />
安装后会多出 "以管理员打开"</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agatezone.cn/code/archives/285/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gnome 下在当前文件夹下打开终端</title>
		<link>http://www.agatezone.cn/code/archives/283</link>
		<comments>http://www.agatezone.cn/code/archives/283#comments</comments>
		<pubDate>Sat, 08 Nov 2008 12:55:20 +0000</pubDate>
		<dc:creator>agate</dc:creator>
				<category><![CDATA[系统操作]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.agatezone.cn/code/?p=283</guid>
		<description><![CDATA[$sudo apt-get install nautilus-open-terminal
这样便会在每个文件夹的右键菜单中出现 "在终端中打开" 的一个选项, 选择便会打开一个终端, 路径为当前文件夹!
当然, 可以使用 nautilus-scripts 添加右键扩展. 在 ~/.gnome2/nautilus-scripts/ 目录下新建一个文件名为 "从这里打开终端", 内容如下:
gnome-terminal --working-directory=$PWD
之后把这个文件设置为可执行(在属性中选择, 或者命令行 chmod +x 怎么设置随你开心)
然后在右键有个 "脚本" 里头就有了!
记得重启 X环境噢! Ctrl + Alt + Backspace
]]></description>
			<content:encoded><![CDATA[<p><code>$sudo apt-get install nautilus-open-terminal</code><br />
这样便会在每个文件夹的右键菜单中出现 "在终端中打开" 的一个选项, 选择便会打开一个终端, 路径为当前文件夹!</p>
<p>当然, 可以使用 nautilus-scripts 添加右键扩展. 在 ~/.gnome2/nautilus-scripts/ 目录下新建一个文件名为 "从这里打开终端", 内容如下:<br />
<code>gnome-terminal --working-directory=$PWD</code><br />
之后把这个文件设置为可执行(在属性中选择, 或者命令行 chmod +x 怎么设置随你开心)<br />
然后在右键有个 "脚本" 里头就有了!</p>
<p>记得重启 X环境噢! Ctrl + Alt + Backspace</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agatezone.cn/code/archives/283/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cron 时间部分的关键字用法</title>
		<link>http://www.agatezone.cn/code/archives/231</link>
		<comments>http://www.agatezone.cn/code/archives/231#comments</comments>
		<pubDate>Tue, 07 Oct 2008 01:29:46 +0000</pubDate>
		<dc:creator>agate</dc:creator>
				<category><![CDATA[系统操作]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.agatezone.cn/code/?p=231</guid>
		<description><![CDATA[一般来说 crontab 的格式是 "xxx时间 xxx用户 xxx命令". 其中 xxx时间 又是由五个区间段组成. 例如 "12 3 * * *", 无意中在查看开机自动运行方法中发现了原来 cron 可以通过 @reboot 实现开机自动运行. 于是便寻觅缘由, 被我发现了其他的 "at" 命令!
关键字          含义
------         -------
@reboot        在启动的时候执行一次.
@yearly     [...]]]></description>
			<content:encoded><![CDATA[<p>一般来说 crontab 的格式是 "xxx时间 xxx用户 xxx命令". 其中 xxx时间 又是由五个区间段组成. 例如 "12 3 * * *", 无意中在查看开机自动运行方法中发现了原来 cron 可以通过 @reboot 实现开机自动运行. 于是便寻觅缘由, 被我发现了其他的 "at" 命令!</p>
<blockquote><pre>关键字          含义
------         -------
@reboot        在启动的时候执行一次.
@yearly        每年执行一次, 相当于 "0 0 1 1 *".
@annually      (和 @yearly 一回事)
@monthly       每月执行一次, 相当于 "0 0 1 * *".
@weekly        每周执行一次, 相当于 "0 0 * * 0".
@daily         每日执行一次, 相当于 "0 0 * * *".
@midnight      (和 @daily 一回事)
@hourly        每小时执行一次, 相当于 "0 * * * *". </pre>
</blockquote>
<p>用以上 8 个关键字可十分方便地替代原来 5 个时间区间的常用部分. 当然其中特别要说明一下的是 @reboot . 这是一种十分方便的方法, 可以让每一个用户在启动的时候执行某个命令而不需要 root 身份!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agatezone.cn/code/archives/231/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
