Nov 24, 2010
Python Cheat Sheet
Quick Python Script Expalanation for Programmers from http://coffeeghost.net
中文版 from http://wiki.woodpecker.org.cn/
Python 2.6 Quick Reference
Nov 20, 2010
Kernel Shared Memory (KSM)
動手玩看看前,先確定 linux kernel > 2.6.32 and Enable KSM
$ cat /boot/config-`uname -r` | grep KSM
CONFIG_KSM=y
KSM 只能使用在利用 madvise syscall 將記憶體區塊設為 MADV_MERGEABLE,另外如要取消改為 MADV_UNMERGEABLE。所以需要確認 KVM 的版本 > v0.12.0-rc0。
linux 有 Enable KSM 的話,/sys/kernel/mm/ksm/ 會有以下檔案
pages_shared how many shared pages are being used
pages_sharing how many more sites are sharing them i.e. how much saved
pages_unshared how many pages unique but repeatedly checked for merging
pages_volatile how many pages changing too fast to be placed in a tree
full_scans how many times all mergeable areas have been scanned
run Whether the KSM process is running.
sleep_millisecs how many milliseconds ksmd should sleep before performing another page scan.
開始使用
1. 開啟 KSM 功能
echo 1 > /sys/kernel/mm/ksm/run
2. 開二個相似的 VM image
/opt/bin/qemu -hda xp.raw -m 1024 &
/opt/bin/qemu -hda xp2.raw -m 1024 &
下面的二張圖是有開KSM跟沒關的差別,可明顯的看出,開了KSM的記憶體使用量少了一半左右
[1] http://lwn.net/Articles/306704/
[2] http://kernelnewbies.org/Linux_2_6_32
[3] http://www.xen.org/files/xensummit_fall07/18_GregorMilos.pdf
[4] http://kb.vmware.com/kb/1021095
Nov 11, 2010
讓你的封包,送出時自動加上 VLAN ID
1. insert 802.1q kernel module
sudo modprobe 8021q
2. create a vlan id on NIC by vconfig。
sudo vconfig add eth0 111
Added VLAN with VID == 111 to IF -:eth0:-
3. start up eth0.111
sudo ifconfig eth0.111 192.168.1.2 up
4. 測試前的準備:
sudo ifconfig eth0.111 192.168.1.25. 利用 wireshark 抓出來的封包
eth0.111 Link encap:Ethernet HWaddr 00:21:70:ff:d7:88 inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::221:70ff:feff:d788/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:238 (238.0 B)
此例中,在eth0上加上 vlanid 111,成功之後,會多出一個 eth0.111 的network device,只要是從這個 device 出去的封包,會自動加上 802.1Q 的 header
Oct 24, 2010
zenity 的 python wrap : PyZenity
而 PyZenity 其實一個 wrap 而已,執行時是 call popen(zenity),而使用起來跟 zenity 差不多。
Oct 4, 2010
Install Ubuntu 9.10 Karmic on Kohjinsha SX3 UMPC
1. Poulsbo (GMA500) Support in Karmic (9.10)1)
1)PPA-based (UbuntuMobile & Milone):2. IM
wget http://gma500re.altervista.org/scripts/poulsbo_ppa.sh && sh ./poulsbo_ppa.sh
or
2) FTP-based (no ppa repositories):
wget http://gma500re.altervista.org/scripts/poulsbo.sh && sh ./poulsbo.sh
http://vicamo.blogspot.com/2009/07/boshiamy-for-ibus.html3. pen screen
工人舍SH8安裝Ubuntu 9.04 netbook remix初步心得
penmount Driver Download
call graph
void __cyg_profile_func_enter (void *this_fn, void *call_site); void __cyg_profile_func_exit (void *this_fn, void *call_site);
先來個 example 試試看:
#includevoid __attribute__((__no_instrument_function__)) __cyg_profile_func_enter(void *this_func, void *call_site) { printf("Enter &%s:%p, called by %p \n", __FUNCTION__, this_func, call_site); } void __attribute__((__no_instrument_function__)) __cyg_profile_func_exit(void *this_func, void *call_site) { printf("Enter &%s:%p, called by %p \n", __FUNCTION__, this_func, call_site); } void a(void); void b(void); void b() { } void a() { b(); } int main(int argc, const char *argv[]) { a(); return 0; }
利用 j 的 Dot 語法,可以簡單的畫出 directed graph 語言感覺很像以前讀研究所時,寫 network simulation的腳本
digraph G { node1; node2; node3; node1 -> node2 [label="edge_1_2"]; node1 -> node3 [label="edge_1_3"]; node2 -> node3 [label="edge_2_3"]; }
Conver to JPG:
dot -Tjpg graph.dot -o graph.jpg產生出來的圖

reference:
http://tarot.freeshell.org/leafpad/
http://blog.linux.org.tw/~jserv/archives/001870.html
http://www.ibm.com/developerworks/cn/linux/l-graphvis/
http://blog.linux.org.tw/~jserv/archives/001723.html
booting iso from grub2
sudo mkfs.vfat /dev/sdd1
2. mount partition on the temp directory
sudo mkdir /media/flash_disk
sudo mount /dev/sdd1 /media/flash_disk/
3. Install GRUB 2 onto the USB stick.
sudo grub-install --no-floppy --root-directory=/media/flash_disk/ /dev/sdd
4. Edit /media/flash_disk/boot/grub/grub.cfg to point to the ISO files.
set timeout=10
set default=0
menuentry "Run Ubuntu Live 10.04" {
loopback loop /ubuntu-10.04-desktop-i386.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-10.04-desktop-i386.iso splash --
initrd (loop)/casper/initrd.lz
}
menuentry "Ubuntu 10.4 Server i386" {
loopback loop /ubuntu-10.04-server-i386.iso
linux (loop)/install/vmlinuz --
initrd (loop)/install/initrd.gz
}
5. copy linux cdrom iso to /media/flash_disk
cp ubuntu-10.04-desktop-i386 /media/flash_disk/
6. booting by qemu
sudo /opt/bin/qemu -hda /dev/sdd -boot c -m 256 -localtime
Jun 1, 2010
Doxygen 初試
剛在網路上找到一份不錯的文章:簡介Doxygen
1. 先在 project 目錄打 doxygen -g doxy.conf; doxy.conf是產生的 config 檔,使用 doxy 之前先對你的 project 做相關的設定
2. doxygen doxy.con; doxygen 後面直接接你的 config 檔,執行玩會發現你的目錄多出二個檔案匝 html and latex。
May 4, 2010
讓 Chrome 支援 Java
- mkdir /opt/google/chrome/plugins
- cd /opt/google/chrome/plugins
- ln -s `dpkg -L sun-java6-bin | grep libnpjp2.so` .
recover juniper ex-4200's root password
NOTE: Once in the CLI, you will need to enter configuration mode usingNOTE: the 'configure' command to make any required changes. For example,NOTE: to reset the root password, type:NOTE: configureNOTE: set system root-authentication plain-text-passwordNOTE: (enter the new password when asked)NOTE: commitNOTE: exitNOTE: exitNOTE: When you exit the CLI, you will be asked if you want to rebootNOTE: the system
Apr 29, 2010
hte: 超棒的 Hex's Editor

Apr 27, 2010
auto-update tags
function! UPDATE_TAGS()let _f_ = expand("%:p")let _cmd_ = '"ctags -a -f /dvr/tags --c++-kinds=+p --fields=+iaS --extra=+q " ' . '"' . _f_ . '"'let _resp = system(_cmd_)unlet _cmd_unlet _f_unlet _respendfunctionautocmd BufWritePost *.cpp,*.h,*.c call UPDATE_TAGS()
nmap:!find . -iname '*.c' -o -iname '*.cpp' -o -iname '*.h' -o -iname '*.hpp' > cscope.files \ :!cscope -b -i cscope.files -f cscope.out \ :cs reset
Dec 27, 2009
linux's core dump
先認定 core file size: ulimit -a

1. sudo vi /etc/security/limits.conf, 加入這行
* soft core unlimited2. 開一個新的 terminal,輸入 ulimit -c,此時因該還是0, 利用 ulimit -c unlimited,更改成 unlimited。
設定完 core file size 之後,我使用下面程式來測試 debgu 的效果
/*
* file name: wrong.c
* gcc -g wrong.c -o wrong
*/
#include
#include
void func3()
{
//go to dia;
char *x = 0x0;
*x = 1;
printf("%s", x);
strcpy(x, "This is wrong");
}
void func2(void)
{
func3();
}
void func1(void)
{
func2();
}
int main(void)
{
func1();
return 0;
}
執行結果為:
程式記憶體區段錯誤 (core dumped)如沒有意外的話,因該可以看到多出了一個 core 的檔案
$file core有了 core file 之後,我們就可以利用 gdb 來做 backtrace
core: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, from './wrong'
$ gdb wrong core
Core was generated by `./wrong'.我們大概可以知道是停在 func3 裡,透過 print 可知道,發生了什麼事
Program terminated with signal 11, Segmentation fault.
#0 0x08048264 in func3 () at wrong.c:8
warning: Source file is more recent than executable.
8
(gdb) p x另外,最好用的當然是 backtrace
$1 = 0x0
(gdb) p *x
Cannot access memory at address 0x0
(gdb) wherewhere 指令,我們能很清楚的知道是從
#0 0x08048264 in func3 () at wrong.c:8
#1 0x080482a4 in func2 () at wrong.c:15
#2 0x080482b1 in func1 () at wrong.c:20
#3 0x080482be in main () at wrong.c:26
(gdb) help where
Print backtrace of all stack frames, or innermost COUNT frames.
With a negative argument, print outermost -COUNT frames.
Use of the 'full' qualifier also prints the values of the local variables.
main -> func1 -> func2 -> func3另外還有一種情況是,程式掉進 trap,而不會觸發 SIGEGV signal,此時可以利用 xiaosuo 寫的 dumper 讓你所想要的程式觸發 signal 產生 core file。
將 wrong.c 中的 func3 改成
void func3()
{
//go into loop;
while(1){
sleep(1);
}
}
compiler完之後,讓 wrong_loop 於背景執行
./wrong_loop &當然,我們都知道,它是不會中止的,此時可以利用 dumper 來中止 wrong_loop 且產生 core file
[1] 31908
$ ./dumper 31908 -k產生了 core 我們就可利用 GDB 來debug
Start injecting(31908)...OK
[1]+ 不合法的命令 (core dumped) ./wrong_loop
$
$ file core
core: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, from './wrong_loop'
$ gdb wrong_loop core
.....
Program terminated with signal 4, Illegal instruction.
#0 0xbfe0f4dc in ?? ()
(gdb) where
#0 0xbfe0f4dc in ?? ()
#1 0x08048266 in func3 () at wrong_loop.c:8
#2 0x08048273 in func2 () at wrong_loop.c:14
#3 0x08048280 in func1 () at wrong_loop.c:19
#4 0x0804828d in main () at wrong_loop.c:25
(gdb)
Reference:
Dec 13, 2009
UNISON 無法備份目錄的問題
fails to set permissions的 error,不過可自行更改一下 sync 的設定檔,加入下面二行
owner=false
perms=0
Reference:
Dec 2, 2009
coding style
-nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2 -ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -nprs -psl -saf -sai -saw -nsc -nsob

-nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs -nprs -npsl -saf -sai -saw -nsc -nsob -nss

3. The original Berkeley style: : -orig
-nbad -nbap -bbo -bc -br -brs -c33 -cd33 -cdb -ce -ci4 -cli0 -cp33 -di16 -fc1 -fca -hnl -i4 -ip4 -l75 -lp -npcs -nprs -psl -saf -sai -saw -sc -nsob -nss -ts8
Nov 29, 2009
Nov 25, 2009
利用 rsa 登入 SSH Server
Generating public/private rsa key pair.2. scp ~/.ssh/*.pub 你欲登入的主機:~/.ssh/.
Enter file in which to save the key (/home/username/.ssh/id_rsa): [按 Enter 使用預設值(建議)]
Enter passphrase: 輸入你的 Passphrase
Enter same passphrase again: 再一次輸入你的 Passphrase
Your identification has been saved in /home/username/.ssh/id_rsa.
Your public key has been saved in /home/username/.ssh/id_rsa.pub.
The key fingerprint is: cc:e8:a9:da:a3:41:c6:a9:97:52:59:ef:0c:cf:45:b6 username@abc.com
3. ssh 你欲登入的主機
4. cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
5. chmod 711 ~/.ssh
6. chmod 644 ~/.ssh/authorized_keys
發現,用 ubuntu 9.10 完成以上這些動作,就可以直接登入主機,不需在使用 ssh-agent
Reference:
Nov 23, 2009
Diff & Merge tool
sdiff <- 單純印出,每一行的內容
vimdiff <- 好像沒辨法對目錄下所有的檔案做比較,希望可以像 meld 那樣
meld <- 目前試了一下,還不錯
kdiff3 <- 我大多是用 Gnome,不太想多裝 KDE lib
DiffMerge <- non-opensource
Reference:
Visual Diff Tools in Linux
超棒的 Debian 小技巧
Debian 小技巧 #1: 您可以使用 reportbug 套件中的 'reportbug' 指令來回報問題,或者也可使用圖形化介面 'reportbug-ng'。
Debian 小技巧 #2: 您可以使用 'dpkg-reconfigure
Debian 小技巧 #3: 您可以使用 'apt-cache search <關鍵字>' 搜尋所有套件的描述的關鍵字。
Debian 小技巧 #4: 您可以使用 'apt-cache policy
Debian 小技巧 #5: 如果您需要編譯一個自定的核心,請使用 kernel-package 套件中的 'make-kpkg' 指令稿。
Debian 小技巧 #6: 第 #6 個提示不存在。今天就來生一個!
Debian 小技巧 #7: 您可以使用 cron-apt 套件每晚自動下載您更新套件。
Debian 小技巧 #8: 如果您在 Debian 中遇到的問題,無法透過閱讀手冊和文件解決,那麼請到 Debian 用戶郵遞論壇詢問 (簡: debian-chinese-gb@lists.debian.org,繁: debian-chinese-big5@lists.debian.org)。
Debian 小技巧 #9: 如果您需要知道目前正在使用的 Debian 是什麼版本,請查看 /etc/debian_version;如果您想知道那個版本的開發代號 (例如: 3.0 的開發代號是'Woody'),請參考此連結: http://www.debian.org/doc/FAQ/ch-ftparchives.html#s-codenames
Debian 小技巧 #10: Debian 郵遞論壇討論使用者問題或者 Debian 政策文件。瀏覽 http://www.debian.org/MailingLists/ 並訂閱您所感興趣的內容吧。
Debian 小技巧 #11: 關心新聞 - 閱讀 Debian Times。請於線上瀏覽 http://times.debian.net/
Debian 小技巧 #12: 有一個 grep-dctrl 套件提供了若干指令,它們可用來快速搜索各種套件的 control 檔 (像是套件中的檔案)。
Debian 小技巧 #13: 如果您不喜歡使用某個 Debian 套件的預設選項,您可以把它的源碼下載下來,按照您的偏好重新編譯一個版本。請參考 http://www.debian.org/doc/FAQ/ch-pkg_basics.html (第 6.13 和 6.14 節) 瞭解更多資訊。不過請記住,大部分軟體的多數選項都能夠在執行時進行設定,通常不必重新編譯套件。
Debian 小技巧 #14: 如果您想追蹤某個套件的發展 (比如說,如果您希望瞭解缺陷回報,發行通知以及其它類似資訊),請考慮在套件追蹤系統 (Package Tracking System)中訂閱。您可以於此找到有關套件跟蹤系統 (PTS) 的更多資訊:http://www.debian.org/doc/manuals/developers-reference/resources.html (第 4.10 節)
Debian 小技巧 #15: 一般而言套件的文件可以在 /usr/share/doc/
Debian 小技巧 #16: 如果您正在搜索一個不知道屬於那個套件的檔案,請試試 'apt-file',它為這類資訊提供了一個小型的資料庫。或者您也可以從 Debian 套件資料庫中搜索這些內容,也可以進行檔案搜尋:"http://www.debian.org/distrib/packages#search_contents
Debian 小技巧 #17: 想找一些人聊聊 Debian 嗎? 如果您習慣於 IRC (Intenret Relay Chat) 聊天,只要安裝您慣用的 IRC 軟體,然後加入 irc.debian.org 的 #debian 或 #dot 或 #debian-zh 頻道就可以了。
Debian 小技巧 #18: 在 http://packages.qa.debian.org/
Debian 小技巧 #19: 如果您對從封裝軟體套件感興趣,您應該考慮安裝 apt-src 這個套件。
Debian 小技巧 #20: 想要持續追蹤某個您已安裝的套件版本紀錄 (對那些混用 stable / testing / unstable 系統的人尤其有用)?請試試 apt-show-versions。
Debian 小技巧 #21: 如果您的 Debian 機器所使用的連線速度很慢,但是您可以使用另一個比較快的網路,那麼請試試 apt-zip 套件。
Debian 小技巧 #22: 正在猶豫使用哪個 Debian 鏡像站?請試試 apt-spy 和 netselect-apt 套件,它們可以為您測試不同網站的速度。
Debian 小技巧 #23: 若您的系統佔用了太多的硬碟空間,請試試 deborphan 套件。它能建議您哪些套件是無用的且可刪除的。當然,別忘了清除掉 APT 暫存 (使用 'apt-get clean'、'aptitude clean'、或者 aptitude 工具選單中的 '動作'->'清除套件暫存' 選項)。
Debian 小技巧 #24: 如果您想感謝某個維護者對於所處理的問題的辛勞,請試試reportbug --kudos。
Debian 小技巧 #25: 'debian-reference' 套件為 Debian 使用者和開發人員提供了非常廣泛的參考文件。其中大多數資訊都在這個連結:http://www.debian.org/doc/manuals/reference。
Debian 小技巧 #26: 如果一個套件沒有足夠的參考文件,那麼請查找名為
Debian 小技巧 #27: 請定期檢查您的備份。您*確定*備份無誤了,對吧? 對吧?(此技巧帶給您的當頭棒喝是 '徹' '底' '崩' '潰',以及「空」。)
Debian 小技巧 #28: 如果您的機器並非持續處於開機狀態 (例如一台筆記型電腦),請試試 'anacron' 套件。即使在機器並未開機,它能夠確保讓該定期執行的軟體依然被啟動。
Debian 小技巧 #29: 保持您系統時鐘的精確性 - 請安裝 'ntpdate' 套件並且設定為每次開機自動啟動。另外,經常開機的機器應該通過安裝 'ntp' 套件在每次開機時進校時。
Debian 小技巧 #30: 若安裝了 'doc-base' 和 'doc-central' 套件以及相依的套件後,就可以從 http://localhost/ 來瀏覽文件囉。
Debian 小技巧 #31: 停用一個特定 runlevel 的開機服務,應該是將 /etc/rc
Debian 小技巧 #34: 有一個 'doc-debian' 套件提供了一些有關 Debian 項目的通用文件。它還有西班牙語版本 (doc-debian-es)、法語版本 (doc-debian-fr) 和烏克蘭語版本 (doc-debian-uk)。
Debian 小技巧 #35: 'devscripts' 套件為那些希望改進 Debian 的使用者提供了一些有用的指令,如 wnpp-alert, rc-alert 以及 bts。
Debian 小技巧 #36: 如果您希望追蹤 Debian 開發版 (sid),但只有少量的下載權限或者一個頻寬很小的網路,請試試 debdelta 套件。
Debian 小技巧 #37: 搜尋遊戲嗎 ? 試試 'goplay' 吧,它提供了一個很棒的使用介面可瀏覽各種類型的遊戲。
Debian 小技巧 #38: 需要一些比 Debian 穩定版更新的套件,但又不願升級到 'testing' 或者 'unstable' 嗎? 有些更新套件擺在 volatile.debian.org,另一些套件可在 www.backports.org 找到。
Debian 小技巧 #39: 希望下載一個套件但卻不想安裝它?請用 'aptitude download
Debian 小技巧 #40: 想學會使用軟體的新技巧嗎? \"man\" 是你最佳好友! 在 shell 下打 \"man <程式名稱>\" 或者打 \"man -H <程式名稱>\" 在瀏覽器下閱讀操作手冊。
Debian 小技巧 #41: 安裝 bash-completion 軟體套件可增強 bash's 的 tab 補齊功能。
Debian 小技巧 #42: 如果你安裝了 command-not-found,當你鍵入系統未安裝之軟體時候,系統將會自動提醒你應該安裝那個套件。
Debian 小技巧 #3: 您可以使用 'apt-cache show <套件名稱>' 或 'aptitude show <套件名稱> 來取得套件的詳細描述。
Debian 小技巧 #44: 您可以使用 'apt-file list <套件名稱> 來查詢套件中所包含得檔案。這個指令很接近 dpkg -L,只是不需要安裝或先下載該套件。
Nov 22, 2009
dns timing issus when install ttf-mscorefonts
以下做簡單的筆記:
1. sudo vi /var/lib/
2. sudo dpkg --configure -a#!/bin/bash
#Version: 1.0
#Info: Bash script to install mscorefonts without using
#currently broken ttf-mscorefonts-installer (3.0) for
#Ubuntu 9.10 Karmic Koala (date: 03/11/09)#Author: Jonathan K.
#Website: http://www.friendlytec hninja. vndv.com
#Email:#License: This is free to use and distribute (for free only) as long as
#credit is given to original author.#Create temp and mscorefonts dir
sudo mkdir /usr/share/fonts/truetype/ mscorefonts
mkdir /tmp/mscorefonts
cd /tmp/mscorefonts#Download links
wget http://sourceforge. net/projects/ corefonts/ files/the% 20fonts/ final/andale32. exe/download? use_mirror= cdnetworks- kr-1
wget http://sourceforge. net/projects/ corefonts/ files/the% 20fonts/ final/arial32. exe/download? use_mirror= cdnetworks- kr-1
wget http://sourceforge. net/projects/ corefonts/ files/the% 20fonts/ final/arialb32. exe/download? use_mirror= cdnetworks- kr-1
wget http://sourceforge. net/projects/ corefonts/ files/the% 20fonts/ final/comic32. exe/download? use_mirror= cdnetworks- kr-1
wget http://sourceforge. net/projects/ corefonts/ files/the% 20fonts/ final/courie32. exe/download? use_mirror= cdnetworks- kr-1
wget http://sourceforge. net/projects/ corefonts/ files/the% 20fonts/ final/georgi32. exe/download? use_mirror= cdnetworks- kr-1
wget http://sourceforge. net/projects/ corefonts/ files/the% 20fonts/ final/impact32. exe/download? use_mirror= cdnetworks- kr-1
wget http://sourceforge. net/projects/ corefonts/ files/the% 20fonts/ final/times32. exe/download? use_mirror= cdnetworks- kr-1
wget http://sourceforge. net/projects/ corefonts/ files/the% 20fonts/ final/trebuc32. exe/download? use_mirror= cdnetworks- kr-1
wget http://sourceforge. net/projects/ corefonts/ files/the% 20fonts/ final/verdan32. exe/download? use_mirror= cdnetworks- kr-1
wget http://sourceforge. net/projects/ corefonts/ files/the% 20fonts/ final/webdin32. exe/download? use_mirror= cdnetworks- kr-1 #Extract all .tff files
cabextract *.exe -F*.ttf -L#Rename files and move files
sudo cp andalemo.ttf /usr/share/fonts/truetype/ mscorefonts/ Andale_ Mono.ttf
sudo cp ariali.ttf /usr/share/fonts/truetype/ mscorefonts/ Arial_Italic. ttf
sudo cp arialbd.ttf /usr/share/fonts/truetype/ mscorefonts/ Arial_Bold. ttf
sudo cp arialbi.ttf /usr/share/fonts/truetype/ mscorefonts/ Arial_Bold_ Italic. ttf
sudo cp arial.ttf /usr/share/fonts/truetype/ mscorefonts/ Arial.ttf
sudo cp ariblk.ttf /usr/share/fonts/truetype/ mscorefonts/ Arial_Black. ttf
sudo cp comicbd.ttf /usr/share/fonts/truetype/ mscorefonts/ Comic_Sans_ MS_Bold. ttf
sudo cp comic.ttf /usr/share/fonts/truetype/ mscorefonts/ Comic_Sans_ MS.ttf
sudo cp cour.ttf /usr/share/fonts/truetype/ mscorefonts/ Courier_ New.ttf
sudo cp courbd.ttf /usr/share/fonts/truetype/ mscorefonts/ Courier_ New_Bold. ttf
sudo cp courbi.ttf /usr/share/fonts/truetype/ mscorefonts/ Courier_ New_Bold_ Italic. ttf
sudo cp couri.ttf /usr/share/fonts/truetype/ mscorefonts/ Courier_ New_Italic. ttf
sudo cp georgiaz.ttf /usr/share/fonts/truetype/ mscorefonts/ Georgia_ Bold_Italic. ttf
sudo cp georgiab.ttf /usr/share/fonts/truetype/ mscorefonts/ Georgia_ Bold.ttf
sudo cp georgiai.ttf /usr/share/fonts/truetype/ mscorefonts/ Georgia_ Italic. ttf
sudo cp georgia.ttf /usr/share/fonts/truetype/ mscorefonts/ Georgia. ttf
sudo cp impact.ttf /usr/share/fonts/truetype/ mscorefonts/ Impact. ttf
sudo cp times.ttf /usr/share/fonts/truetype/ mscorefonts/ Times_New_ Roman.ttf
sudo cp timesbd.ttf /usr/share/fonts/truetype/ mscorefonts/ Times_New_ Roman_Bold. ttf
sudo cp timesbi.ttf /usr/share/fonts/truetype/ mscorefonts/ Times_New_ Roman_Bold_ Italic. ttf
sudo cp timesi.ttf /usr/share/fonts/truetype/ mscorefonts/ Times_New_ Roman_Italic. ttf
sudo cp trebuc.ttf /usr/share/fonts/truetype/ mscorefonts/ Trebuchet_ MS.ttf
sudo cp trebucbd.ttf /usr/share/fonts/truetype/ mscorefonts/ Trebuchet_ MS_Bold. ttf
sudo cp trebucbi.ttf /usr/share/fonts/truetype/ mscorefonts/ Trebuchet_ MS_Bold_ Italic. ttf
sudo cp trebucit.ttf /usr/share/fonts/truetype/ mscorefonts/ Trebuchet_ MS_Italic. ttf
sudo cp verdanab.ttf /usr/share/fonts/truetype/ mscorefonts/ Verdana_ Bold.ttf
sudo cp verdanai.ttf /usr/share/fonts/truetype/ mscorefonts/ Verdana_ Italic. ttf
sudo cp verdanaz.ttf /usr/share/fonts/truetype/ mscorefonts/ Verdana_ Bold_Italic. ttf
sudo cp verdana.ttf /usr/share/fonts/truetype/ mscorefonts/ Verdana. ttf
sudo cp webdings.ttf /usr/share/fonts/truetype/ mscorefonts/ Webdings. ttf #Clean up
cd ~
rm -r /tmp/mscorefonts