Skip to content

Instantly share code, notes, and snippets.

@ragazzid
Last active September 23, 2022 19:49
Show Gist options
  • Save ragazzid/48637ea1b18f042d2a8d328938baca13 to your computer and use it in GitHub Desktop.
Save ragazzid/48637ea1b18f042d2a8d328938baca13 to your computer and use it in GitHub Desktop.
#!/bin/bash
AGORA=$(date)
# Basic
echo "Updating APT"
sudo apt update 2>/dev/null
echo "Installing basic packages"
sudo apt install \
git vim python3 python3-pip gcc g++ \
curl terminator awesome awesome-extra \
lxrandr arandr pavucontrol zsh jq unzip \
xscreensaver xscreensaver-data -y
# Docker
echo "Starting Dcoker"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
echo "Updating apt"
date
sudo apt-get update 2> /dev/null
sudo apt-get install docker-ce docker-ce-cli containerd.io -y 2> /dev/null
sudo apt-get install binfmt-support qemu-user-static -y
sudo usermod -a -G docker $USER 2> /dev/null
# ZSH
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
## Save the default .zsh in case we need it
if [ ! -f "${HOME}/.zshrc.original" ]; then
cp $HOME/.zshrc $HOME/.zshrc.original
fi
# HomeBrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew tap allcloud-io/tools
brew install tfenv kubectl kubectx clisso terraform-docs
if [ "$(grep 'kubectl completion zsh' $HOME/.zshrc | wc -l)" -eq "0" ]; then
cat >> ~/.zshrc <<EOF
source <(kubectl completion zsh)
EOF
fi
# NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
if [ "$(grep NVM_DIR $HOME/.zshrc | wc -l)" -eq "0" ]; then
cat >> ~/.zshrc <<EOF
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
EOF
fi
# AWS CLI
echo "Installing AWS_CLI"
date
mkdir -p /tmp/aws_install 2> /dev/null
cd /tmp/aws_install 2> /dev/null
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" 2> /dev/null
unzip awscliv2.zip 2> /dev/null
chmod +x /tmp/aws_install/aws/install
sudo bash -c "/tmp/aws_install/aws/install" 2> /dev/null
# Antigen
mkdir -p ~/bin
curl -L git.io/antigen > ~/bin/antigen.zsh
## Check if we need to add Antigen to ZSH
if [ "$(grep -i antigen $HOME/.zshrc | wc -l)" -eq "0" ]; then
cat ~/.zshrc ~/.zshrc_bkb
cat > ~/.zshrc <<EOF
source $HOME/bin/antigen.zsh
antigen use oh-my-zsh
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle git
antigen bundle pip
antigen bundle lein
antigen bundle command-not-found
# Syntax highlighting bundle.
antigen bundle zsh-users/zsh-syntax-highlighting
# Tell Antigen that you're done.
antigen apply
EOF
cat ~/.zshrc_tmp >> ~/.zshrc
rm -rf ~/.zshrc_bkb
fi
# Installing some Plugins
mkdir -p $HOME/.oh-my-zsh
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
# Msgs
echo "Uhul, agora adiciona no seu .zshrc esses plugins"
echo "zsh-history-substring-search kubectl aws ssh-agent"
echo "eah, fiquei com pregui"
FIM=$(date)
echo "Iniciado em: ${AGORA}"
echo "Encerrado em: ${FIM}"
echo "#### RagazziD ####"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment