System: 2.6.32-29-generic Ubuntu
整理如下:
需要shntool (轉換utility) mac (for handling ape), flac, ttaenc
mac: deb file in i386
ttaenc http://pkgs.org/package/ttaenc
sudo dpkg -i mac-3.99-u4_b3-1_i386.deb (for ape)
sudo dpkg -i ttaenc_3.4.1-0.1_i386.deb (for tta)
sudo apt-get install flac
sudo apt-get install shntool
use shntool to split ape according to the information in the cue file
shntool split -f image.cue -t '%n.%t' -o flac image.ape
Similarly for tta file.
* cue file needs to be utf8
Ref: Converting Monkey’s Audio (ape) to flac in Ubuntu
2011年4月20日 星期三
ubuntu 將ape或tta轉成flac
如果tw.archive.ubuntu.come一直連不到時
暫時的主機掛點
解決方法:修改source.list檔內的mirror,再update一次
cd /etc/apt/
sudo cp sources.list sources.list.backup (做個備份~之後直接換回來)
sudo vim sources.list
將tw.archive.ubuntu.com全部修改為其他的mirror site,e.g. mirror.nttu.edu.tw
(vim指令)
:1,$s/tw.archive.ubuntu.com/mirror.nttu.edu.tw/g
再update後就可以了
sudo apt-get update
2010年11月25日 星期四
ubuntu 嘸蝦米 in Ibus
Environment: ubuntu 10.10
reference
到 這裡 下載 ibus-table-boshiamy 的 deb檔安裝後
重新啟動ibus
即可在ibus輸入法選單裡看到嘸蝦米輸入法。
[自己修改字碼表的順序]
1. 下載ibus-table-boshiamy的原始檔(tag.gz or zip)
解壓縮後修改 tables/boshiamy.txt
(請注意同樣的拆碼,第三欄數字愈大的排愈前面,如果有一樣的拆碼在不同語系,第3欄數字要相同)
2.建立字碼的轉換檔:
ibus-table-createdb -s boshiamy.txt -n boshiamy.db
3. 將檔案複製到ibus讀取字碼轉換檔的位置,覆蓋原來的檔案 (不放心可先備份):
sudo cp boshiamy.db /usr/share/ibus-table/tables/
4. 重新啟動ibus
註:如果發現輸入法的圖標出不來~可能是不小心把面板小程式移除了,在面板上加入就好。
2010年4月24日 星期六
install opera/chrome browser on ubuntu
Environment: ubuntu 9.10
opera:
1. add source list in your /etc/apt/sources.list file:
sudo gedit /etc/apt/sources.list
add
deb http://deb.opera.com/opera/ stable non-free
2. import GPG package signing key
wget -O - http://deb.opera.com/archive.key | sudo apt-key add -
3. update & install
sudo apt-get update
sudo apt-get install opera
google chrome:
1. add source list in your /etc/apt/sources.list file:
sudo gedit /etc/apt/sources.list
add
deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main
2. import GPG package signing key
(for karmic user) sudo add-apt-key ppa:chromium-daily/ppa
(for lucid user)sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xfbef0d696de1c72ba5a835fe5a9bf3bb4e5e17b5
3. update & install
sudo apt-get update
sudo apt-get install chromium-browser
2010年4月3日 星期六
Missing libstdc++.so.5 in Ubuntu 9.10
今天下載了一個執行檔要執行,結果出現了
missing libstdc++.so.5 的錯誤
google了一下發現是因為ubuntu 9.10拿掉了這個library
參考了這篇網誌的內容
1.In debian's website download libstdc++5 (according to your machine&location)
wget http://debian.linux.org.tw/debian/pool/main/g/gcc-3.3/libstdc++5_3.3.6-18_i386.deb
(you can find different download source to download this package)
2. unpack this package
dpkg-deb -x libstdc++5_3.3.6-18_i386.deb ia32-libs
3. move library to /usr/lib and make a symbolic link
cd ia32-libs/usr/lib
sudo cp libstdc++.so.5.0.7 /usr/lib/
cd /usr/lib
sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5
2010年3月30日 星期二
ubuntu BusyBox problem
environment: ubuntu 9.10 with grub2 , ext4 filesystem
昨天用了shutdown讓ubuntu自動關機後,
今天從grub選單選了ubuntu要進入後,
出現了類似以下的訊息
Gave up waiting for root device. Common problems:
-Boot args (cat /proc/cmdline)
-Check rootdelay= (did the system wait long enough?)
-Check root= (did the system wait for the right device?)
-Missing modules (cat /proc/modules; ls /dev)
Alert .... /dev/disk/by-uuid/34e5c1 ... does not exist ...
似乎是因為root device找不到 所以進入了busybox
root drive is not available or not recognized while ubuntu is loading
重新用reboot重新啟動到grub的選單裡
在選單上按e進入修改
發現我原先是類似
linux /boot/vmlinuz-2.6.31-16-generic root=UUID=xxxxxxxxxxxxxxxx ro quiet splash
網路上的解法是把UUID的表示法,改成/dev/sdaX之類的表示法
(也許是UUID找不到?!)
其中 /dev/sdaX 是你安裝ubuntu的位置
p.s 如果不知道的話,可以用ubuntu live CD 進入 ubuntu裡,
在terminal打 sudo fdisk -l
假設我linux是安裝在 /dev/sda4
則這裡就要改成
linux /boot/vmlinuz-2.6.31-16-generic root=/dev/sda4 ro quiet splash
再按ctrl+x重新啟動
就可進入了。
正確進入後,要記得打上
sudo update-grub
重新更新grub
以上的解法是參考http://computergyan.wordpress.com/2009/12/31/solving-the-busybox-black-screen-problem-in-grub2ubuntu9-10/
但實際上,我一開始不是用這個解決的.....
一開始我很擔心我的資料是不是都不見了.....
所以用liveCD打開ubuntu後,試著mount -t ext4 /dev/sda4 到某處
結果資料都還在!!!那就表示只是grub無法正確的找到root device來mount
我的方法是: (參考自這裡)
1) use liveCD to enter ubuntu
2) open terminal
3) sudo mount /dev/sda4 /mnt
(將自己安裝的系統掛載到 /mnt,如果系統的 /boot 在另一個硬碟,請一併掛到 /mnt 下)
4) sudo mount –bind /dev /mnt/dev (掛載設備)
5) sudo chroot /mnt (以root的身份進到舊系統裡)
6) nano /etc/default/grub
(如果要改的話,就改這個檔案
ex: GRUB_CMDLINE_LINUX="rootdelay=90" <=加上rootdelay參數 #GRUB_HIDDEN_TIMEOUT_QUIET=true ) 7) update-grub (更新grub) 這步可能會有一些error(ex:Cannot find list of partitions!),這是由於你的雙系統的關係~ 先ignore 等下次進入ubuntu後,再執行一次update-grub後,就會重新找到windows的記錄!
8) grub-install /dev/sda 這步說明上有說要做,但因為我是以win7的開機程式為主,所以這裡grub就不寫到MBR (當初安裝時也是直接安裝在/dev/sda4裡),我就不用執行這個動作!!
9) exit (離開舊系統環境)
10) sudo umount /mnt/dev
sudo umount /mnt (依續解除剛剛的mount)
11) 重新啟動電腦~就可以進入了!!!
12) 要記得正常進入ubuntu後,要update-grub
結果在grub選單裡,按e進入查看...
發現修改後的東西就是前一個方法的內容....(把UUID的部分改成root=/dev/sda4)
所以我就在猜第一個方法可能有用.....
這裡有一篇把initramfs和BusyBox的問題分析的滿好的
可以參考一下~雖然我完全沒有採納他所講的XD但可以了解busybox的訊息之類的。
有助於分析問題。
2010年3月29日 星期一
flex builder in ubuntu
My environment: ubuntu 9.10
reference: adobe's release notes
1. install java jre if you don't have it
sudo apt-get install sun-java6-jre
p.s sun jre 1.5 above is enough
2. install eclipse (eclipse3.3 above)
sudo apt-get install eclipse
3. download eclipse plugin binary from adobe
http://labs.adobe.com/downloads/flexbuilder_linux.html
4. execute the downloaded bin
ex: sh xxxx.bin
2010年3月25日 星期四
svn
https://help.ubuntu.com/community/Subversion
安裝:
sudo apt-get install subversion libapache2-svn apache2
建立svn倉庫
sudo mkdir /home/svn
cd /home/svn
sudo mkdir myproject
sudo svnadmin create /home/svn/myproject
sudo chown -R www-data:www-data /home/svn
sudo chmod -R g+rws myproject
1)從apache看
sudo gedit /etc/apache2/mods-available/dav_svn.conf
加入
<Location /svn>
DAV svn
SVNParentPath /home/svn
SVNListParentPath On
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/subversion/passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>restart apache
sudo /etc/init.d/apache2 restart加passwd
sudo htpasswd -c /etc/subversion/passwd user_name
cat /etc/subversion/passwd (確認用)
access
svn co http://localhost/svn/myproject myproject --username user_name
2010年3月24日 星期三
自動掛載windows硬碟
1. 先找出windows硬碟代表的UIUD
sudo blkid
畫面大概像這樣
/dev/sda5: UUID="74589xxxxxxxx" LABEL="DATA" TYPE="ntfs"
2. 修改 /etc/fstab ,以便開機時能自動掛載硬碟分割
sudo gedit /etc/fstab
加入
# mount selected partition
UUID=74589xxxxxxxx /media/disk ntfs defaults 0 0
3. 建立掛載點(如果原本不存在)
sudo mkdir /media/disk
4. 檢查是否有掛載了
df
5. 測試fstab檔是否有錯,沒錯則mount
sudo mount -a
ps. 卸載方法
sudo umount /dev/sda5
2009年9月28日 星期一
mount iso file
1) Using Nautilus Scriptstwo scripts for mount iso images: mount,unmount
sudo chmod +x /home/username/mount.sh
sudo chmod +x /home/username/unmount.sh
sudo mv /home/username/mount.sh ~/.gnome2/nautilus-scripts/
sudo mv /home/username/unmount.sh ~/.gnome2/nautilus-scripts/
it will show up when you click the right button.
2) Using kernel loop module
mount:# make dir to mount
sudo mkdir /media/isoimage
# loop mount
sudo mount my.iso /media/isoimage/ -t iso9660 -o loop
unmount:sudo umount /media/isoimage
reference
2008年11月25日 星期二
GTK
為了寫mmai作業,研究了gtk+
但那時候還不知道有Glade這麼好用的工具
所以邊研究邊建立GUI搞了好久.....
Glade 是 GTK+ 圖形使用者介面產生器 (User Interface Builder for GTK+)!
好像還不錯!
這樣以後要建GUI介面都方便多了~
reference:
http://caterpillar.onlyfun.net/Gossip/GTKGossip/Glade.html
2008年11月15日 星期六
解決/usr/bin/ld: cannot find -xxxx錯誤
為了compile voip hw需要的pwlib~
發生類似的錯誤
以下引用自別人的blog的文章
"
類似/usr/bin/ld: cannot find -xxxx的錯誤有很多, 首先我們可以最簡單的判斷一下:
這類情況一般是由於缺乏某某庫文件, 又或者可能是由於已存在的庫問題版本不對造成的
一般都是解決的辦法就是安裝缺乏的devel包就可以解決, 當然還有其他的未知因素, 我們看一個實例:
我在一台裝centos5.2 x86_64的系統上配置php環境, 提示這個錯誤
"/usr/bin/ld: cannot find -lmysqlclient"
於是我安裝了
# yum -y install mysql-devel
"
像我這次是缺少 /usr/bin/ld: cannot find -ldv
我就找找有沒有像dv這樣的lib
apt-get install libdv-dev
果然就可以了^^
2008年5月12日 星期一
ie for Linux -ies4linux
http://howtoforge.com/ubuntu_internet_explorer
http://blog.pixnet.net/Nelson/post/12146305
1.modify /etc/apt/sources.list
sudo vi /etc/apt/sources.list
deb http://de.archive.ubuntu.com/ubuntu gusty universe
deb http://wine.budgetdedicated.com/apt gusty main
註:因為我剛升級成gusty版本 所以改成gusty
但如果還是feisty的話就改成feisty就好
2.安裝所需套件
sudo apt-get update
apt-get install wine cabextract
wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
tar zxvf ies4linux-latest.tar.gz
cd ies4linux-xxxxxxx (請填上解壓縮後的版本)
安裝:
如果直接執行 ./ies4linux 的話一直不能成功安裝..
試著用 ./ies4linux --nogui 也會出現問題
會出現如下的錯誤
ADVAUTH.CAB: No such file or directory
CRLUPD.CAB: No such file or directory
而且我資料夾底下真的也沒有這些檔案~
查了一下好像是ie4linux 2.99.0 新版本的問題
解決辦法:
修改 ./lib/messages.txt
gedit ./lib/messages.txt
第19行 tw . zhTW TW
改成 zh tw zhTW TW
修改 /lib/functions.sh
gedit ./lib/functions.sh
第98行從
pid=$(wget -q -b -t 1 -T 5 -U "$useragent" -o /dev/null $URL $WGETFLAGS -O "$file" | sed -e 's/[^0-9]//g')
改成
pid=$(LANG=C wget -q -b -t 1 -T 5 -U "$useragent" -o /dev/null $URL $WGETFLAGS -O "$file" | sed -e 's/[^0-9]//g')
之後執行安裝後,我會出現flash無法下載的錯誤還有權限不合
所以我就直接用sudo 並加上不要flash的tag
sudo ./ies4linux --noflash
但這一個安裝後有一個問題
每次執行ie6時都要sudo....
所以我就直接把相關的資料夾都改owner成一般的user了
cd ~/.ies4linux
sudo chown -R name:group ./bin
sudo chown -R name:group ./downloads/
sudo chown -R name:group ./ie6
XD這樣就可以以一般使用者執行ie6了XDXD
美化的部分google一下就可以有結果了
http://noviceworld.blogspot.com/2007/10/ie4linux.html
2008年5月10日 星期六
增加字型
今天升級了ubuntu 8.0多版
結果打開了pcmanx 發現是亂碼 改了一下字型成AR開頭的就可以了
但是因為不是自己以前用的所以看起來有點不習慣XD
安裝新字型 firefly的新宋體
在/etc/apt/sources.list增加
deb http://apt.debian.org.tw unstable main
sudo apt-get update
sudo apt-get install ttf-arphic-newsung
將/etc/fonts/conf.d/ttf-arphic-newsung.conf裡
copy 到/etc/fonts/fonts.conf
就會出現新宋體的字型了^^
8.04版字型變好看了~~~!!
ubuntu真的愈做愈好~~~~~!!
java+java ide
手動安裝: netbeans + jdk
參考 http://daggertim.blogspot.com/2006/10/ubuntu-java.html
1. 下載netbeans 、 jdk
http://download.netbeans.org/netbeans/6.1/final/
http://java.sun.com/javase/downloads/index.jsp
2. install jdkchmod a+x jdk-6
./jdk-6
sudo mkdir /usr/lib/jvm/jdk1.6.0_06
sudo cp -r ./jdk1.6.0_06 /usr/lib/jvm/
修改 /etc/profile 在最底下加入
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_06
export CLASSPATH=.::$JAVA_HOME/lib:$JAVA_HOME/lib/dt.jar::$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin::$PATH
2. netbeanssh netbeans-6.1-javaee-linux.sh
3. 由於netbeans開起來會有方塊一格格的亂碼
google後發現是中文字的原因mkdir $JAVA_HOME/jre/lib/fonts/fallback
cp /usr/share/fonts/truetype/fireflysung.ttf $JAVA_HOME/jre/lib/fonts/fallback/
重開netbeans
其中fireflysung.ttf不一定每個人都有這個檔案
只要替換成可以顯示中文的字型檔就可以了
ex: /usr/share/fonts/truetype/arphic資料夾底下
2008年2月16日 星期六
gedit plugins
Installation
Download both files and place them into ~/.gnome2/gedit/plugins. If the plugins directory does not exist, create it: mkdir -p ~/.gnome2/gedit/plugins
#已包裝好的plugins
sudo apt-get install gedit-plugins
#Find in Documents
Adds a side panel that allows you to search all open documents for a string. Uses grep. Download: http://www.psyguygames.com/FindInDocuments_plugin.tar.gz
#Line Tools Plugin
Provides useful line functionality to increase editing efficiency. Features include line duplication, bookmarking, and more! Gedit/LineToolsPlugin
#Class Browser
A class browser located in the side pane. Based on ctags, it supports a wide range of languages. Download: http://www.stambouliote.de/projects/gedit_plugins.html
-ctags-
sudo apt-get install exuberant-ctags gedit-plugins
Code::Blocks 暫時先安裝
其實一直以來都是用記事本加comand line..
今天才發現有這一套open source軟體可以用!!
聽說是linux的Dev C++吧!
這樣說也許不對xdxd 因為它好像是跨平台?!
google找了一下安裝方法: 原文
首先先確定已安裝gcc gdb
sudo apt-get install build-essential
sudo apt-get install gdb
1.add repositoriessudo vi /etc/apt/sources.list
加入
deb http://apt.wxwidgets.org/ gutsy-wx main
deb http://lgp203.free.fr/ubuntu/ gutsy universe
2. get the gpg key for the repos
wget -q http://lgp203.free.fr/public.key -O- | sudo apt-key add -
wget -q http://apt.wxwidgets.org/key.asc -O- | sudo apt-key add -
3. 開始安裝
sudo apt-get update
sudo apt-get install codeblocks
sudo apt-get install codeblocks-contrib # plug-in
註:若要開發 wxWidgets GUI 應用程式,下載 wxSmith plug-in(optional):
sudo apt-get install libwxsmithlib0
安裝contrib會自動帶入
vim相關
安裝vim後
修改(或建立) ~/.vimrc 增加一些好用的功能
我的 .vimrc檔備份
"顯示行號
set number
filetype on
"設定template
:colorscheme torte
syntax on
set autoindent
set smartindent
" \t 會以 4個空格代替
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
"顯示對應的括號
set showmatch
" 下面出現一列 bar.
set ls=2
set statusline=%<%f\ %m%=\ %h%r\ %-19([%p%%]\ %3l,%02c%03V%)%y
highlight StatusLine ctermfg=blue ctermbg=white
" 搜尋到的字加 hilight
" set hlsearch
set cindent
" :sp 開檔時, 上面會列出所有檔案
set wildmenu
" 可以用 {{{ }}} 縮排 Folded
set foldmethod=marker
" 會自動到最後離開的位置
if has("autocmd")
autocmd BufRead *.txt set tw=78
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif
endif
大家來學VIM(一個歷久彌新的編輯器)
記一下大概的指令
fold的操作 - 我設定為{{{ }}}之間會fold起來
折疊的操作
zo 將游標所在處的折疊打開。open。
zc 將游標所在處已打開的內容再度折疊起來。close。
zr 將全文的所有折疊依層次通通打開。reduce。
zm 將全文已打開的折疊依層次通通再折疊起來。more。
zR 作用和 zr 同,但會打開含巢狀折疊(折疊中又還有折疊)的所有折疊。
zM 作用和 zm 同,但對於巢狀折疊亦有作用。
zi 這是個切換,是折疊與不折疊指令間的切換。
zn 打開全文的所有折疊。fold none。
zN 這是 zn 的相對指令,回復所有的折疊。
多檔開啟時
:n 編輯下一個檔案。
:N 編輯前一個檔案。
2008年2月15日 星期五
Vista/win7 下安裝Ubuntu雙系統 用BCD當開機程式
cited::
實地安裝時,你有可能使用ubuntu安裝程式來分割硬碟,結果到這一步時,無法把開機程式裝在該分區。此時你需要先退出安裝程式,然後"預先"分割好你的磁區再來安裝ubuntu。可先進入windows,使用它"系統管理"中的磁區管理,把磁區分割出來(可以不用給它路徑符號,另外,也可以用邏輯磁區)。
這篇寫的真的很詳細!!!還附上圖表!!可以直接閱讀~
Ubuntu 7.10 加 Windows Vista,超華麗雙重開機
一開始還很擔心用vista的東西當作開機程式會不會有問題…
因為一直以來都是用Grub~
但是作者說的說服我了...
如果Vista要重灌也比較方便
而且就我剛剛linux一直弄不好 重灌幾次...如果是用Grub 那我不是連windows都要重灌嗎.....
所以BCD真是好選擇XD 不過它是Vista/win7限定~
大致記錄一下步驟:
1.安裝Vista:應該不用再提,大家都會裝,或電腦出貨時就裝好了。
2.分割磁區給Ubuntu:大概10GB就夠了,想裝一堆軟體就留大一點。
開始--「電腦」上按右鍵選管理,然後在磁碟上按右鍵選「壓縮磁碟區」3.安裝EasyBCD:管理Vista開機程式的好用小工具
4.備份Vista:天有不測風雲,人有旦夕手賤。 (我有還原光碟xd 這步就省略了)
5.安裝GRUB到Ubuntu磁區:最重要的步驟,千萬小心!
在最後的確認步驟中,按右下角的「Advanced」,把「用來安裝開裝程式的裝置」從(hd0)改成放Ubuntu的磁區。(我這次是sda6) 這會把Ubuntu的開機程式GRUB和Ubuntu放在一起6.執行EasyBCD加入Ubuntu磁區,大功告成。
執行EasyBCD,在「Add/Remove Entries」>「Add an Entry」下,選Linux、GRUB和你安裝Ubuntu的磁區, 取個名字,設預設的os,倒數秒數 之類的
下次開機就會出現選單