-
-
Save delano/4eee6bcfce0b6e3c83f1e98d9cd7af16 to your computer and use it in GitHub Desktop.
Revisions
-
delano revised this gist
Oct 26, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ See: https://gist.github.com/delano/4eee6bcfce0b6e3c83f1e98d9cd7af16 -
delano revised this gist
Oct 26, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,8 +13,8 @@ function print_green { print_green 'Clean Apt' apt-get -y autoremove apt clean apt autoclean print_green 'Remove SSH keys' [ -f /home/ubuntu/.ssh/authorized_keys ] && rm /home/ubuntu/.ssh/authorized_keys -
delano revised this gist
Oct 26, 2022 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,11 @@ #!/bin/bash # Forked from: https://gist.github.com/justindowning/5921369/raw/ami-clean.sh # This script cleans up your EC2 instance before baking a new AMI. # Run the following command in a root shell: # # bash <(curl -s https://gist.githubusercontent.com/delano/4eee6bcfce0b6e3c83f1e98d9cd7af16/raw/ami-clean.sh) function print_green { echo -e "\e[32m${1}\e[0m" @@ -25,4 +27,4 @@ unset HISTFILE [ -f /root/.bash_history ] && rm /root/.bash_history [ -f /home/ubuntu/.bash_history ] && rm /home/ubuntu/.bash_history print_green 'AMI cleanup complete!' -
jdowning revised this gist
Jul 3, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ # This script cleans up your EC2 instance before baking a new AMI. # Run the following command in a root shell: # # bash <(curl -s https://gist.github.com/justindowning/5921369/raw/ami-clean.sh) function print_green { echo -e "\e[32m${1}\e[0m" -
jdowning created this gist
Jul 3, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ #!/bin/bash # This script cleans up your EC2 instance before baking a new AMI. # Run the following command in a root shell: # # bash <(curl -s https://gist.github.com/justindowning/ami-clean.sh) function print_green { echo -e "\e[32m${1}\e[0m" } print_green 'Clean Apt' apt-get -y autoremove aptitude clean aptitude autoclean print_green 'Remove SSH keys' [ -f /home/ubuntu/.ssh/authorized_keys ] && rm /home/ubuntu/.ssh/authorized_keys print_green 'Cleanup log files' find /var/log -type f | while read f; do echo -ne '' > $f; done print_green 'Cleanup bash history' unset HISTFILE [ -f /root/.bash_history ] && rm /root/.bash_history [ -f /home/ubuntu/.bash_history ] && rm /home/ubuntu/.bash_history print_green 'AMI cleanup complete!'