Skip to content

Instantly share code, notes, and snippets.

@cmccormack
Last active June 16, 2022 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmccormack/b7c1dbdbd9007f24d3ec2cd3b7f7e178 to your computer and use it in GitHub Desktop.
Save cmccormack/b7c1dbdbd9007f24d3ec2cd3b7f7e178 to your computer and use it in GitHub Desktop.

Setup new Ubuntu 20.04.4LTS deployment with customizations

Initial Setup

Proceed through the initial configuration, entering username and password.

Update packages:

sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get dist-upgrade

Install ZSH:

sudo apt-get install zsh

Install oh-my-zsh via curl:

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install zsh-autosuggestions via Oh My Zsh

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

Install zsh-syntax-highlighting via Oh My Zsh

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

Replace plugins section in .zshrc file:

# ~/.zshrc
...
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
...

Install powerlevel10k prompt:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

# ~/.zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"

Install bat (cat replacement):

sudo apt-get install bat
...
# ~/.zshrc
alias cat="batcat"

Python pyenv

Install build environment tools:

sudo apt-get -y install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

Download pyenv from github:

git clone https://github.com/pyenv/pyenv.git ~/.pyenv

Build pyenv:

cd ~/.pyenv && src/configure && make -C src

Add pyenv shell environment to .zshrc file:

# ~/.zshrc
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

Restart shell:

exec "$SHELL"

Install python version:

pyenv install 3.9.13

Set version as global version:

pyenv global 3.9.13

Installing Docker

Set up the repository:

sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install docker engine:

sudo apt-get -y update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Restart shell then test:

exec "$SHELL"
...
docker run hello-world

Windows Terminal (Incomplete)

Acquire UUID from Ubuntu and store output somewhere safe:

uuidgen
97091d37-5a58-4f5a-9fd5-045a4ee0e3ca <=== [Example Output]

Acquire name for Ubuntu distribution and store output somewhere safe (run from PowerShell):

wsl -l
Windows Subsystem for Linux Distributions:
docker-desktop-data (Default)
Ubuntu-20.04 <=== [Example Output]
docker-desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment