2008年3月16日 星期日

Freeware List

Visio viewer
VMware server, VMware client, VMware server console, VMware vix
License Key
VMware Server for Windows A80DJ-FUM6F-VFKFJ-4JQ9J
VMware Server for Linux A804M-FU6AN-U878L-4L33M

VMware Server License Key: 98DPT-YAVDK-19N77-4AQRH (20100417)

FTP:
FileZilla
FTP Wanderer
Baby FTP
WWW File Share Pro
AlFTP belong to the AlTools)

CD/DVD burning tools
Alcohol 52/120% -- CD and DVD burning software, open iso file http://www.alcohol-soft.com/
Nero BurnLite

XML Viewer - MindFusion's XML Viewer
http://www.mindfusion.eu/product1.html

Input Method:
Yahoo Input Method (support chinese)

The opensource TFTP client/server
http://www.jounin.net/tftpd32.html

List IE cookies
IECookiesView v1.74
http://www.nirsoft.net/utils/iecookies.html

List Firefox cookies
MozillaCookiesView v1.30
http://www.nirsoft.net/utils/mzcv.html

Multiple Clock
Qlock - http://www.qlock.com/recommend.php?dl=qlock&src=download
Introduction article - http://www.techsupportalert.com/content/best-free-multiple-timezone-world-clock.htm

ssh, telnet and most discovered feature, serial console, client software -- putty, maybe pietty (for chinese users) is ok

Hex editor - PSPad

md5 caculator
WinMd5

Photo Viewer
Windows version PMB Portable Installer
http://support.d-imaging.sony.co.jp/www/disoft/int/pmb/download/software/pmbp_win/ct.html?S=CTL

RemoteManagement
TeamViewer

2008年3月13日 星期四

Linux Command - ps

show the current processes in the tree shape
# ps axjf

normal show all the current processes
# ps auxwww
or
# ps aux (seems the same as the above command)

See the difference of 2 kinds of fully ps show
# ps -auxwww | head -1
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
# ps -eLf | head -1
UID PID PPID LWP C NLWP STIME TTY TIME CMD



#To get info about threads:
# ps -eLf
# ps axms

If we use "-f" and "-L" parameter of ps, it will add
NLWP (number of threads)
LWP (thread ID)
to display the thread informations
-f does full-format listing. This option can be combined with many other
UNIX-style options to add additional columns. It also causes the command
arguments to be printed. When used with -L, the NLWP (number of threads) and
LWP (thread ID) columns will be added. See the c option, the format keyword
args, and the format keyword comm.

2008年3月9日 星期日

Linux Service - DHCP

I am not understand dhcp very well. The following is my experience about dhcp.

DHCP packet flow
Client -- send DHCP Discover
Server -- send DHCP Offer
Client -- send DHCP Request
Server -- send DHCP ACK

These four packets all contain the same Transaction ID
DHCP protocols use option to carry the main messages. These options include message type, server identifier, IP address lease time, renewal time value and rebinding time value etc..


dhcp running daemon
/sbin/dhclient -1 -q -lf /var/lib/dhcp/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0

dhcp configuration file
/var/lib/dhcp/dhclient-eth0.leases
lease {
interface "eth0";
fixed-address 192.168.1.4;
option subnet-mask 255.255.255.0;
option routers 192.168.1.254;
option dhcp-lease-time 604800; ==> one week
option dhcp-message-type 5;
option domain-name-servers 168.95.1.1,140.113.1.1;
option dhcp-server-identifier 192.168.1.254;
option dhcp-renewal-time 302400;
option dhcp-rebinding-time 453600;
option domain-name "";
renew 0 2008/2/10 19:31:07;
rebind 3 2008/2/13 04:01:58;
expire 4 2008/2/14 22:01:58;
}
lease {
interface "eth0";
fixed-address 192.168.1.4;
option subnet-mask 255.255.255.0;
option routers 192.168.1.254;
option dhcp-lease-time 604800; ==> one week
option dhcp-message-type 5;
option domain-name-servers 168.95.1.1,140.113.1.1;
option dhcp-server-identifier 192.168.1.254;
option dhcp-renewal-time 302400;
option dhcp-rebinding-time 453600;
option domain-name "";
renew 3 2008/2/13 21:31:39;
rebind 6 2008/2/16 01:31:07;
expire 0 2008/2/17 19:31:07;
}
lease {
interface "eth0";
fixed-address 192.168.1.4;
option subnet-mask 255.255.255.0;
option routers 192.168.1.254;
option dhcp-lease-time 604800;
option dhcp-message-type 5;
option domain-name-servers 168.95.1.1,140.113.1.1;
option dhcp-server-identifier 192.168.1.254;
option dhcp-renewal-time 302400;
option dhcp-rebinding-time 453600;
option domain-name "";
renew 6 2008/2/16 17:36:07;
rebind 2 2008/2/19 03:31:39;
expire 3 2008/2/20 21:31:39;
}
lease {
interface "eth0";
fixed-address 192.168.1.4;
option subnet-mask 255.255.255.0;
option routers 192.168.1.254;
option dhcp-lease-time 604800;
option dhcp-message-type 5;
option domain-name-servers 168.95.1.1,140.113.1.1;
option dhcp-server-identifier 192.168.1.254;
option dhcp-renewal-time 302400;
option dhcp-rebinding-time 453600;
option domain-name "";
renew 1 2008/3/10 17:58:49;
rebind 3 2008/3/12 12:55:15;
expire 5 2008/3/14 06:55:15;
}
lease {
interface "eth0";
fixed-address 192.168.1.101;
option subnet-mask 255.255.255.0;
option routers 192.168.1.254;
option dhcp-lease-time 86400;
option dhcp-message-type 5;
option domain-name-servers 192.168.1.254;
option dhcp-server-identifier 192.168.1.254;
renew 2 2008/3/11 03:37:46;
rebind 2 2008/3/11 14:58:50;
expire 2 2008/3/11 17:58:50;
}
lease {
interface "eth0";
fixed-address 192.168.1.2;
option subnet-mask 255.255.255.0;
option routers 192.168.1.254;
option dhcp-lease-time 86400;
option dhcp-message-type 5;
option domain-name-servers 192.168.1.254;
option dhcp-server-identifier 192.168.1.254;
renew 2 2008/3/11 15:28:19;
rebind 3 2008/3/12 00:37:47;
expire 3 2008/3/12 03:37:47;
}

# if you want dhcpd to listen only on the specific interface, add the interface parameter in the dhcpd config file, as following steps
a. update /etc/sysconfig/dhcpd, add " eth1" as the listening interface
DHCPDARGS=" eth1"

b. restart the dhcpd
# service dhcpd restart

c. verify that dhcpd is launched with the " eth1" as the parameter
# ps auxwww | grep dhcpd
root 3848 0.0 0.1 6208 1212 ? Ss 14:51 0:00 /usr/sbin/dhcpd eth1



### Setup the dhcp config
And we config the /etc/dhcpd.conf to include the following options to comply the AutoIP testing item requirement of DLNA Test Plan.

# --- default gateway
# option routers 192.168.0.1;  << comment out the default router of DHCP advertisement to avoid the client receiver to set the default router in the LAN network
option subnet-mask 255.255.255.0;

option nis-domain "domain.org";
option domain-name "domain.org";
option domain-name-servers 192.168.1.1;

option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.0.10 192.168.0.100;
default-lease-time 300; << Set lease time as 300 seconds to conform the certification testing requirement
max-lease-time 43200;

Besides, we need to setup the server address of binding network interface in the same network domain as the assigned dhcp address. In our example, we set the server network address as 192.168.0.1 and netmask as 255.255.255.0.

### Start up the DHCP Server
Start the DHCP server
# service dhcpd start
Starting dhcpd: [ OK ]

Show the DHCP server current status
# service dhcpd status
dhcpd (pid 11185) is running...

# netstat -anp | grep 67 | grep dhcpd
udp 0 0 0.0.0.0:67 0.0.0.0:* 11185/dhcpd

Stop the DHCP server
# service dhcpd stop
Shutting down dhcpd: [ OK ]

2008年3月6日 星期四

Use netstat to show the current binding port of each daemon

If we want to know which port is binding on which program, we can use the netstat. Use the -p parameter to show the binding program name.
# netstat -anp | more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 2213/hpiod
tcp 0 0 0.0.0.0:966 0.0.0.0:* LISTEN 2056/rpc.statd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2230/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2264/sendmail: acce
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN 2218/python
tcp 0 0 :::111 :::* LISTEN 2022/rpcbind
tcp 0 0 :::22 :::* LISTEN 2244/sshd
tcp 0 52 ::ffff:192.168.180.57:22 ::ffff:192.168.180.56:4143 ESTABLISHED 32126/sshd: vincent
udp 0 0 0.0.0.0:32768 0.0.0.0:* 2456/avahi-daemon:
udp 0 0 0.0.0.0:960 0.0.0.0:* 2056/rpc.statd
udp 0 0 0.0.0.0:963 0.0.0.0:* 2056/rpc.statd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2456/avahi-daemon:
udp 0 0 0.0.0.0:631 0.0.0.0:* 2230/cupsd
udp 0 0 :::32769 :::* 2456/avahi-daemon:
udp 0 0 :::925 :::* 2022/rpcbind
udp 0 0 :::5353 :::* 2456/avahi-daemon:
udp 0 0 :::111 :::* 2022/rpcbind

2008年3月5日 星期三

Use the adapted "make options" to compile shared/static libpcap library

The method of how to compile and install libpcap as static/shared library

Following the command sequence
# make all
# make install
>> It will produce libpcap.a static library
# make shared
# make install-shared
It will produce the libpcap.so.0.9.7 shared library


How to compile and install openssl as a shared library
# use the following command to produce the Makefile
./config --prefix=/usr shared

# make
# make build-shared
# make install

The message output by the command "make install"
installing libcrypto.a
installing libssl.a
installing libcrypto.so.0.9.8
installing libssl.so.0.9.8
make[1]: Entering directory `/usr/lib'
make[2]: Entering directory `/usr/lib'
make[2]: Leaving directory `/usr/lib'
make[2]: Entering directory `/usr/lib'
make[2]: Leaving directory `/usr/lib'
make[1]: Leaving directory `/usr/lib'
cp libcrypto.pc /usr/lib/pkgconfig
chmod 644 /usr/lib/pkgconfig/libcrypto.pc
cp libssl.pc /usr/lib/pkgconfig
chmod 644 /usr/lib/pkgconfig/libssl.pc
cp openssl.pc /usr/lib/pkgconfig
chmod 644 /usr/lib/pkgconfig/openssl.pc


之後就會在目錄中產出libcrypto.so.0.9.8, libssl.so.0.9.8兩個shared library
(These two libraries are the mainly components of the openssl package)
# ls -la /usr/lib/lib*
[omit]
-rw-r--r-- 1 root root 2056086 2月 13 17:20 libcrypto.a
-rw-r--r-- 1 root root 251 2月 13 17:29 libcrypto.pc
lrwxrwxrwx 1 root root 18 2月 13 17:41 libcrypto.so -> libcrypto.so.0.9.8
-rwxr-xr-x 1 root root 1344300 2月 13 17:41 libcrypto.so.0.9.8
-rw-r--r-- 1 root root 362224 2月 13 17:23 libssl.a
-rw-r--r-- 1 root root 266 2月 13 17:29 libssl.pc
lrwxrwxrwx 1 root root 15 2月 13 17:41 libssl.so -> libssl.so.0.9.8
-rwxr-xr-x 1 root root 265219 2月 13 17:41 libssl.so.0.9.8
[omit]