2015年5月2日 星期六

開機自動執行, boot script in Ubuntu

●Background:
=================================
1.)Ubuntu 14.04.2 LTS 64bit


●Procedure:
=================================
1.)Create Script File
e.g:
#!/bin/sh
your-command

2.) $ chmod 755 your-script-file
3.)Ubuntu tool bar -> Search Application: Startup Applications
4.)Add your-script-file
5.)Done


●Other Info:
=================================


●Comment:
=================================
有很多方法可以做boot script,但目前測試只有這個方法才能執行 xinput 的命令


●Refference:
=================================
[1]startup script for trackpad
http://ubuntuforums.org/showthread.php?t=1561311

修正GTP硬碟轉MBR仍不能裝雙系統Win7+Ubuntu問題

●Background:
=================================
1.)安裝雙系統:
Win7 64bit (先)
Ubuntu 14.04.2 LTS 64bit (後)
2.)說明:
GTP硬碟裝雙系統Win7+Ubuntu會有問題,首先要裝雙系統要把GTP硬碟格式轉成MBR,但若使用的工具不對,會殘留GTP table資料,雖然Win7能安裝,但在Ubuntu安裝時,仍會誤以為硬碟還是GTP格式,看不到Win7。
3.)注意事項:
 - 不要使用 Win7 的安裝光碟做 GTP 轉 MBR 的動作
 - 不要使用 Windows 的 "diskpart" tool 做 GTP 轉 MBR 的動作
 - 不要灌了 Win7 再操作以下步驟,以下步驟操作完後再開始灌雙系統
 - 灌好 Win7 後最好先裝顯卡driver,不然可能會在裝完Ubuntu後,無法進入Win7(預設的顯卡driver error)


●Procedure[1]:
=================================
1.)Launch Ubuntu 14.04 install DVD
2.)Select: "Try Ubuntu"
3.)Ctrl+Alt+T
4.) $ gdisk
說明:找不到tool的話請執行 $ sudo apt-get install gdis
5.) Key-in: /dev/sdX
說明: Device filename, X for a, b, c.... e.g.: /dev/sda 請注意要操作哪個硬碟!!
6.) Key-in: r
說明: Start recovery/transformation.
7.) Key-in: g
說明: Convert GPT to MBR.
8.) Key-in: p
說明: Preview the converted MBR partition table.
9.) Key-in: w
說明: Write changes to the disk.
10.)Done
說明: Key-in "exit" to exit gdisk. You can reboot now to install Win7 and do disk partition on Win7.


●Other Info:
=================================


●Comment:
=================================



●Refference:
=================================
[1]How to Convert a GPT disk layout to a MS-DOS/MBR layout without data loss
http://www.firewing1.com/blog/2012/03/05/how-convert-gpt-disk-layout-ms-dosmbr-layout-without-data-loss-and-gigabyte-hybrid

修正Ubuntu的vi不能進insert mode問題


●Background:
=================================
1.)修正vi不能進insert mode問題,Ubuntu的vi不完整[1]
2.)Ubuntu 14.04.2 LTS 64bit


●Procedure:
=================================
1.)Connect to internet
2.)Ctrl+Alt+T
3.) $ sudo apt-get install vim
4.)Done



●Other Info:
=================================
1.)使用此命令可以把vi comand導向vim: $ alias vi=vim
但在Ubuntu 14.04 不需要這麼打

2.)常用的vi指令:
不儲存並離開:
"ESC" -> ":" -> "q!" -> Press Enter
儲存並離開:
"ESC" -> ":" -> "wq" -> Press Enter


●Comment:
=================================
建議安裝ubuntu後馬上處理此問題,很多地方會用到vi


●Refference:
=================================
[1]LINUX,進入VI後為什麼不能切到插入模式
http://zhidao.baidu.com/question/147839980.html

更改 Grub 開機順序 與 倒數時間

●Background:
=================================
1.)更改 Grub 開機順序 與 倒數時間
2.)Ubuntu 14.04.2 LTS 64bit


●Procedure:
=================================
1.)Ctrl+Alt+T
2.) $ sudo gedit /etc/default/grub
說明:不要用vi,ubuntu的vi有問題,不能進insert mode
3.)Change "GRUB_DEFAULT" to 4
說明:Ubuntu是0,4是Win7,此值請看開機時的Grub menu,或去學著看/boot/grub/grub.cfg(麻煩)
4.)Change "GRUB_TIMEOUT" to 3
說明:修改Grub menu的倒數時間為3秒
5.) $ sudo update-grub
說明:產生新的config file,不要漏打了
6.)Done



●Other Info:
=================================


●Comment:
=================================
建議安裝ubuntu後馬上處理此問題


●Refference:
=================================

無法關閉touchpad (Ubuntu)

●Background:
=================================
1.)Ubuntu 無法偵測 touchpad,所以無法關閉 touchpad
2.)Ubuntu 14.04.2 LTS 64bit


●Procedure:
=================================
1.)Ctrl+Alt+T
2.) $ xinput list
說明: 找出touchpad的裝置與index,e.g.: PS/2 Generic Mouse,index = 13
3.) $ xinput -disable 13
4.)Done


●Other Info:
=================================
1.)打開裝置的命令為: $ xinput -enable 13
2.)以上命令關機後重置


●Comment:
=================================
1.)建議安裝ubuntu後馬上處理此問題,把以上步驟存成 boot script[2]
2.)但Index可能會變!!(如果有後來有新增鍵盤滑鼠類的週邊的話)


●Refference:
=================================
[1]How to disable the touchpad?
http://askubuntu.com/questions/65951/how-to-disable-the-touchpad

[2]開機自動執行, boot script in Ubuntu
http://fy123p.blogspot.tw/2015/05/boot-script-in-ubuntu.html