Last active
December 15, 2019 01:20
-
-
Save ManzDev/1723236e55293ca70ab5b0b60cb35365 to your computer and use it in GitHub Desktop.
Linux setup (WIP)
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 | |
# Script for prepare Ubuntu/Debian distro | |
# 2019 - Manz (terminaldelinux.com) | |
# | |
# Prerequisites: | |
# - curl sudo bash installed | |
# - script executed as non-root (but sudo permissions) | |
# | |
# --gui Install GUI software | |
# | |
# Examples: | |
# | |
# curl -sL https://update.terminaldelinux.com | sudo bash - | |
# curl -sL https://update.terminaldelinux.com | sudo bash /dev/stdin --gui | |
# | |
# Change folder | |
pushd . | |
cd /tmp/ | |
# Install updates | |
sudo apt-get update -y | |
sudo apt-get autoremove -y | |
sudo apt-get upgrade -y | |
sudo apt-get dist-upgrade -y | |
# Install essentials | |
sudo apt-get install -y curl sudo man wget vim nano git sl \ | |
fish zsh ccze jq make tldr g++ \ | |
neofetch less ctop htop catimg \ | |
nnn googler ddgr autojump zip \ | |
p7zip-full ncdu apt-transport-https \ | |
ca-certificates gnupg2 \ | |
software-properties-common locales \ | |
locales-all | |
# Constants | |
DISTRO=$(lsb_release -si | tr [A-Z] [a-z]) | |
CODENAME=$(lsb_release -cs) | |
USER=$(whoami) | |
ZSH_THEME="agnoster" | |
GUI_FLAG=$(echo $1 | tr [A-Z] [a-z]) | |
# Installers | |
installFromDeb() { | |
wget -q $1 -O /tmp/tempfile | |
sudo dpkg -i /tmp/tempfile | |
rm -f /tmp/tempfile | |
} | |
installFromZip() { | |
wget -q $1 -O /tmp/tempfile | |
rm -rf /tmp/tempdir | |
mkdir /tmp/tempdir | |
unzip /tmp/tempfile -d /tmp/tempdir | |
sudo mv /tmp/tempdir/* /usr/local/bin/$2 | |
} | |
# cat enhanced, HTML processor, ls enhanced | |
installFromDeb "https://github.com/sharkdp/bat/releases/download/v0.11.0/bat_0.11.0_amd64.deb" | |
installFromZip "https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip" "pup" | |
installFromZip "https://github.com/ogham/exa/releases/download/v0.9.0/exa-linux-x86_64-0.9.0.zip" "exa" | |
# Node 12 | |
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - | |
sudo apt-get install -y nodejs | |
npm install -g npm | |
# Docker | |
curl -fsSL "https://download.docker.com/linux/$DISTRO/gpg" | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$DISTRO $CODENAME stable" | |
sudo apt-get update -y | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io | |
sudo usermod -aG docker $USER | |
# Micro editor | |
curl https://getmic.ro | sudo bash | |
sudo mv micro /usr/local/bin | |
# NPM packages | |
npm install -g parcel-bundler emoj mdr | |
# zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended | |
cp ~/.zshrc ~/.backup-zshrc | |
cat ~/.backup-zshrc | sed s/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"$ZSH_THEME\"/ > ~/.zshrc | |
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions | |
echo function cheat\(\) \{ curl cheat.sh/\$1\; \} >~/.myzsh.sh | |
echo alias ls=\"exa\" >>~/.myzsh.sh | |
echo alias cat=\"bat\" >>~/.myzsh.sh | |
echo alias grep=\"grep --color\" >>~/.myzsh.sh | |
echo export PAGER=\"less\" >>~/.myzsh.sh | |
echo export LESS_TERMCAP_mb=\$\'\\E[1\;31m\' >>~/.myzsh.sh | |
echo export LESS_TERMCAP_md=\$\'\\E[1\;36m\' >>~/.myzsh.sh | |
echo export LESS_TERMCAP_me=\$\'\\E[0m\' >>~/.myzsh.sh | |
echo export LESS_TERMCAP_so=\$\'\\E[01\;44\;33m\' >>~/.myzsh.sh | |
echo export LESS_TERMCAP_se=\$\'\\E[0m\' >>~/.myzsh.sh | |
echo export LESS_TERMCAP_us=\$\'\\E[1\;32m\' >>~/.myzsh.sh | |
echo export LESS_TERMCAP_ue=\$\'\\E[0m\' >>~/.myzsh.sh | |
echo source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh >>~/.myzsh.sh | |
echo ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#333333,bg=black,bold" >>~/.myzsh.sh | |
echo source ~/.myzsh.sh >>~/.zshrc | |
sudo chsh -s /usr/bin/zsh | |
# GUI Software | |
if [ "$GUI_FLAG" = "--gui" ]; then | |
echo "GUI flag enabled..." | |
# VSCode 1.41.0 | |
if [ "$DISTRO" = "ubuntu" ]; then | |
CHROMIUM="chromium-browser" | |
FIREFOX="firefox" | |
else | |
CHROMIUM="chromium" | |
FIREFOX="firefox-esr firefox-esr-l10n-es-es" | |
fi | |
sudo apt-get install libnotify4 libnss3 libxkbfile1 libsecret-1-0 libgtk-3-0 libxss1 libx11-xcb-dev libasound-dev -y | |
installFromDeb "https://github.com/VSCodium/vscodium/releases/download/1.41.0/codium_1.41.0-1576181610_amd64.deb" | |
sudo apt-get install $CHROMIUM inkscape $FIREFOX -y | |
# Chrome | |
curl -fsSL "https://dl.google.com/linux/linux_signing_key.pub" | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | |
sudo apt-get install google-chrome-stable -y | |
fi | |
sudo chsh -s $(which zsh) | |
wget "https://gist.githubusercontent.com/ManzDev/a84fcfd41791605be9e6862fc357c338/raw" -O /usr/local/bin/check_versions | |
sudo chmod +x /usr/local/bin/check_versions | |
# Finish | |
echo "====== END ======" | |
check_versions | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment