Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -xe |
| 4 | |
| 5 | # Delete vagrant user |
| 6 | sudo userdel -r -f vagrant |
| 7 | |
| 8 | # Free space on disk |
Carmelo Cascone | 57defd3 | 2018-05-11 14:34:01 -0700 | [diff] [blame] | 9 | rm -rf ~/p4tools/protobuf |
| 10 | rm -rf ~/p4tools/grpc |
| 11 | rm -rf ~/p4tools/bmv2 |
| 12 | rm -rf ~/p4tools/p4runtime |
| 13 | rm -rf ~/p4tools/p4c |
| 14 | rm -rf ~/p4tools/libyang |
| 15 | rm -rf ~/p4tools/sysrepo |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 16 | |
Carmelo Cascone | 57defd3 | 2018-05-11 14:34:01 -0700 | [diff] [blame] | 17 | sudo apt-get clean |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 18 | sudo apt-get -y autoremove |
Carmelo Cascone | 57defd3 | 2018-05-11 14:34:01 -0700 | [diff] [blame] | 19 | sudo rm -rf /tmp/* |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 20 | |
Carmelo Cascone | 57defd3 | 2018-05-11 14:34:01 -0700 | [diff] [blame] | 21 | # Zerofill virtual hd to save space when exporting |
| 22 | time sudo dd if=/dev/zero of=/tmp/zero bs=1M || true |
| 23 | sync ; sleep 1 ; sync ; sudo rm -f /tmp/zero |
| 24 | |
| 25 | history -c |
| 26 | rm -f ~/.bash_history |