Skip to content

Instantly share code, notes, and snippets.

@vtno
Last active April 18, 2020 09:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vtno/aa0a32ed4fd35b5c6a0e2cdf94be67c0 to your computer and use it in GitHub Desktop.
Save vtno/aa0a32ed4fd35b5c6a0e2cdf94be67c0 to your computer and use it in GitHub Desktop.
Setup a new Ubuntu machine for my personal use
set -e
cd
sudo apt update && sudo apt install -y build-essential zsh tmux libssl-dev libreadline-dev zlib1g-dev libpq-dev
# Setting up ZSH
chsh -s /usr/bin/zsh $USER
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Setup Z
git clone git@github.com:rupa/z.git ~/.z
touch ~/.z/data
# Rbenv for Ruby with RubyBuild
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src && cd
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
mkdir -p "$(rbenv root)"/plugins
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
echo "gem: --no-document" > ~/.gemrc
# Tmux
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
curl https://gist.githubusercontent.com/vtno/917f99d07ecff2e06d274e2fd1830e9a/raw/.tmux.conf.local > ~/.tmux.conf.local
# NVM for NodeJS
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | zsh
# Yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
# Docker
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get install \
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 add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo groupadd docker
sudo usermod -aG docker $USER
echo 'Log out and log in to enable docker with sudo permission'
# Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Pull .zshrc from Gist
curl https://gist.githubusercontent.com/vtno/e0b661e50990125f64215d368bff0dad/raw/.zshrc > ~/.zshrc
. ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment