Skip to content

Instantly share code, notes, and snippets.

@compleatang
Created April 9, 2013 23:31
Show Gist options
  • Select an option

  • Save compleatang/5350321 to your computer and use it in GitHub Desktop.

Select an option

Save compleatang/5350321 to your computer and use it in GitHub Desktop.
Install Scripts for Virtual Machine Setup
#!/bin/bash
#^jist installd-virt -pu 5350321
CUR_USER=`who am i | awk '{print $1}'`
pkgs=( git zsh curl samba htop conky keepassx pandoc mongodb build-essential libreadline6-dev git-core zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf ncurses-dev automake libtool bison subversion vim vim-gtk faenza-icon-theme sshfs alacarte y-ppa-manager texlive tclreadline rsync mediterraneannight-gtk-theme terra nodejs cifs-utils nmap haskell-platform virtualbox-guest-x11 virtualbox-guest-utils compizconfig-settings-manager libudev0 )
function install_a_bunch() {
RQST_PKGS=("${@}")
PKGS_INST=( )
for PKG in "${RQST_PKGS[@]}"; do
sudo apt-get -qq --dry-run install $PKG &>/dev/null
if [ $? != 100 ]; then
dpkg -s $PKG &>/dev/null | grep -q not-installed
if [ $? == 1 ]; then
PKGS_INST=( "${PKGS_INST[@]}" "${PKG}" )
fi
fi
done
if [[ ! ${#PKGS_INST[@]} == 0 ]]; then
sudo apt-get install -y ${PKGS_INST[@]}
else
echo "Nothing to install"
fi
}
echo -e "\033[32m"
echo "First we'll got to the Home directory"
echo -e "\033[0m"
cd ~
echo -e "\033[32m"
echo "This is the Virtual Box Installer."
echo -e "\033[0m"
echo -e "\033[32m"
echo "Now, purge the Ubuntu bloat"
echo -e "\033[0m"
sudo apt-get purge -y spamassassin brasero thunderbird empathy empathy-common gwibber rhythmbox gucharmap aisleriot simple-scan vino remmina ubuntuone-client ubuntuone-client-gnome ubuntuone-control-panel ubuntuone-control-panel-qt ubuntuone-couch totem gnome-orca brasero-cdrkit brasero-common gir1.2-totem-1.0 gir1.2-rb-3.0 gir1.2-totem-plparser-1.0 gwibber-service gwibber-service-facebook gwibber-service-identica gwibber-service-twitter libbrasero-media3-1 libgwibber-gtk3 libgwibber3 librhythmbox-core6 libtotem-plparser17 libtotem0 python-ubuntuone-client python-ubuntuone-control-panel python-ubuntuone-storageprotocol remmina-common rhythmbox-data totem-common unity-lens-gwibber unity-lens-shopping deja-dup unity-lens-shopping zeitgeist-core indicator-messages telepathy-indicator
DROP_DIST=~/.dropbox-dist/dropboxd
if [ ! -e $DROP_DIST ] ;then
echo -e "\033[32m"
echo "Let's install Dropbox, shall we?"
echo -e "\033[0m"
wget -cO- "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf - && $DROP_DIST &
fi
echo -e "\033[32m"
echo "Let's Upgrade the Installed Packages"
echo -e "\033[0m"
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
echo -e "\033[32m"
echo "Let's locate the needed repositories."
echo -e "\033[0m"
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo add-apt-repository -y ppa:git-core/ppa
sudo add-apt-repository -y ppa:libreoffice/ppa
sudo add-apt-repository -y ppa:ozcanesen/terra-terminal
sudo add-apt-repository -y ppa:satyajit-happy/themes
sudo add-apt-repository -y ppa:smathot/cogscinl
sudo add-apt-repository -y ppa:tiheum/equinox
sudo add-apt-repository -y ppa:webupd8team/sublime-text-2
sudo add-apt-repository -y ppa:webupd8team/themes
sudo add-apt-repository -y ppa:webupd8team/y-ppa-manager
echo -e "\033[32m"
echo "Now for some Chrome & Gtalk Action"
echo -e "\033[0m"
dpkg -s google-chrome-stable &>/dev/null | grep -q installed
if [ $? != 0 ] ;then
wget -cO ~/Downloads/goog-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i ~/Downloads/goog-chrome.deb
rm ~/Downloads/goog-chrome.deb
sudo apt-get -f install -y
else
echo "Chrome already installed"
fi
echo -e "\033[32m"
echo ".......and.....Update!"
echo -e "\033[0m"
sudo apt-get update
echo -e "\033[32m"
echo "Wait for it, this will be the long install!"
echo -e "\033[0m"
install_a_bunch "${pkgs[@]}"
sudo adduser $CUR_USER fuse
echo -e "\033[34m"
echo "OK, now we'll do some adjusting of things by building the user specific configs."
read -p "Has Dropbox Finished its Loading? <y/n>" prompt
echo -e "\033[0m"
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] ;then
echo -e "\033[32m"
echo "After all that installing, copy over the files from Dropbox repo."
echo -e "\033[0m"
~/Dropbox/bootstrap
sudo chmod 600 ~/.gem/credentials
sudo chmod 600 ~/.ssh/ -R
echo -e "\033[32m"
echo "Now, let us pull in Oh-My-ZSH && Sublime Settings."
echo -e "\033[0m"
git clone [email protected]:coda/oh-my-zsh.git ~/.oh-my-zsh
git clone [email protected]:coda/MySublimeSettings.git ~/.config/sublime-text-2/Packages && cd ~/.config/sublime-text-2/Packages
git submodule update --init && git submodule foreach 'git submodule update --init --recursive; git checkout master; git pull origin master; git submodule update --init --recursive'
cd ~
echo -e "\033[32m"
echo "Now, install RVM and Gemsets"
echo -e "\033[0m"
\curl -L https://get.rvm.io | bash -s stable --ruby
source ~/.rvm/scripts/rvm
rvm install 1.9.3
rvm use 1.9.3
cd ~/Dropbox/Rvm-Gems
gemfiles=( * )
for f in ${gemfiles[@]}; do
IFS='.'
gems=$(echo $f | awk '{print $1}')
rvm gemset create $gems
rvm gemset use $gems
rvm gemset import $gems
done
cd ~
echo -e "\033[32m"
echo "Now, the Great and Wonderful Pandoc"
echo -e "\033[0m"
cabal update; cabal install pandoc
echo -e "\033[32m"
echo "Now, Node and Bower Stuff"
echo -e "\033[0m"
sudo npm install bower -g
echo -e "\033[32m"
echo "Now, Let's Change the Shell"
echo -e "\033[0m"
sudo vim /etc/passwd
echo -e "\033[32m"
echo "Pull the coding from backups"
echo -e "\033[0m"
rsync -rtpovclHzs --progress --delete --ignore-existing [email protected]:/srv/WSL-WPC-data/csk-backup/sites ~/sites
echo -e "\033[32m"
echo "Fixing Ubuntu's Automatic Updater"
echo -e "\033[0m"
sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop
~/Dropbox/bootstrap
fi
echo -e "\033[34m"
read -p "Wanna Do A Final Cleanup & Reboot? <y/n> " prompt
echo -e "\033[0m"
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] ;then
echo -e "\033[0m"
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get autoremove -y
sudo apt-get autoclean
sudo reboot
fi
### For MANUAL ADDITION
#sudo apt-get install virtualbox-4.2
### To File
#sudo bash -c 'echo vboxvideo >> /etc/modules'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment