root@helga:~# ip -s -s link show eth0
2: eth0:mtu 1500 qdi
WN qlen 1000
link/ether 00:24:8c:d5:6a:a7 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
1633058095 16933162 0 0 0 0
RX errors: length crc frame fifo missed
0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
1994496524 5588574 0 0 0 0
TX errors: aborted fifo window heartbeat
0 0 0 0
Monday, February 8, 2010
Detailed network interface statistics on Linux
Friday, September 11, 2009
I/O usage per process on Linux
$ cat /proc/self/io
rchar: 3809
wchar: 0
syscr: 10
syscw: 0
read_bytes: 0
write_bytes: 0
cancelled_write_bytes: 0
As you know, ever process is presented by it's pid number under /proc directory. You can access any process's I/O accounting values by just looking /proc/#pid/io file. There is a utility called iotop which collects these values and shows you in like top utility. You see your processes I/O activity with iotop utility.
Field Descriptions:
rchar - bytes read
wchar - byres written
syscr - number of read syscalls
syscw - number of write syscalls
read_bytes - number of bytes caused by this process to read
from underlying storage
write_bytes - number of bytes caused by this process to written from
underlying storage
Friday, September 4, 2009
problem compiling Mysql 5.1 with sphinx engine support
configure: error: unknown plugin: sphinx
The trick was to run autorun.sh command in Mysql's source tree before running configure with sphinx engine support. This script will create a new configure script which knows how to compile sphinx engine.
# ./BUILD/autorun.sh
Thursday, September 3, 2009
nethogs network utility
Sunday, July 12, 2009
Fast Copy on Unix systems
# (socat -u tcp4-listen:4123 - | tar xzp -C .) &
On source server, I run socat to feed incoming tar data to destination socat daemon where it listens on tcp port 4123. My destination server's ip adddess was 192.168.36.199 .
# (tar -czp - /mydir/1/ | socat -u - tcp4:192.168.3.199:4123)&
Monday, June 8, 2009
socket programming with Bash

I have used the information provided by "stats" command. Script uses pure bash builtin commands to access a tcp server like memcached.
You can download the script from here.
Here is sample output from the script.

If you're using Ubuntu, probably you will not be able to run this script, because bash is not compiled with "--enable-net-redirections" parameter on Ubuntu systems. RedHat based distributions has no problem with bash net-directions like Fedora,Centos and RedHat ES.
Sunday, May 31, 2009
Mirroring your OpenSolaris root disk with ZFS
As you can see, our zpool contains a single disk called c4t0d0. Let's add a new disk to our rpool to convert it into mirror. zpool will do it automatically for us. One important point here is that Solaris doesn't support boot devices to be in EFI label format. So, if your new disk label is in EFI format, you need to convert it into SMI label. So, I'll use fdisk command to create a Solaris2 partition and remove any EFI labels if present. My new disk name is c4t1d0.
After creating the partition which covers whole disk area, I copied partition map of original rpool member c4t0d0 to our new disk c4t1d0.
Now, it's time to attach our brand new disk into rpool. After attaching the disk, our rpool pool will be converted into mirror (raid-1). Except one thing, the grub boot manager. We need to install it into new disk by hand using installgrub command.
Now, we have created our mirror on rpool. It will take time to sync original disk to new disk. You can watch this process by using zpool's status command.