Skip to content

Instantly share code, notes, and snippets.

@mayconsgs
Last active April 20, 2024 16:54
Show Gist options
  • Save mayconsgs/aecc5c4dd6576693c4757ca286cc5ea6 to your computer and use it in GitHub Desktop.
Save mayconsgs/aecc5c4dd6576693c4757ca286cc5ea6 to your computer and use it in GitHub Desktop.
#!/bin/bash
# chmod 777 ubuntu.sh
cd ~
sudo apt update
sudo apt upgrade -y
echo "=============================="
echo " Install ZSH"
echo "=============================="
sudo apt install zsh -y
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
echo 'zinit light zsh-users/zsh-syntax-highlighting' >> ~/.zshrc
echo 'zinit light zsh-users/zsh-autosuggestions' >> ~/.zshrc
echo 'zinit light zsh-users/zsh-completions' >> ~/.zshrc
echo "=============================="
echo " Install Docker"
echo "=============================="
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER
newgrp docker
docker run -d -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 --restart unless-stopped --name postgres postgres
docker run -d -e MYSQL_ROOT_PASSWORD=mysecretpassword -p 3306:3306 --restart unless-stopped --name mysql mysql
docker run -d -p 27017:27017 --restart unless-stopped --name mongo mongo
docker run -d -p 6379:6379 --restart unless-stopped --name redis redis
echo "=============================="
echo " Install GitHub CLI"
echo "=============================="
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
echo "=============================="
echo " Install Google Cloud CLI"
echo "=============================="
sudo apt update
sudo apt install apt-transport-https ca-certificates gnupg curl -y
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt update
sudo apt install google-cloud-cli -y
# gcloud init
echo "=============================="
echo " Install Node"
echo "=============================="
# installs NVM (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# download and install Node.js
nvm install --lts
# verifies the right Node.js version is in the environment
node -v
# verifies the right NPM version is in the environment
npm -v
echo "=============================="
echo " Install JDK"
echo "=============================="
sudo apt install openjdk-21-jdk gradle -y
java -version
gradle -v
echo "=============================="
echo " Limpa alguns pacotes"
echo "=============================="
sudo apt autoremove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment