Thursday, April 30, 2009

complie tpcw java using gij

javac -classpath /root/setup/apache-tomcat-5.5.27/common/lib/servlet-api.jar:/root/setup/tpc-w/src/servlets/ *.java


gij connect mysql using jdbc

please using mysql-connector-java-3.0.17-ga-bin.jar
mysql jdbc driver version 3.1, 5.0, 5.1 all not available.

java -cp .:/root/setup/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga-bin.jar TPCW_Populate


mysql -V
mysql Ver 14.7 Distrib 4.1.12, for unknown-linux-gnu (sparc) using readline 4.3


gij --version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Tuesday, April 28, 2009

setup tomcat under sparc linux

1. install gcc, g++, gcj, gij 4.1.2
../gcc-4.1.2/configure --prefix=/opt/gcc-4.1.2 --program-suffix=4.1.2 --host=sparc-redhat-linux --build=sparc-redhat-linux --target=sparc-redhat-linux

2. install java compat

3. export JAVA_HOME=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0

4. download apache-tomcat-5.5.27.tar.gz and apache-tomcat-5.5.27-compat.tar.gz

5. vi bin/setclasspath.sh
_RUNJAVA='/opt/gcc-4.1.2/bin/gij4.1.2'

6. ./startup.sh

Sunday, April 26, 2009

rss feed xml parser

http://rssphp.net/
http://www.phpclasses.org/browse/package/3724.html

URL redirect 301 by .htaccess file


RewriteEngine On

RewriteCond %{HTTP_HOST} ^francetop.net [NC]
RewriteRule ^(.*)$ http://www.francetop.net/$1 [L,R=301]



Reference
http://www.webweaver.nu/html-tips/web-redirection.shtml

Thursday, April 23, 2009

mysql slow queries log

1. config start slow query log
vi my.cnf

[mysqld]
set-variable=long_query_time=1
log-slow-queries=/home/www/log/mysql-log-slow-queries.log

2. restart mysql server

3. setup mysqlsla
yum install perl-DBI perl-DBD-MySQL perl-DBD-Pg
wget http://hackmysql.com/scripts/mysqlsla

4. using mysqlsla parse mysql slow query log

./mysqlsla-2.03/bin/mysqlsla --user xxx --password -lt slow --ex mysql-log-slow-queries.log --socke=/tmp/mysql.sock

./mysqlsla-1.8-DEBUG --user xxx --password --slow mysql-log-slow-queries.log --socke=/tmp/mysql.sock

web server performance analysis

1. check system load
w

2. check cpu utilization
ps

3. check memory usage and swap disk usage

Monday, April 13, 2009

eAccelerator log

eAccelerator will write many log on apache error_log, link this:
EACCELERATOR hit:"/usr/local/www/xxxx.php"

To avoid this,
add option

eaccelerator.debug="0"
to your server php.ini configure.

Friday, April 10, 2009

php 301 redirect

header ('HTTP/1.1 301 Moved Permanently');
header ('Location: '.$location);

HTTP Status Code Definitions

301 Moved Permanently

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

tpcw

homepage
http://localhost:8080/tpcw/TPCW_home_interaction

Chinese character UTF8 encoding

http://theorem.ca/~mvcorks/cgi-bin/unicode.pl.cgi?start=4E00&end=9FFF
http://www.zhouhaihe.com/tool/UTF-8.htm
http://www.dc9.cn/post/85.html

Thursday, April 9, 2009

ssh

problem:

ssh_exchange_identification: Connection closed by remote host


Check /etc/hosts.allow and /etc/hosts.deny.
/etc/init.d/sshd restart

/etc/ssh/sshd_config

Monday, April 6, 2009

simics usage

  • start
./simics targets/x86-440bx/enterprise-common.simics
continue
  • copy file into simics
mkisofs -r -o setup.iso ./setup/
new-file-cdrom setup.iso
cd0.insert setup
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom

  • network
connect-real-network 10.10.0.12
list-port-forwarding-setup
connect-real-network-port-in ethernet-link=link0 target-ip=10.10.0.12 target-port=8080 host-port=4880 -tcp
ifconfig eth0 10.10.0.12 netmask 255.255.255.0 broadcast 10.10.0.255
  • setup new OS
./simics targets/sunfire/walnut-cd-install1.simics
new-file-cdrom install-sparc64-universal-2008.0.iso
cd0.insert install-sparc64-universal-2008
save-persistent-state install-phase1.state

./simics targets/sunfire/walnut-cd-install2.simics
load-persistent-state install-phase1.state
save-persistent-state install-phase2.state

./simics targets/sunfire/walnut-common.simics

bin/craff walnut-install.disk

send mail in linux server

  • send a mail
mail -v -s "test of my mail on fr" xxx@gmail.com

  • start mail service
service sendmail start

Sunday, April 5, 2009

forward ssh server's graphic display to client

  • on client:
vi /etc/ssh/ssh_config

ForwardX11 yes
  • test
firefox -no-remote


  • Reference:
http://www.ixdba.net/article/29/2026.html

website seo

http://www.seomoz.org
http://www.seomoz.org/blog/the-beginners-checklist-for-small-business-seo
http://www.seomoz.org/blog/the-beginners-checklist-for-learning-seo
http://www.seomoz.org/tools

Saturday, April 4, 2009

SVN server configure

0. setup svn
mkdir svn_dir
cd svn_dir
svnadmin create xxx_dir
svn import . file:///xxx_dir/
svnserve -d -r svn_dir
svn co svn://domain/xxx_dir/


1. not allow anonymous access
vi conf/svnserve.conf
anon-access = none
auth-access = write
password-db = passwd

2. not cache password
vi ~/.subversion/config
store-passwords = no
store-auth-creds = no

Reference:
http://www.subversion.org.cn/svnbook/1.4/index.html
http://www.subversion.org.cn/?action-viewnews-itemid-1

Cron timer in Linux

timer task in Linux
http://cn.tech.yahoo.com/050531/55/26zxf.html

Thursday, April 2, 2009

setup JDK JRE

http://java.sun.com/javase/6/webnotes/install/jdk/install-linux.html

get a setup file such as jdk-6u12-linux-i586.bin
run it directly

character web browser: lynx

get it from http://lynx.isc.org/current/index.html
very cool when you on a console


./configure
make
cp lynx.cfg /usr/local/etc/
cp samples/lynx.lss /usr/local/etc/
./lynx