Erik Reinertsen     Blog     Tech     Research     Talks

Linux setup guide


Here are commands to help set up a new Ubuntu machine on GCP or any cloud platform.

Install basic utilities

sudo apt update
sudo apt-get install vim git curl zsh tmux tree unzip make
sudo apt-get upgrade
sudo apt-get dist-upgrade

Set password

sudo passwd

Log out, then back in.

Shell, dotfiles, zsh theme

ZSH

zsh
sudo chsh -s $(which zsh) $(USER)
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Dotfiles and shell scripts

git clone https://github.com/erikr/dotfiles.git  
cd dotfiles && bash generate-symlinks.sh make

zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-autosuggestions \
 ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Pure theme

mkdir -p $HOME/.zsh
git clone https://github.com/sindresorhus/pure.git \
 $HOME/.zsh/pure

ZSH syntax highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
 ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
rm -rf zsh-syntax-highlighting

Tmux plugin manager (tpm)

git clone https://github.com/tmux-plugins/tpm \
 ~/.tmux/plugins/tpm

Vim plugins

vim-plug

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Install plugins specified in .vimrc:

vim -c PlugInstall

Miniconda and environments

Download and install

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh 
bash Miniconda3-latest-Linux-x86_64.sh
source ~/miniconda3/bin/activate

No need to run conda init zsh because my .zshrc sets paths.

Delete the install shell script when you finish:

rm -rf ~/Miniconda3-latest-Linux-x86_64.sh

Set up the Conda environment:

conda env create -f ~/dotfiles/environment.yml

Speedtest CLI

curl -s https://install.speedtest.net/app/cli/install.deb.sh | sudo bash
sudo apt-get install speedtest