install python 2.7 , gevent on centos 5 x86_64

Posted: 4th August 2010 by admin in Linux How to
# yum install gcc gcc-c++.x86_64 compat-gcc-34-c++.x86_64 openssl-devel.x86_64 zlib*.x86_64

install python 2.7

# wget http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2
# tar -xvjf Python-2.7.tar.bz2
# cd Python*
# ./configure --prefix=/opt/python27
# make
# make install
# vi ~/.bash_profile

replace PATH=$PATH:$HOME/bin
with PATH=$PATH:$HOME/bin:/opt/python27/bin

reload .bash_profile

# source ~/.bash_profile
# echo "/opt/python27/lib" > /etc/ld.so.conf.d/python27.conf
# ldconfig

install setuptool

# cd ~
# wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
# sh setuptools-0.6c11-py2.7.egg

install gevent

# yum install libevent.x86_64 libevent-devel.x86_64
# easy_install-2.7 greenlet
# wget http://pypi.python.org/packages/source/g/gevent/gevent-0.13.0.tar.gz
# tar -xvzf gevent-0.13.0.tar.gz
# cd gevent*
# python2.7 setup.py install

how to mount hdfs

Posted: 31st July 2010 by admin in Linux How to
ant compile-c++-libhdfs -Dislibhdfs=1
mkdir build/libhdfs
cp -r build/c++/Linux-amd64-64/lib/* build/libhdfs/
ant compile-contrib -Dislibhdfs=1 -Dfusedfs=1 -Dlibhdfs-fuse=1
ln -s /usr/local/hadoop/build/contrib/fuse-dfs/fuse_dfs* /bin/
ln -s /usr/local/hadoop/build/libhdfs/* /lib/
mkdir /mnt/hdfs

test mount

fuse_dfs_wrapper.sh dfs://hdmaster01:59995 /mnt/hdfs -d &
ls /mnt/hdfs

how to change apache product name on header

Posted: 31st July 2010 by admin in Linux How to

how to change apache product name on header

vi /apache_1.3.X/src/include/httpd.h

หา

#define SERVER_BASEVENDOR “Apache Group”
#define SERVER_BASEPRODUCT “Apache”
#define SERVER_BASEREVISION “1.3.X”
#define SERVER_BASEVERSION SERVER_BASEPRODUCT “/” SERVER_BASEREVISION

#define SERVER_PRODUCT SERVER_BASEPRODUCT
#define SERVER_REVISION SERVER_BASEREVISION
#define SERVER_VERSION SERVER_PRODUCT “/” SERVER_REVISION
enum server_token_type {
SrvTk_MIN, /* eg: Apache/1.3.0 */
SrvTk_OS, /* eg: Apache/1.3.0 (UNIX) */
SrvTk_FULL, /* eg: Apache/1.3.0 (UNIX) PHP/3.0 FooBar/1.2b */
SrvTk_PRODUCT_ONLY /* eg: Apache */
};

เปลี่ยนเป็น

#define SERVER_BASEVENDOR “Apache Group”
#define SERVER_BASEPRODUCT “Microsoft-IIS” << เปลี่ยนเป็นอะไรก็ได้ #define SERVER_BASEREVISION "6.0" << เปลี่ยนเป็นอะไรก็ได้ #define SERVER_BASEVERSION SERVER_BASEPRODUCT "/" SERVER_BASEREVISION #define SERVER_PRODUCT SERVER_BASEPRODUCT #define SERVER_REVISION SERVER_BASEREVISION #define SERVER_VERSION SERVER_PRODUCT "/" SERVER_REVISION enum server_token_type { SrvTk_MIN, /* eg: Apache/1.3.0 */ SrvTk_OS, /* eg: Apache/1.3.0 (UNIX) */ SrvTk_FULL, /* eg: Apache/1.3.0 (UNIX) PHP/3.0 FooBar/1.2b */ SrvTk_PRODUCT_ONLY /* eg: Apache */ }; เซพแล้ว compile ใหม่ เพิ่ม ServerTokens Min ใน httpd.conf ########################################################## #Apache Server HOW TO CHANGE Server : Apache/2.X.X TO Server : ??????? vi /httpd-2.X.X/include/ap_release.h หา #define AP_SERVER_BASEVENDOR "Apache Software Foundation" #define AP_SERVER_BASEPRODUCT "Apache" #define AP_SERVER_MAJORVERSION_NUMBER 2 #define AP_SERVER_MINORVERSION_NUMBER X #define AP_SERVER_PATCHLEVEL_NUMBER X /* #define AP_SERVER_DEVBUILD_BOOLEAN 1 */ เปลี่ยนเป็น #define AP_SERVER_BASEVENDOR "Apache Software Foundation" #define AP_SERVER_BASEPRODUCT "Microsoft-IIS/6.0" << เปลี่ยนเป็นอะไรก็ได้ #define AP_SERVER_MAJORVERSION_NUMBER 2 #define AP_SERVER_MINORVERSION_NUMBER X #define AP_SERVER_PATCHLEVEL_NUMBER X /* #define AP_SERVER_DEVBUILD_BOOLEAN 1 */ เซพแล้ว compile ใหม่ เพิ่ม ServerTokens Prod ใน httpd.conf เคยเขียนไว้เองใน thaibsd
เอามาเก็บไว้เผื่อมีคนจะใช้

mount iso on solaris

Posted: 30th July 2010 by admin in Linux How to

two command

lofiadm -a /root/my.iso
mount -F hsfs -o ro /dev/lofi/1 /mnt/cdrom

one command

mount -F hsfs -o ro `lofiadm -a /root/my.iso` /mnt/cdrom

zfs basic command

Posted: 30th July 2010 by admin in Linux How to
zpool create mypool /dev/dsk/c0t0d0
zfs list
zfs mount mypool
zfs unmount mypool
zfs create mypool/test
zfs destroy mypool/test
zfs rename mypool/test mypool/test2
zfs set canmount=off mypool
zfs set mountpoint=/home mypool
zfs set compression=on mypool
zfs set atime=off mypool
zfs set quota=1G mypool/test

bash: rsync: command not found

Posted: 29th July 2010 by admin in Linux How to

bash: rsync: command not found

fix by add –rsync-path=PATH

Edit ld.config on solaris 10

Posted: 28th July 2010 by admin in system

Edit Default Library Path on solaris 10
type “crle” for list Default Library Path

crle

Configuration file [version 4]: /var/ld/ld.config
Default Library Path (ELF): /usr/local/lib:/lib:/usr/lib
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)

Command line:
crle -c /var/ld/ld.config -l /usr/local/lib:/lib:/usr/lib

type “crle -c /var/ld/ld.config -l /usr/local/lib:/lib:/usr/lib” to change Default Library Path

crle -c /var/ld/ld.config -l /usr/local/lib:/lib:/usr/lib

Install and config Java on gentoo linux

Posted: 6th July 2010 by admin in Linux How to

Install JDK

emerge virtual/jdk

Config JVM

java-config --list-available-vms
java-config --set-system-vm  ???

enable php curl proxy

Posted: 2nd January 2010 by admin in php

curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY,”$host:$port”);

ubuntu build essential

Posted: 2nd January 2010 by admin in system
apt-get install build-essential