Monday, February 1, 2010

網癮戰爭

引自維基百科:
《網癮戰爭》是中國大陸個人組織製作的網路視訊,整部作品以網路遊戲《魔獸世界》為藍本,由玩家遊戲中人物「出演」,視訊畫面《魔獸世界》里的遊戲場景截取編輯而成。電影主要反映出玩家對於遊戲審批和主流媒體不公正報導的不滿,並調侃電擊治網癮的楊永信。

這裏是Youtube上的版本

看完後,我有很沉重的感覺,上次有這個感覺應該是看six four片段時吧……

雖然主題是惡攪,我也沒有玩過魔獸世界,我一直到很後來才聽說到有關它在中國的風風雨雨,不過這套片所描寫的卻是2009年在社會中發生的種種不平事。片中人物的吶喊,就是他們對這個政府不平的制度下的吶喊。雖然沒有流血,沒有死人,但是這件事和六四是相似的地方是:高官們的權力爭鬥,被害的是小市民,所有的反對聲音被打壓,大家只能在被和諧的環境下默默地生活著。

我建議香港人,都看一看這部電影。雖然可能很多地方不明白(網上有解說),但聽聽內地網民的呼聲。

還有,那些在香港抗議這個抗議那個的人,來大陸吧,這裏才是問題的核心,別浪響時間在香港那個傀儡政府上。孫中山當年也是人在香港,志在中國。各位年青的香港人,放眼中國吧,這可能就是香港的“歴史使命”。

說多了。

Wednesday, October 14, 2009

Convert ogg to mp4

Recently I bought a new G-phone (HTC Hero) which is the actually the first smart phone for me (finally...) I can download a lot of interesting program from Android Market to it.
And one thing I want to do is downloading some training video to the phone so that I can see it in the subway. But it seems that there are no OGG-ready video player in Android Market yet (may be I should write one?). So I have to convert ogg video to mp4.
I search for such application on web but I find the most simple way is using command line:
# ffmpeg -s vga -i video.ogg video.mp4
And the converted video can play on my G-phone seamlessly.
ffmpeg is a famous video libraries for Linux which is available in RPM format in DAG repo.

Friday, July 17, 2009

Google reader public page

I like to use google reader to read blog post and I would share some articles I like. If you are interested, you can have a look:

http://www.google.com/reader/shared/00610968397564927697

Monday, June 8, 2009

ksar: a sar grapher: usage

If you are the first time user of kSar, you can unzip it and start it in Linux by

# unzip kSar-5.0.6.zip
# cd kSar-5.0.6
# sh run.sh

It should able to start the GUI if the java is in your path. If it is not, you can set $JAVA_HOME first. E.g.:

# export JAVA_HOME=/usr/java/jdk1.5.0_08
# sh run.sh

And then you can try everything in the GUI.

But if you are a heavy user of kSar like me, you should learn this:

# sh run.sh -input /var/log/sa/sar13

And there are many others useful command line argument. You should have a look to them by:

# sh run.sh -help

Tuesday, June 2, 2009

ksar: a sar grapher

I use kSar for more then a year in my daily Linux support life. It is really useful (and saved my life for several times). But I haven't see much articles on web that talk about it. So I would like to write a simple introduction by myself.


kSar is a Java-based standalone application, which can read and graph the "sar" file generated by sar from Solaris, Linux, AIX and HP-UX system. Here are some advantage of kSar:

1. Multiple Platform
Because it is Java-based, it can run on many platforms (include Windows, but I have not tested). It is useful for me because I can study the sar files from whatever OS/platfrom on the platform I am using.

2. Dynamic graph + PDF export
It makes use of jfreechart library such that we can zoom-in the graph, while it can also output the graph in pdf, jpg, png and even csv format. It is useful for me to generate reports to customers. Moreover, you can add background (e.g. company logo) in the output graph.

3. Some useful extensions
It is open-source. And I have added several patch to add some common extended statistics on Linux system like "memused with buffer adjusted", stacked memory graph and system restarted marker (add in ksar-5.0.7).

4. Real time statistics
Other then reading existing sar file, it can get the output from command line or ssh command to display real time statistics.

5. Compare two graph
It can load two sar files and view it together for easy comparison, also you can compare two graph in the sar file.


I will talk about the usage of kSar soon.

Thursday, February 19, 2009

“天才”的洞察力

之前有一段時間迷上了魔方(港譯:扭計骰),網上有不少有video的教程,成功完成後很有滿足感。(我現在的最快時間是1分20秒,基本上兩分鐘內可以完成。)在公司更引起年青的同事們一股玩魔方的熱潮。
後來有一個同事順便買了一個兩階(2x2x2)的魔方,但一直放在公司,有人試過要完成它但沒有成功,大家的感覺就是:兩階跟三階不太一樣呀。
今天突然想到要去網上看看兩階的解法,有一個網頁就簡單說了一句:基本上用跟三階類似解法,先對好底層,然後對頂層的角順序。

天!為什麼我沒想到呢?我就把三階魔方用的幾個方法,用在兩階魔方上,很快就完成了。

當我跟別人說這個的時候,他們的反應是:“二階魔方用跟三階類似解法很合理呀。”是的,但是為什麼我就想不到呢?

這讓我想起哥倫布的故事

有時候我會覺得人們眼中的天才,就是常常能洞察到別人還沒有看到,但說出來又很簡單的東西。

Thursday, December 18, 2008

Restart Marker for kSar

I would like to propose a new feature to kSar. I called it "Restart Marker".

Actually the system reboot information is recorded by sar. It would be convenient to show it on kSar and the graph would be much clearer if the graph line is broken when the system restart. The left-end of the gap is the last record before the system restart. And the right-end of the gap is the first record after the system restart. And the time of the marker is the exact time that the system restart.


I have already completed the patch for Linux sar file. As I know, the sar file in other OS should have similar record too but I don't have them in hand. Would anyone please provide me such sar file with system restart record so that I can add this feature for other OS?

You can download the testing ksar here.
The patch for ksar-5.0.6 is here.