About This Blog

This is Chunhao's Blog

I'm writing something about life and technology here. As a practice of English writing.

My Chinese Blog: http://blog.chunhao.net

My Chinese Page: http://chunhao.net/index-cn.html

Subscribe

The books I’m reading

The items I’m interested in

License

23 July 2009 - 14:30Partial Eclipse

Thanks Newton for his discovery of the law of the universe, and so can we predict the occurrence of eclipses so accurately.

On July 22, the solar eclipse occurred in the Yangtze River Basin in China. However, in my hometown, there was only partial eclipse. Following are some photos taken by me, with the assistant of a telescope.

before most eclipse

before most eclipse

Read more…

No Comments | Tags: other

12 June 2009 - 20:14Are Your Fingers Long Enough to Use Vim?

Note: I wrote this post just for fun. Please don’t take it seriously. Thank you! :)

Which editor are you using, Vim or Emacs? And why?

Next time, when you are arguing with other people about which editor is better and trying to persuade others to use your favorite editor, just forget it. If you believe everything is in destiny, it is not an exception for the editor you choose. The choice is written on your fingers.

Several days ago, I learnt from Mike that the choice between using Vim or Emacs depends on your fingers. As he figured out, people have longer fingers prefer to use Vim, while people have shorter fingers prefer to use Emacs. It is amazing, but reasonable.

Read more…

11 Comments | Tags: Software, linux, vim

4 June 2009 - 0:59Which email client are you using?

What can you do for killing time? Maybe you could figure out what email clients your contacts are using. It’s funny.

Most people prefer webmail, especially Gmail. Webmail is very easy to use and does not require much configuration. Gmail is the most wonderful webmail. It groups messages by threads and it has a powerful searching tool. You can easily find out what you want from the mass.

However, one drawback of webmail is that you cannot access your mail off-line. Although Gmail started to support off-line email recently, I still think that keeping the emails in my local storage is safe and reliable. Moreover, an email client is generally much more customizable than webmail. So, I am using Evolution, which is the most powerful and standard email client in Linux, to receive and send email everyday.

Read more…

1 Comment | Tags: Software, linux

21 May 2009 - 19:39Tools for Reading Sources

Hacking is a good method of learning. And the pre-stage of hacking is reading the source code. You might have this experience: facing a large amount of source code (generally dozens of files), you don’t know how to start, or you even don’t know how to read them. A good tool is very helpful for reading code. It can facilitate your understanding of the code and help you find out the things you want as soon as possible. I will introduce you some wonderful tools of browsing sources.

For me, the must-have feathers of a source browsing tool should be:

  1. Syntax highlighting
  2. Friendly user interface
  3. Identifier and function search

Read more…

No Comments | Tags: Software, linux, programming

26 April 2009 - 23:21Burning Video DVD on Ubuntu

Burning video DVD is harder than you think. It involves transcoding, subtitles, burning and other complicated things. Each step may not work for you, let alone on Ubuntu!

I just created my first video DVD. My experience may help you get less trouble on burning your video DVD on Ubuntu/Linux.

Most DVD videos are encoded in MPEG-2 format. So, if your original video is not encoded into MPEG-2, the first thing you need to do is to transcode it into MPEG-2. There are lots of powerful tools to handle it, such as ffmpeg and mencoder. They are command-line tools. If you are a crazy fan of command line, you definitely should try them. However, the command line arguments will generally be 10 lines! If you cannot handle them(like me), just try some GUI tools.

The first option is Avidemux. It’s powerful and easy to use. However, its H264 support is poor. When I tried to transcode a H264 video into MPEG-2, it crashed every time. Maybe it works fine with other format, but I have no chances to take a try.

Read more…

No Comments | Tags: linux

18 April 2009 - 20:11My Chinese Blog

A new blog has been set up. I will post my Chinese articles there.

Here, only English contents will appear from now on. All the old articles in both languages here will be reserved. I will use this blog to post some technique articles related to Linux, programming in English. It should be a good way to practice my English writing.

My Chinese blog: http://blog.chunhao.net

No Comments | Tags: other

24 February 2009 - 0:12How to write an auto-downloading script

如何写一个自动下载的脚本?

用Linux有一个很好的地方就是你可以很方便地让计算机为你做体力活。当然,前提是你要了解Linux的思维方式。下面就是一个活生生的例子,大家可以看看用Linux是怎么做事情的。

如果你喜欢听评书,这里是个不错的地方。这个网站有很多评书,还有百家讲坛,甚至有声的金庸小说。上面的东西不光可以在线听,而且都可以免费下载,不用注册。但是,只能一个链接一个链接地下载。例如,如果想下载《大唐惊雷》第1回,就要进入一个页面,然后点下载;要下载第2回,就要进入另一个页面,然后再点下载。这样,就无法批量下载一整部评书了。

如果你用Windows,那么你要么人肉点击这些链接,一个一个地下载(可能有100+回);要么就用C或者Java写一个程序自动下载,前提是你要懂网络编程的细节。

下面,我就说一说在Linux下如何用Shell写一个自动下载脚本:

Read more…

3 Comments | Tags: linux, programming

22 February 2009 - 23:02Unify the themes

My site is based on various applications. The blog is based on Wordpress, the wiki is based on Dokuwiki, the photo gallery the Simpleviewer. Other pages are written by hand.

Originally, each part had its own theme. It’s hard to acces other parts directly from one part. For example, there are no links from my blog or wiki to my homepage. I decided to change this. Eventually, the goal is achieved.

The theme of my blog is blue-pix. I like it for its briefness. The first thing I did is to port this theme on my home page. This work is pretty simple. I only changed the tags of the CSS file. Then, I modified the blog’s theme, added a link to homepage. The themes of homepage and blog was unified.

Next thing is my wiki. I have no idea about how to create template on dokuwiki at the beginning. When I refered to this link, I started my work. I did a lot of change on CSS and PHP files. Finally, my own template of dokuwiki was created. Now the themes of the whole site is unified, except for the photo gallery.

For the blog’s theme, blue-pix, I also did lots of modification. The originally version did not support widget, and it did not support Google Analytics and other things. It also did not support thread comments. Now, it works fine. If you are interested in this theme, just feel free to contact me.

I am not an expert on PHP, CSS, and HTML. However, I like hacking. All the problems are solved with the help of Google. I believe one sentence–don’t learn to hack, just hack to learn.

———–

Supplement:

Just now, I finished the modification of my photo gallery. Now, everything in my site are following the same theme!

1 Comment | Tags: other, programming

13 February 2009 - 14:08How to synchronize with SSH

I will share my experience in synchronizing files with SSH here. Following are demonstrated by synchronizing Dokuwiki. Of course, you can synchronize everything as you like.

The wiki I used in my homepage is Dokuwiki. The most great feature is that it does not require database connection. It’s very convenience for personal usage.

I have two Dokuwiki maintained. One is located in localhost, another in the webserver. I always edit the pages on localhost, and synchronize them to the webserver at times. Since Dokuwiki is totally PHP based, without database such as MySQL, I only need to synchronize some files.

All the changes on wiki are reflected on the folder “data” in your Dokuwiki path. So every time, I only need to synchronize this folder.

The best way to communicate with webserver is SSH. Fortunately, my webserver Godaddy support SSH access. Another thing need to concern is synchronizer. Here I use Unison. The best description of Unison comes from it’s the author of this software:

Read more…

No Comments | Tags: Software, linux

9 February 2009 - 22:57Site moved here

I have successfully backordered this new domain name “chunhao.net“, which is better to stand for me than my old domain name “chunhao86.cn”.

I am using 000webhost for the old site, which is really a good free host provider. However, due to my misoperation,  the new domain cannot be located in the free web host any more. I switched to another non-free host provider–GoDaddy.

Now, most part of the site have been transferred to the new domain here. All the posts and comments in my blog have also been moved properly. The old domain(chunhao86.cn) will keep alive for a long time. However, no upgrading will be presented there any more.

Most things are the same with old ones, except for some some changes. There most significant is  Wordpress. This new blog is built using Wordpress 2.7, while the old one Wordpress 2.3. There are lots of changes between the two versions, escpecially in the admin page. The new version is more user-friendly and integrated with much new feathers. Thanks for the small quantity of the posts and comments in my old sites, it’s very easy to move them correctly!

So sorry for you inconvenience! And thank you for touching my new site here. Please keep trace of my new site: http://chunhao.net, as well as my blog: http://chunhao.net/blog.

No Comments | Tags: other

Page 1 of 3123»