Skip to content

Instantly share code, notes, and snippets.

@ewilazarus
Last active August 29, 2015 14:12
Show Gist options
  • Save ewilazarus/b537b00b653b14367afd to your computer and use it in GitHub Desktop.
Save ewilazarus/b537b00b653b14367afd to your computer and use it in GitHub Desktop.
Script created to bootstrap my default development configurations.
#!/bin/bash
clear
if [ "$1" = "--debug" ];
then
echo ">>> Creating directories '~/Lab', '~/Scripts' and '~/Workspace'."
mkdir ~/Lab && chown $(logname) ~/Lab
mkdir ~/Scripts && chown $(logname) ~/Scripts
mkdir ~/Workspace && chown $(logname) ~/Workspace
echo
echo ">>> Installing 'curl'..."
apt-get install -y curl
echo
echo ">>> Installing 'git'..."
apt-get install -y git
echo
echo ">>> Installing 'pip'..."
curl -sO https://bootstrap.pypa.io/get-pip.py
python get-pip.py
rm get-pip.py
echo
echo ">>> Installing 'virtualenv'..."
pip install virtualenv
echo
echo ">>> Installing 'virtualenvwrapper'..."
pip install virtualenvwrapper
mkdir -p ~/.venvs && chown $(logname) ~/.venvs
echo
echo ">>> Installing 'vim'..."
apt-get install -y vim
echo
echo ">>> Installing 'tmux'..."
apt-get install -y tmux
apt-get update
apt-get install -y python-software-properties software-properties-common
add-apt-repository -y ppa:pi-rho/dev
apt-get update
apt-get install -y tmux=1.9a-1~ppa1~t
echo
echo ">>> Installing 'rlwrap'..."
apt-get install -y rlwrap
echo
echo ">>> Installing 'ack-grep'..."
apt-get install -y ack-grep
echo
echo ">>> Installing 'exuberant-ctags'..."
apt-get install -y exuberant-ctags
echo
echo ">>> Installing 'build-essentials'..."
apt-get install -y build-essentials
echo
echo ">>> Installing 'python-dev'..."
apt-get install -y python-dev
echo
echo ">>> Installing 'ipython'..."
apt-get install -y ipython
echo
echo ">>> Cloning into '~/.dotfiles' repository... (this may take a while)"
git clone https://github.com/ewilazarus/dotfiles.git ~/.dotfiles --recursive
echo
echo ">>> Creating symbolic links to the configuration files..."
ln -s ~/.dotfiles/gitconfig ~/.gitconfig
ln -s ~/.dotfiles/tmux ~/.tmux
ln -s ~/.dotfiles/tmux.conf ~/.tmux.conf
tmux new-session -d
bash ~/.dotfiles/tmux/plugins/tpm/scripts/install_plugins.sh
tmux kill-server
ln -s ~/.dotfiles/vim ~/.vim
ln -s ~/.dotfiles/vimrc ~/.vimrc
echo
echo ">>> Installing 'powerline-fonts'..."
bash ~/.dotfiles/resources/powerline-fonts/install.sh
echo
echo ">>> Installing 'zsh'..."
apt-get install -y zsh
ln -s ~/.dotfiles/zsh/oh-my-zsh/ ~/.oh-my-zsh
ln -s ~/.dotfiles/zshrc ~/.zshrc
chsh -s /bin/zsh $(logname)
echo
echo ">>> Changing default terminal style..."
rm ~/.gconf/apps/gnome-terminal/profiles/Default/%gconf.xml
ln -s ~/.dotfiles/gconf/terminal/gconf.xml ~/.gconf/apps/gnome-terminal/profiles/Default/%gconf.xml
chown $(logname) ~/.gconf/apps/gnome-terminal/profiles/Default/%gconf.xml
chown -R $(logname) ~/.dotfiles
else
echo "Setting up development environment"
echo
sleep 2
echo "Creating directories '~/Lab', '~/Scripts' and '~/Workspace'."
mkdir ~/Lab && chown $(logname) ~/Lab
mkdir ~/Scripts && chown $(logname) ~/Scripts
mkdir ~/Workspace && chown $(logname) ~/Workspace
echo "Installing 'curl'..."
apt-get install -y curl > /dev/null
echo "Installing 'git'..."
apt-get install -y git > /dev/null
echo "Installing 'pip'..."
curl -sO https://bootstrap.pypa.io/get-pip.py > /dev/null
python get-pip.py > /dev/null
rm get-pip.py
echo "Installing 'virtualenv'..."
pip install virtualenv > /dev/null
echo "Installing 'virtualenvwrapper'..."
pip install virtualenvwrapper > /dev/null
mkdir -p ~/.venvs && chown $(logname) ~/.venvs
echo "Installing 'vim'..."
apt-get install -y vim > /dev/null
echo "Installing 'tmux'..."
apt-get install -y tmux > /dev/null
apt-get update > /dev/null 2>&1
apt-get install -y python-software-properties software-properties-common > /dev/null 2>&1
add-apt-repository -y ppa:pi-rho/dev > /dev/null 2>&1
apt-get update > /dev/null 2>&1
apt-get install -y tmux=1.9a-1~ppa1~t > /dev/null 2>&1
echo "Installing 'rlwrap'..."
apt-get install -y rlwrap > /dev/null
echo "Installing 'ack-grep'..."
apt-get install -y ack-grep > /dev/null
echo "Installing 'exuberant-ctags'..."
apt-get install -y exuberant-ctags > /dev/null
echo "Installing 'build-essentials'..."
apt-get install -y build-essentials > /dev/null
echo "Installing 'python-dev'..."
apt-get install -y python-dev > /dev/null
echo "Installing 'ipython'..."
apt-get install -y ipython > /dev/null
echo "Cloning into '~/.dotfiles' repository... (this may take a while)"
git clone https://github.com/ewilazarus/dotfiles.git ~/.dotfiles --recursive > /dev/null 2>&1
echo "Creating symbolic links to the configuration files..."
ln -s ~/.dotfiles/gitconfig ~/.gitconfig
ln -s ~/.dotfiles/tmux ~/.tmux
ln -s ~/.dotfiles/tmux.conf ~/.tmux.conf
tmux new-session -d
bash ~/.dotfiles/tmux/plugins/tpm/scripts/install_plugins.sh > /dev/null 2>&1
tmux kill-server
ln -s ~/.dotfiles/vim ~/.vim
ln -s ~/.dotfiles/vimrc ~/.vimrc
echo "Installing 'powerline-fonts'..."
bash ~/.dotfiles/resources/powerline-fonts/install.sh > /dev/null
echo "Installing 'zsh'..."
apt-get install -y zsh > /dev/null 2>&1
ln -s ~/.dotfiles/zsh/oh-my-zsh ~/.oh-my-zsh
ln -s ~/.dotfiles/zshrc ~/.zshrc
chsh -s /bin/zsh $(logname)
echo "Changing the terminal style..."
rm ~/.gconf/apps/gnome-terminal/profiles/Default/%gconf.xml > /dev/null 2>&1
ln -s ~/.dotfiles/gconf/terminal/gconf.xml ~/.gconf/apps/gnome-terminal/profiles/Default/%gconf.xml > /dev/null 2>&1
chown $(logname) ~/.gconf/apps/gnome-terminal/profiles/Default/%gconf.xml
chown -R $(logname) ~/.dotfiles
echo
echo "Finishing"
rm $0
echo "Rebooting machine in 10s"
sleep 10
shutdown -r 0
fi
@ewilazarus
Copy link
Author

Bootstrap Development Environment

Usage

  1. Download and unpack this file.
  2. Run sudo bash ./bootstrap_devenv.sh (for debugging purposes, you may want to append --debug)
  3. If not already working, in order to display vim's status line special characters, change the terminal's default font to one that is compatible.

Notice

This script is intended to run only on linux distributions that use either the Aptitude package manager and the Gnome Terminal. So far it has been tested on fresh installs of the distributions listed below and it might not work accordingly elsewhere.

Distribution Version Architecture
Mint 17 x64
Lubuntu 14.04 x32
Ubuntu 14.04.1 x64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment