Skip to content

Instantly share code, notes, and snippets.

@yorickdowne
Last active February 23, 2023 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yorickdowne/ea91cb6d0cf7ad7afd2d6f3d4729b770 to your computer and use it in GitHub Desktop.
Save yorickdowne/ea91cb6d0cf7ad7afd2d6f3d4729b770 to your computer and use it in GitHub Desktop.
#! /bin/bash
# http://linuxcommand.org/wss0150.php
function error_exit
{
echo "$1" 1>&2
exit 1
}
# http://unix.stackexchange.com/questions/70859/why-doesnt-sudo-su-in-a-shell-script-run-the-rest-of-the-script-as-root
if [ `whoami` = root ]; then
apt-get update
apt-get -y install ca-certificates curl gnupg lsb-release msmtp msmtp-mta htop chrony ufw
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
apt-get -y dist-upgrade
usermod -aG docker debian
echo 'alias docker-compose="docker compose"' >>/home/debian/.profile
cat <<EOF >/home/debian/.vimrc
set paste
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
filetype indent on
syntax on
EOF
cp /home/debian/.vimrc /root/
else
error_exit "Should not be here!!!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment