Skip to content

Instantly share code, notes, and snippets.

@compleatang
Last active December 16, 2015 00:49
Show Gist options
  • Select an option

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

Select an option

Save compleatang/5350298 to your computer and use it in GitHub Desktop.
Install Scripts for Main Machine Setup
#!/bin/bash
#^jist installd-workers -pu 5350298
#^jist /home/coda/Dropbox/Dot-Files/installd-workers -pu 5350298
cur_user=`whoami | awk '{print $1}'`
pkgs=( alacarte audacity blender blueman chromium-browser conky cuneiform darktable filezilla gawk gconf-editor git git-core gksu glipper gnome-shell-theme-elegance-colors gnome-tweak-tool gocr gparted gpointing-device-settings gscan2pdf guake htop insync insync-nautilus keepass2 keepass2-plugin-application-indicator libreoffice-lightproof-en libreoffice-style-crystal libreoffice-style-sifr macchanger meld multitail mumble numix-gtk-theme numix-icon-theme numix-icon-theme-circle openvpn p7zip-full pandoc pavucontrol pdfmod pdftk pidgin pidgin-plugin-pack pidgin-themes ppa-purge pulseaudio-module-bluetooth rsync seahorse-nautilus skype spotify-client sshfs sysinfo tesseract-ocr tesseract-ocr-eng texlive texlive-latex-extra texlive-luatex texlive-xetex tig tmux transmission-remote-gtk ttf-mscorefonts-installer ttfautohint typecatcher ubuntu-restricted-extras unrar vim vlc vncviewer vokoscreen whois xindy zotero-standalone zsh )
dev_pkgs=( autoconf automake awscli bison build-essential catdoc checkinstall chktex clang cmake curl debhelper docker.io dpkg-sig enscript g++-multilib gcc-multilib gnupg2 golang golang-doc golang-go.tools graphicsmagick hfsprogs intltool libappindicator1 libgif-dev libgmp-dev libgmp3-dev libgnome-keyring-dev libgnome2-dev libjpeg-dev libleveldb-dev libmagic-dev libmagickcore-dev libmagickwand-dev libnotify-dev libreadline6-dev libssl-dev libtool libzmq3-dev mercurial miniupnpc mongodb mono-complete nfs-common nmap nodejs perl-tk pgadmin3 postgresql postgresql-contrib postgresql-server-dev-all purifyeps python-docutils python-gpgme python-pip python-poppler python-virtualenv qemu-kvm redis-server rhash sqlite3 subversion tcl-tclreadline traceroute tree uuid-dev valac virtualenvwrapper xclip xdotool yasm )
function install_a_bunch() {
rqst_pkgs=("${@}")
pkgs_inst=( )
for pkg in "${rqst_pkgs[@]}"; do
echo "checking for package: $pkg"
sudo apt-get -qq --dry-run install $pkg &>/dev/null
if [ $? != 100 ]; then
dpkg -s $pkg 2>/dev/null | grep -q installed
if [ $? == 1 ]; then
pkgs_inst=( "${pkgs_inst[@]}" "${pkg}" )
echo "$pkg: not installed, will install it."
else
echo "$pkg: already installed."
fi
else
echo "$pkg: cannot find in the repos, try checking the apt repositories"
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 "now, purge the ubuntu bloat"
echo -e "\033[0m"
sudo apt-get purge -y spamassassin brasero empathy empathy-common evolution rhythmbox gucharmap aisleriot simple-scan vino ubuntuone-client ubuntuone-client-data ubuntuone-control-panel totem gnome-orca brasero-cdrkit brasero-common gir1.2-totem-1.0 gir1.2-rb-3.0 gir1.2-totem-plparser-1.0 libbrasero-media3-1 libtotem-plparser17 libtotem0 python-ubuntuone-client python-ubuntuone-control-panel python-ubuntuone-storageprotocol totem-common deja-dup zeitgeist-core telepathy-indicator
# install dropbox
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 &disown
#dropbox stop &
#dropbox start &
fi
# Fix Apt Translations
sudo touch /etc/apt/apt.conf.d/99translations
sudo sed -i "Acquire::Languages \"none\";" /etc/apt/apt.conf.d/99translations
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:chris-lea/zeromq
sudo add-apt-repository -y ppa:dlech/keepass2-plugins
sudo add-apt-repository -y ppa:git-core/ppa
sudo add-apt-repository -y ppa:gnome3-team/gnome3
sudo add-apt-repository -y ppa:libreoffice/ppa
sudo add-apt-repository -y ppa:numix/ppa
sudo add-apt-repository -y ppa:satyajit-happy/themes
sudo add-apt-repository -y ppa:smathot/cogscinl
sudo add-apt-repository -y ppa:webupd8team/java
echo -e "\033[32m"
echo "now, to handle the non-automatic repos"
echo -e "\033[0m"
insync_apt=/etc/apt/sources.list.d/insync.list
spotify_apt=/etc/apt/sources.list.d/spotify.list
if [ ! -e $insync_apt ] ;then
sudo echo "deb http://apt.insynchq.com/ubuntu $(lsb_release -sc) non-free contrib" | sudo tee $insync_apt
wget -qO - "https://d2t3ff60b2tol4.cloudfront.net/[email protected]" | sudo apt-key add -
fi
if [ ! -e $spotify_apt ] ;then
sudo echo "deb http://repository.spotify.com stable non-free" | sudo tee $spotify_apt
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558f59
fi
echo -e "\033[32m"
echo "now for some chrome & gtalk action"
echo -e "\033[0m"
gchrome=`dpkg -s google-chrome-stable 2>/dev/null | grep installed | awk '{print $4}'`
gtalk=`dpkg -s google-talkplugin 2>/dev/null | grep installed | awk '{print $4}'`
gmusic=`dpkg -s google-musicmanager-beta 2>/dev/null | grep installed | awk '{print $4}'`
if [ "$gchrome" != "installed" ] ;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
sudo apt-get -f install -y
rm ~/Downloads/goog-chrome.deb
else
echo "chrome already installed"
fi
if [ "$gtalk" != "installed" ] ;then
wget -cO ~/Downloads/goog-talk.deb https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb
sudo dpkg -i ~/Downloads/goog-talk.deb
rm ~/Downloads/goog-talk.deb
else
echo "gtalk already installed"
fi
if [ "$gmusic" != "installed" ] ;then
wget -cO ~/Downloads/goog-mus.deb https://dl.google.com/linux/direct/google-musicmanager-beta_current_amd64.deb
sudo dpkg -i ~/Downloads/goog-mus.deb
sudo apt-get -f -y install
rm ~/Downloads/goog-mus.deb
else
echo "gmusic already installed"
fi
echo -e "\033[32m"
echo "let's install golang now."
echo -e "\033[0m"
wget -O golang.tar.gz https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf golang.tar.gz
export PATH=$PATH:/usr/local/go/bin
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 "${dev_pkgs[@]}"
install_a_bunch "${pkgs[@]}"
sudo apt-get -f -y install
sudo adduser $cur_user fuse
echo -e "\033[32m"
echo "now let's get the keepass plugins that we lack."
echo -e "\033[0m"
keepass_dir=/usr/lib/keepass2
if [ -d $keepass_dir ] ;then
if [ ! -e /usr/lib/keepass2/keepassfavicondownloader.plgx ] ;then
sudo wget -cO /usr/lib/keepass2/keepassfavicondownloader.plgx http://downloads.sourceforge.net/project/keepass-favicon/1.7.2/KeePassFaviconDownloader.plgx
fi
if [ ! -e /usr/lib/keepass2/KeePassHttp.plgxl ] ;then
sudo wget -cO /usr/lib/keepass2/KeePassHttp.plgx https://raw.github.com/pfn/keepasshttp/master/KeePassHttp.plgx
fi
else
mkdir $keepass_dir
if [ ! -e /usr/lib/keepass2/keepassfavicondownloader.plgx ] ;then
sudo wget -cO /usr/lib/keepass2/keepassfavicondownloader.plgx http://downloads.sourceforge.net/project/keepass-favicon/1.7.2/KeePassFaviconDownloader.plgx
fi
if [ ! -e /usr/lib/keepass2/KeePassHttp.plgx ] ;then
sudo wget -cO /usr/lib/keepass2/KeePassHttp.plgx https://raw.github.com/pfn/keepasshttp/master/KeePassHttp.plgx
fi
fi
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 and are your keys installed to ~/.keys? <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
chmod 600 ~/.ssh/*
chown $cur_user:$cur_user ~/.gnupg/gpg.conf
chmod 700 ~/.gnupg
chmod 600 ~/.gnupg/gpg.conf
echo -e "\033[32m"
echo "pull the coding from backups"
echo -e "\033[0m"
IS_EXTERNAL_HD_MOUNTED=`mount 2> /dev/null | grep "$EXTERNAL_HD" | cut -d' ' -f3`
if [ ! -d ~/sites ]; then
mkdir -p ~/sites
fi
if [[ "$IS_EXTERNAL_HD_MOUNTED" ]] ;then
rsync -rtpovclHzs --progress --delete --ignore-existing ~/sites/ /media/coda/MediaHD/Coding
else
rsync -rtpovclhzs --progress --ignore-existing ei:/srv/WSL-WPC-data/csk-backup/Coding/ ~/sites
fi
echo -e "\033[32m"
echo "now, let us pull in sublime settings."
echo -e "\033[0m"
git clone git://github.com/compleatang/my-sublimetext3-packages.git ~/.config/sublime-text-3/Packages
cd ~
echo -e "\033[32m"
echo "now, install rvm and gemsets"
echo -e "\033[0m"
\curl -L https://get.rvm.io | bash
source ~/.rvm/scripts/rvm
rvm get stable --auto-dotfiles
chmod 0600 /home/coda/.gem/credentials
rvm install 2.0.0
rvm install 1.9.3
rvm use 2.0.0@global --default
gem install t jist rvm rake bundle paint pry bundle awesome_print bond irbtools foreman listen miro
~/.bin/loggemsets --import ~/Dropbox/Dot-Files/gemsets.yml
echo -e "\033[32m"
echo "now, node stuff"
echo -e "\033[0m"
sudo npm install -g grunt-cli bower
echo -e "\033[32m"
echo "now, python stuff"
echo -e "\033[0m"
sudo pip install tutum
echo -e "\033[32m"
echo "now, go stuff"
echo -e "\033[0m"
export GOPATH=~/sites/gostuff
export PATH="$PATH:$GOPATH/bin"
echo -e "\033[32m"
echo "now, let's change the shell"
echo -e "\033[0m"
sudo chsh -s /bin/zsh $cur_user
echo -e "\033[32m"
echo "set up the crons from the dropbox logs"
echo -e "\033[0m"
cat ~/Dropbox/Dot-Files/crontastic | crontab -u $cur_user -
echo -e "\033[32m"
echo "Install Sublime Text 3 from Dev Build."
echo -e "\033[0m"
cd ~/Downloads
wget http://c758482.r82.cf2.rackcdn.com/sublime-text_build-3066_amd64.deb
sudo dpkg -i sublime-text_build-3066_amd64.deb
rm sublime-text_build-3066_amd64.deb
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
echo -e "\033[32m"
echo "install brother drivers"
echo -e "\033[0m"
sudo /home/coda/.bin/brother-installer
brsaneconfig4 -a name=Primates-Printer model=MFC-8510DN ip=10.176.17.10
echo -e "\033[32m"
echo "install vundle"
echo -e "\033[0m"
cd ~
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
vim +BundleInstall +qall
echo -e "\033[32m"
echo "Install Heroku Toolbelt."
echo -e "\033[0m"
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
echo -e "\033[32m"
echo "Install Safejumper for Proxies."
echo -e "\033[0m"
wget -cO safejumper.zip https://proxy.sh/safejumper_linux.zip
7z x safejumper.zip
tar -xzvf safejumper_lin64.tar.gz
sudo ./Safejumper-1.6-Linux-x86_64-Install
rm -rf safe*
rm -rf Safe*
echo -e "\033[32m"
echo "Some Postgres necessaries."
echo -e "\033[0m"
sudo su postgres -c passwd
echo "ADD this: ALTER USER postgres WITH PASSWORD ‘password';"
sudo su postgres -c psql template1
echo -e "\033[32m"
echo "Ensure Gnome Shell Extensions are Setup."
echo -e "\033[0m"
~/.bin/shell-reloaded
fi
echo -e "\033[34m"
read -p "wanna do a final cleanup? <y/n> " prompt
echo -e "\033[0m"
if [[ $prompt == "y" || $prompt == "y" || $prompt == "yes" || $prompt == "yes" ]] ;then
echo -e "\033[0m"
xinput set-prop ETPS/2 Elantech Touchpad Synaptics Finger 5 75 0
sudo chmod -x /etc/grub.d/20_linux_xen
sudo chmod -x /etc/grub.d/20_memtest86+
sudo chmod -x /etc/grub.d/30_os-prober
sudo chmod -x /etc/grub.d/30_uefi-firmware
sudo cp Dropbox/Dot-Files/grub-40-custom /etc/grub.d/40_custom
sudo update-grub
rm -rf ~/Documents
rm -rf ~/Pictures
rm -rf ~/Templates
rm -rf ~/.subversion
rm ~/examples.desktop
rm ~/.profile
rm ~/.bash*
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 update-rc.d -f mongodb remove
sudo update-rc.d -f postgresl remove
sudo update-rc.d -f redis-server remove
~/Dropbox/bootstrap
fi
echo -e "\033[34m"
read -p "wanna reboot? <y/n> " prompt
echo -e "\033[0m"
if [[ $prompt == "y" || $prompt == "y" || $prompt == "yes" || $prompt == "yes" ]] ;then
echo -e "\033[0m"
sudo reboot
fi
### to file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment