記錄些使用 Unity 常調整的項目
# 設定 system tray 顯示所有
$ gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"
# 常用套件
$ sudo apt-get install hime(or gcin) ssvnc ubuntu-restricted-extras gparted
openjdk-7-jre vim tree gthumb audacious easytag
sound-juicer pidgin stardict gimp inkscape vlc openshot openssh-server wine
# 安裝 Java plugin for Firefox
sudo apt-get install icedtea-7-plugin
# 啟用 nonfree/third-party 軟體
* enable "Canonical partner software"
$ sudo apt-get install skype acroread
# Install common codecs
$ sudo apt-get install non-free-codecs libxine1-ffmpeg gxine mencoder totem-mozilla icedax tagtool easytag id3tool lame nautilus-script-audio-convert libmad0 mpg321 mpg123libjpeg-progs
# 安裝 dvd 相關函式庫
$ sudo wget
--output-document=/etc/apt/sources.list.d/medibuntu.list
http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list ; sudo
apt-get --quiet update ; sudo apt-get --yes --quiet
--allow-unauthenticated install medibuntu-keyring ; sudo apt-get --quiet
update
$ sudo apt-get install libdvdcss2
# 安裝壓縮/解壓縮工具
sudo apt-get install unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudeview mpack lha arj cabextract file-roller
# 進階需要套件
$ sudo apt-get install git subversion debmirror nmap
# Wine 相關
http://www.unixmen.com/install-and-configure-wine-to-play-latest-windows-games-in-linux-ubuntu-linuxmint-fedora/
# 安裝 Ubuntu Tweak
$ sudo add-apt-repository ppa:tualatrix/ppa
$ sudo apt-get update && sudo apt-get install ubuntu-tweak
# 安裝 Indicator
* Weather Applet
$ sudo apt-get install indicator-weather
* System Monitor Applet
$ sudo add-apt-repository ppa:indicator-multiload/stable-daily; sudo apt-get update
$ sudo apt-get install indicator-multiload
Reference:
http://www.unixmen.com/201204-top-things-to-do-after-installing-ubuntu-2/
===========================
# 變更 Nautilus 位置以路徑顯示
gsettings set org.gnome.nautilus.preferences always-use-location-entry true|false
# 設定 Launcher 套用哪些設定
gsettings set com.canonical.Unity.Launcher favorites "['/home/ceasar/.local/share/applications/gnome-terminal.desktop', '/home/ceasar/.local/share/applications/nautilus-home.desktop', 'pidgin.desktop', 'firefox.desktop', 'thunderbird.desktop', 'stardict.desktop', 'audacious2.desktop', 'gedit.desktop', 'easytag.desktop', 'ssvnc.desktop', 'filezilla.desktop', 'virtualbox.desktop','radiotray.desktop']"
# 變更預設目錄sudo vi .config/user-dirs.dirs
# 安裝 dvd 相關函式庫sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list ; sudo apt-get --quiet update ; sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring ; sudo apt-get --quiet update
sudo apt-get install libdvdcss2
# 安裝 nautilus-gksu in Unity nautilus
sudo apt-get install -y nautilus-gksu
sudo cp /usr/lib/nautilus/extensions-2.0/libnautilus-gksu.so /usr/lib/nautilus/extensions-3.0/
# restart nautilus
pkill nautilus
# Adobe PDF reader 安裝
1. Ubuntu軟體中心→編輯→軟體來源→其它軟體→把 Canonical夥伴 打勾→關閉
2. sudo apt-get install acroread
http://wiki.ubuntu-tw.org/index.php?title=AdobeReader
# PDF 中文方框問題
sudo sed -i '/DejaVu/d ; /Bitstream Vera/d ; /WenQuanYi Bitmap Song/d' /etc/fonts/conf.avail/69-language-selector*
# 便條紙程式 tomboy
sudo add-apt-repository ppa:remi.rerolle/unity-lens-tomboy
sudo apt-get update
sudo apt-get install unity-lens-tomboy
# Disable Overlay Scrollbars
sudo apt-get remove overlay-scrollbar liboverlay-scrollbar3-0.2-0 liboverlay-scrollbar-0.2-0
# Disable Global Menu (AppMenu)
sudo apt-get remove appmenu-gtk3 appmenu-gtk appmenu-qt
Reference:
http://www.webupd8.org/2011/10/things-to-tweak-after-installing-ubuntu.html
http://www.techdrivein.com/2011/10/15-things-i-did-after-installing-new.html
http://blog.sudobits.com/2011/12/02/10-things-to-do-after-installing-linux-mint-12/
http://www.noobslab.com/2011/11/things-to-do-after-installing-linux.html
系統轉移常備份之文件 :
/etc/{fstab,rc.local,crontab,resolv.conf, /network/interfaces,/apt/sources.list}
個人轉移常備份之文件 :
~/{.ssh, .gnupg, .vnc, .filezilla, .gcin, .Skype, }
2012年2月2日 星期四
2011年3月30日 星期三
Note for GPG
Reference:
http://wiki.debian.org.tw/GnuPG
(Ps:加入並修正 -o outputfile 的做法)
http://wiki.debian.org.tw/GnuPG
(Ps:加入並修正 -o outputfile 的做法)
基本 GPG Use Case
信任簽證
- 指紋的後8碼就是 KeyId
- gpg --recv-keys ID
- gpg --edit ID
- fpr
- sign
- save
- gpg --send-keys ID
管理 Private keys
- 列出 gpg --list-secret-keys
- 新增 gpg --gen-key && gpg --send-keys [KeyId]
- 刪除 gpg --gen-revoke [KeyId] && gpg --send-keys [KeyId] && gpg --delete-secret-keys [KeyId]
- 匯出 cp ~/.gnupg/secring.gpg [FileName]
- 匯入 gpg --import < [FileName || secring.gpg ]
- 備份撤消聲明 gpg --output [FileName] --gen-revoke [KeyId||Name] 將文字印出來存放著。
管理 Public Keys
- 列出 gpg --list-keys
- 新增 gpg --import < [KeyFile || pubring.gpg ]
- 新增 gpg --recv-keys [KeyId]
- 刪除 gpg --delete-keys [KeyIds]
- 匯出 gpg --export > [FileName]
- gpg --armor --export KeyID > PublicKey.asc
- 匯入 gpg --import < [FileName || pubring.gpg ]
- 更新 gpg --refresh-keys
簽名/驗證
- 明文簽名 gpg --clearsign [-o OutputFileName] [FileName]
- 明文驗證 gpg --verify [FileName.asc]
- 檔案簽名 gpg --sign --detach-sign [-o OutputFileName] [FileName]
- 檔案驗證 gpg --verify [FileName.gpg] [FileName]
加密/解密
- 加密 gpg --encrypt --recipient [KeyId] [-o OutputFileName] [FileName]
- 解密 gpg --decrypt [-o OutputFileName] [FileName.gpg]
增加 UID
- gpg --edit-key [KeyId]
- 指令> adduid
- ... # 依照指示填入姓名、郵件地址、註解
- 指令> save
- gpg --send-keys [KeyId]
2011年3月24日 星期四
Windows batch script 雜記
- 擴充變數語法
- 網芳掛載
- 網路印表機掛載
- 擴充變數語法
http://fan.renren.it/a/caozuoxitong/Windows/20101021/53524.html
http://www.911cd.net/forums/lofiversion/index.php/t3730.html
舉例 比如你有個批處理a.bat在D:\qq文件夾下
a.bat內容為
cd /d %~dp0 在這裡
cd /d %~dp0的意思就是cd /d d:\qq
%0代表批處理本身 d:\qq\a.bat
~dp是變量擴充
d既是擴充到分區號 d:
p就是擴充到路徑 \qq
dp就是擴充到分區號路徑 d:\qq
擴充變量語法詳解:
:: 選項語法:
:: ~I - 刪除任何引號("),擴充 %I
:: %~fI - 將 %I 擴充到一個完全合格的路徑名
:: %~dI - 僅將 %I 擴充到一個驅動器號
:: %~pI - 僅將 %I 擴充到一個路徑
:: %~nI - 僅將 %I 擴充到一個文件名
:: %~xI - 僅將 %I 擴充到一個文件擴展名
:: %~sI - 擴充的路徑只含有短名
:: %~aI - 將 %I 擴充到文件的文件屬性
:: %~tI - 將 %I 擴充到文件的日期/時間
:: %~zI - 將 %I 擴充到文件的大小
:: %~$PATH:I - 查找列在路徑環境變量的目錄,並將 %I 擴充
:: 到找到的第一個完全合格的名稱。如果環境變量名
:: 未被定義,或者沒有找到文件,此組合鍵會擴充到
:: 空字符串
:: 可以組合修飾符來得到多重結果:
:: %~dpI - 僅將 %I 擴充到一個驅動器號和路徑
:: %~nxI - 僅將 %I 擴充到一個文件名和擴展名
:: %~fsI - 僅將 %I 擴充到一個帶有短名的完整路徑名
:: %~dp$PATH:i - 查找列在路徑環境變量的目錄,並將 %I 擴充
:: 到找到的第一個驅動器號和路徑。
:: %~ftzaI - 將 %I 擴充到類似輸出線路的 DIR
net use v: "\\$ip\share3" "password" /user:[pcid]\[userid] /persistent:no
:: ~I - 刪除任何引號("),擴充 %I
:: %~fI - 將 %I 擴充到一個完全合格的路徑名
:: %~dI - 僅將 %I 擴充到一個驅動器號
:: %~pI - 僅將 %I 擴充到一個路徑
:: %~nI - 僅將 %I 擴充到一個文件名
:: %~xI - 僅將 %I 擴充到一個文件擴展名
:: %~sI - 擴充的路徑只含有短名
:: %~aI - 將 %I 擴充到文件的文件屬性
:: %~tI - 將 %I 擴充到文件的日期/時間
:: %~zI - 將 %I 擴充到文件的大小
:: %~$PATH:I - 查找列在路徑環境變量的目錄,並將 %I 擴充
:: 到找到的第一個完全合格的名稱。如果環境變量名
:: 未被定義,或者沒有找到文件,此組合鍵會擴充到
:: 空字符串
:: 可以組合修飾符來得到多重結果:
:: %~dpI - 僅將 %I 擴充到一個驅動器號和路徑
:: %~nxI - 僅將 %I 擴充到一個文件名和擴展名
:: %~fsI - 僅將 %I 擴充到一個帶有短名的完整路徑名
:: %~dp$PATH:i - 查找列在路徑環境變量的目錄,並將 %I 擴充
:: 到找到的第一個驅動器號和路徑。
:: %~ftzaI - 將 %I 擴充到類似輸出線路的 DIR
- 網芳掛載
net use v: "\\$ip\share3" "password" /user:[pcid]\[userid] /persistent:no
- 網路印表機掛載
2011年3月15日 星期二
解決 tree 指令無法顯示中文問題
預設安裝的 tree 套件無法正確顯示中文,如:
Done.
再試一次
~/tmp$ tree需要手動更改:
.
`-- \346\211\213\345\206\212
`-- shell \346\267\261\345\272\246\346\225\231\345\255\270.pdf
1 directory, 1 file
- 至 http://mama.indstate.edu/users/ice/tree/下載最新版本,以 1.5.3 為例
- 解開並重新編譯、安裝
$ wget http://mama.indstate.edu/users/ice/tree/src/tree-1.5.3.tgz
$ tar xzf tree-1.5.3.tgz; cd tree-1.5.3/ ; make ; sudo make install
Done.
再試一次
~/tmp$ tree中文目錄與檔名都可正確顯示
.
`-- 手冊
`-- shell 深度教學.pdf
1 directory, 1 file
常見繁簡文互換或中文編碼問題
編碼轉換(不轉換繁、簡文)
* 先測試看看:從 big5 編碼轉成 utf8
繁、簡體轉換
將 gb2312 編碼的簡體轉為 big5 編碼的繁體
反之亦然,如:
* 複雜的情況:
文件內容為 utf8 編碼之簡體,要轉換成 utf8 繁體,則需要中介編碼,如下
下面則是轉換都是 utf8 的方式繁、簡檔名
* 先轉換目錄名稱
- 改變將路徑下的目錄與檔案名稱的編碼方式
* 先測試看看:從 big5 編碼轉成 utf8
convmv -f big5 -t utf8 -r --nosmart folder_name* 強制轉換
convmv -f big5 -t utf8 -r --nosmart --notest folder_name
繁、簡體轉換
- 轉換檔案內容:利用 iconv 進行繁、簡互轉
將 gb2312 編碼的簡體轉為 big5 編碼的繁體
iconv sc-gb2312.txt -f gb2312 -t big5 -o output.txt若需要再把編碼轉為 utf8 則再換一次
iconv sc-gb2312.txt -f gb2312 -t big5 | iconv -f big5 -t utf8 -o output.txtbig5 繁體中文要轉成 utf8 編碼的繁體中文
cat tc-big5.txt | iconv -f big5 -t utf8 > output.txt但比較麻煩的不知道編碼的格式為何。如此,可以用 autob5, autogb (需要安裝 zh-autoconvert ) 來協助,需要再轉換 utf8 編碼再 pipe 給 iconv 做,如下:
cat sc-unknow.txt | autob5 | iconv -f big5 -t utf8 > output.txt批次轉換
for i in `ls *.chs.srt`; do cat $i | autob5 | iconv -f big5 -t utf8 > $i.cht-srt ; done
反之亦然,如:
cat tc-big5.txt | autogb | iconv -f gbk -t utf8 > output.txt
* 複雜的情況:
文件內容為 utf8 編碼之簡體,要轉換成 utf8 繁體,則需要中介編碼,如下
cat sc-utf8.txt | iconv -f utf8 -t gb2312 | iconv -f gb2312 -t big5 | iconv -f big5 -t utf8 output.txt
下面則是轉換都是 utf8 的方式繁、簡檔名
- utf8簡體檔名轉成utf8繁體檔名
* 先轉換目錄名稱
find . -type d -print0 | while read -d $'\0' file ; do mv "$file" "$(echo $file | autob5 --input utf8 | iconv -f big5 -t utf8)" ; done* 再轉換檔案名稱
find . -print0 | while read -d $'\0' file ; do mv "$file" "$(echo $file | autob5 --input utf8 | iconv -f big5 -t utf8)" ; donePS:以上用法可避免檔案或目錄名稱中有空白
訂閱:
文章 (Atom)