Monday, November 06, 2006

Java ant tool

proejct 项目
name 指定工程名称
default 指定默认的target(即任务)
basedir 指定系统的基本路径
property 属性,类似于全局变量
name 变量名称
value 变量值
属性访问方法: ${property}
内置属性:
basedir 工程的路径.
ant.file build文件的路径.
ant.version 版本
ant.project.name 工程名
ant.java.version jvm版本
target 目标,即任务
name 指定目标名称
depends 指定所依整的目标
if 条件,可达到控制流程目的
unless
description
task 一小段的任务
reference 引用





My ant example.



























Tuesday, October 17, 2006

Reasch student weekly report system database schema

















userspervisesuperviserreportadminstrator
ididid
namestudent idstudent id
usernamesuperviser iddate
password
week
position


semester



project title



milestones



self evalution



work conduetal



work plan



sper common



response common



issues





Ubuntu update server

deb http://au.archive.ubuntu.com/ubuntu/ dapper main restricted
deb-src http://au.archive.ubuntu.com/ubuntu/ dapper main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://au.archive.ubuntu.com/ubuntu/ dapper-updates main restricted
deb-src http://au.archive.ubuntu.com/ubuntu/ dapper-updates main restricted

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
# deb http://au.archive.ubuntu.com/ubuntu/ dapper universe
# deb-src http://au.archive.ubuntu.com/ubuntu/ dapper universe

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://au.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
# deb-src http://au.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu dapper-security main restricted
deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted
# deb http://security.ubuntu.com/ubuntu dapper-security universe
# deb-src http://security.ubuntu.com/ubuntu dapper-security universe
deb http://ubuntu.cn99.com/ubuntu/ breezy main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ breezy-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ breezy-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ breezy-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ breezy main restricted universe multiverse
deb http://ubuntu.cn99.com/backports/ breezy-extras main restricted universe multiverse

Install JSDK on Ubuntu 6.0

Now go to Sun's website http://java.sun.com and select the java jdk or jre that you want. In my case I needed 1.4.2 so I downloaded j2sdk-1_4_2_09-linux-i586.bin.

Then run the following commands from the terminal:

First install the required packages:
sudo apt-get install fakeroot java-package java-common
Create the Deb file for the install:
fakeroot make-jpkg jre-1_5_0_05-linux-i586.bin
Install The deb file
sudo dpkg -i sun-j2re1.5_1.5.0+update05_i386.deb
Now make Sun's java the default by running this command and selecting it.
sudo update-alternatives --config java

hsqldb_stratup_usage

Usage: java org.hsqldb.Server [options]










OPTIONTYPEDEFAULTDESCRIPTION
-? ---- prints this message
-addressname|numberanyserver inet address
-port number 9001/544 port at which server listens
-database.i[type]spec 0=testname of database i
-dbname.i alias--url alias for database i
-silenttrue|falsetrue false => display all queries
-tracetrue|falsefalsedisplay JDBC trace messages
-tlstrue|false falseTLS/SSL (secure) sockets
-no_system_exittrue|false false do not issue System.exit()

The server looks for a 'server.properties' file in the current directory and
loads properties from it if it exists.

Here is an example 'server.properties' file:

server.port=1234
#mounts a file-based (persistent) database with alias 'filetest'
#database connection url would be 'jdbc:hsqldb:hsql://host:1234/filetest'
#but '/filetest' can be omitted because database.0 is the default
server.database.0=file:/mydatbasedir/test
server.dbname.0=filetest
#mounts a 'file_in_jar' database with alias 'restest'
#database connection url would be 'jdbc:hsqldb:hsql://host:1234/restest'
server.database.1=res:/mypackage/test
server.dbname.1=restest
#mounts a 100% in-memory (transient) database with alias 'memtest'
#database connection url would be 'jdbc:hsqldb:hsql://host:1234/memtest'
server.database.2=mem:test
server.dbname.2=memtest
...
server.database.n=...
server.dbname.n=...
server.silent=true

#end of 'server.properties' file

Command line options override those loaded from the 'server.properties' file.

The default port is 9001 if tls is false and 544 if it is true.
When omitted, the value of tls is true iff the system property:

javax.net.ssl.keyStore

is defined. An example command line invocation requesting TLS might look like:

java -Djavax.net.ssl.keyStore=x -Djavax.net.ssl.keyStorePassword=y org.hsqldb.Server [options]

HSQLDB server model startup example:
  java -cp ../lib/hsqldb.jar org.hsqldb.Server -database.0 mydb -dbname.0 xdb
HSQLDB manager starup example:
  java -cp ../lib/hsqldb.jar org.hsqldb.util.DatabaseManager

Wednesday, October 11, 2006

Setup Tomcat on Unix

Set Linux environment variable
User Class
Script to modify
One user
$HOME/.bash_profile
All users except root
/etc/profile
root
/root/.bash_profile


Set JAVA_HOME:
JAVA_HOME=/usr/j2se
export JAVA_HOME

Start Tomcat
gointo the install directory and than go into bin directory. ./startup.sh

access Tomcat by browser:
put hostname:port into the address form of the browser.

Saturday, May 27, 2006

The report of CyberCrime
Abstract: Cyber-crimes are increasing rapidly and cyber-criminals commit the crime which is online fraud, online money laundering, and theft business information. Unlike general criminals, cyber-criminals have high technical abilities. However, the police are not trained completely and governments do not make impeccable laws.


See full PDF
see full PDF