#!/bin/bash if [ -z $1 ] then echo "[+] $0 capture.pcap" exit fi if [ ! -z $2 ] then limit=$2 else limit=0 fi #tshark -r $1 | grep "1.1.1.1 -> 1.1.1.2" | grep -v "ICMP"| grep -i "\[Data\] Seq\|UDP\|TCP" | awk '{if(NR==1){f=$2;s=$2};print ($2-f),($2-s)*1000;s=$2;}' > jitter.tmp tshark -r $1 | grep "1.1.1.1 -> 1.1.1.2" | grep -v "ICMP"| grep -i "\[Data\|UDP\|TCP" | awk '{if(NR==1){f=$2;s=$2};print ($2-f),($2-s)*1000;s=$2;}' > jitter.tmp #cat jitter.tmp | awk '{ k=$2-s ; if(($2-s)<0){k=($2-s)*(-1)} ; t=t+k ; print $1,$2-s,t/NR ; s=$2}' > jitter.txt ## mixed cat jitter.tmp | awk -v l=$limit '{ k=$2-s ; if(($2-s)<0){k=($2-s)*(-1)} ; t=t+k ; if(k>l){print $1,k,t/NR}; s=$2}' > jitter.txt ## all positive avg=`tail -n1 jitter.txt | awk '{print $3}'` echo 'set data style points' > jitter.gp echo 'set nogrid' >> jitter.gp echo 'set style line 1 lt 1 lw 2' >> jitter.gp echo 'set style line 2 lt 2 lw 2' >> jitter.gp echo 'set style line 3 lt 3 lw 5' >> jitter.gp echo 'set style line 4 lt 3 lw 1' >> jitter.gp echo 'set style line 5 lt 3 lw 2' >> jitter.gp echo 'set style line 6 lt 3 lw 1' >> jitter.gp echo 'set style line 7 lt 17 lw 2' >> jitter.gp echo 'set style line 8 lt 17 lw 4' >> jitter.gp echo '#set logscale y' >> jitter.gp echo '#set xrange[1:180]' >> jitter.gp echo '#set yrange[1:2]' >> jitter.gp echo '#set samples 2000' >> jitter.gp echo '#set xtics 50' >> jitter.gp echo '#set ytics 50' >> jitter.gp echo 'set xlabel "Time (sec)"' >> jitter.gp echo 'set ylabel "Kbit/s"' >> jitter.gp echo 'plot "jitter.txt" using 1:($2/1) title "jitter ('$avg'ms)" with impulses ls 6' >> jitter.gp echo '#plot "jitter.txt" using 1:($2/1) title "jitter ('$avg'ms)" with lines ls 6' >> jitter.gp echo '#replot "jitter.txt" using 1:($3/1) title "cumul jitter ('$avg'ms)" with lines ls 8' >> jitter.gp echo 'set encoding iso_8859_1' >> jitter.gp echo 'set term post color "Helvetica" 18' >> jitter.gp echo 'set output "jitter.eps"' >> jitter.gp echo 'replot' >> jitter.gp echo 'set term png' >> jitter.gp echo 'set output "jitter.png"' >> jitter.gp echo 'replot' >> jitter.gp gnuplot jitter.gp 2>&1 1>/dev/null qiv jitter.png &
skip to main |
skip to sidebar
#!/bin/bash
function usage()
{
echo
echo "[*] usage: $0 filename column"
echo
exit
}
if [ -z $1 ] || [ -z $2 ]
then
usage
fi
line=`cat $1 | wc -l`
max=`cat $1 | awk -v c=$2 '{if($c>=s){s=$c;line=NR}}END{print s,"("line")"}'`
min=`cat $1 | awk -v s=9999999999 -v c=$2 '{if($c<=s){s=$c;line=NR};}END{print s,"("line")"}'`
avg=`cat $1 | awk -v c=$2 '{total=total+$c}END{print total/NR}'`
stdev=`cat $1 | awk -v avg=$avg '{x=$1-avg;total=total+x*x;}END{print sqrt(total/NR)}'`
echo
echo "[*] input : $1"
echo "[*] column : $2"
echo "[*] no of data : $line"
echo
echo "[*] min : $min"
echo "[*] max : $max"
echo "[*] std.dev : $stdev"
echo

apt-get install msttcorefonts
Download this file :: http://www.sharpfonts.com/fontconfig.tbz
sudo tar xjvf /etc/fonts
restart firefox ... open www.google.com ... you'll see the difference for yourself ;)
My firefox fonts settings :
Thursday, May 8, 2008
calculate Jitter from a pcap file
My kick-ass script to compute min,max,avg & standard deviation ;)
#!/bin/bash
function usage()
{
echo
echo "[*] usage: $0 filename column"
echo
exit
}
if [ -z $1 ] || [ -z $2 ]
then
usage
fi
line=`cat $1 | wc -l`
max=`cat $1 | awk -v c=$2 '{if($c>=s){s=$c;line=NR}}END{print s,"("line")"}'`
min=`cat $1 | awk -v s=9999999999 -v c=$2 '{if($c<=s){s=$c;line=NR};}END{print s,"("line")"}'`
avg=`cat $1 | awk -v c=$2 '{total=total+$c}END{print total/NR}'`
stdev=`cat $1 | awk -v avg=$avg '{x=$1-avg;total=total+x*x;}END{print sqrt(total/NR)}'`
echo
echo "[*] input : $1"
echo "[*] column : $2"
echo "[*] no of data : $line"
echo
echo "[*] min : $min"
echo "[*] max : $max"
echo "[*] std.dev : $stdev"
echo
Monday, May 5, 2008
Hang on Lois, Super man is coming !!!
www.sfgate.com
aha, so this is how superman provides his service in Mexico !!!
Saturday, May 3, 2008
Sharp fonts in firefox [K/Ubuntu]
apt-get install msttcorefonts
Download this file :: http://www.sharpfonts.com/fontconfig.tbz
sudo tar xjvf /etc/fonts
restart firefox ... open www.google.com ... you'll see the difference for yourself ;)
My firefox fonts settings :
- Default font :: Verdana :: Size=12
- Font for :: Western
- Proportional :: Serif :: Size = 12
- Serif :: Verdana
- Sans-Serif :: Verdana
- Monospace :: Terminux :: Size = 12
- Minimum Font Size :: 12
- Allow pages to chose their own fonts
- Default character encoding :: Western (windows-1252)
Thursday, May 1, 2008
Labels
- amarok (2)
- android (4)
- antitaint (1)
- apache (1)
- apple trailers (1)
- apple tv (5)
- ati (2)
- avimerge (1)
- awk (8)
- bash (29)
- batch (1)
- bios (1)
- bittorrent (2)
- blah (1)
- bug (2)
- c (3)
- c++ (1)
- captcha (3)
- chromium (1)
- cityrail (3)
- clipboard (1)
- compiz (3)
- console (1)
- crystal hd (1)
- dccp (2)
- debian (18)
- dhcp (1)
- dictionary (2)
- dns (2)
- dokuwiki (1)
- dpkg (4)
- elitebook (1)
- epoch-time (1)
- epstopdf (1)
- evince (1)
- extract (1)
- fat32 (1)
- ffmpeg (2)
- fileserve (1)
- firefox (9)
- flurry (1)
- font (2)
- foxtel (1)
- funny (1)
- gdb (2)
- gmail (1)
- gnome (1)
- gnuplot (4)
- google-chrome (1)
- greasemonkey (1)
- grep (1)
- gtk (1)
- h264 (2)
- highlight (2)
- hotfile (1)
- hotkey (1)
- hotmail (1)
- hotspotter (1)
- hp (1)
- image-manipulation (3)
- initrd (1)
- iso (1)
- java (3)
- jelly bean (1)
- kernel (1)
- keyboard (1)
- klog (1)
- konqueror (1)
- ktorrent (1)
- laptop (1)
- latex (7)
- lcd (1)
- lightdm (1)
- linux (39)
- lubuntu (3)
- lxde (1)
- lyrics (4)
- lyx (2)
- mac (1)
- mangafox (1)
- miktex (2)
- mkv (2)
- monitor (1)
- mplayer (3)
- netgear (1)
- ns2 (2)
- onemanga (1)
- open-office (1)
- partition (1)
- pastebin (1)
- pdroid (1)
- pennytel (2)
- perl (1)
- php (1)
- pop (1)
- popup (1)
- premiumforfree (1)
- printk (2)
- programming (3)
- prothom-alo (2)
- python (3)
- rapidshare (1)
- real-audio (1)
- reverse-engineering (3)
- screensaver (1)
- sed (6)
- skype (2)
- sms (1)
- ssh (1)
- strace (1)
- swap (1)
- synergy (1)
- taint (1)
- taintdroid (1)
- tcl (1)
- tcpdump (1)
- teleport (1)
- theme (1)
- tshark (3)
- tvshark (1)
- ubuntu (35)
- uuid (1)
- vim (5)
- virtual-box (2)
- vnc (1)
- webmail (2)
- windows (7)
- windows8 (2)
- wine (4)
- wireshark (1)
- word-list (1)
- x11 (3)
- yahoo (1)

