From 2ce00a122543d442aeb41121f55d15ad4b4f5899 Mon Sep 17 00:00:00 2001 From: ston1th Date: Fri, 10 Dec 2021 23:43:21 +0100 Subject: [PATCH] added ubuntu 18.04 --- README.md | 4 +++- hash.sh | 4 ++-- ubuntu_1804.sh | 23 +++++++++++++++++++++++ ubuntu_1804.sh.sha256 | 1 + ubuntu_1804_full.sh | 25 +++++++++++++++++++++++++ ubuntu_1804_full.sh.sha256 | 1 + ubuntu_2004.sh.sha256 | 2 +- ubuntu_2004.sh.sha256.sha256 | 1 - ubuntu_2004_full.sh.sha256 | 2 +- ubuntu_2004_full.sh.sha256.sha256 | 1 - ubuntu_2004_min.sh | 26 ++++++++++++++++++++++++++ ubuntu_2004_min.sh.sha256 | 1 + 12 files changed, 84 insertions(+), 7 deletions(-) create mode 100644 ubuntu_1804.sh create mode 100644 ubuntu_1804.sh.sha256 create mode 100644 ubuntu_1804_full.sh create mode 100644 ubuntu_1804_full.sh.sha256 delete mode 100644 ubuntu_2004.sh.sha256.sha256 delete mode 100644 ubuntu_2004_full.sh.sha256.sha256 create mode 100644 ubuntu_2004_min.sh create mode 100644 ubuntu_2004_min.sh.sha256 diff --git a/README.md b/README.md index c52ba94..3e214a7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ Validate the scripts. -Download and execute the script is the hash matches: +Calculate the `sha256` hash for yourself. + +Download and execute the script if the hash matches: ``` curl -sSL https://git.giftfish.de/ston1th/cleanup/raw/branch/master/ubuntu_2004_full.sh >/tmp/cleanup.sh diff --git a/hash.sh b/hash.sh index f5e3e32..9a8014c 100755 --- a/hash.sh +++ b/hash.sh @@ -1,4 +1,4 @@ #!/bin/sh -for f in $(ls ubuntu*); do - sha256sum ${f} >${f}.sha256 +for f in $(ls ubuntu*.sh); do + sha256sum ${f} | cut -d' ' -f1 >${f}.sha256 done diff --git a/ubuntu_1804.sh b/ubuntu_1804.sh new file mode 100644 index 0000000..c6ec59a --- /dev/null +++ b/ubuntu_1804.sh @@ -0,0 +1,23 @@ +#!/bin/sh +apt-get -y purge apport apport-symptoms bash-completion byobu \ + htop landscape-common lxcfs lxd lxd-client motd-news-config \ + nano ntfs-3g os-prober ufw +apt-get -y autoremove --purge +apt-get -y clean + +mkdir /etc/systemd/system/motd-news.service.d +cat </etc/systemd/system/motd-news.service.d/override.conf +[Service] +ExecStart=/bin/true +EOF + +mkdir /etc/systemd/timesyncd.conf.d +cat </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 diff --git a/ubuntu_1804.sh.sha256 b/ubuntu_1804.sh.sha256 new file mode 100644 index 0000000..afe564d --- /dev/null +++ b/ubuntu_1804.sh.sha256 @@ -0,0 +1 @@ +d0b579bb906528e06b2ee3298b31b73ae786b4dd9237a1da6fce3359bf867af4 diff --git a/ubuntu_1804_full.sh b/ubuntu_1804_full.sh new file mode 100644 index 0000000..2ebf287 --- /dev/null +++ b/ubuntu_1804_full.sh @@ -0,0 +1,25 @@ +#!/bin/sh +apt-get -y purge apport apport-symptoms bash-completion byobu \ + htop landscape-common lxcfs lxd lxd-client motd-news-config \ + nano ntfs-3g os-prober ufw +apt-get -y purge 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 </etc/systemd/system/motd-news.service.d/override.conf +[Service] +ExecStart=/bin/true +EOF + +mkdir /etc/systemd/timesyncd.conf.d +cat </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 diff --git a/ubuntu_1804_full.sh.sha256 b/ubuntu_1804_full.sh.sha256 new file mode 100644 index 0000000..ab08d68 --- /dev/null +++ b/ubuntu_1804_full.sh.sha256 @@ -0,0 +1 @@ +0bd0b15de9bc317f8f73ed6ce0785cdbcd7dbdc81e701bf4c77da376638052a0 diff --git a/ubuntu_2004.sh.sha256 b/ubuntu_2004.sh.sha256 index 2dcf7bc..65ff419 100644 --- a/ubuntu_2004.sh.sha256 +++ b/ubuntu_2004.sh.sha256 @@ -1 +1 @@ -15d111ab2de72ef204a6e3dd77006038f869f3d596109a34a994d0474e124816 ubuntu_2004.sh +15d111ab2de72ef204a6e3dd77006038f869f3d596109a34a994d0474e124816 diff --git a/ubuntu_2004.sh.sha256.sha256 b/ubuntu_2004.sh.sha256.sha256 deleted file mode 100644 index bc5be5d..0000000 --- a/ubuntu_2004.sh.sha256.sha256 +++ /dev/null @@ -1 +0,0 @@ -213d1b35771c3a43ae53667ef0a25beecd9faaed3b2c21355ba4584210c63b68 ubuntu_2004.sh.sha256 diff --git a/ubuntu_2004_full.sh.sha256 b/ubuntu_2004_full.sh.sha256 index 5cd2b7c..0bc2403 100644 --- a/ubuntu_2004_full.sh.sha256 +++ b/ubuntu_2004_full.sh.sha256 @@ -1 +1 @@ -fe2827d03ebba6e058ed7b9e56116eef78a45606f2e5f2956b2b2f495f042724 ubuntu_2004_full.sh +fe2827d03ebba6e058ed7b9e56116eef78a45606f2e5f2956b2b2f495f042724 diff --git a/ubuntu_2004_full.sh.sha256.sha256 b/ubuntu_2004_full.sh.sha256.sha256 deleted file mode 100644 index 2b0588f..0000000 --- a/ubuntu_2004_full.sh.sha256.sha256 +++ /dev/null @@ -1 +0,0 @@ -1806939ad40adae83d208a759732696ccb3b11587013488b6e9b09f328d6ee60 ubuntu_2004_full.sh.sha256 diff --git a/ubuntu_2004_min.sh b/ubuntu_2004_min.sh new file mode 100644 index 0000000..fef062e --- /dev/null +++ b/ubuntu_2004_min.sh @@ -0,0 +1,26 @@ +#!/bin/sh +apt-get -y purge alsa-topology-conf alsa-ucm-conf apport \ + apport-symptoms bolt byobu eatmydata command-not-found \ + eject fonts-ubuntu-console lxd-agent-loader \ + nano ntfs-3g pastebinit plymouth plymouth-theme-ubuntu-text \ + popularity-contest python3-apport os-prober \ + sound-theme-freedesktop +apt-get -y autoremove --purge +apt-get -y clean + +mkdir /etc/systemd/system/motd-news.service.d +cat </etc/systemd/system/motd-news.service.d/override.conf +[Service] +ExecStart=/bin/true +EOF + +mkdir /etc/systemd/timesyncd.conf.d +cat </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 diff --git a/ubuntu_2004_min.sh.sha256 b/ubuntu_2004_min.sh.sha256 new file mode 100644 index 0000000..49fa264 --- /dev/null +++ b/ubuntu_2004_min.sh.sha256 @@ -0,0 +1 @@ +22719b169127b311f024c0a8d9f2c1f5c69115b4d0bc7c2224f5ee3cccb15e2f