User Tools

Site Tools


scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scripts [2013/03/11 13:41] – created cedricscripts [2013/03/11 14:32] (current) cedric
Line 1: Line 1:
 +====== Server administration ======
 +
 <code bash> <code bash>
 #! /bin/sh #! /bin/sh
  
-for ip in echo `grep -i unban /var/log/fail2ban.log | awk '{print $NF}'`+for ip in echo `grep Ban /var/log/fail2ban.log | awk '{print $NF}' | sort | uniq`
 do do
     for email in `whois $ip | perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}' | sort | uniq`     for email in `whois $ip | perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}' | sort | uniq`
Line 19: Line 21:
     done     done
 done done
 +</code>
 +
 +====== apt and dpkg ======
 +
 +<code bash>
 +dpkg -l |awk '/^rc/ {print $2}' | xargs sudo dpkg --purge
 </code> </code>
scripts.1363005684.txt.gz · Last modified: 2013/03/11 13:41 by cedric