Last active
March 9, 2023 14:05
-
-
Save joshmfrankel/a36dae5238f6f948075ae3fb239ea271 to your computer and use it in GitHub Desktop.
Linux: Setup development environment script
This file contains hidden or 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
#!/bin/bash | |
echo "#### PREPPING DEPENDENCIES" | |
sudo apt install -y apt-transport-https curl software-properties-common | |
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
echo "#### ADDING GPG KEYS" | |
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg | |
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - | |
curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | sudo apt-key add - | |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
echo "#### ADDING DEBS/PPA" | |
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"| sudo tee /etc/apt/sources.list.d/brave-browser-release.list | |
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list | |
echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null | |
# NOTE: lsb_release -cs return jolnir but we need the Ubuntu distro release name for 20.04 which is `focal` | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ | |
focal stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo add-apt-repository ppa:philip.scott/pantheon-tweaks | |
sudo add-apt-repository ppa:numix/ppa | |
sudo add-apt-repository ppa:solaar-unifying/stable | |
echo "#### UPDATING PKG LIST" | |
sudo apt update | |
echo "#### INSTALLING APPS" | |
sudo apt install -y brave-browser sublime-text sublime-merge spotify-client git gh docker-ce docker-ce-cli containerd.io zsh pantheon-tweaks numix-icon-theme-square numix-icon-theme-circle solaar nginx net-tools jq peek snapd libsqlite3-dev libc6-dev | |
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
echo "#### FLATPAK APPS" | |
flatpak install flathub com.gitlab.newsflash com.github.babluboy.bookworm com.slack.Slack us.zoom.Zoom org.libreoffice.LibreOffice -y | |
echo "#### SNAPD APPS" | |
sudo snap install pick-colour-picker | |
curl https://cli-assets.heroku.com/install.sh | sh | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
echo "#### SETTTING UP ASDF-VM" | |
sudo apt install -y linux-headers-$(uname -r) build-essential libssl-dev zlib1g-dev libreadline-dev libcurl4-openssl-dev uuid-dev icu-devtools libffi-dev libyaml-dev | |
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.9.0 | |
echo ". $HOME/.asdf/asdf.sh" >> ~/.zshrc | |
asdf plugin add ruby | |
asdf plugin add nodejs | |
asdf plugin add postgres | |
echo "* Use `asdf install` within projects containing a .tool-versions file" | |
# npm install --global yarn | |
echo "#### CONFIGURING GIT" | |
git config --global user.name "NAME" | |
git config --global user.email email | |
git config --global core.editor subl | |
git config --global init.defaultBranch main | |
git config --global merge.ff only | |
git config --global commit.gpgsign true | |
echo "#### CONFIGURING DOCKER" | |
echo "NOTE: Logout to initialize docker user group" | |
sudo groupadd docker | |
sudo usermod -aG docker $USER | |
echo "#### AUTHENTICATING SERVICES" | |
heroku login | |
gh auth login | |
echo "#### CONFIGURING SHELL" | |
# Download Meslo font | |
echo "* Use tweaks to set monospace font to Meslo" | |
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k | |
echo "* Set ZSH_THEME='powerlevel10k/powerlevel10k' in .zshrc" | |
p10k configure | |
echo "#### CONFIGURING GPG COMMIT SIGNING" | |
echo "* Use 4096 for keysize" | |
gpg --full-generate-key | |
echo "* Copy long form of key from sec line after slash" | |
gpg --list-secret-keys --keyid-format=long | |
echo "* git config --global user.signingkey <inser_key>" | |
echo "* gpg --armor --export <insert_key>" | |
echo "* Copy output to GPG section of Github" |
I'd like to create some prompt messages to automate basic setup
https://wiki.ubuntu.com/Releases
- What is your Ubuntu release name? (input)
- What is your name? (input)
- What is email do you use for Github? (input)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apps
CLI
Configuration