Skip to content

Instantly share code, notes, and snippets.

@weirded
Created May 24, 2012 05:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save weirded/2779581 to your computer and use it in GitHub Desktop.
Save weirded/2779581 to your computer and use it in GitHub Desktop.
Data Destroying Drone script
#!/bin/bash
set -e
export INSTANCE_ID=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id`
export VOLUME_ID=v-12345678
export EC2_URL=https://ec2.us-east-1.amazonaws.com
export EC2_ACCESS_KEY=[key id]
export EC2_SECRET_KEY=[key]
sudo apt-get install scrub
euca-attach-volume -i $INSTANCE_ID -d /dev/sdj $VOLUME_ID
sudo scrub -b 50M -p dod /dev/sdj > ~/sdj.scrub.log 2>&1
sleep 30
euca-detach-volume $VOLUME_ID
euca-delete-volume $VOLUME_ID
halt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment