Skip to content

Instantly share code, notes, and snippets.

@epeters3
Last active May 24, 2023 15:39
Show Gist options
  • Save epeters3/17d7d6cf18584a66239815915a087dee to your computer and use it in GitHub Desktop.
Save epeters3/17d7d6cf18584a66239815915a087dee to your computer and use it in GitHub Desktop.
Ubuntu Clean Install Post-Setup (w/GPU)
# ENVIRONMENT
#############
cd ~
mkdir code
mkdir code/sandbox
# Make desktop environment clock be AM/PM instead of 24h.
gsettings set org.gnome.desktop.interface clock-format '12h'
# DEVELOPER ESSENTIALS
######################
sudo apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install build-essential gcc g++ make binutils python3-pip python3-venv \
&& apt-get -y install software-properties-common git cmake pkg-config python3-tk tree
# GOGH TERMINAL THEMES
# Source: https://github.com/Mayccoll/Gogh#install-non-interactive-mode
######################
# Prerequisites
sudo apt-get install dconf-cli uuid-runtime
# clone the repo into "$HOME/src/gogh"
mkdir -p "$HOME/src"
cd "$HOME/src"
git clone https://github.com/Mayccoll/Gogh.git gogh
cd gogh/themes
# necessary on ubuntu
export TERMINAL=gnome-terminal
# install themes
./palenight.sh
cd ~
# NVIDIA DRIVERS
################
# Update the pciids registry
sudo update-pciids
# Add ppa repository to gain access to beta drivers
sudo add-apt-repository ppa:graphics-drivers/ppa
# Install ubuntu-recommended nvidia drivers
sudo ubuntu-drivers autoinstall
# DOCKER
########
# Allow apt to use a repository over HTTPS
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
# Add docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Set up the stable repository
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# Install docker engine
sudo apt-get install docker-ce docker-ce-cli containerd.io
# DOCKER-COMPOSE
################
# TODO: Update the version of docker-compose in this URL to the most up-to-date version.
# Download the current stable release of docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# Apply executable permissions to the binary
sudo chmod +x /usr/local/bin/docker-compose
# NVIDIA-CONTAINER TOOLKIT (NVIDIA+DOCKER)
##########################################
# Set up the stable repository and the GPG key
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
&& 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-get update
sudo apt-get install -y nvidia-docker2
# Restart the docker daemon to complete the installation after setting the default runtime
sudo systemctl restart docker
# INSTALL FAVORITE APPS
#######################
sudo snap install --classic code # VS Code
# VS Code extensions
code --install-extension vscode-icons-team.vscode-icons
code --install-extension zhuangtongfa.material-theme
code --install-extension ms-vscode-remote.remote-ssh
sudo snap install slack --classic # Slack
sudo snap install postman --classic # Postman
sudo snap install todoist --classic # Todoist
sudo snap install pycharm-community --classic # PyCharm
# GIT SETTINGS
##############
# Cache credentials securely in memory for 10 hours
git config --global credential.helper 'cache --timeout=36000'
# ALIASES
#########
cat <<EOT >> ~/.bash_aliases
alias glol="git log --oneline"
alias gri="git rebase --interactive"
alias gpfo='git push --force-with-lease origin $(git branch --show-current)'
alias gcm="git checkout master"
alias grm="git rebase master"
# Create and checkout a new branch.
alias gcb="git checkout -b"
alias gp="git pull"
# Push the current branch to the remote origin.
alias gpo='git push origin $(git branch --show-current)'
alias gb="git branch"
alias gss="git standup -s -m 2"
alias gs="git stash"
alias gsp="git stash pop"
alias poe="poetry run poe"
alias up1="cd .."
alias up2="cd ../.."
alias up3="cd ../../.."
alias up4="cd ../../../.."
EOT
# THE END -- REBOOT TO FINALIZE
###############################
sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment