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

22 June 2008 - 0:54Slax Linux, with Chinese

A few days ago, I decided to installed linux on my 1GB USB Drive. In order for the ability to do some recovering when my system crashes(hope not) and for fun.

After considering several distro, I chose slax linux. I think I’ve been influenced a lot by my friend Jiawei who had used slax linux when his hard drive was down.

After installing slax linux on my USB drive correctly following the official manual, I found it didn’t support Chinese at all. When I googled that, I found fanx, a localized slax. Since I am the people who like solving problems in a more challenge way, I didn’t choose that.

For the first thing, I downloaded the modules for i18n of Chinese packages from here. The only packages I needed are the files start with 001, 002, 003, 004, 010 and 011. Put them on /slax/modules on my USB drive.

After started it(don’t choose the “fresh mode” or “copy to ram” mode), modify /etc/profile.d/lang.sh. Added the following lines:

export LC_ALL=zh_CN.UTF-8

export LANG=zh_CN.UTF-8

And commented all other lines by add ‘#’ at the first of the line. So simple!

You may also want to use your favourite fonts. Then, copy the ‘.ttf’ fonts to the folder /usr/share/fonts/TTF

Every thing is OK now. After short configurations, it can display Chinese characters as well as with Chinese input method available. Let’s enjoying the beautiful, lightweight and portable linux.

Before writing 70-647 and 640-816, make sure that basics like 70-271 and 70-293 are cleared well in advance for PMI-001 and eventually 350-018.

5 Comments | Tags: OS, linux

20 March 2008 - 15:00Interesting Unix Time

If you set the preference of you system time, you will find a clock type called “UNIX time“.

screenshot16.png

If “UNIX time” is selected, what will happen?

screenshot17.png

Cool! This is the time here. Isn’t it interesting? Well, it may be confusing as hell, and you may ask what’s the time it is. Let’s investigate what’s Unix Time.

Unix time is displayed in seconds elapsed since January 1, 1970. It is stored in a 32-bits integer, time_t. So, it looks like this.

But there is a small issue there, say, as long as the largest integer a 31-bits(1 bit for sign bit) number can represent is 2^31 that is 2147483648. So large? What time it is? It is exactly 03:14:07am(GMT), January, 19th, 2038. This is the famous 2038 problem. After this time, the variable will turn into 10000000000000000000000000000000, which is -2147483648 in decimal. Is that tricky? What’s the time then? May be 8:45:52pm, December, 13rd, 1901. Wow, it’s really a big problem, almost all the computer will be crashed at that time. Is that true? Of course, but I don’t think that will be a critical problem, because after 30 years, almost all the computer will be upgraded in to 64-bits or even 128-bits(256-bits?). The problem will be easily fixed then. So, just think it as a tricky, rather a problem.

At last, I want to say, enjoy your Unix time! You know, developers are the primary users of it.

Not all 650-393 students are qualified for 642-446 or 642-503. They need to write 156-215 as well as 642-436 in order to prepare for 70-284.

1 Comment | Tags: OS, linux