Monthly Archives: September 2008

To kill Dead process

for i in `ps ax | grep D | awk {‘print $1′}`;do kill -9 $(cat /proc/${i}/status | grep PPid | awk {‘print $2′});done

Posted in Scripts

To kill Zombie process

for i in `ps ax | grep Z | awk {‘print $1′}`;do kill -9 $(cat /proc/${i}/status | grep PPid | awk {‘print $2′});done

Posted in Scripts

To find ddos attack

netstat -an |grep 80 netstat -plan|grep :80|awk {‘print $5′}|cut -d: -f 1|sort|uniq -c|sort -nk 1 netstat -plan|grep :25|awk {‘print $5′}|cut -d: -f 1|sort|uniq -c|sort -nk 1 watch -n 5 ‘w; ls -alS /usr/local/apache/domlogs/ ‘

Posted in Scripts

Top memory consuming processes

ps aux | head -1;ps aux –no-headers| sort -rn +3 | head

Posted in Scripts

Number of exim connections

tail -1000 /var/log/exim_mainlog |grep ‘\[‘ |cut -d[ -f2 |cut -d] -f1|sort -n |uniq -c |sort -n

Posted in Scripts

To find cppop attack

tail -1000 /var/log/maillog | grep host= | cut -d= -f2| cut -d” ” -f1|sort -n |uniq -c |sort -n

Posted in Scripts

To find number of httpd connections

netstat -plan|grep :80|awk {‘print $5′}|cut -d: -f 1|sort|uniq -c|sort -nk 1 or netstat -pan | sort +4 | grep TIME_WAIT | awk ‘{print $5}’ | sed -e s/':.*’//g | sort | uniq -c | sort -k 1 -nr | head -n

Posted in Scripts
Blog Stats
  • 118,259 hits
Follow

Get every new post delivered to your Inbox.

Join 209 other followers