Skip to content

Instantly share code, notes, and snippets.

@psengh
Last active September 23, 2020 10:39
Show Gist options
  • Save psengh/088971405ce1c05e182c3e947731dfc0 to your computer and use it in GitHub Desktop.
Save psengh/088971405ce1c05e182c3e947731dfc0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo "Enter you Name : (Optional, to configure Git)"
read NAME
echo "Enter your Email : (Optional, to configure Git)"
read EMAIL
echo "Give a Passphrase for SSH Key : (Optional, leave it for an empty Passphrase)"
read PASSPHRASE
echo "Starting sudo session, so that you can leave the setup unattended..."
echo "Enter your Password :"
sudo -v
echo "Starting setup..."
# Update apt
sudo apt update
PACKAGES=(
build-essential
libssl-dev
openssl
automake
autoconf
git
curl
wget
ca-certificates
rar
unrar
zip
unzip
p7zip-full
p7zip-rar
zsh
libkrb5-dev
python-pip
virtualenv
xclip
tmux
htop
openvpn
)
echo "Installing APT packages..."
sudo apt install -y "${PACKAGES[@]}"
echo "Installing Postgresql"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt install -y postgresql-11
echo "Installing Node.js"
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt update
sudo apt install -y nodejs
echo "Installing NPM Global packages..."
NPM_PACKAGES=(
express
@vue/cli
eslint
webpack
pm2
nodemon
)
sudo npm -g install "${NPM_PACKAGES[@]}"
echo "Upgrading Pip..."
pip install --upgrade pip
echo "Installing Python packages..."
PYTHON_PACKAGES=(
Flask
Django
)
pip install "${PYTHON_PACKAGES[@]}"
echo "Configuring Git..."
# Check if user has given NAME
if test "$NAME"; then
echo "Setting global username..."
git config --global user.name $NAME
fi
# Check if user has given EMAIL
if test "$EMAIL"; then
echo "Setting global email..."
git config --global user.email $EMAIL
fi
git config --global color.ui auto
# Check if user has given PASSPHRASE
if test "$PASSPHRASE"; then
echo "Creating SSH key with given passphrase..."
ssh-keygen -f id_rsa -t rsa -C $EMAIL -N $PASSPHRASE
else
echo "Creating SSH key without passphrase..."
ssh-keygen -f id_rsa -t rsa -C $EMAIL -N ""
fi
SNAPS_NORMAL=(
spotify
vlc
)
echo "Installing normal SNAP packages..."
sudo snap install "${SNAPS_NORMAL[@]}"
echo "Installing Chrome"
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
echo "Creating folder workspace..."
[[ ! -d workspace ]] && mkdir workspace
echo "Installing Oh My Zsh"
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" --unattended
chsh -s $(which zsh)
echo "Exiting sudo session..."
sudo -k
echo "Setup complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment