Posts

Showing posts from October, 2015

Shell Scripting

Script to monitor the outgoing ssh connection on a linx machine (100 is a private n/w so grepping it out) max_ssh_conn=0 while true do ssh_conn=`netstat -an|grep -v 127|grep -v "100.1.1"|grep ":22"|grep ESTABLISHED|wc -l` if [ $ssh_conn -gt $max_ssh_conn ] then  echo -n "connection increased to " max_ssh_conn=$ssh_conn echo $max_ssh_conn else echo "connection max seen is " $max_ssh_conn "and current connection level is at" $ssh_conn fi sleep 1 done List only the filenames after using find command find /opt -name '*.jar' -printf "%f\n"

some funny stuffs

Dazed and confused :)   [root@PC-020 ~]#  Message from syslogd@PC-020 at Jul 29 16:12:08 ...  kernel:Uhhuh. NMI received for unknown reason b1 on CPU 0. Message from syslogd@PC-020 at Jul 29 16:12:08 ...  kernel:You have some hardware problem, likely on the PCI bus. Message from syslogd@PC-020 at Jul 29 16:12:08 ...  kernel:Dazed and confused, but trying to continue Write failed: Broken pipe [root@ATT-Pres ams]#