2010年4月5日 星期一

Vim 鍵盤指令圖解

常用的ubuntu 熱鍵

Ctrl + N New 開新檔案
Ctrl + O Open 開啟舊檔
Ctrl + A Select all 全選
Ctrl + X Cut 剪下
Ctrl + C Copy 複製
Ctrl + V Paste 貼上
Ctrl + Z Undo 重來、上一步
Ctrl + Y Redo 復原(與上一 步相反功能)
Ctrl + S Save 儲存
Ctrl + W Close 關閉檔案
Ctrl + Q Quit 離開程式
Alt + Tab
切換視窗
Alt + Shift+Tab
反向切換視窗
Alt + Space
視窗控制選單
(與在視窗標題列案滑鼠右鍵同功能)
Alt + Print Screen
擷取目前視窗畫面
Ctrl + Alt + d
全部視窗最小化
alt + 滑鼠左鍵
可以移動視窗
alt + 滑鼠中鍵
可以resize視窗
Ctrl + Alt + right arrow
切換桌面
Ctrl + Alt + left arrow
切換桌面
Ctrl + Alt + up arrow
切換桌面
Ctrl + Alt + down arrow
切換桌面
Ctrl + Alt + F1 = 跳到文字模式1(virtual terminals)
Ctrl + Alt + F2(F3)(F4)(F5)(F6) = 跳到文字模式2~6
Ctrl + Alt + F7 = 回到桌面
Ctrl + Alt + Backspace 跳出桌面,進入登入畫面

How to Reset Ubuntu/Gnome Settings to Defaults without Re-installing

Keep in mind that this will only reset your Gnome-specific settings. If you are having problems with your video card, display, x-server, etc., this WILL NOT fix your problems.

If you don’t have access to your graphical (GUI) desktop to delete these folders in Nautilus or you’re stuck at the login screen, drop to a terminal by hitting CTRL + ALT + F1, login to your account, and run this command:

rm -rf .gnome .gnome2 .gconf .gconfd .metacity

Get back to your GUI desktop by hitting CTRL + ALT + F7.

利用電話透過Asterisk 開家裡電鎖

利用電話撥到家中電話透過Asterisk,若CallerID 符合自己設定的Call Filter List時,則由Analog Port 3接電鎖中繼器送出"#"給中繼器後,將啟動電鎖開關,來開啟大門,經測試以此方式門口機不會咬線.




[call-filter-custom-0]
fullname = unlock
exten = s,1,Goto(CallFilter-${CDR(src)}|1)
exten = CallFilter-0912000000,1,Goto(voicemenu-custom-5|s|1)
exten = CallFilter-0912000001,1,Goto(voicemenu-custom-5|s|1)
exten = i,1,Goto(voicemenu-custom-6|s|1)

[voicemenu-custom-5]

comment = unlock
exten = s,1,dial(zap/3/ww#,60,G(hangdoorphone,hangupcall,1))

[hangdoorphone]
exten = hangupcall,1,wait(30)
exten = hangupcall,n,hangup

不錯的 10個 Ubuntu 佈景主題





1 – Add the key for the repository
Open a terminal and do:

gpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-key 881574DE && gpg -a --export 881574DE | sudo apt-key add -
if the server doesn’t respond, just wait a few minutes and try again
2 – Add the repository
Add those lines at the end of your sources.list (always in a terminal):
sudo gedit /etc/apt/sources.list

for Ubuntu 9.10
## Themes
deb http://ppa.launchpad.net/bisigi/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/bisigi/ppa/ubuntu karmic main

3 - Install Themes
Update your software sources: (In a terminaln do):
sudo aptitude update
Then install themes: (this command install all themes. If you want to install only one theme, go look here)
sudo aptitude install bisigi-themes
or click on apt://bisigi-themes



Liste des commandes pour installer les thèmes:
AquaDreams: sudo aptitude install aquadreams-theme
Ubuntu Sunrise: sudo aptitude install ubuntu-sunrise-theme
Bamboo-Zen: sudo aptitude install bamboo-zen-theme
Step into Freedom: sudo aptitude install step-into-freedom-theme
Tropical: sudo aptitude install tropical-theme
Exotic: sudo aptitude install exotic-theme
Balanzan: sudo aptitude install balanzan-theme
Wild Shine: sudo aptitude install wild-shine-theme

Infinity: sudo aptitude install infinity-theme
Showtime: sudo aptitude install showtime-theme
Orange: sudo aptitude install orange-theme
Ellanna: sudo aptitude install ellanna-theme
AirLines: sudo aptitude install airlines-theme

彩色化 man command

vim ~/.bashrc

於最後加入

# colorful man page
export PAGER="`which less` -s"
export BROWSER="$PAGER"
export LESS_TERMCAP_mb=$'\E[0;34m'
export LESS_TERMCAP_md=$'\E[0;34m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[0;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[0;33m'

How to use simple speedtest in RaspberryPi CLI

  pi@ChunchaiRPI2:/tmp $  wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py --2023-06-26 10:4...