Tuesday, May 29, 2012

Measure network speed on unix like OS


  1. install iperf on both machines
  2. Machine A run as server : iperf -s -p 65000
  3. Machine B run as client : iperf -c <machine A ip> -p 65000
sample result.

[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec    113 MBytes  94.5 Mbits/sec

Sunday, May 27, 2012

Debian6 Souce List


deb http://ftp.uk.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.uk.debian.org/debian/ squeeze main contrib non-free

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

Wednesday, May 23, 2012

Java wait(), notify()

Java Multithread wait(), notify() must know.

1. Object use to lock must be static, each object have it own wait().

2. Locked object must release by own monitor, e.g :

            public static Object lock = new Object();

                        synchronized(lock) {
lock.wait(RES_WAIT_TIMEOUT);
}

            //on other thread


                synchronized(lock) {
lock.notify();
}