Next to Richard Stallman

我这个人一般不八卦,你知道的。但是个别时候实在是情难以堪。 Bug 626593 – Gnome ate my boyfriend! Help! https://bugzilla.gnome.org/show_bug.cgi?id=626593 这位女士在GNOME bugzilla上提交bug,bug提交在empathy项目下。(注 dict empathy: 心意相通) 先不看正文,备注信息就极具幽默感: Status: RESOLVED INVALID Product: empathy Component: User Guide Version: unspecified OS: Windows Importance: Normal critical 是不是真的RESOLVED就不知道了。 事情的直接原因是上周海牙GUADEC,此男cancel了周末和这位reporter的约会。此女不堪长期忍受此男、Linux、Maemo、C等等,彻底爆发了。 He even tried to put Linux on my computer and I simply could not take it. I came home from work one [...]

Posted in: 自话 by Sunng 7 Comments ,

用markdown书写文档

写文档是头疼事,没人愿意写文档。在word里写文档,时间长了都怀疑自己是不是搞技术的。我阅历有限,在我的印象里就没有用word格式看过什么有价值的东西。只要一打开word想到的就是连篇累牍的废话、码字。word最重要的功能是什么?保存。其次呢?字数统计。我所写过的word文档绝大多数都是“只写”的,通常作为流程里的一个附件,没有人真正去看。 以上是人身攻击,接下来比较实际的问题,word文档不是符合unix哲学的东西。格式不开放,你就没有办法进行diff操作,把word文档放到svn里,只能使用最基本的版本控制,没法查看changeset,只知道改了,不知道改了什么。 为了改变这种情况,我试过用docbook格式。docbook用xml书写,定义了一套复杂的Schema,详细到作者的email都有定义。docbook还有丰富的工具集,可以通过xsl把docbook转换成所有你知道的文档格式。Maven: the Definitive Guide就是用docbook写成的。不过用docbook也存在一些问题,docbook太复杂了,用纯文本编辑器很难处理,作者的学习曲线也比较高,需要所见即所得的编辑器支持。与docbook相类似的DITA,也存在这样的问题,它们是重量级的格式。 轻量级的Wiki格式不错,但是Wiki格式很让人头疼就是没有统一的规范。举例,dokuwiki里顶级标题是6个=,而moinmoin里顶级标题恰恰相反是一个=,不portable,文档维护起来就非常麻烦。 铺垫了这么多,委屈以上格式了,该markdown出场了。markdown是简单的html原型,用来生成html,它的设计目标就是为了KISS,兼容html。看看一些必要的格式吧:(或者直接看Wikipedia) 标题 # 标题 ## 二级标题 … ###### 六级标题 对于一级标题还可以这么写 headline ======== 二级标题可以 headline ——– 这个怎么输入呢,我想起来前几天看vim hacks里的一组快捷键 yypoVr= yypoVr- 谁用谁知道 段落: 一段文本以两个换行结束。 换行: 一行文本行末两个空格。 图片 ![alternative text](image-url “image-title”) 用markdown,图片的alt你不写都不行。 链接 [Linktext](link “linktitle”) 列表 ul 无序列表 * * ol 有序列表 1. 2. 以上就是主要的格式支持。用标题来划分文档层次,没有多余的格式,没有机会让你五颜六色。 在linux上可以安装markdown的处理脚本: apt-get install markdown 安装vim的语法文件: http://www.vim.org/scripts/script.php?script_id=1242 [...]

Posted in: 装备 by Sunng 3 Comments ,

exaile豆瓣电台插件(exaile-doubanfm-plugin)

豆瓣电台一直是flash客户端,嵌入浏览器,出于对flash的厌恶,本人开发了这个exaile插件,让广大linux同学在exaile里享受豆瓣电台一目了然桌面集成和全部豆瓣电台功能。 exaile-doubanfm-plugin features: 登录豆瓣,获取豆瓣电台播放列表 持续下载电台播放列表,实现不重复的持续播放 标记/取消“喜爱”、标记“回收站”、跳过 显示歌曲信息 项目地址: http://github.com/sunng87/exaile-doubanfm-plugin 下载页: http://github.com/sunng87/exaile-doubanfm-plugin/downloads 使用: 激活插件,填写用户名密码 重启exaile 文件菜单,open douban.fm,选择频道 点击播放开始 将rating设置为5 标记喜欢 rating设置2 豆瓣标准跳过 rating设置1 豆瓣删除 The post is brought to you by lekhonee v0.7

Exaile-Douban-Covers 0.0.3 Released

一眨眼有大半年没有维护这个插件了,Exaile从0.3.0升级到了0.3.2。严重的是这三个版本的插件接口各不相同,0.3.1新增了cover providers管理, 修改了track获得相应字段的api,简化了CoverSearchMethod的职责(去掉了缓存管理,只负责find_convers和get_conver_data两个功能)。而0.3.2至少也修改了配置管理界面的API,所以可以在0.3.1上工作的版本也不能在0.3.2上工作。 这次升级维护把插件升级到0.0.3,兼容目前Ubuntu仓库里的Exaile 0.3.1.1。0.3.1.1新提供了一个cover provider的配置界面,可以调整cover provider的优先级,如果你听中文歌比较多,建议可以把douban cover放在第一位。 下载页面(doubancovers-0.0.3.exz ): http://bitbucket.org/sunng/exailedoubancovers/downloads 新版本和0.3.0已经无法兼容,0.3.0的用户可以继续使用0.0.2 。而兼容0.3.2的版本预计要等到10月份之后推出了,用Archlinux和其他自己安装的用户要稍等一阵了。 The post is brought to you by lekhonee v0.7

Posted in: 广告 by Sunng No Comments , ,

Python获取本机IP

除了用inetface库和分析ifconfig输出以外,一个比较简单的获取本机IP的方法: import socket def get_local_ip():     s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)     s.connect(("sdo.com",80))     return s.getsockname()[0] 参考 http://stackoverflow.com/questions/166506/finding-local-ip-addresses-in-python

Posted in: 把戏 by Sunng No Comments ,

Reset default cursor theme and web browser after installing kubuntu

If you installed kubuntu parallel to ubuntu, you might find that the default browser is set to konqueror and cursor theme is oxygen which cannot modified by “gnome-default-applications-properties” and “gnome-appearance-properties”. To fix this, use Debian update-alternatives tool: update-alternatives –config x-www-browser update-alternatives –config x-cursor-theme All configurable options are listed at /var/lib/dkpg/alternatives

Posted in: 把戏 by Sunng No Comments ,

Get your conky location aware

Add this in your conkyrc ${exec curl -s "http://api.hostip.info" | xpath -e "//gml:featureMember/Hostip/gml:name/text()" -q} ${exec curl -s "http://api.hostip.info" | xpath -e "//gml:featureMember/Hostip//gml:coordinates/text()" -q} Hostip is well known as a service provider of the geoclue framework. It translates IP address to geolocation information. The API we use will return a GML document like <?xml version="1.0" encoding="ISO-8859-1" [...]

Posted in: 装备 by Sunng No Comments , , ,

Using weather

Ubuntu仓库里有个weather-util包,可以用来查看天气信息。weather工具从weather.noaa.gov网站获得天气信息,对美国的城市可以直接用名字查询,其他国家只能使用id查询。id的规则和weather.com不太相同。 中国的天气站点id可以在这个页面上查到。比如南京ZSNJ,上海浦东ZSPD。使用weather工具查询: weather -i ZSNJ Current conditions at China (ZSNJ) 32-00N 118-48E 12M (ZSNJ) Last updated Feb 18, 2010 – 08:00 AM EST / 2010.02.18 1300 UTC Temperature: 35 F (2 C) Relative Humidity: 59% Wind: from the SSW (210 degrees) at 4 MPH (4 KT) 简化操作,可以在$HOME下创建.weatherrc文件,形如 [default] ID = ZSPD [nj] ID = ZSNJ [...]

Posted in: 装备 by Sunng No Comments , ,

老物什 / Old Stuff

大年初一翻旧物,找到一些让人颇有感触的旧物件。2004年买的RH9,2005年夏天买的Fedora 4。前者至今还安装在我家最旧的电脑里,虽然我都忘了它的样子了。 包装 手册 CDs 这个代理商里仁软件似乎已经倒闭了。

Posted in: 留影 by Sunng 2 Comments ,

Virtual Machine Searcher for Gnome Deskbar Applet

Very glad to announce another daily-coding work: an extension for gnome deskbar applet to search and launch virtual machine. There is a plugin for gnome-do that does the same job. That’s what I create the the plugin for. I switched to deskbar because gnome-do’s Do.exe reminds me nightmares when I was a M$ Windows user. [...]

Posted in: 广告 by Sunng 3 Comments , , ,