2007年11月29日 星期四

[Linux文件] vsftpd 安裝與設定

通常fedora有內建,如果沒裝到,
請去抓rpm或是用yum安裝,

#yum install vsftpd

安裝好後,請下

#/etc/init.d/vsftpd start
#netstat -tulnp| grep 21

最後面的參數可以改成restart、stop等等
第二行指令可以看是否開啟成功。
但是因為fedora7內建SELinux設定關係,
ftp服務會被擋掉,所以在連進ftp時,
會出現下面的錯誤訊息
"500 OOPS: cannot change directory:/home/xxxxxx "

請到 系統->管理->Fire and SELinux裡面,
把防火牆和selinux關掉,
再連線就ok了!

http://linux.vbird.org/linux_server/0410vsftpd.php#server
--

2007年11月28日 星期三

[Linux文件] 星際譯王 安裝

官方網站:
http://stardict.sourceforge.net/

在fedora7中不一定會安裝到這軟體
在官方網站download那裡,可以下載最新fedora的rpm安裝檔,
# rpm -ivh star...
可惜會少一些相關套件,一個一個找太麻煩 = =

# yum search stardict
列出可以下載的正式名稱
# yum install stardict
就可以安裝主程式和三、四個相關套件了

程式安裝完畢後,再到官網dictionary區中把字典下回來,
rpm檔的話,直接下指令安裝就可以了^^

2007年11月24日 星期六

[Linux文件] VNC Server設定

參考網頁
http://fedoranews.org/tchung/vnc/index.shtml
-----------------------------------
What is VNC?

VNC stands for Virtual Network Computing. It is remote control software which
allows you to view and interact with one computer (the "server") using a
simple program (the "viewer") on another computer anywhere on the Internet.
The two computers don't even have to be the same type, so for example you can
use VNC to view an office Linux machine on your Windows PC at home. VNC is
freely and publicly available and is in widespread active use by millions
throughout industry, academia and privately.

For more information, please visit http://www.realvnc.com/

Do I have it in my system?

Type following command to check if you have the client and server installed
in your system.

[tchung@tchung101 tchung]$ rpm -q vnc vnc-server
vnc-4.0-0.beta4.3.2
vnc-server-4.0-0.beta4.3.2
[tchung@tchung101 tchung]$

--------------------------------------換頁
To configure vncserver as a service on your system, add yourself in following
config file.

[tchung@tchung101 tchung]$ sudo vi /etc/sysconfig/vncservers

# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# URL:http://www.uk.research.att.com/vnc/sshvnc.html


# VNCSERVERS="1:myusername"
VNCSERVERS="1:tchung"

--------------------------------------換頁
Before starting vncserver as a service, let's create a vnc password with
vncpasswd command.
Notice it creates a hidden directory .vnc under your home account with file
passwd which contains your vnc password.

[tchung@tchung101 tchung]$ vncpasswd
Password:
Verify:
[tchung@tchung101 tchung]$ ls -d .vnc
.vnc
[tchung@tchung101 tchung]$ ls .vnc
passwd
[tchung@tchung101 tchung]$

--------------------------------------換頁
Now let's start vncserver as a service.

[tchung@tchung101 tchung]$ sudo /sbin/service vncserver start
Starting VNC server: 1:tchung [ OK ]
[tchung@tchung101 tchung]$

Take a look at the contents of .vnc directory now. You should have something
similiar to following.

[tchung@tchung101 tchung]$ cd .vnc
[tchung@tchung101 .vnc]$ ls
passwd tchung101:1.log tchung101:1.pid xstartup
[tchung@tchung101 .vnc]$

If you edit the script called xstartup, you will notice following comment in
red.
Uncomment those two lines in red as shown below!!! Otherwise, you will get
nothing but grey screen.

#!/bin/sh


# Uncomment the following two lines for normal desktop:

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc


[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

----------------------------------------換頁
Since we've just edited vnc startup script, let's restart the vncserver.

[tchung@tchung101 tchung]$ sudo /sbin/service vncserver restart
Shutting down VNC server: 1:tchung [ OK ]
Starting VNC server: 1:tchung [ OK ]
[tchung@tchung101 tchung]$

So how do I connect to vncserver? Use vncviewer command in vnc client as
following.

[tchung@tchung101 tchung]$ vncviewer localhost:1

Enter your vnc password and here is the result: Screenshot
UPDATE:
To connect to a remote system with firewall, port 5901 needs to be open.
Add following line in red to open port 5901 and restart iptables service.

[tchung@tchung101 tchung]$ sudo vi /etc/sysconfig/iptables

# Firewall configuration written by redhat-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j
ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT

[tchung@tchung101 tchung]$ sudo /sbin/service iptables restart
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
Applying iptables firewall rules: [ OK ]
[tchung@tchung101 tchung]$

TIP by Forrest Taylor

To enable two different users in vncservers:


VNCSERVERS="1:tchung 2:thomasc"

You will, of course have to run vncpasswd for both users. Also in your
firewall update, you may want to clarify that VNC uses port 5901 for
connection 1. If you had both users above, you would have to have ports 5901
and 5902 open.

2007年11月16日 星期五

[Linux文件] ns2 安裝

1. http://www.isi.edu/nsnam/ns/
到官方網站下載allinone這個檔案。

2.到root資料夾,解壓縮tar檔
tar -zxvf ns...

3. cd ns...
./install
等它跑完

4.將bash檔覆蓋到家目錄
export
PATH=/root/ns-allinone-2.31/bin:/root/ns-allinone-2.31/tcl8.4.14/unix:/root/ns-a
llinone-2.31/tk8.4.14/unix:$PATH
export
LD_LIBRARY_PATH=/root/ns-allinone-2.31/otcl-1.13:/root/ns-allinone-2.31/lib
export
TCL_LIBRARY=/root/ns-allinone-2.31/tcl8.4.14/library:/usr/local/gcc-3.4.0/lib

5.登出再登入,讓它載入新的設定檔

6.到 /root/ns.../ns.../tcl/ex
這是範例資料夾,執行下面指令測試是否可以run起來
ns nam-example.tcl

7.可以run,大功告成。

2007年11月14日 星期三

[Windows]星際譯王 安裝

StarDict 星際譯王是一款免費且跨平台(Linux, FreeBSD, Solaris, Windows)的翻譯軟
體,有許多熱心的人為它貢獻了各式各樣的字典,除了繁簡中英日文外,其他像是佛教字
典或一些專有領域字典都有。若是下載了語音檔,它也能發音喔~底下我列出安裝步驟,
不過為了能下載到最新的版本,建議你上官方網站下載。另外這裡有一篇好心人寫的詳細
教學,推薦給各位。

* 首先要安裝 GTK+ 執行環境,下載點在
http://prdownloads.sourceforge.net/gimp-win/gtk%2B-2.8.15-setup.zip?download
* 然後安裝主程式,下載點在
http://prdownloads.sourceforge.net/stardict/stardict-2.4.7.exe?download
* 若你要發音功能,就下載
http://prdownloads.sourceforge.net/stardict/WyabdcRealPeopleTTS.tar.bz2?downloa
d
,用 WinRAR 或其他解壓縮軟體把它解壓縮到 C:\Program files\StarDict\ 底下。
* 字典在 http://stardict.sourceforge.net/Dictionaries.php 下載,網頁上方有
列出各種類型,其中 ja 是日文字典。
* 把下載的 tarball 檔用 WinRAR 解壓縮到 C:\Program files\stardict\dic\ 底
下即可。


前不久推出了新版本,詳細資料可到這裡看:
http://stardict.sourceforge.net/ChangeLog,在這裡列出幾點我覺得比較重要的更新
重點。

* 之前移到簡體跟日文會當掉的問題已修正。
---------------------------------------------------------------------------
目前我用的字型是 Tahoma,可以正確顯示繁簡中文、音標、日文。另外有個字型叫
Arial Unicode MS 也不錯,似乎只要安裝 Office 2K/XP/2003 就會有了。

另外我目前有安裝的字典有 CDICT5 英漢辭典、CEDICT 漢英辭典、JCEDICT、朗道漢英字
典5.0、朗道英漢字典5.0,已非常夠用。提醒各位不要裝太多用不到的字典,會大大拖慢
程式啟動時間。另外這裡也有教你如何更快速的啟動 StarDict。還有一篇好心人寫的詳
細教學 ,推薦給各位。
-----------------------------------------------------
如果使用時,有很多音標出不來,到右下"偏好設定"->"字型"->選自設字型選Tahoma
就可以正確顯示音標了!
* 可監視剪貼簿。
* 加入 Acrobat 的 plugin,可以邊看 PDF 邊翻譯了 (可是我試不出來,有誰會的
教一下)
* 全文檢索功能 (這我也不知道是什麼)
* 新增了一些字典。

還沒更新或還沒用過的人快去試看看吧:)
---------------------------------------------
記得解壓縮字典檔時,要解壓兩次才會是程式可用字典檔

2007年11月10日 星期六

yum不能使用解法

有時執行yum指令會出發下列訊息,

[root@localhost Casanoba]# yum search virtualbox
Loading "installonlyn" plugin
Existing lock /var/run/yum.pid: another copy is running. Aborting.

此時可以使用 # ps aux | grep yum
來找到那個程序有關yum,然後再用kill殺掉它,
root 2499 0.0 1.0 25328 10464 ? S 20:23 0:00
/usr/bin/python /usr/sbin/yum-updatesd
root 3353 0.0 0.0 4988 676 pts/1 R+ 20:51 0:00 grep yum


# kill 2499
這樣處理後,就可以使用yum指令了。