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

2010/08/08

Network Manager 的bug ??

openSUSE 11.3在休眠後網路居然就不會通了!?
Network Manage 顯示 disabled
但切換回傳統的ifup,網路又回復正常

上網查到,似乎是個經典問題了
解決方式就是刪掉 /var/lib/NetworkManager/NetworkManager.state
或是修改這個檔
[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true



刪掉或修改完畢,再重新啟動Network Manager即可

2010/07/31

冏到的重灌經驗

心血來潮地重新安裝電腦作業系統
原本的計畫是:先裝 Windows 7,再裝 Windows Server 2008,最後安裝 openSUSE 11.3
如此一來 boot manager將會是 openSUSE的grub
其選單會有 openSUSE、Failsafe和 Windows三項
選擇 Windows就可切換到 windows boot manager, 挑選 Windows 7或 Windows Server 2008進行開機

將要安裝 Windows Server 2008時,在微軟網站上看到 Hyper-V Server 2008 R2
一時不察,想著 R2比較新,裝這個好了...下載後進行安裝
想不到 Hyper-V Server 2008 R2是類似 Server Core的方式,以指令列管理...冏!
心想,先放著吧,再想辦法解決....繼續安裝 openSUSE 11.3

隔天,再拿到 Windows Server 2008 R2準備安裝
錯就錯在這個地方了
我只掛念著,要安裝在先前 Hyper-V Server 2008 R2所在的分割區,不要動到其他分割
卻忘了 windows boot manager會直接安裝在 mbr
結果就是...開機之後直接進入 Windows Server 2008 R2

仔細思考後開始動手!
一、應該要先把 Windows 7的選單加入到 windows boot manager中
在 version 6之後,windows boot manager都放在名為"系統保留"的 system partition,
而且要以 bcdedit進行編輯,無法像先前版本的 boot.ini可以用文字編輯器處理
若直接從 grub著手,它還是只會認得 Windows Server 2008 R2

要編輯 windows boot manager,得利用 bcdedit
bcdedit /v 先確認有無相關的 identifier,若有即可直接編輯,可是因為我是後來"再"裝上 Windows Server 2008 R2,似乎它將先前的記錄全部清掉了
這時只好請出原版光碟進行修復

不必做什麼動作,在自動檢查後,就會提示已經修復完畢,要求重開機,開機時就看到二個選單了!!

二、安裝 grub
放入 openSUSE的光碟並重新啟動後,選擇 resecure system

原本以為直接 grub-install /dev/sda6就可以收工了
但卻一直出現 does not have any corresponding BIOS drive的錯誤訊息
網路上是說 device map的錯,要下達 grun-install --recheck /dev/sda6

搞定後,再編輯 /boot/grub/menu.lst
把 grub抓到的三個 Windows 處理一下
三個?一個是系統分割,一個是 Windows 7,另一個是 Windows Server 2008 R2
後二者只是 boot partition,無法開機

總之,終於收工了!

2010/07/02

Linux上的即時通訊軟體

裝好ubuntu 10.04
內建的IM是 empathy
感覺上和pidgin是類似的,可同時支援多個protocol,甚至有QQ和SKYPE

另外也用了 emesene (有免安裝版本)
是比較類似 amsn,只支援MSN,介面比較好看一點點

不過這二個都沒法顯示 M群訊息中的聯絡人名稱
造成在聊天時都不知道是誰在說話
從GOOGLE找到解決方法,改一下原始碼就好了
empathy的方法:
修改 /usr/share/pyshared/papyon/conversation.py
大概在353行左右,找到
if message_type == 'text/plain':
msg = ConversationMessage(unicode(message.body, message_encoding),
TextFormat.parse(message_formatting),
self.__last_received_msn_objects)
try:
display_name = message.get_header('P4-Context')


在 if之後 msg= 那一段改成
msg = ConversationMessage(unicode(”["+message.get_header('P4-Context')+"]“+message.body, message_encoding),
TextFormat.parse(message_formatting),
self.__last_received_msn_objects)
except KeyError:
msg = ConversationMessage(unicode(message.body, message_encoding),
TextFormat.parse(message_formatting),
self.__last_received_msn_objects)


改完存檔,重新啟動 empathy應該就OK了
原本的

改過的


emesene的修改方法
修改 /usr/share/emesene/emesenelib/Switchboard.py
大約在 281行,有 X-MMS-IM-Format的那段,在charset = '' 這行後面
加上


if 'P4-Context' in header:
nick = nick + header['P4-Context']
body = header['P4-Context'] + ": " + body


修改過變成這樣

改完存檔,重新啟動 emesene 就OK了

2010/06/11

ubuntu 10.04 上的行列輸入法

ubuntu 10.04的輸入法沒有行列
而且使用的是ibus而不是gcin或scim
上網查了一下怎麼安裝...

有網路真好

sudo apt-get install ibus-array
sudo apt-get install ibus-table-array30
重開機就好了

2008/05/11

使用 cygwin

來自俊宏的客戶的怪要求
在沒有Windows Domain環境下,想要做使用者帳號管理...(不是很了解其具體目的)
原本曹老師的建議是去利用ADSLedit去修改
另外也想到說用WSH撰寫
但是這樣就捨棄了俊宏UNIX長處而去遷就Windows
後來他想到 cygwin這個軟體
就來試試看吧

Step 1 安裝cygwin
1-1 下載 http://www.cygwin.com/setup.exe
我是直接網路安裝,亦可以事先下載所需套件,在本機進行安裝
(查了一下,路徑是ftp://cygwin.com/pub/cygwin/release-2/)

1-2 選擇下載點
當然挑一個台灣的網站比較快一點
接著它會去下載(?)清單....(可能像 yum去檢查軟體套件清單吧)

1-3 選擇軟體
挑選要用的軟體囉
Net->openssh (沒有sshd的bash,就不好遠端操作啦)

Step2 設定sshd
這是在Jamyy's Weblog 查到的
在 cygwin的視窗中執行ssh-host-config
依照下列問答回應
Should privilege separation be used? (yes/no) no
Do you want to install sshd as service? (yes/no) yes
CYGWIN= (直接按 Enter 鍵接受預設值 "ntsec")
還會問你要不要建一個ssh的帳號,我是不理他...:P

cygrunsrv --start sshd 啟動 sshd 服務


其實這樣就大功搞定,如果沒有防火牆之類其他的問題
應該就可以遠端連過來了
對了,ssh 登入這台cygwin時,我的帳號是 administrator(因為沒有別的使用者)

Step 3 新增帳號
登入後下達 net user jack 123456 /add 新增一個帳號,名稱是jack,密碼是123456
但是不能馬上用這個帳號遠端登入
要再進行mkpasswd -l > /etc/passwd 進行 cygwin的/etc/paaswd變動
不過這是對要使用cygwin的user才要做的

2008/05/08

自由不是免費的午餐

在<經濟大預言>裡看到的一句話:自由不是免費的午餐"
網路上也常有人會跳出來說:"不用錢的最貴"
讓我連想到OpenSource的"FREE"
偶爾都會看到類似關於Freeware的討論...FREE不等於免費,只是讓你自由取用
有這樣一句話:Linux is free, if your time is free.
當你很有時間可以去解決Linux的拉里拉雜的問題時,你的確是可以免費地使用Linux
然而多數的使用者是"使用"電腦,而不是在"解決"電腦的問題
無怪乎OpenSource常常在學術環境或是一些宅類的人群中興盛

比對於sakana和爽爽豪,我的二位"自由工作"朋友
他們的"自由"跟他們的不固定收入大有關係
他們可以花多一點時間"工作",就可以有較多的收入
也可以"老子想休息"就跑去玩一個星期,就少了一個星期的收入
沒有固定的收入(月薪),一定會在心理上有些不安全感
然而為了強化這種安全感汲汲於工作,又常常淪於有工作沒生活
<經濟大預言>裡有個極反諷的例子--囚犯擁有最高的安全,絕對不愁吃穿,但是完全沒有自由

那,我要安全還是自由??
我自己還不確定答案是什麼
不過我爸可能是比較愛自由的....

2008/05/06

老囉,不做筆記都會忘記

找不到設定 OpenWebmail的 Title
也不知道是關鍵字下錯還是怎樣?就是找不到
回去查之前的記錄,當時也是沒找到,但事後一定有找到,只是沒寫上...>_<

現在只找到那個關鍵字詞是 @@@TITLEBAR_TEXT@@@ 或是 titlebar_text
但還是找出來在哪邊修改可以對所有語系生效
現在只好先改最常用的語系頂著先
/var/www/cgi-bin/openwebmail/etc/templates/zh_TW.UTF-8/header.template

2007/11/24

How to flush dns cache in linux

好久沒有認真的做學習了#^_^#

在 Windows裡練習 DNS的架設與實做,常會用 ipconfig/flushdns 來輔助操作
但是在 Linux的環境就一直沒有去查詢
之前都是在ifconfig裡去看 man page,但始終沒有發現類似的參數、選項
原來 linux裡有獨立的服務在負責 cache的部份 Name Service Cache Daemon
#rcnscd restart 即可

真的不能跑Virutal Host with SSL ?

文章來源 http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html

Why can't I use SSL with name-based/non-IP-based virtual hosts?

The reason is very technical, and a somewhat "chicken and egg" problem. The SSL protocol layer stays below the HTTP protocol layer and encapsulates HTTP. When an SSL connection (HTTPS) is established Apache/mod_ssl has to negotiate the SSL protocol parameters with the client. For this, mod_ssl has to consult the configuration of the virtual server (for instance it has to look for the cipher suite, the server certificate, etc.). But in order to go to the correct virtual server Apache has to know the Host HTTP header field. To do this, the HTTP request header has to be read. This cannot be done before the SSL handshake is finished, but the information is needed in order to complete the SSL handshake phase. Bingo!



Why is it not possible to use Name-Based Virtual Hosting to identify different SSL virtual hosts?

Name-Based Virtual Hosting is a very popular method of identifying different virtual hosts. It allows you to use the same IP address and the same port number for many different sites. When people move on to SSL, it seems natural to assume that the same method can be used to have lots of different SSL virtual hosts on the same server.

It comes as rather a shock to learn that it is impossible.

The reason is that the SSL protocol is a separate layer which encapsulates the HTTP protocol. So the SSL session is a separate transaction, that takes place before the HTTP session has begun. The server receives an SSL request on IP address X and port Y (usually 443). Since the SSL request does not contain any Host: field, the server has no way to decide which SSL virtual host to use. Usually, it will just use the first one it finds, which matches the port and IP address specified.

You can, of course, use Name-Based Virtual Hosting to identify many non-SSL virtual hosts (all on port 80, for example) and then have a single SSL virtual host (on port 443). But if you do this, you must make sure to put the non-SSL port number on the NameVirtualHost directive, e.g.

NameVirtualHost 192.168.1.1:80

Other workaround solutions include:

Using separate IP addresses for different SSL hosts. Using different port numbers for different SSL hosts.


所以,在 3073的LAB題組可能要留意一下了...

2007/05/12

問君能有幾副肝,恰似一串鞭炮爆不完

好累喔,終於考完了...趕在期限前完成了NCLP 10這個挑戰

剛好星期二又遇到公司 mail server掛了,當天就在公司撐到凌晨三點才回家,隔天還是準時上班
而星期四Max要上考場了,星期三晚上我們一起挑燈夜戰到天亮(四點多近五點),躺一下還是準時去上班
5月11日是王建民主投的比賽,當然要支持他囉,看到六局真的撐不下去了...應該也是四點了
星期五一早起床真的很累,心裡好掙扎,很想請假
但是骨子裡一個不認輸的念頭,讓我還是準時去上班了

至於這個考試,考試時間有180分鐘,但我真的寫到只剩5分鐘才都寫完
再快速檢查一下只剩一分鐘,就勇敢的按下 End Exam,等待結果了...

考試心得如下:
一、lag (latency)為考試內容,表示這是一個隱藏的狀況題
二、是實作題但是沒有Tab鍵可以用(還好有Ctrl + i)
三、題目不多(我遇到四個題組),但是題組間都互有關連,所以如果一個小失誤都可能影響大局
總結:NCLP 應考難度比LPI高多了...

2007/05/09

Open Webmail的幾個設定

儘量在最短時間內恢復 mail server 的運作
也把Webmail設定差不多了

一、rpm裝好後,要到/var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf
找到這三行,並修改成
dbm_ext .db
dbmopen_ext .db
dbmopen_haslock no
然後執行 /var/www/cgi-bin/openwebmail./openwebmail-tool.pl --init

二、不知道為什麼,登入後會出現 Internal Server Error
到 /var/www/cgi-bin/openwebmail/etc/openwebmail.conf
找到 enable_viruscheck ,把yes改成no
就搞定了

三、Open Webmail的設定幾乎都在 /var/www/cgi-bin/openwebmail/etc/openwebmail.conf 裡
這段就是修改登入畫面的文字
這段是預設的簽名檔
logo_url、logo_link 用來修改登入畫面的那個圖片及其連結
default_language 用來設定預設語系 (zh_TW.Big5)
default_iconset 這是按鈕的類型 (Cool3D.Chinese.Traditional)


但目前還沒找到如何修改Title的部份
 
_ _