Tuesday, January 11

Moar Bash - Time to get some contact info...

Once again a task from work presented a strange challenge, reading the contact infomation for 400+ domains...

for x in $(cat ./list_of_domains); do whois -H $x | awk 'BEGIN{RS=""}/Registrant/,/Registration Service Provider:/ {print} END{print "----------------\n"}' && sleep 5000; done >> ./domain_infomation


Wednesday, January 5

lil' bit o' Bash to kill a hard drive via shred

Just a lil' something I wrote to clear hdds as I was doing lots at work...

no error checking or anything sensible like that, use at your own risk ;)

tim.bowers@timDesktop ~ $cat ./bin/kill_drive 
echo 'You wish to kill '$1'. Are you sure? (y/n)'
read consent
if [ $consent != "y" ]; then
echo 'Quitting'
sudo shred -v /dev/$1; xmessage -nearmouse Finished killing $1 &

Search This Blog