initial commit
This commit is contained in:
commit
acde20fb92
8 changed files with 75 additions and 0 deletions
12
README.md
Normal file
12
README.md
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
# Ubuntu Installation Cleanup Scripts
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Validate the scripts.
|
||||||
|
|
||||||
|
Download and execute the script is the hash matches:
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -sSL https://git.giftfish.de/ston1th/cleanup/raw/branch/master/ubuntu_2004_full.sh >/tmp/cleanup.sh
|
||||||
|
[ "$(sha256sum /tmp/cleanup.sh|cut -d' ' -f1)" = "fe2827d03ebba6e058ed7b9e56116eef78a45606f2e5f2956b2b2f495f042724" ] && sh /tmp/cleanup.sh || echo "error: cleanup script hash does not match" >&2
|
||||||
|
```
|
||||||
4
hash.sh
Executable file
4
hash.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
for f in $(ls ubuntu*); do
|
||||||
|
sha256sum ${f} >${f}.sha256
|
||||||
|
done
|
||||||
26
ubuntu_2004.sh
Normal file
26
ubuntu_2004.sh
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/sh
|
||||||
|
apt-get -y purge alsa-topology-conf alsa-ucm-conf apport \
|
||||||
|
apport-symptoms at bash-completion bolt byobu eatmydata command-not-found \
|
||||||
|
eject fonts-ubuntu-console htop install-info landscape-common lxd-agent-loader \
|
||||||
|
motd-news-config nano ntfs-3g pastebinit plymouth plymouth-theme-ubuntu-text \
|
||||||
|
popularity-contest policykit-1 python3-apport os-prober snapd \
|
||||||
|
sound-theme-freedesktop ubuntu-advantage-tools ufw
|
||||||
|
apt-get -y autoremove --purge
|
||||||
|
apt-get -y clean
|
||||||
|
|
||||||
|
mkdir /etc/systemd/system/motd-news.service.d
|
||||||
|
cat <<EOF>/etc/systemd/system/motd-news.service.d/override.conf
|
||||||
|
[Service]
|
||||||
|
ExecStart=/bin/true
|
||||||
|
EOF
|
||||||
|
|
||||||
|
mkdir /etc/systemd/timesyncd.conf.d
|
||||||
|
cat <<EOF>/etc/systemd/timesyncd.conf.d/ntp.conf
|
||||||
|
[Time]
|
||||||
|
NTP=pool.ntp.org
|
||||||
|
EOF
|
||||||
|
|
||||||
|
rm /home/ubuntu/.ssh/authorized_keys
|
||||||
|
find /var/log -type f | while read f; do echo -ne >$f; done
|
||||||
|
rm -rf /var/lib/cloud/* /var/tmp/* /tmp/* /tmp/.*-unix
|
||||||
|
exit 0
|
||||||
1
ubuntu_2004.sh.sha256
Normal file
1
ubuntu_2004.sh.sha256
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
15d111ab2de72ef204a6e3dd77006038f869f3d596109a34a994d0474e124816 ubuntu_2004.sh
|
||||||
1
ubuntu_2004.sh.sha256.sha256
Normal file
1
ubuntu_2004.sh.sha256.sha256
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
213d1b35771c3a43ae53667ef0a25beecd9faaed3b2c21355ba4584210c63b68 ubuntu_2004.sh.sha256
|
||||||
29
ubuntu_2004_full.sh
Normal file
29
ubuntu_2004_full.sh
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
#!/bin/sh
|
||||||
|
apt-get -y purge alsa-topology-conf alsa-ucm-conf apport \
|
||||||
|
apport-symptoms at bash-completion bolt byobu eatmydata command-not-found \
|
||||||
|
eject fonts-ubuntu-console htop install-info landscape-common lxd-agent-loader \
|
||||||
|
motd-news-config nano ntfs-3g pastebinit plymouth plymouth-theme-ubuntu-text \
|
||||||
|
popularity-contest policykit-1 python3-apport os-prober snapd \
|
||||||
|
sound-theme-freedesktop ubuntu-advantage-tools ufw
|
||||||
|
apt-get -y purge accountsservice multipath-tools packagekit udisks2 \
|
||||||
|
unattended-upgrades lshw lsof ltrace man-db manpages mdadm mtr-tiny \
|
||||||
|
screen sosreport strace tcpdump tmux usbutils whiptail
|
||||||
|
apt-get -y autoremove --purge
|
||||||
|
apt-get -y clean
|
||||||
|
|
||||||
|
mkdir /etc/systemd/system/motd-news.service.d
|
||||||
|
cat <<EOF>/etc/systemd/system/motd-news.service.d/override.conf
|
||||||
|
[Service]
|
||||||
|
ExecStart=/bin/true
|
||||||
|
EOF
|
||||||
|
|
||||||
|
mkdir /etc/systemd/timesyncd.conf.d
|
||||||
|
cat <<EOF>/etc/systemd/timesyncd.conf.d/ntp.conf
|
||||||
|
[Time]
|
||||||
|
NTP=pool.ntp.org
|
||||||
|
EOF
|
||||||
|
|
||||||
|
rm /home/ubuntu/.ssh/authorized_keys
|
||||||
|
find /var/log -type f | while read f; do echo -ne >$f; done
|
||||||
|
rm -rf /var/lib/cloud/* /var/tmp/* /tmp/* /tmp/.*-unix
|
||||||
|
exit 0
|
||||||
1
ubuntu_2004_full.sh.sha256
Normal file
1
ubuntu_2004_full.sh.sha256
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
fe2827d03ebba6e058ed7b9e56116eef78a45606f2e5f2956b2b2f495f042724 ubuntu_2004_full.sh
|
||||||
1
ubuntu_2004_full.sh.sha256.sha256
Normal file
1
ubuntu_2004_full.sh.sha256.sha256
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
1806939ad40adae83d208a759732696ccb3b11587013488b6e9b09f328d6ee60 ubuntu_2004_full.sh.sha256
|
||||||
Loading…
Add table
Add a link
Reference in a new issue