Skip to content

Instantly share code, notes, and snippets.

@hemenkapadia
Created September 30, 2019 20:16
Show Gist options
  • Save hemenkapadia/b3be6f2c5f76fa5942aab654502ad287 to your computer and use it in GitHub Desktop.
Save hemenkapadia/b3be6f2c5f76fa5942aab654502ad287 to your computer and use it in GitHub Desktop.
[Ubuntu Bootstrap]
#!/bin/bash
# Check sudo.
# If credentials not already cached, ask for password and cache credentials.
# If already cached, increase sudo timeout by 5 min
sudo -v && exit 1 'Sudo access needed to execute this script'
# First update
echo "Updating apt list ...."
sudo apt-get update
# Install dialog
echo "Installing dialog ...."
sudo apt install -y dialog
# Check if upgrade is needed
dialog --title "Upgrade" \
--yesno "Do you want to run apt-get upgrade ?" 6 25
if [[ "$?" -eq 0 ]]; then
echo "Upgrading system ...."
sudo apt-get upgrade -y
else
echo "Proceeding without system upgrade ..."
fi
clear
# Offer list of applications to select for installation
cmd=(dialog --separate-output --checklist "Please Select Software you want to install:" 22 76 16)
options=(1 "Git" off
2 "Tig" off
3 "Lazygit" off
4 "tmux" off
5 "Miniconda" off)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
for choice in $choices; do
case $choice in
1)
# Install Git
echo ""
echo "Installing Git ...."
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt intall git
echo "Git Installation completed."
echo ""
;;
2)
# Install Tig
echo ""
echo "Installing Tig ...."
sudo apt-get update
sudo apt install tig
echo "Tig Installation completed."
echo ""
;;
3)
# Install Lazygit
echo ""
echo "Installing Lazygit ...."
sudo add-apt-repository ppa:lazygit-team/release
sudo apt-get update
sudo apt install lazygit
echo "Lazygit Installation completed."
echo ""
;;
4)
# Install tmux
echo ""
echo "Installing tmux...."
sudo apt-get update
sudo apt install tmux
echo "Lazygit Installation completed."
echo ""
;;
5)
# Install Miniconda latest
echo ""
echo "Installing Miniconda3 latest...."
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -q --show-progress
chmod u+x Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda
echo 'export PATH="$HOME/miniconda/bin:$PATH"' >> ~/.bashrc
echo '$PATH updated in .bashrc. Remember to source it . ~/.bashrc'
echo "Miniconda Installation completed."
echo ""
;;
*)
# Default Option
echo ""
;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment