Saturday, April 13, 2013

alias for converting unix epoch time



alias conv="perl -pe 's/(\d+)/localtime($1)/e'"

tail -f nagios.log | conv

Saturday, April 6, 2013

non-root user capture


ssh -X user@host


sudo apt-get install libcanberra-gtk-module libcap2-bin
sudo chgrp wireshark /usr/bin/dumpcap
sudo chmod 750 /usr/bin/dumpcap
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
sudo getcap /usr/bin/dumpcap

Launch wireshark
Capture

Wednesday, April 3, 2013

when did linux boot?


jibe02:~# cat /proc/stat
cpu  93878078 0 16855580 25751420315 34959524 105248 583941 0 0
cpu0 17320194 0 4114063 6378518608 8860219 25377 139115 0 0
cpu1 31359989 0 5080216 6433128705 9034045 26296 152290 0 0
cpu2 23660085 0 3881774 6448155438 8538259 27098 140773 0 0
cpu3 21537809 0 3779525 6491617563 8527000 26475 151761 0 0
intr 2015970250 64 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 125 0 0 0 0 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7317621 1852240958 156411454 0 0 0 0 0 0 0 0 0
ctxt 49060828436
btime 1301067620
processes 5483876
procs_running 1
procs_blocked 0
jibe02:~# date -R -d @1301067620
Fri, 25 Mar 2011 08:40:20 -0700