Wednesday, August 26, 2009

[drm:i915_get_vblank_counter] *ERROR* trying to get vblank count for disabled pipe 0

This is about how to solve a frame buffer problem I encountered after
upgrading to the 2.6.28-15-generic kernel. Last week I enabled the frame buffer
in my grub menu.lst to use the very fast fbterm(a Chinese console
environment, better than zhcon), with the following options:

vga=791 video=vesafb:ywrap,mtrr:3

At that time, everything worked well, and I really enjoyed the many
features of fbterm: display ttf font, Chinese and any other double width
characters, as well as the scrollback history.

However, after I upgraded to the latest kernel 2.6.28.15-generic in
through Ubuntu's apt, I found the console couldn't work any
longer. After the GRUB menu, everything disappeared and nothing showed
until the very late stage, when X desktop stared. If I get out to
the console with Ctrl+Alt+F1, it is still blank, and I found the
following message in dmesg every time I tried to invoke the console:

[drm:i915_get_vblank_counter] *ERROR* trying to get vblank count for
disabled pipe 0

A quick google gave no answer to my question, and a test of booting with
the previous 2.6.28-14 kernel didn't help either. So it's not a problem
with the upgrade, and there must be something wrong with my
configuration, but I am sure I didn't change any of the system files.

...

The resolution of this problem finally came when I was checking the vga
opinions, and thought of the vesafb module. Was it loaded?

lsmod | grep fb

told me the answer, and after I load vesafb with the command:

modprobe vesafb

MY CONSOLE IS BACK!

I think the kernel should load it automatically as the options given is
clear, but it didn't. No matter how, I add the it in /etc/modules, and
hope it will solve this problem.

--------------------
UPDATE:

Found the source of the problem, in

/etc/modprobe.d/blacklist-framebuffer.conf

to solve the problem, just comment out the line of vesafb.

--------------------
UPDATE2:

It's not the blacklist, change it won't help. it's the mtrr option,
it should be:

vga=791 video=vesafb:ywrap,mtrr:1

Sunday, August 9, 2009

iptables forward local port 80 to 8080

This is about how to forward local port 80 to 8080, or any other port,
which is useful when you are runing some test server with no root
privilege, while the client can still connect to the standard www port.

iptables -t nat -A OUTPUT -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-port 8080

Friday, August 7, 2009

cmd create a .lnk(shortcut)

We don't use any extra command tool that you have to download somewhere
else and worry about its security, but the winxp built-in cscript(or
wscript, if you prefer) to excute a little Jscript creat-a-lnk.js(source
followed), and create your shortcut on the desktop(or anywhere you want
to), quick and safe!

--------------------create-a-lnk.js--------------------
Shell = new ActiveXObject("WScript.Shell");
DesktopPath = Shell.SpecialFolders("Desktop");
link = Shell.CreateShortcut(DesktopPath + "\\shortcut-name.lnk");
// If you want:
// link = Shell.CreateShortcut("D:\\path\\to\\your\\shortcut-name.lnk");
link.Description = "a lnk created from cmd";
link.HotKey = "CTRL+ALT+SHIFT+l";
//link.IconLocation = ".exe,1";
link.TargetPath = Shell.CurrentDirectory + "\\lnk-to-this.txt";
// If you want:
// link.TargetPath = "E:\\path\\to\\your\\target.exe";
link.WindowStyle = 3;
link.Save();
--------------------create-a-lnk.js--------------------

Personally, I feel this is much better than running some unkown
XcreateLnk.exe as you can see the source, learn the process, and
guarante the security of your system.

linux zip/unzip err encoding 压缩解压中文文件 乱码

在linux下压缩和解压(zip,unzip)时,如果文件名中含有中文,就会由于文件名编码
(encoding)不同而出现平台(GNU/linux与win)之间制作的压缩包不能互相兼容的问
题,就是所谓的乱码.这里说一种最简单的解觉方法(2009)

首先,出现这种情况时不需要紧张,因为这只是文件名称的混乱,文件本身的内容还是正常
的.

然后,来看解觉的方法^_^:
前提:您身处2005以后的时代~
安装了zip,unzip ->以ubuntu为例 (~$ sudo apt-get install zip unzip)

1.制作可以在win下打开的zip压缩包
# sorry.暂缺

2.解压在win下制作的zip压缩包
~$ unzip -O cp936 /path/to/file.zip

-O 参数指定原压缩包的编码方式.
简体中文(GBK/GB2312) 为 cp936
繁体中文(BIG5) 为 cp950

结束语.
遇到问题,先尝试 -h --help,然后man,再然后才轮到Google.

小记:因为要从压缩包里取一个文件名含中文的文件夹出来,记得以前在linux下做的
压缩包在win下会打不开,反过来win下压缩的也会解压成乱码,就试验了一下.果然,
跟以前一样还是行不通的,并没有因为时间过渡到了2009,版本升到了9.04就有所改
变.乱码依旧,直接google,结果除了台湾一个贴子看起来比较有趣外,英文的搜索没
有结果,中文搜索 linux 压缩 解压 乱码得到的全部都是关于rar,7z代替的方案,
再不然就是一篇转了无数次的更改zip源代码的沉旧文章.可是我原先的zip都做好
了,并切也(还)没有养成动辙就源代码编译的好习惯(尤其是在ubuntu下),所以就准
备reboot回我们的D版winxp...

就在^D退出Terminal的这当口,想到了-h, --help.

于是就有了本篇的故事.为什么ubuntu里面带的zip不是Info-ZIP的呢?那样也许就
可以在制做压缩包的时候也指定编码格式了.

# 台湾的站
http://mrtg2.tnc.edu.tw/xoops/html/modules/weblog/details.php?blog_id=181

Sunday, August 2, 2009

google code svnsync Error setting property

When I tried to sync a local repository to google code project host, I
got the Error setting property.
yang@acer:~$ svnsync init https://yangs.googlecode.com/svn file:///home/yang/code.google/
yang@acer:~$ svnsync sync https://yangs.googlecode.com/svn
.......
Committed revision 7.
Copied properties for revision 7.
Transmitting file data ................
Committed revision 8.
svnsync: Error setting property 'log'
svnsync: At least one property change failed;
repository is unchanged
svn: Error setting property 'log'
Could not execute PROPPATCH
After somewhat hours of googling, I didn't find any direct solution for
my problem, although it did help me get an general understanding of
several keyword in the err log:
PROPPATCH is an http method used in WebDav, just like GET, POST, and
PUT.
property is some technology SVN used to store additonal
information about the files in a repository.
Okay, let's go back to my problem, and its solution. In fact, it's easy,
and all included in the svn help. I didn't realize this until I went
back to the svnbook after long time unsuccessful attempts to google the
solution.
The Err message tells you that something wrong happened while setting a
property 'log'. Exactly speaking, it's the 'log' property of revision 8,
as the err happened right after revision 7's commit job was done. So, to
solve the problem, you need to check and repair the 'log' property of
r8, with the folling command:
svn propedit --revprop svn:log file:///home/yang/code.google/ -r8
In my case, it's some unknown blank new lines at the end of the 'log'
property. After remove them, and the command svnsync went through
without any problem.
Hope this will help those who encounter the same/similar questions, and
the lesson I learned from this experience, again: read the manual~

Monday, May 4, 2009

入党志愿书 2009

我志愿加入中国共产党,拥护党的纲领,遵守党的章程,履行党员义务,执行党的决定,严守党的纪律,保守党的秘密,对党忠诚,积极工作,为共产主义奋斗终身,随时准备为党和人民牺牲一切,永不叛党。

中国共产党是中国工人阶级的先锋队,同时是中国人民和中华民族的先锋队,是中国特色社会主义事业的领导核心,代表中国先进生产力的发展要求,代表中国先进文化的前进方向,代表中国最广大人民的根本利益。党的最高理想和最终目标是实现共产主义。我愿为共产主义事业奋斗终身。

自1921年建党至今,我们的党已经走过了80多年的道路。这几十年,中国共产党从小到大、从弱到强、从幼稚到成熟,不断发展壮大。从建党之初的50多名党员,逐步发展到今天拥有七千多万党员的执政党。并在长期的革命和建设过程中,先后形成了分别以毛泽东、邓小平、江泽民为核心的三代党中央领导集体。

新的历史时期,树立和落实科学发展观及构建社会主义和谐社会,是以胡锦涛同志为总书记的党中央提出的重大战略思想。科学发展观揭示了中国发展的本质和核心在于坚持以人为本。以人为本,就是以实现人的全面发展为目标,从人民群众的根本利益出发谋发展、促发展,不断满足人民群众日益增长的物质文化需要,切实保障人民群众的经济、政治和文化权益,让发展的成果惠及全体人民,这直接构成了构建社会主义和谐社会的根本目的。构建社会主义和谐社会必须以人为出发点,着眼于人的问题。努力为构建社会主义和谐社会服务,更是我们每一个共产党员的责任和义务,我们要满腔热忱的投入到建设中国特色社会主义事业中去。

中国革命的实践雄辩证明了没有中国共产党的领导就没有新中国,没有中国共产党的领导,中国人民就不可能摆脱受奴役的命运成为国家的主人。党是中国特色社会主义事业的领导核心,我以自己能够加入这样伟大的党而感到光荣和自豪。是党把我从一个不懂事的孩子培养成为一名具有大学文化程度的青年。多年来,在党组织的教育与培养下,通过自己的刻苦学习与工作锻炼,我牢固地树立起坚定的马克思主义政治信仰和共产主义理想信念。加入中国共产党,为共产主义理想、为建设中国特色社会主义、为党和人民的根本利益而奉献自己的青春、热血与汗水,这是我的毕生信念与追求。

现在,如果能接纳我为中国共产党党员,我一定要认真地用共产党员标准来严格要求自己,全心全意地为人民服务,不谋求任何个人私利.百折不挠地执行党的决定,维护党的团结和统一,严守党的纪律,保守党的机密,对党忠诚老实,言行一致,密切联系群众,在工作、学习和社会生活中起先锋模范作用,随时为捍卫党和人民的利益英勇斗争,为全面建设小康社会的宏伟目标不懈奋斗。

如果暂时不能吸收我入党,那说明我距离党的要求还有一定的差距,我将无情地解剖自己,认真改造世界观、人生观和价值观,不断克服自身存在的缺点,争取早日成为一名光荣的中国共产党党员。

我志愿加入中国共产党,为共产主义事业奋斗终身!

X X X

2009年X月X日

Friday, May 1, 2009

澄海3C-CREG-无限版 下载地址及开启方法

澄海3C-CREG-无限版,非作弊版本。下载地址:
点击这里下载
无限技能,需要5V5(可以加电脑),选择死亡模式,即自动开启。