Skip to content

Instantly share code, notes, and snippets.

@PeteLawrence
Created May 4, 2016 14:15
Show Gist options
  • Save PeteLawrence/05190ea897648ab38f200d84a4cbe687 to your computer and use it in GitHub Desktop.
Save PeteLawrence/05190ea897648ab38f200d84a4cbe687 to your computer and use it in GitHub Desktop.
Cleans up a vagrant box, ready for packaging
#!/bin/bash
# Based on https://scotch.io/tutorials/how-to-create-a-vagrant-base-box-from-an-existing-one
# Clear the apt-get cache
sudo apt-get clean
# Zero out the drive
sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
# Reset the shell history and exit
cat /dev/null > ~/.bash_history && history -c && exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment