Posts

AIGLX + beryl 终于跑起来了

比XGL还要顺畅 哦yeah!

A good article about DocBook

http://lwn.net/Articles/199200/

reStructuredText

rst可以让你从文本文件生成html/xml/LaTeX http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html http://docutils.sourceforge.net/docs/user/rst/quickref.html http://docutils.sourceforge.net/docs/user/rst/quickstart.html

还是screen

C-o会和vim里的命令冲突的 所以现在用\\ escape \\\\ 意思是\是命令键,相当于之前的C-a,要打反斜线\就打两个\\ 同理 escape ^Oo 意思是C-o是命令键,C-o o就相当于C-o

看来我应该放弃AIGLX的努力了

https://help.ubuntu.com/community/CompositeManager/AIGLX Information about unsupported hardware The open-source ATI driver (radeon) uses software rendering for alpha (transparency). This makes Compiz unusably slow on a Radeon 9200 (one of the fastest cards supported). No word from ATI on when their proprietary driver (which has proper 3d acceleration) will support AIGLX.

想让screen更像个桌面么?

需要有个好的screenrc screen的默认配置的最大问题是ctrl-A和bash里回到行首的快捷键冲突,导致要使用后者要多打一个a(ctrl-a a)。比较麻烦。 下面这个screenrc重定义了这个快捷键 而且加上了一个更漂亮的caption,有日期时间主机名等 现在terminal是否有tab功能对我来说已经无所谓了 哈哈 # ~/.screenrc # use visual bell vbell on # replace ctrl-A by ctrl-O escape ^Oo # set a big scrolling buffer defscrollback 5000 # Set the caption on the bottom line caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= @%H - %LD %d %LM - %c"

一个python脚本,把一个目录下所有文件转成utf8编码

chardet package is in gentoo-china-overlay layman -a gentoo-china I have already filed a chardet's bug, requesting it to be added to portage However, no response yet #! /usr/bin/python import sys,chardet,shutil,os,tempfile def convert(fname):         fp = open(fname)         text = fp.read()         encoding = chardet.detect(text)['encoding']         rate = chardet.detect(text)['confidence']         if rate > 0.9 and not encoding == 'utf-8':                 tmp,tmpname=tempfile.mkstemp()                 os.write(tmp, unicode(text,encoding).encode('utf-8'))                 shutil.move(tmpname, fname) if __name__=="__main__":         dir = sys.argv[1]         for f in os.listdir(dir):                 pathname = os.path.join(dir, f)                 convert(pathname)