Sunday, May 31, 2009

Eason Chen Moving on stage 21 part II

昨晚陪老婆去台北小巨蛋聽陳奕迅Moving on stage 21 part II的演唱會,老實說我並非Eason的歌迷,對他的歌比較熟悉的是只有K歌之王,你的背包,婚禮的祝福(這張專輯我有買)。
整體聽下來我可以了解為何老婆這麼喜歡Eason了,他真的很有實力,歌曲確實能打動人心, 感覺上他真的唱得很賣力,連唱了四個小時吧!有幸能參加這種實力派歌手的演唱會真是我們的幸福,可惜我只聽到11:00多就先行離場回家去哄小朋友睡覺了,不然真的很想跟Eason待到最後。

Anyway Eason期待你下一次再來台北開唱!婚禮的祝福真是太好聽了!

Wednesday, May 20, 2009

Moving SUSE Linux to another system

工作用的一台PC可能太過老舊,常常跑到一半就system freeze,懷疑是熱當,然而剛好有一台idle的機器,想說就將hard drive換到那台機器就好了,本以為應該會很順利,沒想到系統重開時SUSE回報:
waiting for device /dev/hda2 to appear
waiting for device /dev/hda4 to appear
然後整個系統就停止了.... 事情似乎沒有我想像得單純..... :p
進入rescue mode查看hard drive也沒損壞呀? 只好上google查看看吧~

後來查到原來是當更換到另一台機器時,由於主機板上的controller是不一樣的! SUSE需要重新make initrd, Redhat不用! 呵呵.... 整個救援的方法如下:

hard drive partition information:
/dev/hda1 -> /boot
/dev/hda2 -> swap
/dev/hda3 -> /home
/dev/hda4 -> /

1. 利用SUSE安裝光碟進入rescue mode
2. 將root partition掛載: mount /dev/hda4 /mnt
3. 將rescue mode的/dev與/proc分別掛載到 /mnt/dev與/mnt/proc: mount --bind /dev /mnt/dev; mount --bind /proc /mnt/proc
4. 將目前的rescue mode的single-root轉成實際上的root partition: chroot /mnt
5. 將/boot掛載: mount /dev/hda1 /boot
6. 切換到/boot目錄,並執行mkinitrd: cd /boot; mkinitrd

Accomplished!

Monday, May 18, 2009

快速取得路由路徑資訊

在Linux下,要確定或查看到某一個destination的方法,比較傳統的方法是執行route -n 或是netstat -rn取得routing table後,再以肉眼判斷讀出,不過我看過有些人管控的機器其routing table內容非常之可怕! 眼睛可能會看到"脫窗", 所幸我今天發現到了一個新的指令可以幫助苦命的IT/MIS.

# ip route get x.x.x.x
-> 系統就會回報到x.x.x.x會經由哪個gateway出去, e.g.,
ip route get 168.95.1.1
168.95.1.1 via 192.168.1.254 dev br0 src 192.168.1.100
cache mtu 1500 advmss 1460 hoplimit 64
解讀: 從src 192.168.1.100到dst 168.95.1.1是透過192.168.1.254出去

Tuesday, May 12, 2009

[Shell script] 讓/etc/passwd更利於閱讀

#!/bin/bash
IFS=:
echo "System User list:"
echo "-------------------------------------"
while read username shapass uid gid comm home shell
do
echo "UserName:$username"
echo " 1.password:$shapass"
echo " 2.uid:$uid"
echo " 3.gid:$gid"
echo " 4.comment:$comm"
echo " 5.home:$home"
echo " 6.default shell:$shell"
echo "------------------------------------"
done < /etc/passwd

參考Linux-101 Hacks, hack 88. Read data file fields inside a shell script

Monday, May 11, 2009

Get Ready for openSUSE Community Week!

The first openSUSE Community Week is just around the corner. May 11 through May 17 we’ll be hosting live sessions in IRC to help grow the openSUSE Community.
Community week is all about helping new contributors get started with openSUSE and getting existing contributors together to mentor new contributors, and working together on major projects.
We’ll be hosting a week of IRC tutorials, Q&A’s, and jam sessions on a number of topics. Learn to work with the testing/QA team, create packages, work with the openSUSE Build Service, help work on the wiki, or get involved with the GNOME and KDE teams. There’s something for everybody.


Schedule:
http://en.opensuse.org/Community_Week

Tuesday, May 05, 2009

Ubuntu and Upstart

Ubuntu與Fedora都採用了upstart模擬跑SysV. 但是OpenSUSE11.1/SLES11 whereas.... 還是採用大家熟悉的SysV, 讓我們來看看Novell的concern吧:

http://en.opensuse.org/Ubuntu_and_Upstart

是不是差點沒說出脫褲子放屁~ XD