Monday, January 22, 2007

What Ruth Turner should've done

Apologies in advance for those that have no idea what I am talking about. I simply couldn't resist. Trust me, its funny.
#!/bin/bash

echo -n "What email do you want to destroy today? : "
read destroy
size=`stat $destroy | grep Size | awk '{print $2}'`
count=`echo $(( $size / 512 +1 ))`
for i in $(seq 1 1000)
do
dd if=/dev/random of=$destroy count=$count
clear
echo "Overwriting $destroy with random data $i times"
done
for i in $(seq 1 1000)
do
dd if=/dev/zero of=$destroy count=$count
clear
echo "Overwriting $destroy with zeros $i times"
done
echo "$destroy has been obliterated properly"
echo "You have now successfully perverted the course of justice"
Note: Probably won't work well on journal based filesystem, RAID5 or NFS. But its still funny.

3 comments:

Anonymous said...

erm... the grep statement wont return anything. Shouldn't lines 5 and 6 be;

count='stat -f "%z" %destroy'

Such a nerd; I know, I know.

dizzy said...

Depends on the version of "stat" you're using, so we're both right.

Anonymous said...

Fair enough. Let me assure everybody that Dizzy isn't lying, it is pretty funny!