Thursday, December 18, 2008
Install Chinese pinyin input method on Ubuntu
http://code.google.com/p/scim-python/downloads/list
download file:
scim-python-0.1.12.tar.gz
Execute commands:
$ sudo apt-get install scim-dev
$ sudo apt-get install Python-dev
$ sudo apt-get install python-enchant
$ sudo apt-get install python-gtk2-dev
$ sudo apt-get install libgtk2.0-dev
$ tar zxvf scim-python-${version}.tar.bz2
$ cd scim-python-${version}
$ ./configure –prefix=/usr
$ make
$ sudo make install
The Chinese input method will effect after you log out and then log in,
Thursday, November 20, 2008
湿热下注针灸治疗
症状:小腹坠沉,... ...
针灸穴位:
三阴交,
足少阴神经:太溪,复溜,
足厥阴肝经:行间,太冲,
足少阳胆经:侠溪,
足太阴脾经:阴陵泉,血海,
足阳明胃经:足三里,
任脉:关元,
手少阳三焦经:支沟
足三里,侠溪,复溜不必须
Wednesday, November 12, 2008
Ubuntu 8.10
I never thought it would be do easy to install Ubuntu! Even much easy then windows. Afer the installation finished, everthing is working.
When I start it I heard the start sound, I knew that I don't need worry to find the driver for the sound card. Then I saw a firefox icon there, I double clicked it the web page just come out, I realized that I even don't need to do anything to setup the network card and Internet connection! Wow!!
I like that!
I used Unix, Linux and Windows for so many years, I don't worry about to get the drivers for different hardware, I could do it, But everything takes time.
What I am lack is just the time.
Now I find Ubuntu. it can save mo lots of time. I still have two computers stay there and doing nothing because I could not get time to install it.
Now I am going to install Ubuntu on both of them .
Tuesday, November 11, 2008
Frequently Used MySQL Commands For Reference
Returns the string that results from concatenating the arguments. May have one or more arguments. If all arguments are non-binary strings, the result is a non-binary string. If the arguments include any binary strings, the result is a binary string. A numeric argument is converted to its equivalent binary string form; if you want to avoid that, you can use an explicit type cast, as in this example:
SELECT CONCAT(CAST(int_col AS CHAR), char_col);
CONCAT() returns NULL if any argument is NULL.
mysql> SELECT CONCAT('My', 'S', 'QL');
-> 'MySQL'
mysql> SELECT CONCAT('My', NULL, 'QL');
-> NULL
mysql> SELECT CONCAT(14.3);
-> '14.3'
Monday, November 10, 2008
Install Tomcat on Linux
November 10, 2008
Install java
Go to http://java.sun.com/
Download and install jdk. Newest version 1.3.1_01 (during the time it is first installed).
The file name is: j2sdk-1_3_1_01-linux-i386-rpm.bin (or something like that.)
feed it into a shell:
# chmod 700 j2sdk-1_3_1_01-linux-i386-rpm.bin
# j2sdk-1_3_1_01-linux-i386-rpm.bin
scroll through the license agreement, answer yes at the bottom, and it will unpack into jdk-1.3.1_01.i386.rpm
Install the rpm file:
# rpm -ivh jdk-1.3.1_01.i386.rpm
This will install the JDK in: /usr/java/jdk1.3.1_01
You need to modify the /etc/profile to include /usr/java/jdk.x.x/bin in the path, so that the executable will run.
Usually, to make a symble link called /usr/java/jdk:
# ln –s /usr/java/jsk.x.x /usr/java/jdk
This way we don’t need to update the path in the /etc/profile every time a new version of JDK is installed.
JAVA_HOME should alos be set up in the /etc/profile
Add line:
JAVA_HOME=/usr/java/jdk; export JAVA_HOME
Into /etc/profile
Install tomcat
Download the latest stable release of tomcat, I have got: jakarta-tomcat-5.0.28.tar.gz
And then extract it into /usr/local
# cd /usr/local
# tar zxvf jakarta-tomcat-5.0.28.tar.gz
For convenience,
# ln –s Jakarta-tomcat-5.0.28 tomcat
# cd tomcat
# cd bin
# rm *.bat
To enable the Tomcat manager, you need to modify /usr/local/jakarta-tomcat-5.0.28/conf/tomcat-users.xml add a user “admin” with the role “manager”. The result should look like this:
Now the tomcat should be able to be started:
# /usr/local/tomcat/bin/startup.sh
We should be able to connect to : http://localhost:8080/index.jsp
To stop tomcat:
# /usr/local/tomcat/bin/shutdown.sh
The default permissions in the binary directory for tomcat are wrong for some silly reason.
# cd $TOMCAT_HOME/bin
# chmod 744 *.sh
Set up environment variables
In the /etc/profile, add lines:
JAVA_HOME=/usr/java/jdk; export JAVA_HOME
CLASSPATH=/usr/java/jdk/lib:usr/java/jre/lib:/usr/java/jdk/src.zip; export CLASSPATH
CATALINA_HOME=/usr/local/tomcat; export CATALINA_HOME
CATALINA_BASE=/usr/local/tomcat; export CATALINA_BASE
PATH=$PATH:$JAVA_HOME/bin
Auto-Start tomcat
To start tomcat automatically when the Linux starts:
1.
Add lines:
JAVA_HOME=/usr/java/jdk
CATALINA_HOME=/usr/local/tomcat
In the Catalina.sh file, before the line: PRGDIR=’dirname “$PRG” ‘
2.
# cd /etc/rc.d/init.d
# cp /usr/local/tomcat/bin/Catalina.sh ./
# ln –s /etc/rc.d/init.d/catalina.sh /etc/rc.d/rc5.d/S81tomcat
Linux Command
Linux Prectical How To
Contents
- Linux Command
- Firewall
- environment variable
- customise firewall while install RedHat Linux
- Install Web Application on RedHat Linux
- 1. Install Apache Web Server
- 2. install JAVA 2
- 3. install tomcat
- 4.install MySQL
- About security of redhat linux
- turn on ftp server (for ever)
- linux command
- create WAR file for bustops
- Network Config
- Add a user
linux command
- setup the computer: prompt>setup
- config network interface: prompt>network config
- ?? chkconfig ipchains off ??
- service ipchains status
- service ipchains start
- service ipchains stop
- service ipchains restart
- about net work configure
- lsmod
- cd /etc/sysconfig/network-scripts
- ls
- pico ifcfg-eth0
- service network restart
- ifconfig
- lokkit
- service ipchains restart
Firewall
check firewall: service ipchains status
turn off firewall: service ipchains stops
turn off firewall from computer boot: chkconfig ipchains off
environment variable
The local environment variable is the "local" variable, it's available only for the particular instance of the shell.
The global environment variable is the shell variable which stays available ("inherited") for any program started from the current shell, including an another shell.
To set the local environment variable:
set variable_name=value (C shell)
variable_name=value (Korn or Bourne shell)
To unset the local environment variable:
unset variable_name (all shells)
To set the global environment variable:
setenv VARIABLE_NAME value (C shell)
VARIABLE_NAME=value; export VARIABLE_NAME (Korn or Bourne shell)
To unset the global environment variable:
unsetenv VARIABLE_NAME value (C shell)
unset VARIABLE_NAME (Korn or Bourne shell)
To list all environmnet variables:
env
To check a single environment variable:
echo $VARIABLE_NAME
customise firewall while install RedHat Linux
1.install
2.lokkit [enter]---customise
3.netconfig[enter]?
4.rhn_rgister[enter]
5.up2date
Install Web Application on RedHat Linux
1. Install Apache Web Server
cd /usr/local
cp /mnt/cdrom/apache_1.3.24.tar.gz ./
tar -zxf apache_1.3.24.tar.gz
mkdir apache
cd apache
cp -rf /usr/local/apache_1.3.24/* ./
cd ..
rm -rf apache_1.3.24
cd apache
./config
make
make install
/usr/local/apache/bin/apachectl start
stop apache
/usr/local/apache/bin/apachectl stop
restart apache
/usr/local/apache/bin/apachectl restart
2. install JAVA 2
RedHat Application CD
cd IBM
rpm -ivh IBMJava2-SDK-1.3-9.0.i386.rpm
cd /root
vi .bash_profile
add follow two lines:
JAVA_HOME=/opt/IBMJava2-13; export JAVA_HOME
PATH=$PATH:/opt/IBMJava2-13; export PATH
set PATH and JAVA_HOME for tomcat
3. install tomcat
tomcat 3.3.2
cd /usr/local
cp -rf /mnt/cdrom/jakarta-tomcat-3.3.2-dev.tar.gz ./
tar -zxf jakarta-tomcat-3.3.2-dev.tar.gz
mkdir tomcat
cd tomcat
cp -rf /usr/local/jakarta-3.3.2-dev/* ./
cd ..
rm -rf /usr/local/jakarta-tomcat-3.3.2-dev
cd tomca
cd bin
chmod 755 startup
chmod 755 tomcat
chmod 755 shutdown
./startup to start tomcat
./shutdown to stop tomcat
to open port 8080
prompt> ipchains -I input -j ACCEPT -p tcp -s 64.119.96.78 -d 64.119.96.77 8080
this command will not work
you must do:
prompt> setup
select firewall or prompt> lokkit[enter]
go to customize, on the line of "Other ports" put "webcache:tcp"
then type:
prompt> service ipchains restart
4.install MySQL
rpm -ivf /mnt/cdrom/MySQL-3.22.32-1.i386.rpm
rpm -ivf /mnt/cdrom/MySQL-client-3.22.32-1.i386.rpm
add password to root user:
/usr/bin/mysqladmin -u root password 'susan';
let 64.119.96.78 access MySQL on linux server as MySQL client
prompt> ipchains -I input -j ACCEPT -p tcp -s 64.119.96.78 -d 64.119.96.77 3306
3306 mysql's default tcp port number
About security of redhat linux
1. install
2. lokkit
3. netconfig[enter]?
4. rhn_register
5. up2date
?????????????????????????
after change the security rules:
ipchain restart
?????????????????????????
turn on ftp server (for ever)
- prompt>chkconfig wu-ftpd on
- check : prompt>ftp localhost
create WAR file for bustops
JAR -cvf ../deploy/emstops0.war *.*
Network Config
- list all exist network interface: ifconfig
- change IP: ifconfig eth0 664.119.96.78
- assign nstmask: ifconfig eth0 netmask 255.255.255.248
- stop network interface: ifconfig eth0 down
- start network interface: ifconfig eth0 up
- add default gateway: route add default gw 64.119.96.73
Add a User
- add user on Linux Server: take nina as a example
- add nina to www group password: ninatang
- useradd -g www nina
- vi ninapas
- nina:ninatang
- chpasswd < ninapas
- change group the user belong to: usermod -g newgroup nina
latest update : July 22, 2002
Linux Command
Then I found it dificult to find out them later.
Now I am starting to find them and put them here.
Linux Command
written by: YLast updated: Monday Oct. 27, 2008
find Linux kernel version
uname -mrsn
Uninstall MySQL 4.0.12
1.rpm -qagrep -i mysql
display:
MySQL-server-4.0.12-0MySQl-client-4.0.12-0
2.rpm -e MySQL-server-4.0.12-0
3.
rpm -e MySQL-client-4.0.12-0
usermod: enables the user to modify the information contained in the system account files
Example: To change user Ajita's home directory to /home/chemdept. enter
shell>usermod -d /home/chemdept ajita
Find the number of files in a Listing(directory)
$ls wc -l
49
$
Make a symbolic link to a file
# ln -s /etc/rc.d/init.d/catalina.sh /etc/rc.d/rc5.d/S81tomcat
delete the symbolic link
# unlink /etc/rc.d/rc5.d/S81tomcat
Find out run level
# runlevel