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
Last revisionBoth sides next revision
scripts [2013/03/11 13:41] – created cedricscripts [2013/03/11 14:15] 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 `awk '{print $NF}' /var/log/fail2ban.log | 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.txt · Last modified: 2013/03/11 14:32 by cedric