Skip to content

Instantly share code, notes, and snippets.

@Benoss
Last active May 13, 2018 10:18
Show Gist options
  • Save Benoss/3a9aa3c8a5a6b1d94537c02319546534 to your computer and use it in GitHub Desktop.
Save Benoss/3a9aa3c8a5a6b1d94537c02319546534 to your computer and use it in GitHub Desktop.
#! /bin/sh
# oneliner to get and update the above script
# wget https://gist.githubusercontent.com/Benoss/3a9aa3c8a5a6b1d94537c02319546534/raw/get_startup_gist.sh -O get_startup_gist.sh && chmod +x get_startup_gist.sh && ./get_startup_gist.sh
# Or you can copy the content of this file
wget https://gist.githubusercontent.com/Benoss/3a9aa3c8a5a6b1d94537c02319546534/raw/install_docker_and_nginx_16_04.sh -O install_docker_and_nginx_16_04.sh
chmod +x install_docker_and_nginx_16_04.sh
./install_docker_and_nginx_16_04.sh
#utils:
# Simple CPU Benchmark single thread for i in {1..5}; do time ssh-keygen -b 8192 -f /tmp/test_ssh -N '' -q && rm /tmp/test_ssh; done
# other benchmark python3 -m test.pystone 500000
# Get info about the machine wget --no-check-certificate https://github.com/rafa3d/vHWINFO/raw/master/vhwinfo.sh -O - -o /dev/null|bash
#!/bin/sh
DOCKER_COMPOSE_V="1.21.2"
DOCKER_COMPOSE_LINK="https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_V}/docker-compose-$(uname -s)-$(uname -m)"
DISTRIB_NAME="ubuntu"
DISTRIB_VERSION="xenial"
#DISTRIB_NAME="debian"
#DISTRIB_VERSION="stretch"
sudo apt-get update
sudo apt-get install apt-transport-https -y
curl -fsSL http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
curl -fsSL https://download.docker.com/linux/$DISTRIB_NAME/gpg | sudo apt-key add -
echo "deb [arch=amd64] https://download.docker.com/linux/$DISTRIB_NAME $DISTRIB_VERSION stable" | sudo tee /etc/apt/sources.list.d/docker.list
echo "deb http://nginx.org/packages/$DISTRIB_NAME/ $DISTRIB_VERSION nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
echo "deb-src http://nginx.org/packages/$DISTRIB_NAME/ $DISTRIB_VERSION nginx" | sudo tee -a /etc/apt/sources.list.d/nginx.list
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install ca-certificates ntp htop ncdu git jq docker-ce nginx -y
sudo service docker start
sudo sh -c "curl -L $DOCKER_COMPOSE_LINK > /usr/local/bin/docker-compose"
sudo chmod +x /usr/local/bin/docker-compose
LATEST="$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.tag_name')"
echo "Docker compose installed is $DOCKER_COMPOSE_V latest is $LATEST orginal gist is https://gist.github.com/Benoss/3a9aa3c8a5a6b1d94537c02319546534/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment