Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
for i in `seq 37 47`; do apt-get -yy purge linux-image-3.2.0-$i-virtual linux-headers-3.2.0-$i; rm -rfv /lib/modules/3.2.0-$i-virtual; done

 

 

Removing set of e-mail address from another set of email address

List of address with optional names, separated by whitespace:

Code Block
visser@rasputin:~$ cat addresses.txt
dick@TIENHUIS.nl  Dick Visser
dnmvisser@Gmail.CoM  Dick "Gmail" Visser
dnmvisser@yahoo.com
dick.visser@geant.org  Dick Visser
visser@terena.org Dick's old address...

Similar for a blacklist:

Code Block
visser@rasputin:~$ cat blacklist.txt
Dnmvisser@gmail.com  Evil guy

 

You can 'subtract' the blacklist using this Ruby one line:

 

Code Block
languagebash
visser@rasputin:~$ ruby -e 'a = File.readlines("addresses.txt").map { |x| x.split.first.downcase } - File.readlines("blacklist.txt").map { |x| x.split.first.downcase }; puts a'
dick@tienhuis.nl
dnmvisser@yahoo.com
dick.visser@geant.org
visser@terena.org