Skip to content

Instantly share code, notes, and snippets.

@fxlv
Last active August 29, 2015 14:11
Show Gist options
  • Save fxlv/d5b2125d5604a843be5b to your computer and use it in GitHub Desktop.
Save fxlv/d5b2125d5604a843be5b to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "cleaning up apt cache"
sudo apt-get clean
sudo /etc/init.d/rsyslog stop
echo "Removing old logs"
sudo find /var/log -type f -delete
echo "Zeroing out disk"
sudo dd if=/dev/zero of=/zero bs=1M
echo "Removing zero file"
sudo rm -v /zero
echo "Cleaning up the history"
cat /dev/null |sudo tee /root/.bash_history
cat /dev/null |sudo tee /home/vagrant/.bash_history
history -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment