2008年1月23日 星期三


Linux run levels are numbered 0 through 6. Run levels stop at six for practical and historical reasons, but it is entirely possible to have more if desired.

The following table summarizes the User Linux run levels:
* 0
System Halt* 1 Single user* 2 Full multi-user mode (Default)* 3-5 Same as 2* 6 System Reboot

Special Run Levels
Run level 0 is the system halt condition. Nearly all modern X86
computers will power off automatically when run level 0 is reached. Older X86 computers, and various different architectures will remain powered on and display a message referring to the halt condition.
Run Level 1 is known as ’single user’ mode. A more apt description would be ‘rescue’, or ‘trouble-shooting’ mode. In run level 1, no daemons (services) are started. Hopefully single user mode will allow you to fix whatever made the transition to rescue mode necessary.
(You can boot into single user mode typically by using your boot loader, lilo or grub, to add the word ’single’ to the end of the kernel command line).
Run levels 2 through 5 are full multi-user mode and are the same in a default User Linux (Debian) system. It is a common practice in other Linux distributions to use run level 3 for a text console login and run level 5 for a graphical login.
Run level 6 is used to signal system reboot. This is just like run level 0 except a reboot is issued at the end of the sequence instead of a power off.
In the interests of completeness, there is also a runlevel ‘S’ that the system uses on it’s way to another runlevel. Read the man page for the init command (”For manpage click here”) for more information, but you can safely skip this for all practical purposes.
Run Levels Location
Like everything else in a Linux system, run levels are defined by files in the
file system. All the run level files are found in the /etc directory according to the following table:
/etc/rc0.d Run level 0
/etc/rc1.d Run level 1
/etc/rc2.d Run level 2
/etc/rc3.d Run level 3
/etc/rc4.d Run level 4
/etc/rc5.d Run level 5
/etc/rc6.d Run level 6
Each defined run level should have an rcX.d directory where X is the run level number. The contents of the rcX.d directory determines what happens at that run level.
Change run levels in Debian and Ubuntu Linux
Before we change run levels it might help to find out which run level is current. Use the ‘runlevel’ command to tell you two things: The last run level, and the current run level. Here is the command and the output shown together due to the sparsity of the output:
# runlevel N 2
The ‘N’ stands for none, meaning there has been no run level change since powering up.
The init system controls run levels, but then again, the init system pretty much controls everything. The init system will be looked at in detail in a future article.
The primary command used to change run levels is ‘telinit’.
#telinit 3
telinit takes one argument on the command line. As always, see the man page for full details. Normally the argument will be one of: 0,1,2,3,4,5,6, or the letter ‘S’. As you may have guessed, the numbers correspond to the run level you wish to move to. Using the ‘S’, for single-user, is the same as the number 1, but don’t do it; the ‘S’ runlevel is intended for use by the UserLinux (Debian)system.
A note of caution is warranted here. You can easily use the telinit command to reboot (run level 6), or shutdown (run level 0) the system, but it is not recommended. Certain programs need special processing for an orderly shutdown. Bypassing the expected shutdown sequence can have dire effects on your data. Older _Unix_ systems are especially sensitive to shutdown/bootup operations.
The preferred method for a serious runlevel change is ’shutdown’. There are easier mnemonics, but in a running system they all point to the ’shutdown’ command. You can use the ‘halt’, or ‘poweroff’ command to stop a system and the ‘reboot’ command to restart your system. In each case they call the ’shutdown’ command with different parameters.
I
f you wanted runlevel 3 to be the default, then you need to edit /etc/inittab.
# The default runlevel.
id:2:initdefault:
You’d change the ‘2′ to a ‘3′. Next time you reboot, your system will start in runlevel 3. There will be no display manager running in runlevel 3, because you turned it off. Therefore, runlevel 3 will become text only, and it will be the default. If that’s what you want to do.
Adding a new service
You can only add a new service to the boot sequence if a script in /etc/init.d exists. In that case the following command will install it with default settings (foo being the name of a script in /etc/init.d).
#update-rc.d foo default
Removing a service
A service may only be removed after the script in /etc/init.d as deleted already. If so, the following command will remove its references (foo being the name of a script in /etc/init.d).
#update-rc.d foo remove
If you want to remove a service without removing the start/stop script as well, you may consider using the file-rc package and editing the runlevel configuration file /etc/runlevel.conf. When using the SysV method you should rename the start/stop script, then call update-rc.d and then rename the start/stop script back to its old name.
Some of the content for this article source from
here

Ubuntu Runlevel Setup

1. Edit the inittab
~>vi /etc/inittab

# The default runlevel X. where X is the run level you need to assign.
id:X:initdefault:

2. Use sysv-rc-conf to cheek the service running in each runlevel.
~>sudo apt-get install sys-rc-conf
~>sys-rc-conf

Vim syntax highlight

Make your linux vim editor more convinent and confortable.
~# vi /etc/vim/vimrc

and add the following in vimrc

set cindent
set smartindent
set hls
set nocompatible
set sw=3
set showmatch
set background=light
colorscheme desert
syntax on
set hlsearch
highlight Search term=reverse ctermbg=4 ctermfg=7
highlight Normal ctermbg=black ctermfg=white
highlight Comment ctermfg=blue

2007年11月27日 星期二

Portfolio

LeapFrog FLY Fusion Pentop Computer



This a a pentop computer. A pen embedded with a small sensor, which can analyize what you are write, from algebraic equtions, texts, or anything you doodles.

Personalize your mobile phone


This is a concept picture about an personalized mobile phone. It designed with a lattice grid in the surface of a mobile phone. You can insert small bits in the lattice grid.

2007年11月18日 星期日

This is not your grandmon sewing machine!!

This is not your grandmon sewing machine!!

Blowing user interface

Students in GVU center, GIT introduce a new interaction interface, blowing user interface. It can be implemented on most commodity computing platform through a single mic. Here is the paper link.

2007年11月16日 星期五

優秀


小的時候,以為優秀就是聰明,反應快,書唸的好。曾幾何時,這樣的想法在自己的生命經驗中漸漸的轉變。
台灣的教育體制,是一個很有趣的現象,從小老師們的淳淳教誨告訴我們要好好的念書,做一個對社會國家有貢獻的人,似乎不好好唸書,不會唸書的小孩將來就沒辦法對社會國家出一份心力。在這樣集體anomic的催眠下,許多小孩被期許需要有好學歷,所以現在四技變專科,五專變大學來供應這群被期待必須擁有高學歷的學生。
工藝技術在台灣不像日本的對於藝匠達人重視,會修車,善金工能捕魚的人,只把你當黑手、工匠和漁夫,社會地位遠不如日本。
台灣的教育像鑄模子,從孩子小時候就把他熔化,依社會不同的需要鑄入不同的模具中,個人的性向與特質不被重視,用考試制度將小孩分類到不同的模子中,最會考試的鑄入醫生、律師模具;不擅考試的小孩就被貼上失敗模具的標籤,直到他們出了社會,才發現自己是那麼有天份與才華,台灣教育制度使孩子不能適得其所,孩子透過考試分配他的社會地位,不是根據他們的興趣,其實本質跟科舉制度沒兩樣。
然而歐洲的教育,像是一個園丁,照顧園中各種不同的植物,讓他們曬太陽,給他們肥沃的土壤,偶爾幫他們澆澆水,除除草,這樣的花園植物必定漂亮。
台灣在教育理念上近年有很大的改善,然而我們還是太著重在"給",給予孩子許多知識,卻少教他們"想",讓他們想他們需要什麼。我想教育還是有進步的空間,請多給予掌聲!!
若是你在年紀很輕的時候就意識到這個問題,那我說你是個有智慧又幸運的人;然而,我卻是在這幾年才了解教育環境對我的影響,也看到了對週遭朋友的影響。直到現在還是有許多人根本不了解自己想要的是什麼,不想要什麼而卻繼續在自己的崗位堅持不懈。若你是這樣的人,Ok,你是一個好員工沒錯,請繼續加油!! 若你對於現在的自己的想要有些疑惑,請跳出來,思考,你會找到新方向。
現在我覺得優秀不只具有學識,更具智慧,能獨立思考並且堅持信念的人!台灣必須透過教育再培養更多優秀的小朋友!!

Make magzine!!

A magzine tells you how to make litte funny things based on physics and electronics laws.
http://makezine.com/magazine/