2015年11月23日 星期一

Install Ubuntu packages from cdrom

  1. mount /dev/cdrom /media/cdrom
  2. uncomment the first line of /etc/apt/source.list
    deb xxxx
  3. apt-get install xxxxx

2015年11月12日 星期四

防止VPN連線成為預設閘道

Prevent VPN connection become the default gateway

for both IPv4 and IPv6 properties, after clicking the Advanced button, make sure "Use default gateway on remote network" isunchecked.

Prevent VPN proxy

jekyll docker under windows


  1. Install Docker Toolbox
  2. Startup Docker Terminal
  3. Use Putty to login 192.168.99.100 docker/tcuser (Do not use the original windows Bash, it will cause problem when using $(pwd) in docker --volume parameter)
  4. cd /c/Users/yourname/Document/jekyll_site
  5. jekyll new .

docker run --rm --label=jekyll --volume=$(pwd):/srv/jekyll -it -p 0.0.0.0:4000:4000 jekyll/jekyll:pages jekyll new .

5. jekyll s --force_polling
6. Browse the page in host browser with http://192.168.99.100:4000

2015年11月3日 星期二

Validate PCIe's Speed and Width under Linux

1. use `lspci` to list all pci devices
The number less than 7f:xx:xx is for CPU0
more than 80:xx:xx is for CPU1

2. use 'lspci -vv" to check the detail of target device
check the "LnkStat:"
 Speed 2.5GT/s is gen1
 Speed    5GT/s is gen2
 Speed    8GT/s is gen3

Width is the PCIe lances

Reference:
https://en.wikipedia.org/wiki/PCI_Express

2015年9月21日 星期一

openvpn

I follow the steps from this to setup my VPN server:
https://wiki.debian.org/OpenVPN

and here:
https://openvpn.net/index.php/open-source/documentation/howto.html

The important for me is:
Next, you must set up a route on the server-side LAN gateway to route the VPN client subnet (10.8.0.0/24) to the OpenVPN server (this is only necessary if the OpenVPN server and the LAN gateway are different machines).
Make sure that you've enabled IP and TUN/TAP forwarding on the OpenVPN server machine.


2015年8月25日 星期二

Performance Tests

Memory bandwidth:
1. Get source code from: https://www.cs.virginia.edu/stream/FTP/Code/
2. Refer to source code stream.c, On multiprocessor test, Use"gcc -O -fopenmp stream.c -o stream_omp" to compiler it
3. set OMP_NUM_THREADS to the number of threads you want to run. Ex. "export OMP_NUM_THREADS=12"

4. Run command "./stream_omp"
(The first run result should be ignored, refer from rc25482_performance report.pdf)

Memory Random Access, Random Access
1. The source code is under: http://icl.cs.utk.edu/hpcc/software/index.html
(But I don't know how to compiler it)

Block-IO test, fio
 1. Get latest fio from https://github.com/axboe/fio
2. unzip and "./configuration", "make", "make install" to compile and install it.
3. run "fio xxxx.fio"

Network Bandwidth, nuttcp
1. Get the source code from: http://www.nuttcp.net/Welcome%20Page.html
2. Use "gcc -O nuttcp.c -o nuttcp" to compile it
3. Run "./nuttcp -S" on receiver , and run "./nuttcp [recevier ip]" on SUT

Network performance/latency, netperf
1. Get source code from: http://www.netperf.org/netperf/
2. unzip and "./configuration", "make", "make install" to compile and install it.
3. Run "netserver" on receiver (Server)
4. Run "netperf XXX" on SUT
Test TCP Stream Throughput:
#netperf  -t  TCP_STREAM  -l  60  -H  192.1.1.100  -c  --  -s  128k  -S  128K

Test UDP Stream Throught:
#netperf  -t  UDP_STREAM  -l  60  -H  192.1.1.100  -c  --  -s  128k  -S  128K

Test TCP Request/Response in 1 byte
#netperf  -t  TCP_RR  -l  300  -H  192.1.1.100  -c

Test TCP Request/Response in 32/1024 byte
#netperf  -t  TCP_RR  -l  300  -H  192.1.1.100  -c  --  -r  32/1024

Test TCP Connect/Request/Response in 1 byte:
#netperf  -t  TCP_CRR  -l  300  -H  192.1.1.100  -c

Test TCP Connect/Request/Response in 32/1024 byte
#netperf  -t  TCP_CRR  -l  300  -H  192.1.1.100  -c  --  -r  32/1024

2015年1月26日 星期一

docker networking

http://www.dasblinkenlichten.com/docker-networking-101/

  1. By default, all container networks are hidden from the real network. Here’s a masquerade (hide NAT) rule for all container traffic.  This allows all of the containers to talk to the outside world (AKA the real network) but doesn’t allow the outside rule to talk back to the containers.
  2. docker run -it –rm –p 8080:80 busybox   If we run that command, we can see that iptables creates an associated NAT rule that forwards traffic destined for 8080 on the host (10.20.30.100 in this case) to port 80 on the container…  if the busybox container on docker1 wants to talk to the busybox container on docker2, it could only do so through an exposed port on the hosts network interface. 
  3. 在host中把icc=false,container之間就不會互聯,要在run時用--link參數