Last active
April 19, 2021 19:05
-
-
Save luke-han/5311af1c7c66b46fc9ba7a255d43ec76 to your computer and use it in GitHub Desktop.
snippets for setup machines
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
#!/usr/bin/env bash | |
# update and install latest packages | |
sudo apt update --fix-missing && sudo apt upgrade -y --fix-missing | |
# install lambda stack (nvidia driver, cuda, cudnn) | |
# https://lambdalabs.com/lambda-stack-deep-learning-software | |
LAMBDA_REPO=$(mktemp) && \ | |
wget -O${LAMBDA_REPO} https://lambdalabs.com/static/misc/lambda-stack-repo.deb && \ | |
sudo dpkg -i ${LAMBDA_REPO} && rm -f ${LAMBDA_REPO} && \ | |
sudo apt update --fix-missing && sudo apt install -y lambda-stack-cuda lambda-desktop- lambda-wallpapers- lambda-settings- | |
# install essential packages | |
sudo apt install -y vim openssh-server net-tools git wget curl | |
# install docker-ce | |
# https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
sudo apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt update --fix-missing | |
sudo apt install -y docker-ce docker-ce-cli containerd.io | |
sudo usermod -aG docker ${USER} | |
# install nvidia docker | |
# https://nvidia.github.io/nvidia-docker/ | |
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - | |
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) | |
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \ | |
sudo tee /etc/apt/sources.list.d/nvidia-docker.list | |
sudo apt update --fix-missing | |
# https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(version-2.0)#ubuntu-distributions-1 | |
sudo apt install -y nvidia-docker2 | |
sudo pkill -SIGHUP dockerd | |
# install docker-compose | |
# https://docs.docker.com/compose/install/#install-compose | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
# https://docs.docker.com/compose/completion/ | |
if [[ -n "$BASH_VERSION" ]]; then | |
sudo curl -L "https://raw.githubusercontent.com/docker/compose/1.24.1/contrib/completion/bash/docker-compose" -o /etc/bash_completion.d/docker-compose | |
fi | |
# install anaconda | |
# https://www.anaconda.com/distribution/#linux | |
wget https://repo.anaconda.com/archive/Anaconda3-2019.07-Linux-x86_64.sh | |
bash Anaconda3-2019.07-Linux-x86_64.sh | |
echo "Install completed. Re-login required to use docker without the root permission." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment