Last active
November 8, 2024 02:44
-
-
Save mayconsgs/aecc5c4dd6576693c4757ca286cc5ea6 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# chmod 777 ubuntu.sh | |
cd ~ | |
sudo apt update && sudo apt upgrade -y | |
echo "==============================" | |
echo " Install ZSH" | |
echo "==============================" | |
sudo apt install zsh -y | |
# Install Oh My ZSH | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# Install Zinit | |
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)" | |
# Install plugins | |
echo 'zinit light zsh-users/zsh-syntax-highlighting' >> ~/.zshrc | |
echo 'zinit light zsh-users/zsh-autosuggestions' >> ~/.zshrc | |
echo 'zinit light zsh-users/zsh-autosuggestions' >> ~/.zshrc | |
echo "==============================" | |
echo " Instala Build Essentials" | |
echo "==============================" | |
sudo apt install build-essential | |
sudo apt install unzip | |
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 | |
# Install docker engine | |
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y | |
# Add user to use only docker command | |
sudo groupadd docker | |
sudo usermod -aG docker $USER | |
newgrp docker | |
# Start Containers | |
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 | |
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-get update && sudo apt-get install google-cloud-cli -y | |
# gcloud init | |
echo "==============================" | |
echo " Install Node" | |
echo "==============================" | |
# installs FNM (Fast Node Manager) | |
curl -fsSL https://fnm.vercel.app/install | bash | |
source ~/.zshrc | |
# download and install Node.js | |
fnm use --install-if-missing 22 | |
# 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 " 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