- Using a ready-to-use Ubuntu image
This file contains 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 characters
# clean arm64/amd64 instance with (ubuntu 22.04 minimal) | |
# all actions require root privileges (aka "sudo -i") | |
export DEBIAN_FRONTEND=noninteractive; apt update && apt install lsof | |
# prepare | |
snap remove --purge oracle-cloud-agent && snap remove --purge core18 && \ | |
apt-get purge -y $(dpkg-query -Wf '${Package}\n' | grep header) $(dpkg-query -Wf '${Package}\n' | grep -oP "^linux.*\d\d\d\d-oracle" | grep -v "$(uname -r)") linux-modules-extra-$(uname -r) lxc* lxd* vim* snapd* python* && \ | |
apt-get -y autoremove --purge && apt-get -y autoclean && rm -rf /var/log/* /var/lib/apt/* /var/cache/apt/* && cd / && \ | |
mount -t tmpfs -o size=1700m tmpfs mnt && tar --one-file-system -c . | tar -C /mnt -x && \ | |
mount --make-private -o remount,rw / && \ |
This file contains 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 characters
#debian, ubuntu | |
sed 's|mozilla\/AddTrust_External_Root.crt|!mozilla\/AddTrust_External_Root.crt|g' -i /etc/ca-certificates.conf ; update-ca-certificates -f -v | |
#centos | |
trust dump --filter "pkcs11:id=%AD%BD%98%7A%34%B4%26%F7%FA%C4%26%54%EF%03%BD%E0%24%CB%54%1A;type=cert" > /etc/pki/ca-trust/source/blacklist/addtrust-external-root.p11-kit ; update-ca-trust extract |
This file contains 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 characters
#!/bin/bash | |
python3 bot.py |