Posts Tagged ‘howto’

python-pycurl on Shared Host

Friday, March 21st, 2008

編 Python 2.5, MySQLdb 都很輕鬆
就 make –prefix=~/ 和 python setup.py install 而已
但是 pycurl 讓我浪費了好多個小時的人生

我一直碰到的問題是這樣:

# python
Python 2.5.2 (r252:60911, Mar 21 2008, 05:12:12)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycurl
Traceback (most recent call last):
File "“, line 1, in
ImportError: libcurl.so.4: cannot open shared object file: No such file or directory
>>>

把浪費的時間跳過,總之就是 pycurl 沒寫好 (怨念總是得目標來發洩)
setup 時候的 –curl-config 就跟你說在 ~/lib 了,還去 /usr/lib 下面找 libcurl.so.4
好吧或許摸 unix 環境的時間還不夠久,總之最後發現只要這樣子就解決掉了

export LD_LIBRARY_PATH=~/lib

真是浪費生命

Microsoft Scroll Wheel Speed in GNOME

Tuesday, March 18th, 2008

我的 Microsoft Wireless Laser Mouse 6000 在 GNOME 裡面一直有捲動的問題

簡單說就是輕輕碰到 scroll wheel 就會捲個整個畫面,非常的無法使用

剛剛在覺得很煩的時候下定決心去找一下,看看 GNOME 裡面有沒有選項來改變

找到了這篇: Change scroll wheel speed

裡面內容大致就是說那滑鼠會那麼敏感是因為發送出 multiple event

解法就是在 Linux 下面拔起來再重新插回去就好了

Wireless Receiver 似乎是在 Windows 下面時候會跟 Driver 談好送 multiple event

而 GNOME 下面還不認識那些 Event,就會造成捲動大暴走

aMSN with TrueType Fonts

Wednesday, October 31st, 2007

Ubuntu 7.10 裡面的 aMSN 雖然是 0.97RC,但是還是沒有預設把 anti-aliasing 打開,所以整個字型醜的快要爆炸囧。3v1n0 裡面的 amsn deb 的確是有把 tk/tcl 編進去,只要點幾下把所有 package 都裝進去就可以有漂亮的字型,但是那個版本不知道為什麼一直會讓我 CPU 衝滿。所以決定乾脆自己抓下來編省得麻煩。

省得要 root 權限或以後更新跟系統衝突,所以我把東西都安裝在自己的 home directory 下面。原始碼我都丟在 ~/work 下面,然後編好的執行檔是安裝到 ~/build 下面。

TCL

  1. 在 ~/work 下面將 TCL 的原始碼抓下來

    cvs -d:pserver:anonymous@tcl.cvs.sourceforge.net:/cvsroot/tcl login
    ENTER
    cvs -z3 -d:pserver:anonymous@tcl.cvs.sourceforge.net:/cvsroot/tcl co -P tcl

  2. 在 ~/work/tcl/unix 設定 + 編譯

    ./configure –prefix=/home/peter/build –includedir=/home/peter/build/include/tcl8.5 –enable-shared –enable-threads –enable-64bit –mandir=/home/peter/build/share/man –enable-man-symlinks –enable-man-compression=gzip && make CFLAGS=”-g -O2 -D_REENTRANT”

  3. 安裝

    make install

TK

  1. 在 ~/work 下面把 TK 的原始碼抓下來

    cvs -d:pserver:anonymous@tktoolkit.cvs.sourceforge.net:/cvsroot/tktoolkit login
    ENTER
    cvs -z3 -d:pserver:anonymous@tktoolkit.cvs.sourceforge.net:/cvsroot/tktoolkit co -P tk

  2. 在 ~/work/tk/unix 下設定 + 編譯

    ./configure –prefix=/home/peter/build –includedir=/home/peter/build/include/tcl8.5 –with-tcl=/home/peter/build/lib –enable-shared –enable-threads –enable-64bit –enable-man-symlinks –enable-man-compression=gzip –enable-xft && make CFLAGS=”-g -O2 -D_REENTRANT”

  3. 安裝

    make install

aMSN

  1. 在 ~/work 把 aMSN 的原始碼抓下來

    svn co https://amsn.svn.sourceforge.net/svnroot/amsn/trunk/amsn amsn

  2. 在 ~/work/amsn 下設定 + 編譯

    ./configure –with-tcl=/home/peter/build/lib –with-tk=/home/peter/build/lib –prefix=/home/peter/build
    make

  3. 安裝

    make install

桌面捷徑

  1. 建立 ~/bin/amsn.sh 並把 amsn.sh 設成執行檔

    #!/bin/sh
    /home/peter/build/bin/wish8.5 /home/peter/build/bin/amsn

  2. 建立 ~/Desktop/aMSN.desktop

    [Desktop Entry]
    Version=1.0
    Encoding=UTF-8
    Name=aMSN
    Comment=Flock Web Browser
    Exec=”/home/peter/bin/amsn.sh”
    GenericName=aMSN
    Icon=/home/peter/work/amsn/desktop-icons/128×128/apps/amsn.png
    Path=$HOME/work/amsn
    StartupNotify=true
    Terminal=false
    TerminalOptions=
    Type=Application
    X-KDE-SubstituteUID=false
    X-KDE-Username=
    Categories=Network;Application;
    GenericName[en_US]=aMSN

效果比較

aMSN from Ubuntu 7.10aMSN + TCL/TK

aMSN Chat Window Ubuntu 7.10 no TCL/TKaMSN + TCL/TK Chat Window

Blogged with Flock

Tags: , , ,

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