2011年2月10日

關掉擾人的逼逼聲

Debian
xset b off
xset b on

Ubuntu
tab補齊的bb聲
in ~/.inputrc
set bell-style none 關閉
set bell-style visible 開啟

vim錯誤指令的bb聲
in ~/.vimrc
set vb

less錯誤的bb聲
in ~/.bashrc
alias less="less -Q"

[轉貼]忘記 Debian root password

Source:
http://blog.verycd.com/zipalpha/showentry=31973


現在我們一般使用grub作為系統的引導程式,而lilo進入單用戶的方法很簡單,這裏就不提了。

對於一些版本的OS(如redhat)來說,編輯grub,在後面加上“single”即可進入單用戶模式。
但是對於debian來說,這種方式是無效的,因為debian進入單用戶模式也需要你輸入root用戶的密碼。

下面介紹一個在所有版本linux的grub上均可以使用的方法:

1、在Grub的引導裝載程式功能表上,選擇你要進入的條目,鍵入 “e” 來進入編輯模式。
2、在第二行(類似於kernel /vmlinuz-2.6.15 ro root=/dev/hda2 ),鍵入”e”進入編輯模式;
3、在句末加上”init=/bin/bash”,回車;
4、按“b”啟動系統。
這樣我們即可獲得一個bash的shell。

進入shell後,根分區的掛載模式默認是唯讀,我們要將其改為可寫,否則不能更改root密碼:

mount -no remount,rw /
passwd root
sync
mount -no remount,ro /
reboot


這樣即可成功更改debian的root用戶的密碼。

2010年11月21日

Mount extend partition - LVM using Knoppix LiveCD

Referenced from this article

- Burned a Knoppix LiveCD - version 5.1.1 (Newest:6.2)
(it has lvm-tools available)
- Booted the PC with Knoppix Live CD
- Started a Terminal

$ su
# lvm vgchange --ignorelockingfailure -P -a y
Code:

Partial mode. Incomplete volume groups will be activated read-only.
2 logical volume(s) in volume group "ubuntu" now active

It shows the name of the "volume group"


# lvm lvs
Code:

LV VG Attr LSize Origin Snap% Move Log Copy%
root ubuntu -wi-a- 142.92G
swap_1 ubuntu -wi-a- 5.89G

# mkdir /vg_mnt
# mount /dev/ubuntu/root /vg_mnt
# ls /vg_mnt/
Code:
bin cdrom etc initrd lib media proc sbin sys usr vmlinuz
boot dev home initrd.img lost+found opt root srv tmp var

# ls /vg_mnt/home/satimis/
all my work displayed here.


Inserted an USB pendrive and copied all my work on it.

# umount /vg_mnt

Now I have my work saved on the USB pendrive. Then I successfully copied my files on another PC.

2010年7月21日

修改GRUB開機順序

1.開機後打開終端機.
2. sudo gedit /boot/grub/menu.lst 開啟menu.lst檔案
3.找出default 0
4.把0改成windows開機的次序(注意:看windows是第幾個,若是是第3個則改成2-因為由0開始數)
5.存檔..重開機..

2010年6月3日

Fix Failed to execute child process "xscreensaver" in Solaris 10

Add this line "PATH=$PATH:/usr/openwin/bin:/usr/dt/bin" to the top of these two files:

/usr/dt/config/Xinitrc.tjds
/usr/dt/config/Xinitrc.jds


and log out

you will find this problem is fixed

2010年6月2日

solaris 10 加裝中文字體(繁體+簡體)

[參考文章 How to add languages on Solaris 10]

Solaris 10以後,用localeadm來添加語言,例如添加Japanese:

# localeadm -a ja -d

其它語言:zh_TW, zh_HK, hi_IN, th_TH, ko_KR, ja..etc.

Listing All of the Locales and Codesets
#
localeadm -lc

Listing the Regions Available on a Solaris CD or DVD
#
localeadm -ls -d /cdrom/cdrom0

2010年5月10日

XP 英文版 顯示中文與中文輸入

  1. Start -> Control Panel -> Regional and Language -> 上方的 Language ->
    勾選 Install files for East Asian languages (此選項上面那個不要勾)
  2. 再選上方的 Advanced -> Language for non-Unicode programs 選 Chinese(Taiwan)
  3. 於 Code page conversion tables 選取所有相關 Traditional Chinese 的選項 -> Apply 就會開始安裝(需要 XP 光碟)
  4. 重新開機完成後, 一樣到 Regional and Language Options -> 上方的 Language -> Details -> 會開啟 Text Services and Input Languages 視窗去新增輸入法
  5. 就完成囉.
來源
http://plog.longwin.com.tw/news-windows/2007/01/07/windowsxp_input_chinese_2007