2011年1月26日 星期三

(尚未設定標題)

環境設定:全新安裝的Fedora 14,並更新到最新版


# yum -y update


重開機讓部分更新設定生效( 這很重要喔!! 如果更新系統一定要記得做這個動作! )


# sync;sync;sync;reboot


安裝 wine


# yum -y install wine


下載utorrent,我一開始用 wine + µTorrent Stable (2.2) 竟然裝不起來, 所以我就下載了beta版的 µTorrent beta (2.2.1 build 24266)
# cd ~
# wget http://download.utorrent.com/beta/utorrent-2.2.1-beta-beta-24266.upx.exe


設定開機跑 runlevel 3


# vim /etc/inittab
id:3:initdefault:


檢查 vnc-server 執行狀態


# netstat -tnlp | grep vnc


tcp        0      0 0.0.0.0:6000                0.0.0.0:*                   LISTEN      1351/Xvnc
tcp        0      0 0.0.0.0:6001                0.0.0.0:*                   LISTEN      1379/Xvnc


使用VNC連線到桌面環境


vnc1 


應用程式-->Wine-->Wine Software Uninstaller


wine 


安裝 -> 點選剛剛下載的utorrent -> 開啟


w2 


之後就一直下一步就安裝完成了


重頭戲來了!接下在教大家怎麼在Fedora 14 中使用µTorrent 的 WebUI


影像 8.jpg 


如上圖,點選 uTorrent的功能表中的選項(O) -> 選項 可出現設定畫面


請依照圖中設定方式先設定好網頁介面的選項


接下來開啟瀏覽器: http://IP:8080/gui 


他會跟你說 

" The µTorrent WebUI does not seem to be installed. Click here to try to install it, or see the guide for more details. "

但是點選 here 安裝時又會告訴你....


" There was a problem installing µTorrent WebUI, please see the µTorrent log for more details."


發生錯誤!


這是因為我們是在wine的環境中執行uTorrent,所以只要手動去下載WebUI放到相對應的資料夾就可以了


# cd ~/.wine/drive_c/users/user1/Application\ Data/uTorrent/


# wget 


2011年1月25日 星期二

lftp顯示中文目錄和切換中文目錄

lftp在顯示中文目錄和切換中文目錄時會有問題


解決的辦法如下


# vim ~/.lftp/rc


debug 3
set ftp:charset Big-5
set file:charset UTF-8


這樣就OK了


2011年1月24日 星期一

Fedora 14 安裝 rtorrent

rtorrent 介紹:


rtorrent 是一個可以在文字介面下使用的BT軟體


效能跟傳輸效率都是一流的


現在介紹給大家使用!


 


官方網站:http://libtorrent.rakshasa.no/


 




 


安裝環境 : Fedora core 14


 


安裝 rtorrent libtorrent


# yum -y install rtorrent libtorrent


 


autodl-setup


2011年1月21日 星期五

CentOS 5.5 / Fedora 14 安裝 VNC Server

以前寫過CentOS5 安裝vnc筆記
不知道為什麼會寫的"落落長"

這次來做個更新吧!


安裝VNC Server


# yum -y install vnc-server


修改vnc server設定檔,100這個值可以自訂,意思是說VNC Service啟動時的port(5900+100),5900可以用瀏覽器連http://IP:5900 (Fedora 不行)


# vim /etc/sysconfig/vncservers

VNCSERVERS="100:user1 101:user2" # 設定 user1 和 user2 的VNC
VNCSERVERARGS[100]="-geometry 1024x768" # 指定解析度

注意: 此範例中的user1,user2 必須是系統中的使用者帳號才能使用喔


使用 vncpasswd 設定vnc連線密碼,這邊要注意我們在上一步驟設定了VNCSERVERS="100:user1",所以我們要先su切換成 user1


 # su - user1
$ vncpasswd
Password: #輸入vnc連線的密碼
Verify: #再輸入一次


切換回root並啟動VNC Server


$ exit
# /etc/init.d/rc.d/vncserver start
正在啟動 VNC 伺服器: 100:user1
New 'test01.domain.com:100 (user1)' desktop is test01.domain.com:100

Starting applications specified in /home/user1/.vnc/xstartup
Log file is /home/user1/.vnc/test01.domain.com:100.log
[ 確定 ]
# chkconfig --level 35 vncserver on // 開機自動啟動

vnc1


這樣user1就可透過VNC Client(vnc viewer)使用port 6000(5900+100)連上VNC Server了;瀏覽器連5900。


 


如果你的作業系統是Fedora,到此就完成了。


CentOS 5必須在修改一個檔案,讓醜醜的X-windows變成美美的GNOME or KDE


#vi ~/.vnc/xstartup
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER #將此行 mark 拿掉
exec /etc/X11/xinit/xinitrc #將此行 mark 拿掉


修改後重新啟動VNC Server


# /etc/init.d/rc.d/vncserver restart
正在關閉 VNC 伺服器: 100:user1 [ 確定 ]
正在啟動 VNC 伺服器: 100:user1
New 'test01.domain.com:100 (user1)' desktop is test01.domain.com:100

Starting applications specified in /home/user1/.vnc/xstartup
Log file is /home/user1/.vnc/test01.domain.com:100.log
[ 確定 ]


大功告成!


2011年1月20日 星期四

清除OpenNMS數據庫

停止opennms服務


# service opennms stop


切換成postgres使用者


# su - postgres


刪除 opennms 數據庫


 $ dropdb opennms
$ exit 


重新建立opennms數據庫


# $OPENNMS_HOME/bin/install -dis


啟動opennms


# service opennms start

2011年1月18日 星期二

wget 設定 proxy 連線

因為學網連國外很慢


每次wget 抓東西都很慢


查了一下怎麼用wget 設定proxy


#vim /etc/wgetrc


http_proxy=http://x.x.x.x:3128/

ftp_proxy = http://x.x.x.x:3128/

use_proxy = on


 


Linux製作ISO檔的方法

每次都會忘記...


還是把它紀錄下來吧..


 


方法一 


用法: cp 光碟來源 ISO檔儲存位置


ex: cp /dev/cdrom /tmp/xp.iso


 


方法二


用法: dd if=光碟來源 of=ISO檔儲存位置 bs=512


ex: dd if=/dev/cdrom of=/tmp/xp.iso bs=512


 


記得放光碟啊....


如何在 golang 裡面引用 gitlab private repo

參考文章:https://stackoverflow.com/questions/27500861/whats-the-proper-way-to-go-get-a-private-repository 原文是用 gitlab.company.com 當範例,這邊改成一般帳號...