Skip to content

Instantly share code, notes, and snippets.

@OffS3c
Last active April 25, 2024 08:54
Show Gist options
  • Save OffS3c/d9857ad95e68416c12b7ef511fbc11ce to your computer and use it in GitHub Desktop.
Save OffS3c/d9857ad95e68416c12b7ef511fbc11ce to your computer and use it in GitHub Desktop.
setup.sh
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
export TERM=xterm-mono
cd ~
sudo apt update
sudo apt full-upgrade -y
sudo apt autoremove -y
sudo apt -y install apt-transport-https git wget build-essential ca-certificates curl gnupg-agent software-properties-common
sudo apt clean
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt install docker-ce docker-ce-cli containerd.io -y
sudo usermod -aG docker $USER
export COMPOSE_VERSION_LATEST=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
export COMPOSE_VERSION_LATEST_BC="${COMPOSE_VERSION_LATEST:1}"
sudo -E curl -L "https://github.com/docker/compose/releases/download/$(echo -n $COMPOSE_VERSION_LATEST)/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo -E curl -L "https://raw.githubusercontent.com/docker/compose/$(echo -n $COMPOSE_VERSION_LATEST_BC)/contrib/completion/bash/docker-compose" -o /etc/bash_completion.d/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo chmod +x /etc/bash_completion.d/docker-compose
sudo rm -rf /etc/bash_completion.d/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo systemctl enable docker
sudo apt install nmap python zip unzip -y
sudo apt install ncat -y || true
sudo apt autoremove -y
sudo apt clean
git config --global user.name "bot"
git config --global user.email "bot@localhost.com"
sudo reboot
@OffS3c
Copy link
Author

OffS3c commented Aug 30, 2023

curl -s https://gist.githubusercontent.com/OffS3c/d9857ad95e68416c12b7ef511fbc11ce/raw/68b08a213bb30de38823fd08f5caa4ac75282717/setup.sh | bash

@OffS3c
Copy link
Author

OffS3c commented Aug 30, 2023

export COMPOSE_VERSION_LATEST=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4) && apt update && apt install python3 -y && apt full-upgrade -y && apt clean && curl -L "https://github.com/docker/compose/releases/download/$(echo -n $COMPOSE_VERSION_LATEST)/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && curl -L "https://raw.githubusercontent.com/docker/compose/$(echo -n $COMPOSE_VERSION_LATEST)/contrib/completion/bash/docker-compose" -o /etc/bash_completion.d/docker-compose && chmod +x /usr/local/bin/docker-compose && chmod +x /etc/bash_completion.d/docker-compose && rm -rf /etc/bash_completion.d/docker-compose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment