<?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>Here comes the Sun &#187; linux</title>
	<atom:link href="http://sunng.info/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://sunng.info/blog</link>
	<description>Homemade Clojure Geek</description>
	<lastBuildDate>Fri, 11 May 2012 02:24: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>从GNOME网站安装exaile-doubanfm-gnome-shell-extension</title>
		<link>http://sunng.info/blog/2011/12/%e4%bb%8egnome%e7%bd%91%e7%ab%99%e5%ae%89%e8%a3%85exaile-doubanfm-gnome-shell-extension/</link>
		<comments>http://sunng.info/blog/2011/12/%e4%bb%8egnome%e7%bd%91%e7%ab%99%e5%ae%89%e8%a3%85exaile-doubanfm-gnome-shell-extension/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 06:06:59 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/?p=1088</guid>
		<description><![CDATA[最近GNOME发布了期待已久的extension.gnome.org，这个网站允许你直接通过浏览器安装和管理gnome-shell扩展，有点类似app store的感觉，混乱的~/.local/share/gnome-shell/extensions/终于有了一个官方的界面。 网站开通的第一时间，我提交了exaile-doubanfm-gnome-shell-extension，经过review和修改，这个扩展也得到了进一步的完善，适配了gnome-shell 3.2的风格。 你可以从这个地址直接安装启用 https://extensions.gnome.org/extension/24/exaile-doubanfm-control/ 它会在exaile douban.fm启动后显示一个菜单在gnome-shell上，你可以通过这个菜单进行基本的操作。 如果喜欢，别忘了在extension.gnome.org上vote一下 ：）]]></description>
			<content:encoded><![CDATA[<p>最近GNOME发布了期待已久的extension.gnome.org，这个网站允许你直接通过浏览器安装和管理gnome-shell扩展，有点类似app store的感觉，混乱的~/.local/share/gnome-shell/extensions/终于有了一个官方的界面。</p>
<p>网站开通的第一时间，我提交了exaile-doubanfm-gnome-shell-extension，经过review和修改，这个扩展也得到了进一步的完善，适配了gnome-shell 3.2的风格。</p>
<p>你可以从这个地址直接安装启用<br />
<a href="https://extensions.gnome.org/extension/24/exaile-doubanfm-control/" target="_blank">https://extensions.gnome.org/extension/24/exaile-doubanfm-control/</a></p>
<p>它会在exaile douban.fm启动后显示一个菜单在gnome-shell上，你可以通过这个菜单进行基本的操作。</p>
<p>如果喜欢，别忘了在extension.gnome.org上vote一下 ：）</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2011/12/%e4%bb%8egnome%e7%bd%91%e7%ab%99%e5%ae%89%e8%a3%85exaile-doubanfm-gnome-shell-extension/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Upgraded to GNOME 3.2</title>
		<link>http://sunng.info/blog/2011/10/upgraded-to-gnome-3-2/</link>
		<comments>http://sunng.info/blog/2011/10/upgraded-to-gnome-3-2/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 10:14:27 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[archilinux]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/?p=1012</guid>
		<description><![CDATA[ArchLinux最大的魅力就在于Rolling Release，所有的悲喜剧你都比别人早一步见证。 升级到GNOME 3.2后，我的gnome-settings-daemon不能正常工作，导致gtk+的主题都无效。如果没有经验你可能不太容易注意到它的真实原因。最后找到了同病相怜的人，这个问题被报告在这里。恰好是在我发现这个问题几个小时之前。在gnome解决这个问题之前，有一个简单的workaround： sudo mv /usr/lib/gnome-settings-daemon-3.0/libcolor.so /usr/lib/gnome-settings-daemon-3.0/libcolor.so~ 库加载失败后gnome-settings-daemon会自动禁用这个插件，避免出现Segmentation fault。以上的操作，at your own risk。 此外，gnome-shell升级到3.2以后有些api的变化，我更新了exaile豆瓣电台的gnome-shell插件，你可以顺手git pull一下。]]></description>
			<content:encoded><![CDATA[<p>ArchLinux最大的魅力就在于Rolling Release，所有的悲喜剧你都比别人早一步见证。</p>
<p>升级到GNOME 3.2后，我的gnome-settings-daemon不能正常工作，导致gtk+的主题都无效。如果没有经验你可能不太容易注意到它的真实原因。最后找到了同病相怜的人，这个问题被报告在<a href="https://bugzilla.gnome.org/show_bug.cgi?id=660664" target="_blank">这里</a>。恰好是在我发现这个问题几个小时之前。在gnome解决这个问题之前，有一个简单的workaround：<br />
<em>sudo mv /usr/lib/gnome-settings-daemon-3.0/libcolor.so /usr/lib/gnome-settings-daemon-3.0/libcolor.so~</em></p>
<p>库加载失败后gnome-settings-daemon会自动禁用这个插件，避免出现Segmentation fault。以上的操作，at your own risk。</p>
<p>此外，gnome-shell升级到3.2以后有些api的变化，我更新了exaile豆瓣电台的gnome-shell插件，你可以顺手git pull一下。<br />
<a href="http://www.flickr.com/photos/40741608@N08/6203348334/" title="Screenshot at 2011-10-02 17:48:51 by 贝小塔, on Flickr"><img src="http://farm7.static.flickr.com/6162/6203348334_c71d757170.jpg" width="500" height="157" alt="Screenshot at 2011-10-02 17:48:51"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2011/10/upgraded-to-gnome-3-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Moving to ArchLinux</title>
		<link>http://sunng.info/blog/2011/10/moving-to-archlinux/</link>
		<comments>http://sunng.info/blog/2011/10/moving-to-archlinux/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 16:19:40 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[ArchLinux]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/?p=1009</guid>
		<description><![CDATA[这是用新入的Nikon 55-300mm的长焦镜头300端排的远处的塔吊，它与本文没有直接关系。如果实在要计算间接关系，它是我等待fedora无尽的启动时间里消磨时光的手段之一。 这周开始fedora彻底崩溃了，现在在默认的run-level下NetworkManager根本无法启动，次次3分钟超时。还由于不明的原因，以越来越大的概率，gdm会僵死在启动启动之前。如果切换到terminal，输入完用户名居然连password都不会prompt出来。有时甚至在runlevel3里都无法启动。本想忍下去等到下个月f16发布，但是今天晚上已经彻底无法进入系统了，算了，其实也就是挥挥刀的事情。 Ubuntu的回头路是走不得的，索性切换到了Arch，从此享受rolling release，不再在每年的4月10月里蠢蠢欲动惊慌失措。重装的经验和上次一样：看准分区，/home留着/干掉；在创建用户的时候看准原先用户的uid，直接用这个id创建新用户，这样$HOME自动就归属新用户了。Arch仓库里的东西甚至要比fedora还多，没有那么多洁癖，甚至Skype和IDEA的社区版都直接进了仓库。我现在年纪大了，能从仓库安装我是不会自己再去下载了。 其实Arch也是老朋友了，直不过以前一直把它憋在VirtualBox里，现在它从VBox里爬出来了，Ubuntu和Windows这些当年的host们被踹进去乖乖作guest了，翻身农奴这就起来把歌唱。]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/40741608@N08/6198252182/" title="DSC_0004 by 贝小塔, on Flickr"><img src="http://farm7.static.flickr.com/6022/6198252182_656282b489.jpg" width="335" height="500" alt="DSC_0004"></a><br />
这是用新入的Nikon 55-300mm的长焦镜头300端排的远处的塔吊，它与本文没有直接关系。如果实在要计算间接关系，它是我等待fedora无尽的启动时间里消磨时光的手段之一。</p>
<p>这周开始fedora彻底崩溃了，现在在默认的run-level下NetworkManager根本无法启动，次次3分钟超时。还由于不明的原因，以越来越大的概率，gdm会僵死在启动启动之前。如果切换到terminal，输入完用户名居然连password都不会prompt出来。有时甚至在runlevel3里都无法启动。本想忍下去等到下个月f16发布，但是今天晚上已经彻底无法进入系统了，算了，其实也就是挥挥刀的事情。</p>
<p>Ubuntu的回头路是走不得的，索性切换到了Arch，从此享受rolling release，不再在每年的4月10月里蠢蠢欲动惊慌失措。重装的经验和上次一样：看准分区，/home留着/干掉；在创建用户的时候看准原先用户的uid，直接用这个id创建新用户，这样$HOME自动就归属新用户了。Arch仓库里的东西甚至要比fedora还多，没有那么多洁癖，甚至Skype和IDEA的社区版都直接进了仓库。我现在年纪大了，能从仓库安装我是不会自己再去下载了。</p>
<p>其实Arch也是老朋友了，直不过以前一直把它憋在VirtualBox里，现在它从VBox里爬出来了，Ubuntu和Windows这些当年的host们被踹进去乖乖作guest了，翻身农奴这就起来把歌唱。</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2011/10/moving-to-archlinux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>手动设置Fedora15网卡</title>
		<link>http://sunng.info/blog/2011/05/%e6%89%8b%e5%8a%a8%e8%ae%be%e7%bd%aefedora15%e7%bd%91%e5%8d%a1/</link>
		<comments>http://sunng.info/blog/2011/05/%e6%89%8b%e5%8a%a8%e8%ae%be%e7%bd%aefedora15%e7%bd%91%e5%8d%a1/#comments</comments>
		<pubDate>Sat, 28 May 2011 07:16:29 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[把戏]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2011/05/%e6%89%8b%e5%8a%a8%e8%ae%be%e7%bd%aefedora15%e7%bd%91%e5%8d%a1/</guid>
		<description><![CDATA[今天上午的Fedora更新，版本为0.8.999.3的NetworkManager会致使NetworkManager和network service的版本不一致，从而导致网络功能无法使用。而这个时候要通过yum downgrade NetworkManager*降级又没有网络连接可用，悲剧。 这时只有手动设置网卡了。service network restart和 service NetworkManager restart都报告失败，ifconfig查看网卡，只有本地回环启动。 接下来接上网线，通过 ifconfig -a 查看所有的网卡接口，例如我的接口叫做em2. 启动网卡 ifconfig em2 up 查看网卡情况 ifconfig em2 如果没有获得ip，可以通过dhcpclient获得ip dhclient -4 em2 再查看网卡情况，如果获得了ip，可以尝试ping www.baidu.com，如果出现network unreachable的报错，需要再配置一下路由信息，其中gw是你的网关： route add default gw 192.168.1.1 这时你的网络应该暂时可用了，立刻执行yum downgrade NetworkManager*降级吧。]]></description>
			<content:encoded><![CDATA[<p>今天上午的Fedora更新，版本为<font face="monospace">0.8.999.3</font>的NetworkManager会致使NetworkManager和network service的版本不一致，从而导致网络功能无法使用。而这个时候要通过<font face="monospace">yum downgrade NetworkManager*</font>降级又没有网络连接可用，悲剧。</p>
<p>这时只有手动设置网卡了。<font face="monospace">service network restart</font>和 <font face="monospace">service NetworkManager restart</font>都报告失败，<font face="monospace">ifconfig</font>查看网卡，只有本地回环启动。</p>
<p>接下来接上网线，通过 <font face="monospace">ifconfig -a</font> 查看所有的网卡接口，例如我的接口叫做<font face="monospace">em2</font>.</p>
<p>启动网卡<br />
<font face="monospace">ifconfig em2 up</font></p>
<p>查看网卡情况<br />
<font face="monospace">ifconfig em2</font></p>
<p>如果没有获得ip，可以通过dhcpclient获得ip<br />
<font face="monospace">dhclient -4 em2</font></p>
<p>再查看网卡情况，如果获得了ip，可以尝试<font face="monospace">ping www.baidu.com</font>，如果出现network unreachable的报错，需要再配置一下路由信息，其中gw是你的网关：<br />
<font face="monospace">route add default gw 192.168.1.1</font></p>
<p>这时你的网络应该暂时可用了，立刻执行<font face="monospace">yum downgrade NetworkManager*</font>降级吧。</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=551018aa-7e6c-81e6-b79a-bc1751d9b7be" /></div>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2011/05/%e6%89%8b%e5%8a%a8%e8%ae%be%e7%bd%aefedora15%e7%bd%91%e5%8d%a1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>告别Ubuntu，迁移到Fedora 15，GNOME 3</title>
		<link>http://sunng.info/blog/2011/04/%e5%91%8a%e5%88%abubuntu%ef%bc%8c%e8%bf%81%e7%a7%bb%e5%88%b0fedora-15%ef%bc%8cgnome-3/</link>
		<comments>http://sunng.info/blog/2011/04/%e5%91%8a%e5%88%abubuntu%ef%bc%8c%e8%bf%81%e7%a7%bb%e5%88%b0fedora-15%ef%bc%8cgnome-3/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 13:19:42 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2011/04/%e5%91%8a%e5%88%abubuntu%ef%bc%8c%e8%bf%81%e7%a7%bb%e5%88%b0fedora-15%ef%bc%8cgnome-3/</guid>
		<description><![CDATA[昨晚终于下了决心告别Ubuntu的紫色，迎接新的GNOME3桌面。这个想法有一段时间了，Ubuntu从09年生日的时候安装在这台电脑上，已经将近两年的时间，经历了9.04, 9.10, 10.04, 10.10, 11.04五个版本，安装了GNOME, awesome, KDE, LXDE, Openbox, wmii, GNOME3, Ubuntu Netbook等等桌面环境，可以想想那种混乱。而且通过升级获得的新版本，并不能体会到快速开机这样的特性。这次unity发布以后，用了半个月，没有什么眼前一亮的感觉，操作也不太方便，于是换发行版的想法就更加强烈了。 我的系统之前有三个分区，分别挂载/，/home以及/opt。这次更新理想的方式就是格式化/，保留/home和/opt。之前比较讲究规范，所以/下面基本上没有什么需要备份的东西，配置文件都放在/home下面。这样用fedora的livecd安装程序手动配置磁盘分区，只格式化/就可以了。安装的过程非常顺利，重启以后就进入用户配置的界面了。 要把原先的/home/sun分配给新的sun用户，这里我走了一点弯路。系统可以把/home/sun目录配置给新的sun用户作为$HOME，但是目录的owner并不会根据用户名称来匹配。Ubuntu默认第一个用户的UID是1000，而Fedora创建的新用户默认是500. 我现在不确定如果把第一个用户的ID手动指定为1000会不会就直接成功。不过这个问题不大，只要启动之后用root用户把/home/sun目录chown给新的sun用户就可以了，当然文件很多是需要消耗一些时间的。 进入GNOME3桌面之后发现无线网络连不上，而且不弹出密码输入框。因为我最近改了无线的密码，而NetworkManager还是从gnome-keyring里去读旧的密码，所以总是连接失败。这时rm -r ~/.gnome-keyring/ 删除旧密码即可。 桌面的第二个问题是桌面背景仍然是旧的配置（只有颜色没有图片，因为GNOME3默认桌面不由Nautilus管理），这时要毫不留情地删掉所有GNOME2的配置： rm -rf ~/.gnome2 ~/.gconf ~/.gconfd 第三个问题，gnome的applition菜单非常混乱，还存着Ubuntu系统时候的内容。根据freedesktop的标准，用户的菜单配置保存在~/.config/menus里，而用户菜单会从~/.local/share/applications下读取所有的.desktop文件，甚至包括wine也会在这里创建自己的菜单。对付这些内容，一删了之： rm -rf ~/.local/share/applications/*。这样菜单就只会从/usr/share/applications/下读取.desktop文件，这些都是最新安装的。 然后，然后就没有了！就可以开始享受fresh install了，甚至你打开thunderbird，所有的邮件都在那里，什么都不用再做。 如果要比较gnome-shell和unity的话： gs的启动器比unity要好用，unity的启动器搜索程序之后必须点击图标才能启动，gs可以直接回车启动第一个 gs的dock比unity要好用，其实都与windows7的任务栏类似，但是 unity里打开了一个终端之后，再点这个图标就转到终端，如果想新开一个就无奈了，右键点击也没有新开的选项。（难道是shift+click，来不及试了。。。） unity的indicator比gs的tray强大多了，这是ubuntu的强项，从10.04开始就用自己的indicator，到了11.04已经有成熟的API，除了官方的，还有很多程序支持，还有天气、系统监控的indicator。gs抛弃了原来的panel applets，现在看天气、看系统状况都无从谈起。尤其是看不到cpu使用情况，心里总是不踏实，天知道firefox+flash又把你的系统烧了多久。 总体来说这次重装效果非常好，基本上没有留下任何瑕疵。断断续续用了四年多的Ubuntu，再见了～]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/40741608@N08/5643299802/" title="Fedora15/Gnome3 by 贝小塔, on Flickr"><img src="http://farm6.static.flickr.com/5068/5643299802_787791dd52.jpg" alt="Fedora15/Gnome3" height="313" width="500" /></a></p>
<p>昨晚终于下了决心告别Ubuntu的紫色，迎接新的GNOME3桌面。这个想法有一段时间了，Ubuntu从09年生日的时候安装在这台电脑上，已经将近两年的时间，经历了9.04, 9.10, 10.04, 10.10, 11.04五个版本，安装了GNOME, awesome, KDE, LXDE, Openbox, wmii, GNOME3, Ubuntu Netbook等等桌面环境，可以想想那种混乱。而且通过升级获得的新版本，并不能体会到快速开机这样的特性。这次unity发布以后，用了半个月，没有什么眼前一亮的感觉，操作也不太方便，于是换发行版的想法就更加强烈了。</p>
<p>我的系统之前有三个分区，分别挂载/，/home以及/opt。这次更新理想的方式就是格式化/，保留/home和/opt。之前比较讲究规范，所以/下面基本上没有什么需要备份的东西，配置文件都放在/home下面。这样用fedora的livecd安装程序手动配置磁盘分区，只格式化/就可以了。安装的过程非常顺利，重启以后就进入用户配置的界面了。</p>
<p>要把原先的/home/sun分配给新的sun用户，这里我走了一点弯路。系统可以把/home/sun目录配置给新的sun用户作为$HOME，但是目录的owner并不会根据用户名称来匹配。Ubuntu默认第一个用户的UID是1000，而Fedora创建的新用户默认是500. 我现在不确定如果把第一个用户的ID手动指定为1000会不会就直接成功。不过这个问题不大，只要启动之后用root用户把/home/sun目录chown给新的sun用户就可以了，当然文件很多是需要消耗一些时间的。</p>
<p>进入GNOME3桌面之后发现无线网络连不上，而且不弹出密码输入框。因为我最近改了无线的密码，而NetworkManager还是从gnome-keyring里去读旧的密码，所以总是连接失败。这时<font face="monospace">rm -r ~/.gnome-keyring/</font> 删除旧密码即可。</p>
<p>桌面的第二个问题是桌面背景仍然是旧的配置（只有颜色没有图片，因为GNOME3默认桌面不由Nautilus管理），这时要毫不留情地删掉所有GNOME2的配置： <font face="monospace">rm -rf ~/.gnome2 ~/.gconf ~/.gconfd </font></p>
<p>第三个问题，gnome的applition菜单非常混乱，还存着Ubuntu系统时候的内容。根据freedesktop的标准，用户的菜单配置保存在<font face="monospace">~/.config/menus</font>里，而用户菜单会从<font face="monospace">~/.local/share/applications</font>下读取所有的.desktop文件，甚至包括wine也会在这里创建自己的菜单。对付这些内容，一删了之： <font face="monospace">rm -rf ~/.local/share/applications/*</font>。这样菜单就只会从/usr/share/applications/下读取.desktop文件，这些都是最新安装的。</p>
<p>然后，然后就没有了！就可以开始享受fresh install了，甚至你打开thunderbird，所有的邮件都在那里，什么都不用再做。<br />
<a href="http://www.flickr.com/photos/40741608@N08/5643386496/" title="Window Selector by 贝小塔, on Flickr"><img src="http://farm6.static.flickr.com/5041/5643386496_153d59d4b1.jpg" alt="Window Selector" height="313" width="500" /></a><br />
如果要比较gnome-shell和unity的话：</p>
<ol>
<li>gs的启动器比unity要好用，unity的启动器搜索程序之后必须点击图标才能启动，gs可以直接回车启动第一个</li>
<li>gs的dock比unity要好用，其实都与windows7的任务栏类似，但是 unity里打开了一个终端之后，再点这个图标就转到终端，如果想新开一个就无奈了，右键点击也没有新开的选项。（难道是shift+click，来不及试了。。。）</li>
<li>unity的indicator比gs的tray强大多了，这是ubuntu的强项，从10.04开始就用自己的indicator，到了11.04已经有成熟的API，除了官方的，还有很多程序支持，还有天气、系统监控的indicator。gs抛弃了原来的panel applets，现在看天气、看系统状况都无从谈起。尤其是看不到cpu使用情况，心里总是不踏实，天知道firefox+flash又把你的系统烧了多久。</li>
</ol>
<p>总体来说这次重装效果非常好，基本上没有留下任何瑕疵。断断续续用了四年多的Ubuntu，再见了～</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=98d4edfa-b22d-81bd-b0cc-4b2b6afdacb9" /></div>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2011/04/%e5%91%8a%e5%88%abubuntu%ef%bc%8c%e8%bf%81%e7%a7%bb%e5%88%b0fedora-15%ef%bc%8cgnome-3/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>dbus-python, in case you don&#039;t know</title>
		<link>http://sunng.info/blog/2010/11/dbus-python-in-case-you-dont-know/</link>
		<comments>http://sunng.info/blog/2010/11/dbus-python-in-case-you-dont-know/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 15:02:10 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[手艺]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/11/dbus-python-in-case-you-dont-know/</guid>
		<description><![CDATA[上周用dbus-python写exaile插件，实现mpris2.0，非常痛苦，因为几乎没有完整的文档，只有一个tutorials帮助你入门。总结一下我这次quick and dirty的开发所掌握的资料，当然，因为没有太多时间，所以也没有对dbus做更深入的了解，仅仅是in case you don&#8217;t know。 DBus Interface Properties 对mpris 2.0中定义的properties用dbus-python应该如何实现呢，似乎没有@dbus.service.properties这种decorator啊。这里的文档对Properties进行了简单的说明，对于python程序，只能这样实现了： &#160; &#160; @dbus.service.method&#40;dbus.PROPERTIES_IFACE, in_signature='ss', out_signature='v'&#41; &#160; &#160; def Get&#40;self, interface, prop&#41;: &#160; &#160; &#160; &#160; ... &#160; &#160; @dbus.service.method&#40;dbus.PROPERTIES_IFACE, in_signature='ssv'&#41; &#160; &#160; def Set&#40;self, interface, prop, value&#41;: &#160; &#8230; <a href="http://sunng.info/blog/2010/11/dbus-python-in-case-you-dont-know/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>上周用dbus-python写exaile插件，实现mpris2.0，非常痛苦，因为几乎没有完整的文档，只有一个<a href="http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html">tutorials</a>帮助你入门。总结一下我这次quick and dirty的开发所掌握的资料，当然，因为没有太多时间，所以也没有对dbus做更深入的了解，仅仅是in case you don&#8217;t know。</p>
<h3>DBus Interface Properties</h3>
<p>对mpris 2.0中定义的properties用dbus-python应该如何实现呢，似乎没有@dbus.service.properties这种decorator啊。<a href="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties">这里</a>的文档对Properties进行了简单的说明，对于python程序，只能这样实现了：</p>
<div class="codecolorer-container python twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #66cc66;">@</span>dbus.<span style="color: black;">service</span>.<span style="color: black;">method</span><span style="color: black;">&#40;</span>dbus.<span style="color: black;">PROPERTIES_IFACE</span><span style="color: #66cc66;">,</span> in_signature<span style="color: #66cc66;">=</span><span style="color: #483d8b;">'ss'</span><span style="color: #66cc66;">,</span> out_signature<span style="color: #66cc66;">=</span><span style="color: #483d8b;">'v'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> Get<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: #66cc66;">,</span> interface<span style="color: #66cc66;">,</span> prop<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; ...<br />
&nbsp; &nbsp; <span style="color: #66cc66;">@</span>dbus.<span style="color: black;">service</span>.<span style="color: black;">method</span><span style="color: black;">&#40;</span>dbus.<span style="color: black;">PROPERTIES_IFACE</span><span style="color: #66cc66;">,</span> in_signature<span style="color: #66cc66;">=</span><span style="color: #483d8b;">'ssv'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> Set<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: #66cc66;">,</span> interface<span style="color: #66cc66;">,</span> prop<span style="color: #66cc66;">,</span> value<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; ...<br />
&nbsp; &nbsp; <span style="color: #66cc66;">@</span>dbus.<span style="color: black;">service</span>.<span style="color: black;">method</span><span style="color: black;">&#40;</span>dbus.<span style="color: black;">PROPERTIES_IFACE</span><span style="color: #66cc66;">,</span> in_signature<span style="color: #66cc66;">=</span><span style="color: #483d8b;">'s'</span><span style="color: #66cc66;">,</span> out_signature<span style="color: #66cc66;">=</span><span style="color: #483d8b;">'a{sv}'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> GetAll<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: #66cc66;">,</span> interface<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; ...</div></div>
<p>程序里通过prop判断property名字，返回结果。没办法，就是这样。</p>
<h3>指定返回数据的dbus类型</h3>
<p>对于dbus接口返回的variant类型，dbus-python会guess_signature。可是这部分的功能有的时候并不如我们想象，比如返回一个dict类型，其中的value有字符串有list有int，而out_signature是v。这种情况在Property Get的时候非常常见，如果不能手动指定类型，guess_signature得到的结果，value是统一类型，即，int会报错，如果没有int类型，会将所有字符串转成list（dbus的array）</p>
<p>这种情况需要手动指定返回的类型，用dbus.types模块下的类型对python显示包装，对dict类型，需要用dbus.types.Dictionary()包装，并且在构造函数里传入signature=&#8217;sv‘及相应的<a href="http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html#container-types">variant_level</a>即可显示告知类型。同样，对list对象，需要用dbus.types.Array()包装。</p>
<p>这样即可绕过guest_signature，如果用dbus-monitor查看，就可以看到类型为variant string了。</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/11/dbus-python-in-case-you-dont-know/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Awesome autostart</title>
		<link>http://sunng.info/blog/2010/11/awesome-autostart/</link>
		<comments>http://sunng.info/blog/2010/11/awesome-autostart/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 09:06:23 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/11/awesome-autostart/</guid>
		<description><![CDATA[Problem 让Awesome环境像Openbox一样在启动时，在根上下文中执行一个autostart脚本（启动程序、声明环境变量）。 Solution Ubuntu中GDM启动后会执行 /etc/gdm/Xsession 这个脚本，如果是custom会话（启动参数custom），会执行用户目录下的.xsession脚本，否则会执行 /etc/X11/Xsession.d/ 目录下的所有脚本。 为了支持autostart脚本，可以在 /etc/X11/Xsession.d/ 里创建一个新的脚本 55awesome-autostart BASESTARTUP=$&#40;basename &#34;$STARTUP&#34; &#124; cut -d\ &#160;-f1&#41; if &#91; &#34;$BASESTARTUP&#34; = x-session-manager &#93;; then &#160; &#160; BASESTARTUP=$&#40;basename $&#40;readlink /etc/alternatives/x-session-manager&#41;&#41; fi if &#91; &#34;$BASESTARTUP&#34; = &#34;awesome&#34; &#93;; then &#160; &#160; &#8230; <a href="http://sunng.info/blog/2010/11/awesome-autostart/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Problem</h3>
<p>让Awesome环境像Openbox一样在启动时，在根上下文中执行一个autostart脚本（启动程序、声明环境变量）。</p>
<h3>Solution</h3>
<p>Ubuntu中GDM启动后会执行<i> /etc/gdm/Xsession</i> 这个脚本，如果是custom会话（启动参数custom），会执行用户目录下的.xsession脚本，否则会执行 <i>/etc/X11/Xsession.d/</i> 目录下的所有脚本。</p>
<p>为了支持autostart脚本，可以在 <i>/etc/X11/Xsession.d/</i> 里创建一个新的脚本 55awesome-autostart</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">BASESTARTUP</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">basename</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$STARTUP</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> -d\ &nbsp;-f1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BASESTARTUP</span>&quot;</span> = x-session-manager <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #007800;">BASESTARTUP</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">basename</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">readlink</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>alternatives<span style="color: #000000; font-weight: bold;">/</span>x-session-manager<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$BASESTARTUP</span>&quot;</span> = <span style="color: #ff0000;">&quot;awesome&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #007800;">AWESOME_AUTOSTART</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>awesome<span style="color: #000000; font-weight: bold;">/</span>autostart.sh<br />
&nbsp; &nbsp; <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;<span style="color: #007800;">$AWESOME_AUTOSTART</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; . <span style="color: #ff0000;">&quot;<span style="color: #007800;">$AWESOME_AUTOSTART</span>&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">fi</span></div></div>
<p>这个脚本会判断启动的session是否是awesome，如果是，并且autostart.sh存在的话，source这个文件。autostart.sh按照xdg的约定，放在配置文件目录 <i>$HOME/.config/awesome/</i> 里。</p>
<p>这样，在用户目录下的配置文件里，就可执行一些自启动程序，或者声明环境变量，典型的应用就是指定awesome会话专用的gtkrc：</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">AWESOME_CONFIG_PATH</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>awesome<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GTK2_RC_FILES</span>=<span style="color: #007800;">$AWESOME_CONFIG_PATH</span><span style="color: #000000; font-weight: bold;">/</span>gtkrc<br />
<br />
xcompmgr <span style="color: #660033;">-cCfF</span> <span style="color: #660033;">-t-5</span> <span style="color: #660033;">-l-5</span> -r4.2 -o.55 <span style="color: #660033;">-D6</span> <span style="color: #000000; font-weight: bold;">&amp;</span><br />
awsetbg <span style="color: #660033;">-u</span> feh <span style="color: #660033;">-f</span> .config<span style="color: #000000; font-weight: bold;">/</span>awesome<span style="color: #000000; font-weight: bold;">/</span>ubuntu.jpg</div></div>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/11/awesome-autostart/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bash Color Support for Bti</title>
		<link>http://sunng.info/blog/2010/10/bash-color-support-for-bti/</link>
		<comments>http://sunng.info/blog/2010/10/bash-color-support-for-bti/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 02:14:07 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/10/bash-color-support-for-bti/</guid>
		<description><![CDATA[Bti is well known as a command line twitter/identica/statusnet client, by Greg Kroah-Hartman. I have been using this tool in CLI environment for a long time, found it difficult for human to parse output by eyes. So I forked it &#8230; <a href="http://sunng.info/blog/2010/10/bash-color-support-for-bti/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/gregkh/bti">Bti</a> is well known as a command line twitter/identica/statusnet client, by <a href="http://github.com/gregkh">Greg Kroah-Hartman</a>.</p>
<p>I have been using this tool in CLI environment for a long time, found it difficult for human to parse output by eyes. So I forked it and added this bash color support, to provide some highlight on tweets.<br />
<a href="http://www.flickr.com/photos/40741608@N08/5130529830/" title="bti-bash-color by 贝小塔, on Flickr"><img src="http://farm2.static.flickr.com/1346/5130529830_a1f8eaf793.jpg" width="416" height="500" alt="bti-bash-color" /></a></p>
<p>To enable color support, add an option <i>&#8211;auto-color</i> to bti command, or append <i>auto-color=yes</i> to your configuration file($HOME/.bti)</p>
<p>I have sent pull request to Greg, hope the patch can be merged into master. Before approved, you can check out <a href="http://github.com/sunng87/bti">my fork</a> and compile it yourself. (If liboauth not found, find it <a href="http://liboauth.sourceforge.net/">here</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/10/bash-color-support-for-bti/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The 4k Story</title>
		<link>http://sunng.info/blog/2010/10/the-4k-story/</link>
		<comments>http://sunng.info/blog/2010/10/the-4k-story/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 14:10:37 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[把戏]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mmap]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[nosql]]></category>
		<category><![CDATA[redis]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/10/the-4k-story/</guid>
		<description><![CDATA[从 Redis 2.0 开始，Redis的作者就不断地被问道，你为什么要自己造一个VM轮子呢。尽管作者在FAQ里说明了，但是仍然有很多不同意见。 反向代理Varnish的开发人员，Poul-Henning Kamp 写了一篇文章，What&#8217;s wrong with 1975 programming ?，锋芒毕露，矛头直指竞争对手Squid，顺便也打击一大片牵连到了Redis的作者Antirez。他说： I have spent many years working on the FreeBSD kernel, and only rarely did I venture into userland programming, but when I had occation to do so, I &#8230; <a href="http://sunng.info/blog/2010/10/the-4k-story/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>从 Redis 2.0 开始，Redis的作者就不断地被问道，你为什么要自己造一个VM轮子呢。尽管作者在<a href="http://code.google.com/p/redis/wiki/FAQ#Do_you_plan_to_implement_Virtual_Memory_in_Redis?_Why_don%27t">FAQ</a>里说明了，但是仍然有很多不同意见。</p>
<p>反向代理Varnish的开发人员，Poul-Henning Kamp 写了一篇文章，<a href="http://www.varnish-cache.org/trac/wiki/ArchitectNotes">What&#8217;s wrong with 1975 programming ?</a>，锋芒毕露，矛头直指竞争对手Squid，顺便也打击一大片牵连到了Redis的作者Antirez。他说：</p>
<blockquote><p>I have spent many years working on the FreeBSD kernel, and only rarely did I venture into userland programming, but when I had occation to do so, I invariably found that people programmed like it was still 1975. </p></blockquote>
<p>Kamp兄有来到user-space之后一夜回到解放前的感觉，又好像摇晃着饮料瓶子对着Antirez说：你Out啦！也许是因为作者就是个内核开发者，所以Varnish对操作系统的Virtual Memory机制充分信任，把Squid对内存的手动管理称为wasted work。&#8221;So Welcome to Varnish, a 2006 architecture program. &#8221;</p>
<p>还有<a href="http://blog.kennejima.com/post/1226487020/thoughts-on-redis">用户</a>也提出</p>
<blockquote><p>
Redis doesn’t use OS swap. According to Salvatore Sanfilippo, the creator of Redis, it was because the page size of 4KB was too big. I personally don’t think that helps but it’d be better if Redis preallocated specified amount of buffer pool and bring related objects to the same page to increase locality of reference, instead of letting the heap manager blindly fragment objects. In my opinion, the page size of 32 bytes is too small, considering that the hardware architectures and the compilers are optimized for the conventional page size. In that scale, even the latency of reading something from RAM could be dominant (RAM is too slow for CPU, therefore it’s got L1/L2 cache), and RAM has the pipelined burst mode to pre-fetche memory contents at a few clock cycles, before they are actually requested.
</p></blockquote>
<p>5号，Antirez在博客上写了回击 <a href="http://antirez.com/post/what-is-wrong-with-2006-programming.html">What&#8217;s wrong with 2006 programming?</a>，他认为：</p>
<ul>
<li>OS Swap在一些情况下会导致客户端阻塞</li>
<li>4K大小的Page可能包含很多key，其中总有一些被访问到，导致操作系统无法swap这些page</li>
<li>使用自己实现的Paging为程序提供了极大的自由度，包括作者提到的2.2将会引入的数据压缩、新的数据结构以及自定义的过期算法</li>
</ul>
<p>前段时间，Foursquare用MongoDB时，因为Sharding方法一些疏漏把大量的数据集中到了一台机器上，导致一台EC2实例内存耗尽无法工作。Mongodb的内部机制就是mmap，我的同事做过相关的测试，当内存耗尽时，读写操作都使用磁盘，这时mongodb的性能是完全无法使用的。事后10gen的开发人员Horowitz总结出现问题的原因<a href="http://groups.google.com/group/mongodb-user/browse_thread/thread/528a94f287e9d77e">总结出现问题的原因</a>时，其中很重要的一点是</p>
<blockquote><p>Document size is less than 4k. Such documents, when moved, may be too small to free up pages and, thus, memory. </p></blockquote>
<p>看了这个原因，Redis的作者Twitter上大喜：&#8221;Real world instance of my 4k page + small objects concerns&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/10/the-4k-story/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lua script for Geany to view manpage of functions</title>
		<link>http://sunng.info/blog/2010/09/lua-script-for-geany-to-view-manpage-of-functions/</link>
		<comments>http://sunng.info/blog/2010/09/lua-script-for-geany-to-view-manpage-of-functions/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 07:37:18 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[装备]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[geany]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lua]]></category>

		<guid isPermaLink="false">http://sunng.info/blog/2010/09/lua-script-for-geany-to-view-manpage-of-functions/</guid>
		<description><![CDATA[Requirement When editing when Geany, you need some document of system library functions at hand. So you want to browse manpage at any time. Solution Just two lines: sel=geany.selection&#40;&#41; geany.launch&#40;'rxvt-unicode', '-e', 'man', sel&#41; http://gist.github.com/591279 Install Make sure you have geany-plugin-lua &#8230; <a href="http://sunng.info/blog/2010/09/lua-script-for-geany-to-view-manpage-of-functions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Requirement</h3>
<p>When editing when Geany, you need some document of system library functions at hand. So you want to browse manpage at any time.</p>
<h3>Solution</h3>
<p>Just two lines:</p>
<div class="codecolorer-container lua twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="lua codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sel<span style="color: #66cc66;">=</span>geany<span style="color: #66cc66;">.</span>selection<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
geany<span style="color: #66cc66;">.</span>launch<span style="color: #66cc66;">&#40;</span><span style="color: #ff6666;">'rxvt-unicode'</span><span style="color: #66cc66;">,</span> <span style="color: #ff6666;">'-e'</span><span style="color: #66cc66;">,</span> <span style="color: #ff6666;">'man'</span><span style="color: #66cc66;">,</span> sel<span style="color: #66cc66;">&#41;</span></div></div>
<p><a href="http://gist.github.com/591279">http://gist.github.com/591279</a></p>
<h3>Install</h3>
<p>Make sure you have geany-plugin-lua installed:<br />
<i>sudo apt-get install geany-plugin-lua</i></p>
<p>Create a lua source file named &#8216;ShowMan.lua&#8217; in <i>~/.config/geany/plugins/geanylua/</i>  . If the direcotry does not exist, you should create it first.</p>
<p>Copy two lines of lua code into this file, save and close.</p>
<p>Create a file named hotkeys.cfg in <i>~/.config/geany/plugins/geanylua/</i>, add following content:<br />
<i>ShowMan.lua</i></p>
<p>Restart geany, then open Preferences->Keybindings, Lua Script-> ShowMan, bind a key, for example, Alt+m</p>
<h3>Usage</h3>
<p>Select the function name, and press Alt+m (or from menu Tools->Lua Scripts->ShowMan), then you see the terminal and the manpage.</p>
<p><a href="http://www.flickr.com/photos/40741608@N08/5017060556/" title="geany-lua-manpage by 贝小塔, on Flickr"><img src="http://farm5.static.flickr.com/4127/5017060556_ca89e90517.jpg" width="500" height="313" alt="geany-lua-manpage" /></a></p>
<p>The post is brought to you by <a href="http://fedorahosted.org/lekhonee">lekhonee</a> v0.7</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/09/lua-script-for-geany-to-view-manpage-of-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

