Thursday, October 11, 2012

optimizing xen network speed

http://wiki.xen.org/wiki/Network_Throughput_and_Performance_Guide#Usage

check speed:

Linux
Make sure the following packages are installed on your system: gcc, g++, make, and subversion.
Iperf can be installed from Iperf's SVN repository:
svn co https://iperf.svn.sourceforge.net/svnroot/iperf iperf
cd iperf/trunk
./configure
make
make install
cd
iperf --version # should mentioned pthreads
You might also be able to install it via a package manager, e.g.:
apt-get install iperf
When using the yum package manager, you can install it via RPMForge.
Windows

Here are the simplest commands to execute on the receiver, and then the sender:
# on receiver
iperf -s -f m     # add "-w 256K -l 256K" when sender or receiver is a Windows VM

# on sender
iperf -c  -f m -t 20    # add "-w 256K -l 256K" when sender or receiver is a Windows VM

Sunday, August 05, 2012

best windows cd emulator

this lightweight software can emulate iso image as physical CD-ROM drive. works with windows vista, windows 7. the computer that i'm using right now.

http://wincdemu.sysprogs.org/download/ (815KB)

Tuesday, July 24, 2012

[javascript] how to declare private variable

ref: http://www.w3schools.com/js/js_functions.asp

Situation 1 (Private)
function foobar(){
  var foo =1;
  alert foo;
}
// will alert 1
foobar();
// will alert undefined
alert(foo);


Situation 2 (Public)
function foobar(){
  foo =1; // no var declared. it is public
  alert foo;
}
// will alert 1
foobar();
// will alert 1
alert(foo);

* Can u spot the difference?


The Lifetime of JavaScript Variables

If you declare a variable, using "var", within a function, the variable can only be accessed within that function. When you exit the function, the variable is destroyed. These variables are called local variables. You can have local variables with the same name in different functions, because each is recognized only by the function in which it is declared.
If you declare a variable outside a function, all the functions on your page can access it. The lifetime of these variables starts when they are declared, and ends when the page is closed.

Tuesday, July 03, 2012

ngrep.

Tools
- OpenVPN server
- ngrep
- tcpdump
- strings
- awk
- sort

command:
Code:
ngrep -q -W byline (mybbuser)|(Cookie) dst port 80 -O test2.txt

Related Posts Plugin for WordPress, Blogger...