Skip to content

Instantly share code, notes, and snippets.

@Sydney-o9
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sydney-o9/1f06281aca976e11d580 to your computer and use it in GitHub Desktop.
Save Sydney-o9/1f06281aca976e11d580 to your computer and use it in GitHub Desktop.
(Re)-package CentOS 6.6 Box
#!/usr/bin/env bash
echo "1. Yum Cleaning"
sudo yum clean all
echo "2. Clean /tmp folder"
sudo rm -rf /tmp/*
echo "3. Removing log files"
sudo rm -f /var/log/wtmp /var/log/btmp
echo "4. Compressing disk. (writng zeroes to all empty space on the volume)"
sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
echo "5. Removing History"
cat /dev/null > ~/.bash_history && history -c
echo "6. Shutting Down Machine Now"
sudo shutdown -h now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment