Last active
November 20, 2019 21:28
-
-
Save dennis90/21a2c3d2a6682b5e854730fcc9105b9d 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
#!/usr/bin/env bash | |
# ----------------------------- VARIÁVEIS ----------------------------- # | |
URL_GOOGLE_CHROME="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" | |
URL_SIMPLE_NOTE="https://github.com/Automattic/simplenote-electron/releases/download/v1.8.0/Simplenote-linux-1.8.0-amd64.deb" | |
URL_VSCODE="https://go.microsoft.com/fwlink/?LinkID=760868" | |
URL_SLACK="https://downloads.slack-edge.com/linux_releases/slack-desktop-4.1.2-amd64.deb" | |
URL_FIRECODE_FONT="https://github-production-release-asset-2e65be.s3.amazonaws.com/26500787/4cb9e980-d344-11e9-91cc-18f9a761c960?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20191022%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20191022T165626Z&X-Amz-Expires=300&X-Amz-Signature=0ad748fe86e03afedf84b1738e984d71929e59d711dddec24efdc7aeac1183fb&X-Amz-SignedHeaders=host&actor_id=1143232&response-content-disposition=attachment%3B%20filename%3DFiraCode_2.zip&response-content-type=application%2Foctet-stream" | |
URL_VSCODE_SETTINGS="https://gist.githubusercontent.com/dennis90/f4830b1100fa05fb76294234c261fb42/raw/4b80f25dc758fe900393654fafb02437f37f5110/settings.json" | |
DIRETORIO_DOWNLOADS="$HOME/Downloads/programas" | |
PROGRAMAS_PARA_INSTALAR=( | |
build-essential | |
flameshot | |
gconf2, | |
gconf-service, | |
libgtk2.0-0, | |
curl, | |
git, | |
libappindicator, | |
python, | |
python-dev, | |
python3-dev, | |
python3, | |
python3-pip, | |
libpng-dev | |
) | |
# ---------------------------------------------------------------------- # | |
# ----------------------------- REQUISITOS ----------------------------- # | |
## Removendo travas eventuais do apt ## | |
sudo rm /var/lib/dpkg/lock-frontend | |
sudo rm /var/cache/apt/archives/lock | |
## Adicionando/Confirmando arquitetura de 32 bits ## | |
sudo dpkg --add-architecture i386 | |
## Atualizando o repositório ## | |
sudo apt update -y | |
# ----------------------------- EXECUÇÃO ----------------------------- # | |
## Atualizando o repositório depois da adição de novos repositórios ## | |
sudo apt update -y | |
## Download e instalaçao de programas externos ## | |
mkdir "$DIRETORIO_DOWNLOADS" | |
wget -c "$URL_GOOGLE_CHROME" -P "$DIRETORIO_DOWNLOADS" | |
wget -c "$URL_SIMPLE_NOTE" -P "$DIRETORIO_DOWNLOADS" | |
wget -c "$URL_VSCODE" -P "$DIRETORIO_DOWNLOADS" -o vscode.deb | |
wget -c "$URL_SLACK" -P "$DIRETORIO_DOWNLOADS" | |
## Instalando pacotes .deb baixados na sessão anterior ## | |
sudo dpkg -i $DIRETORIO_DOWNLOADS/*.deb | |
# Instalar programas no apt | |
for nome_do_programa in ${PROGRAMAS_PARA_INSTALAR[@]}; do | |
if ! dpkg -l | grep -q $nome_do_programa; then # Só instala se já não estiver instalado | |
apt install "$nome_do_programa" -y | |
else | |
echo "[INSTALADO] - $nome_do_programa" | |
fi | |
done | |
# ----------------------------- CUSTOMIZAÇÃO E PACOTES --------------------- # | |
# nvm | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash | |
# yarn | |
sudo apt remove cmdtest -y | |
sudo curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | |
sudo echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | |
# docker | |
sudo apt install docker-ce docker-ce-cli -y | |
# enpass | |
sudo echo "deb https://apt.enpass.io/ stable main" > \ | |
/etc/apt/sources.list.d/enpass.list | |
sudo wget -O - https://apt.enpass.io/keys/enpass-linux.key | apt-key add - | |
# postman | |
wget -c https://dl.pstmn.io/download/channel/canary/linux_64 -o postman.tar.gz -P "$DIRETORIO_DOWNLOADS" | |
cd "$DIRETORIO_DOWNLOADS" | |
tar xvfz postman.tar.gz | |
sudo mv PostmanCanary /opt/ | |
chmod +x /opt/PostmanCanary/PostmanCanary | |
# install all apps who needs apt update | |
sudo apt update | |
sudo apt install --no-install-recommends yarn -y | |
sudo apt install enpass -y | |
# ----------------------------- PÓS-INSTALAÇÃO ----------------------------- # | |
## Configuração git | |
git config --global user.name "Dennis Alves" | |
git config --global user.email "dennis.alves@live.com" | |
## install fira code font | |
fonts_dir="${HOME}/.local/share/fonts" | |
if [ ! -d "${fonts_dir}" ]; then | |
echo "mkdir -p $fonts_dir" | |
mkdir -p "${fonts_dir}" | |
else | |
echo "Found fonts dir $fonts_dir" | |
fi | |
for type in Bold Light Medium Regular Retina; do | |
file_path="${HOME}/.local/share/fonts/FiraCode-${type}.ttf" | |
file_url="https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-${type}.ttf?raw=true" | |
if [ ! -e "${file_path}" ]; then | |
echo "wget -O $file_path $file_url" | |
wget -O "${file_path}" "${file_url}" | |
else | |
echo "Found existing file $file_path" | |
fi; | |
done | |
echo "fc-cache -f" | |
fc-cache -f | |
# copy vscode settings | |
wget -c "$URL_VSCODE_SETTINGS" -P "$DIRETORIO_DOWNLOADS" -o settings.json | |
rm ~/.config/Code/User/settings.json | |
mv settings.json ~/.config/Code/User/ | |
# install vscode extensions | |
code --install-extension marioqueiros.camelcase | |
code --install-extension naumovs.color-highlight | |
code --install-extension ms-azuretools.vscode-docker | |
code --install-extension mikestead.dotenv | |
code --install-extension dracula-theme.theme-dracula | |
code --install-extension editorconfig.editorconfig | |
code --install-extension eamodio.gitlens | |
code --install-extension yzhang.markdown-all-in-one | |
code --install-extension eg2.tslint | |
## Finalização, atualização e limpeza## | |
sudo apt update && sudo apt dist-upgrade -y | |
sudo apt autoclean | |
sudo apt autoremove -y | |
# ---------------------------------------------------------------------- # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment