Posts Tagged ‘linux’

SSH 斷線問題

Sunday, April 20th, 2008

最近剛搬到 Slicehost,有個大問題就是 SSH 沒放多久就自動斷線
明明隔壁視窗的 Bluehost 都放了兩天 idle 都沒斷,為啥 Slicehost 才半個小時就葛掉了
稍微找了一下 (其實我丟了一張 ticket :$),發現其實只要再 sshd 裡面修改一下就好了:
編輯 /etc/ssh/sshd_config
KeepAlive yes
ClientAliveInterval 60

還有因為我是從 Ubuntu 下面 GTerm 連過去的,所以其實還可以這樣改:
編輯 ~/.ssh/config
ServerAliveInterval 60

然後很奇妙的是,不再斷線了 XD
Bye bye SSH disconnecting every so fu*ing often :)

Ubuntu 7.10 把玩心得

Sunday, October 7th, 2007

雖然說是把玩,但是會換成 Ubuntu 的原因也主要是因為工作需要。換成 Ubuntu 後最棒的事情就是我覺得我的電腦又變快了 (a)。雖然說我現在還是保持著 Vista 跟 Ubuntu 的 Dual Boot 狀態,但是真正開 Vista 的時間實在很少。以後會開 Vista 就只會在一定要開才開的狀況下吧。我絕對不光是為了 Compiz Fusion 的絢麗畫面而跳槽的 XD

用到目前為止覺得最大的問題是 Logitech 的 Webcam 不能用。雖然偵測的型號都很正常,但是 aMSN 或者 Camorama 就是不能用。第二的大問題就是 Linux 下的多個 mixer 之間的不同。對電腦來說我現在有 3 個輸入輸出裝置,一個是主機板上的 on board 音效卡,一個是 free.2 Skype Phone,還有一個是 Logitech webcam 上的麥克風。雖然進去 Ubuntu 內建的 Mixer 把輸出裝置都改成 onboard 音效卡後,大部分的軟體都正常播放,少數卻還是沒有正常的播。影響最大的是 Firefox 裡面的 Flash 沒有聲音。好吧可能在多花點時間多爬一些文章說不定就會好了,可是很浪費時間耶。

Update: 某次 Software Update 後忽然間 Firefox 的聲音又好了

7.10 的更新很頻繁,再怎麼說幾天後就要 Release 了,每天都可以很開心的 apt-get update + upgrade 上百個剛編好的 package。用到目前覺得最好用的部份應該還是這是一台 Linux Box:伺服器的功能全部都是內建的。有 shell access 的工作站就是比 Windows Box 好用太多了。

下次回台灣來把老被老木的電腦全部灌成 Ubuntu。

Linux 好棒.. ?

Monday, October 1st, 2007

Ubuntu 真的很棒,只要妳用的東西是很熱門很多人研究過,Google 打下去就會出現很詳細 Howto 的話,那的確很棒。但是如果要用的東西不很熱門,或者是某些公司出的 linux 板程式,那很容易要裝個東西就會浪費掉一兩個小時。

剛為了要裝 Oboe Sync 3.0,被 Python、Qt3 vs Qt4、PyQt、sip 這些錯縱複雜的關係搞得很機。抓下來一個 .tar.gz 也沒說要啥 dependency 然後就只有一個 oboe_exe.py,跑了後才開始靠背少了什麼東西。

去找 PyQT 然後又跟我說要編需要 sipconfig,鬼才知道那東西是在哪個 package 裡面。繞了一大圈發現 sip 是 PyQT 同一間公司出的,靠北是不會說喔。

好不容易要開始編 sip 然後又開始靠北說三小

Error: Failed to create ./qtdirs using platform linux-g++.
Make sure your compiler is installed correctly and you have a working make on your PATH. "

最好是這種 error message 有意義。

Google 又找了一下發現是寫 configure.py 的人很白爛,qt3 和 qt4 共存的時候只會抓到 qt3 然後就爆了。又仔細的爬了一下文發現可以用 -q 選項來指定 qmake 的 absolute path,所以來找一下 qmake 在哪裡:

peter@50k:~$ which qmake
/usr/bin/qmake
peter@50k:~$ ls -al /usr/bin/qmake
lrwxrwxrwx 1 root root 23 2007-09-25 22:38 /usr/bin/qmake -> /etc/alternatives/qmake
peter@50k:~$ ls -al /etc/alternatives/qmake
lrwxrwxrwx 1 root root 18 2007-10-01 18:24 /etc/alternatives/qmake -> /usr/bin/qmake-qt3
peter@50k:~$ ls -al /usr/bin/qmake-qt3
-rwxr-xr-x 1 root root 2032164 2007-09-18 10:05 /usr/bin/qmake-qt3
peter@50k:~$ ls /usr/share/qt4/*/qmake
/usr/share/qt4/bin/qmake
peter@50k:~$ whereis qmake-qt4
qmake-qt4: /usr/bin/qmake-qt4 /usr/X11R6/bin/qmake-qt4 /usr/bin/X11/qmake-qt4 /usr/share/man/man1/qmake-qt4.1.gz

靠北夠不夠麻煩阿,Linux 想要更普及話的話,這些問題都得排除。能夠想像你媽打電話來問說要怎麼裝啥啥啥程式嗎?對啦妳可以直接 ssh 進去,那如果變成一個客服要做的時候,最好是有辦法每個 client 都給他 ssh 進去修。

沒有 .deb 的東西還是少裝,省得在那邊覺得為啥只是簡單的想要裝個程式,卻浪費了一堆冤枉時間,到頭來只是幾行沒有人跟你說的指令而已。更!

Ubuntu 7.10 條教筆記

Saturday, September 29th, 2007

nVidia TwinView

  1. 在 Restricted Drive Manager 停用 nVidia 的 Driver
  2. 去 nVidia 官方網站抓最新的 Linux Driver 讓他裝
  3. 在 Restricted Drive Manager 啟用 nVidia 的 Driver
  4. 用 nVidia X Server Setting 來設定 TwinView

Screenshot-NVIDIA X Server Settings

FASTTRAK 378 RAID 0

  1. 安裝 dmraid: sudo apt-get install dmraid
  2. 建立 mount point: sudo mkdir /media/raid0
  3. 測試: sudo mount /dev/mapper/pdc_cbchadihee1 /media/raid0
  4. 最後再把這個 mount point 寫入 /etc/fstab 讓下次重開時候自動 mount

GCIN

  1. 在 Synaptic 裡面把 SCIM uninstall 掉然後安裝 GCIN
  2. 在 shell 裡面輸入 im-switch -s gcin
  3. 把 ~/.gtkrc.mine 改成:

    export GTK_IM_MODULE=gcin
    export LC_CTYPE=”zh_TW.UTF-8″

  4. 登出再登入

Sound

  1. 打開 System / Preferences / Sound
  2. 把 Sound playback 選成 VIA 8237

Desktop Effect

  1. sudo apt-get install ccsm
  2. System / Advanced Desktop Effects Settings

Screenshot-CompizConfig Settings Manager

Fonts

  1. 安裝微軟正黑體:

    sudo cp msjh* /usr/share/fonts
    sudo chmod o+rx /usr/share/fonts/msjh*
    sudo fc-cache -f -v

  2. 打開 Firefox: Edit / Preferences 然後把所有字體預設都改成 Microsoft JhengHei 省得麻煩

sshfs

sudo apt-get install sshfs
adduser peter fuse

GDM Dead Keyboard
這個奇怪的問題似乎有人碰過: Keyboard not funtioning at login。問題應該是像上面那篇文章寫的一樣,不知道為什麼 gdm 會比其他的 getty 開啟的更早,導致 keyboard 的控制被 getty 拿去,然後 gdm 下啥都不能做了囧。我用比較簡單的解法:

  1. 把 gdm 預設關閉:mv /etc/rc2.d/S30gdm /etc/rc2.d/K70gdm
  2. 在 /etc/rc.local 加入:service gdm start

Wine + Wine Doors

  1. Wine:

    wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
    sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/feisty.list -O /etc/apt/sources.list.d/winehq.list
    sudo apt-get update
    sudp apt-get install wine

  2. Wine Doors: 去這裡下載最新的 deb 然後讓 Package Manager 自動安裝

Microsoft IntelliMouse Explorer

  1. 修改 /etc/X11/xorg.conf:

    Section “InputDevice”
    Identifier “Mouse0″
    Driver “mouse”
    Option “CorePointer”
    Option “Device” “/dev/psaux”
    Option “Protocol” “ExplorerPS/2″
    Option “Buttons” “7″Option ”
    ButtonMapping” “1 2 3 4 5″
    Option “ZAxisMapping” “6 7″
    Option “Resolution” “100″
    EndSection

  2. 安裝 imwheel: sudo apt-get install imwheel
  3. 修改 /etc/X11/imwheel/imwheelrc:

    “.*” None,Up,Alt_L|Left None,Down,Alt_L|Right”^firefox-bin$”
    None,Left,Alt_L|Left
    None,Right,Alt_L|Right

  4. 新增 /etc/X11/Xsession.d/57xmodmap:
    #/bin/bash
    xmodmap -e “pointer = 1 2 3 6 7 4 5″

  5. 把 /etc/X11/Xsession.d/57xmodmap 改成執行檔: sudo chmod 755 /etc/X11/Xsession.d/57xmodmapservice

PHP 5.2.1 on FC4 x86_64 compile note

Saturday, April 21st, 2007

Linking libraries from its default location

ln -s /usr/include /opt/include
ln -s /usr/lib64 /opt/lib

Now configuring with new location:

./configure --prefix=/usr/local --enable-force-cgi-redirect --enable-fastcgi --with-libxml --with-zlib --with-bz2 --with-curl  --with-gd --enable-mbstring --with-mysql --with-jpeg-dir=/opt --with-png-dir=/opt --with-mysql=/opt
All Rights Reserved Copyright © 2008 Design by StyleShout and Clazh