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)的魔方,但一直放在公司,有人試過要完成它但沒有成功,大家的感覺就是:兩階跟三階不太一樣呀。
今天突然想到要去網上看看兩階的解法,有一個網頁就簡單說了一句:基本上用跟三階類似解法,先對好底層,然後對頂層的角順序。

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

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

這讓我想起哥倫布的故事

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