Skip to content

Instantly share code, notes, and snippets.

@uroshekic
Last active August 29, 2015 14:02
Show Gist options
  • Save uroshekic/b4fdff8566a09afd9c88 to your computer and use it in GitHub Desktop.
Save uroshekic/b4fdff8566a09afd9c88 to your computer and use it in GitHub Desktop.
Migrating to Linux Mint 17
#### InstallEssentials Script ####
# args: Options that will be appended to every apt-get install command.
# Possible options: -y --force-yes -q -qq ...
#args="-y -qq"
args="-y"
# argsAddRepo: Options that will be appended to every add-apt-repository command.
# Possible options: -y (force yes on all confirmation questions!)
argsAddRepo="-y"
# ask function: https://gist.github.com/davejamesmiller/1965569
function ask {
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
default=Y
elif [ "${2:-}" = "N" ]; then
prompt="y/N"
default=N
else
prompt="y/n"
default=
fi
# Ask the question
read -p "$1 [$prompt] " REPLY
# Default?
if [ -z "$REPLY" ]; then
REPLY=$default
fi
# Check if the reply is valid
case "$REPLY" in
Y*|y*) return 0 ;;
N*|n*) return 1 ;;
esac
done
}
# Set some default variables
forceOffer=false
offerSetupGit=false
offerSetupRHC=false
offerSetupDropbox=false
# Quick setup
if ask "Do you want to execute EVERYTHING?"; then
everything=true
else
everything=false
fi
# Update & Upgrade
if $everything || ask "Do you want to update OS?" Y; then
echo 'Updating OS...'
sudo apt-get $args update
sudo apt-get $args upgrade
fi
# Git, gitg
if $everything || ask "Do you want to install Git?"; then
echo 'Installing Git...'
sudo apt-get $args install git
offerSetupGit=true
if $everything || ask "Do you want to install GitG (Git GUI)?"; then
echo 'Installing GitG...'
sudo apt-get $args install gitg
fi
fi
# Sublime Text
if $everything || ask "Do you want to install Sublime Text 3?"; then
echo 'Installing Sublime Text 3...'
sudo add-apt-repository $argsAddRepo ppa:webupd8team/sublime-text-3 &> /dev/null && echo 'Sublime Text repository added.' || echo 'Error adding Sublime Text repository!'
sudo apt-get $args update
sudo apt-get $args install sublime-text-installer
if $everything || ask "Do you want to download Package Control for Sublime Text?"; then
echo 'Downloading Package Control...'
wget -nv -P ~/.config/sublime-text-3/Installed\ Packages/ https://sublime.wbond.net/Package%20Control.sublime-package
fi
fi
# PHP, MySQL, Nginx stack
# https://github.com/lj2007331/lnmp
# http://www.tanbir.net/lnmp-linux-nginx-mysql-php/
# http://www.servermom.org/quickest-easiest-way-to-install-lnmp-stack-on-centos-and-ubuntu/746/
# XAMPP
if $everything || ask "Do you want to install XAMPP?"; then
# https://www.apachefriends.org/download.html
#wget http://downloads.sourceforge.net/project/xampp/XAMPP%20Linux/1.8.3/xampp-linux-x64-1.8.3-4-installer.run
#chmod 755 xampp-linux-*-installer.run
#sudo ./xampp-linux-*-installer.run
#sudo /opt/lampp/lampp start
#rm xampp-linux-*-installer.run
fi
# Python 3 & Python 2.7 with IDLE
if $everything || ask "Do you want to install Python 3.4 & Python 2.7 with IDLE?"; then
echo 'Installing Python 3.4 & Python 2.7 with IDLE...'
sudo apt-get $args install python3.4 idle-python3.4 python2.7 idle-python2.7
fi
# OpenShift RHC (after install: rhc setup)
if $everything || ask "Do you want to install RHC (including Ruby and RubyGems)?"; then
echo 'Installing Ruby and RubyGems...'
sudo apt-get $args install ruby git-core
echo 'Installing RHC...'
sudo gem install rhc
offerSetupRHC=true
fi
# VirtualBox
if $everything || ask "Do you want to install VirtualBox?"; then
echo 'Installing VirtualBox...'
sudo apt-get $args install virtualbox virtualbox-qt
fi
# Vagrant
# Java, Eclipse - http://www.eclipse.org/downloads/
# Wolfram Mathematica
# VLC, VLSub - https://github.com/exebetche/vlsub
if $everything || ask "Do you want to install VLC?"; then
echo 'Installing VLC...'
sudo apt-get $args install vlc browser-plugin-vlc
fi
# Skype
if $everything || ask "Do you want to install Skype?"; then
echo 'Installing Skype...'
sudo apt-get $args install skype
fi
# Dropbox https://www.dropbox.com/install?os=linux
if $everything || ask "Do you want to install Dropbox?"; then
echo 'Installing Dropbox...'
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
offerSetupDropbox=true
fi
# Transmission
if $everything || ask "Do you want to install Transmission?"; then
echo 'Installing Transmission...'
sudo apt-get $args install transmission
fi
# FileZilla
if $everything || ask "Do you want to install FileZilla?"; then
echo 'Installing FileZilla...'
sudo apt-get $args install filezilla
fi
# LibreOffice
if $everything || ask "Do you want to install LibreOffice?"; then
echo 'Installing LibreOffice...'
sudo apt-get $args install libreoffice-core
fi
# TeXworks
if $everything || ask "Do you want to install TeXworks?"; then
echo 'Installing TeXworks...'
sudo apt-get $args install texworks
fi
# Set up Git
if ($forceOffer || $offerSetupGit) && ask "Do you want to set up Git (user.email, user.name, push.default)?" Y; then
read -e -p "Enter email: " git_email
read -e -p "Enter name: " git_name
git config --global user.email “$git_email”
git config --global user.name “$git_name”
git config --global push.default simple
fi
# Set up RHC
if ($forceOffer || $offerSetupRHC) && ask "Do you want to set up RHC?"; then
rhc setup
fi
# Set up Dropbox
if ($forceOffer || $offerSetupDropbox) && ask "Do you want to set up and run Dropbox?"; then
~/.dropbox-dist/dropboxd &
fi
echo 'Done!'
#### END OF SCRIPT ####
# Import certificates
# Eduroam
# http://www.arnes.si/pomoc-uporabnikom/eduroam/navodila-za-povezavo/prenosni-racunalniki/linux-z-networkmanagerjem-07x.html
# http://svet.fri.uni-lj.si/vsebina/navodila-za-nastavitev-eduroam-povezave
# Video4Linux 2 Universal Control Panel - http://community.linuxmint.com/tutorial/view/219
# sudo apt-get install v4l2ucp
# Chromium Browser - crashes constantly on VM!
# sudo apt-get install chromium-browser
# Silverlight on Linux
# http://fds-team.de/cms/pipelight-installation.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment