Skip to content

Instantly share code, notes, and snippets.

@andrelugomes
Last active April 1, 2021 11:40
Show Gist options
  • Save andrelugomes/0dcedc905cc2bc855b958389cc62c5dd to your computer and use it in GitHub Desktop.
Save andrelugomes/0dcedc905cc2bc855b958389cc62c5dd to your computer and use it in GitHub Desktop.
Setup Ubuntu.
# My Setup
# sudo chmod -x 0_setup_ubuntu.sh
wget https://gist.githubusercontent.com/andrelugomes/0dcedc905cc2bc855b958389cc62c5dd/raw/46a82de08d1f441d80b7a19922c5bff143263059/1_repos.sh
wget https://gist.githubusercontent.com/andrelugomes/0dcedc905cc2bc855b958389cc62c5dd/raw/46a82de08d1f441d80b7a19922c5bff143263059/2_apt.sh
wget https://gist.githubusercontent.com/andrelugomes/0dcedc905cc2bc855b958389cc62c5dd/raw/46a82de08d1f441d80b7a19922c5bff143263059/3_snap.sh
sudo chmod -x 1_repos.sh
sudo chmod -x 2_apt.sh
sudo chmod -x 3_snap.sh
# sh 0_setup_ubuntu.sh
#!/bin/sh
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
wget -qO - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
wget -qO - https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee -a /etc/apt/sources.list.d/sublime-text.list
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
echo \
"deb [arch=amd64 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
sudo apt-get update
#!/bin/sh
sudo apt-get update
sudo apt install curl \
zsh \
vim \
htop \
ansible \
git \
terminator \
xclip \
python-pip \
net-tools \
jq \
kubectl \
apt-transport-https \
ca-certificates \
gnupg \
software-properties-common \
docker-ce \
docker-ce-cli \
containerd.io \
snapd \
google-cloud-sdk \
google-chrome-stable \
gitlint \
unzip \
lsb-release
#!/bin/sh
sudo snap install slack --classic
sudo snap install code --classic
#!/bin/sh
## GOTO
if [ ! -d "$HOME/goto" ]
then
mkdir $HOME/goto &&
git clone https://github.com/iridakos/goto.git $HOME/goto &&
cd $HOME/goto &&
sudo ./install &&
cd $HOME
else
echo "goto already installed"
fi
## KCompose
if ! [ -x "$(command -v kcompose)" ]
then
TEMP_DEB="$(mktemp)" &&
wget -O "$TEMP_DEB" 'https://github.com/arquivei/kcompose/releases/download/0.6.0/kcompose.deb' &&
sudo dpkg -i "$TEMP_DEB"
rm -f "$TEMP_DEB"
else
echo "KCompose already installed"
fi
## Docker Compose
if ! [ -x "$(command -v docker-compose)" ]
then
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose &&
sudo chmod +x /usr/local/bin/docker-compose
else
echo "docker-compose already installed"
fi
## Configuration Docker
if grep -q docker /etc/group
then
echo "docker group exists"
else
sudo groupadd docker
fi
sudo usermod -aG docker $USER
##Apache purge
sudo apt purge apache2
sudo apt remove "apache2*"
## Fuzzy Finder
if [ ! -d "$HOME/.fzf" ]
then
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
else
echo "fzf already installed"
fi
#!/bin/sh
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
#!/bin/sh
## asdf
if [ ! -d "$HOME/.asdf" ]
then
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.8
else
echo "asdf already installed"
fi
if [ -x "$(command -v asdf)" ]
then
echo "asdf ok"
echo "asdf Java"
asdf plugin-add java https://github.com/halcyon/asdf-java.git
asdf plugin-add php https://github.com/asdf-community/asdf-php.git
asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git
fi
bash -c '${ASDF_DATA_DIR:=$HOME/.asdf}/plugins/nodejs/bin/import-release-team-keyring'
echo "ADD asdf as oh-my-zsh => plugins=(asdf "
#!/bin/sh
## Wakatime
python -c 'import wakatime' 2> /dev/null && echo "wakatime already installed" || pip install wakatime
## pre-commit
pre-commit -V 2> /dev/null && echo "pre-commit already installed" || pip install pre-commit
## Gitlint fix
pip install sh==1.11
pip3 install sh==1.11
#!/bin/sh
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment