顯示具有 Ubuntu 標籤的文章。 顯示所有文章
顯示具有 Ubuntu 標籤的文章。 顯示所有文章

2008/7/18

2

解決mplayer播放srt字幕的亂碼問題

發表評論
OS: Ubuntu 8.04.1

在Ubuntu中使用mplayer(或SMPlayer)播放影片,如果字幕是中文的SRT格式,可能會發生亂碼問題,這時候就必須手動編輯設定檔作點修正。

# ~/.mplayer/config
font=/usr/share/fonts/truetype/arphic/ukai.ttc
subcp=utf-8


ukai.ttc是系統中已經存在的中文字型檔,若缺少這個檔案或想使用其他自行,可以查看/usr/share/fonts/truetype資料夾中是否有其他可用字型。ttf-arphic-ukai這個套件通常是預設就安裝的,若沒有可以自己補上。

使用UTF-8的文字編碼可以讓問題少一點,但一般網路下載影片附帶的SRT檔,通常編碼都是用BIG5,這時候必須用iconv作轉換:
iconv -f big5 -t utf-8 Your_movie.srt > Your_movie.utf8.srt

2008/7/15

0

VMWare 6.0.4 Ctrl/Alt/Shift/CapsLock按鍵失效

發表評論
Bugs!!!

測試環境是 Ubuntu 8.04 + VMWare 6.0.4

快樂使用虛擬機器時,回到Ubuntu桌面發現重要的功能鍵通通失效了,Ctrl+Alt不能用讓我的3D桌面怎麼也轉不起來,Shift/Caps Lock失效讓我想打大寫字母比登天還難,當然輸入法也不能切換了,這種情況真是囧。

爬了很多forum,發現有setxkbmap似乎可以解決這個問題,正在期待下一次鍵盤失效中…(話說很想要壞掉的時候卻都不會壞!!!)


2008/7/7

0

Playing SVN with Ubuntu

發表評論
Subversion 是一套好用的版本控制工具,一般簡稱為 SVN,可跨平台、跨開發工具支援,除了作為程式碼專案的版本控制管理,拿來當文件管理、備份、分享系統也相當實用。在 SVN 成為普遍使用的工具之前,最常被使用的工具是CVS(Current Version System),以Eclipse開發工具來說,CVS是很早就已內建支援的團隊協同(team collaboration)開發工具,而SVN通常必須加上3rd Party的延伸套件(Subclipse)才能支援(成為預設套件應該只是時間上的問題,目前3.4已經提供Subversive - SVN Team Provider,只是要另外加裝3rd Party Connectors)。由於SVN的易學易用,並有許多具親和力的圖形介面工具、可與Windows檔案瀏覽器(Explorer)整合(Tortoisesvn),即使是Visual Studio .NET的開發者,也有AnkhSVN可以選擇(當然使用人口沒微軟自家的Team System多啦)。集合起各種作業系統、開發環境平台的使用者,SVN儼然成為時下的主流。

這篇文章提供Ubuntu安裝SVN伺服器的初步說明,希望能幫助還未上手的朋友能在短時間內學會使用這個好工具。

安裝 Subversion

要善用Ubuntu超級豐富的APT套件庫,不但省時省力、日後也好維護。
sudo apt-get install subversion
一道指令解決。

設定 SVN 伺服器

自己架設伺服器也只需要很少的幾個步驟。
sudo apt-get install xinet.d
這道指令並非與SVN直接相關,而是安裝一個xinetd的daemon程式,它就像一個伺服器服務程式的管家,負責幫忙接待想透過網路連結服務的客戶。

建立新檔案在 /etc/xinet.d/svn ,檔案內容如下:
# default: off
# description: svnserve is the server part of Subversion.
# server_args = -i -r /var/lib/svn/repositories
service svn
{
disable = no
port = 3690
socket_type = stream
protocol = tcp
wait = no
user = svn
server = /usr/bin/svnserve
server_args = -i -r /home/svn
}

* /home/svn 是自行指定的 repository 存放目錄

接著建立 svn 的 user 及 home directory:
sudo mkdir /home/svn
sudo useradd -d /home/svn svn
sudo chown svn.svn /home/svn

重新啟動 xinetd ,測試SVN服務:
sudo /etc/init.d/xinetd restart
telnet localhost 3690

當telnet程式連線成功,並出現以下訊息,則表示SVN daemon已經啟動成功:
( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline svndiff1 absent-entries ) ) )

建立新的 repository

cd /home/svn
sudo svnadmin create NEW_REPO
sudo chown svn.svn NEW_REPO -R

完成之後,就能已 svn 指令(SVN client)操作。
svn list svn://localhost/NEW_REPO
當然,因為都還沒有丟檔案,回傳一定是空的。

如果要操作權限(例如有帳號密碼可讀寫,訪客只能讀不能寫),則需要編輯 NEW_REPO/conf/svnserve.conf,設定以下三行(取消註解):
anon-access = read
auth-access = write
password-db = passwd

並在 NEW_REPO/conf/passwd 下新增帳號及密碼,例如:
[users]
jacky = pwd_is_blank

---= Q&A =---

SVN server在運作一段時間後,可能出現資料庫錯誤的狀況,訊息如下:
Could not open the requested SVN filesystem

此時必須使用 db_recover 指令進行修復,以Ubuntu Linux來說,安裝db4.*-util套件即可取得此程式。

以下示範在 Ubuntu Linux 的流程:

先搜尋有哪些db4.*-util版本可以安裝。
apt-cache search db4.*-util
db4.6-util - Berkeley v4.6 Database Utilities db4.2-util - Berkeley v4.2 Database Utilities db4.3-util - Berkeley v4.3 Database Utilities db4.4-util - Berkeley v4.4 Database Utilities db4.5-util - Berkeley v4.5 Database Utilities
我選擇的是db4.4-util,因此開始apt-get安裝。
apt-get install db4.4-util

安裝完成後,就會多一道 db4.4_recover 指令,切換到 svn repository directory 下執行這道指令即可修復。

更多參考資源在:

2008/7/6

0

Google-Gadgets for Ubuntu 8.04

發表評論
Google Gadgets能幫Linux桌面添加更多樂趣,更令人興奮的是在Ubuntu中不必自己動手編譯,只要增加兩行套件來源,輕輕鬆鬆就能裝好google-gadgets。

套件來源(for google-gadgets only):
deb http://ppa.launchpad.net/googlegadgets/ubuntu hardy main
deb-src http://ppa.launchpad.net/googlegadgets/ubuntu hardy main


安裝指令:
apt-get install google-gadgets

簡單的步驟就能安裝好。現在,您需要的是能容納更多桌面小玩意的大螢幕了!


2008/7/4

0

Config Ubuntu to enable Open-SSH X11 Forwarding

發表評論
In server-side, edit "/etc/ssh/sshd_config" file, check settings below:
X11Forwarding yes
X11DisplayOffset 10


Default settings in Ubuntu hardy are X11 forwarding enabled, because of the X11Forwarding is set to yes.

If the configuration file modified, please reload sshd using "/etc/init.d/ssh restart" command.

Parameters must added when client-side using ssh command to connect remote host, two commands below will establishing X11 forwarding connection.
  • ssh -Y user@remote_hostname
  • ssh -X -C user@remote_hostname
Description of parameters is shown below.
-X Enables X11 forwarding.
-Y Enables trusted X11 forwarding.
-C Requests compression of all data.

If something was wrong, there will be some error messages when execute X11 applications on remote host, like "xclock", messages maybe like:
Error: no display specified
To solve this problem, using "ssh -X -v user@remote_hostname" to show all debug messages. This provide information like:
debug1: Remote: No xauth program; cannot forward with spoofing.
The sample error message tell us need to install "xauth" on remote host. It's a program X11 forward required. Just type "apt-get install xauth" to perform installation.

2008/4/26

2

Vodafone with Ubuntu 8.04 Hardy AMD64 完美安裝動手作

發表評論
眾所期待的Ubuntu 8.04(Hardy)終於讓大家等到release的一天,在開放下載當天我就將手邊數台電腦全部重灌新版,當然包括隨身的NB,不過每次重灌新版後的問題,就是3.5G的連線軟體必須重新安裝。

Huawei E220的連線軟體當然首推Vodafone Mobile Connect Card Driver,這套軟體讓Linux下也能享有和Windows的Mobile Connect有相似的3.5G連線、設定專用介面。Vodafone的介紹與設定調整,先前已有多篇介紹,在此就不再重提。

本次要分享的是,在Ubuntu 8.04 Hardy AMD64版本中,如何自行建立arch專屬的deb包(由於Vodafone已提供deb的相關設定,因此步驟相當簡單)。如果是安裝一般x86版本的Ubuntu,Vodafone已有提供i386 arch的deb包下載,並不需要自己動手包。

步驟一、下載所需原始安裝檔、解壓縮
wget https://forge.vodafonebetavine.net/frs/download.php/118/vodafone-mobile-connect-card-driver-for-linux_2.0.beta1.tar.gz
tar zxvf vodafone-mobile-connect-card-driver-for-linux_2.0.beta1.tar.gz
cd vodafone-mobile-connect-card-driver-for-linux-2.0.beta1

步驟二、安裝dpkg-buildpackage依賴的相關套件
sudo apt-get install dpkg-dev fakeroot build-essential debhelper python-setuptools libusb-dev

步驟三、執行dpkg-buildpackage建立deb包
dpkg-buildpackage

步驟四、安裝建立好的deb包
cd ..
dpkg -i vodafone-mobile-connect-card-driver-for-linux_2.0.beta1_amd64.deb
sudo apt-get -f install

將產生的vodafone-mobile-connect-card-driver-for-linux_2.0.beta1_amd64.deb檔案備份下來,下次重灌就不需要重新打包了(只要執行步驟四)。

2008/4/23

0

Ubuntu 8.04 Hardy DVD release

發表評論
DVD版搶先開跑…

ftp://releases.ubuntu.com/cdimage/dvd/20080423/


不過目前下載速度不快…可能要抓個一天@@

今年最期待的作業系統版本誕生!

2008/4/6

0

讓Ubuntu的pure-ftpd支援symbolic links

發表評論
在Linux系統上,建立檔案系統的符號連結(symbolic links)是很自然的一件事,這麼做帶來系統管理很多的彈性與好處。
例如將某FTP資料夾連結到家目錄中:
ln -sf /home/ftp/share ~/share
或是將不同硬碟分割區連結到同一資料夾下:
ln -sf /media/sdb1 /home/ftp/disk2
ln -sf /media/sdc1 /home/ftp/disk3

但是,Ubuntu Linux中以預設參數執行pure-ftpd時,符號連結將會失效。以FileZilla為例,錯誤訊息如下:
狀態: 正在取得目錄列表中...
指令: CWD share
回應: 550 Can't change directory to share: No such file or directory
錯誤: 無法取得目錄列表!

在Mandriva Linux系統上,預設執行pure-ftpd並沒有這種問題,而Ubuntu必須再調整設定,這個問題很多人都遇到,但google搜尋結果大多是只有問題沒有解答,今天發現其實設定很簡單:
編輯 /etc/default/pure-ftpd-common
將 VIRTUALCHROOT=false 改為 VIRTUALCHROOT=true


重新啟動pure-ftpd(/etc/init.d/pure-ftpd restart),FTP Client必須斷線重連後才會生效。

怎麼找到設定? 在 /etc/init.d/pure-ftpd 中,可以看到 virtualchroot 參數的啟用與否,是參考$VIRTUALCHROOT的設定,而這個設定值則是保存在 /etc/default/pure-ftpd-common,而一般的設定則是在 /etc/pure-ftpd/conf 資料夾下。

2008/4/2

0

*.gz Log檔的資料查詢

發表評論
Ubuntu等系統會將 /var/log/syslog 的較舊資料壓縮成syslog.N.gz檔案,若要使用grep檢索需要的資料,就必須先解壓縮才能用,但gunzip指令其實提供一個-c參數,可以將解壓縮出來的資料直接dump在console stdout,而不建立檔案,這樣用起來是比較方便的。

ex. 列出保存的syslog中,有關於pure-ftp的相關訊息紀錄:
gunzip -c /var/log/syslog.*.gz grep pure-ftp