Skip to content

Instantly share code, notes, and snippets.

@paulbdavis
Created January 13, 2014 20:17
Show Gist options
  • Save paulbdavis/8407290 to your computer and use it in GitHub Desktop.
Save paulbdavis/8407290 to your computer and use it in GitHub Desktop.
Ubuntu server setup (docker, node, mongo, bitcoind)
#!/usr/bin/env bash
# add ppas
add-apt-repository -y ppa:chris-lea/node.js
add-apt-repository -y ppa:bitcoin/bitcoin
#mongo
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' > /etc/apt/sources.list.d/mongodb.list
#docker
wget -qO- https://get.docker.io/gpg | apt-key add -
echo 'deb http://get.docker.io/ubuntu docker main' > /etc/apt/sources.list.d/docker.list
apt-get update && apt-get -y dist-upgrade
apt-get -y install git zsh build-essential libncurses{,w}5{,-dev} mercurial python{,3}{,-dev} vim-runtime curl psutils mongodb-10gen bitcoind nodejs lxc-docker automake pkg-config libevent-dev
[[ $? -ne 0 ]] && exit 1
#clone dotfiles repo
git clone --recursive https://github.com/paulbdavis/dotfiles.git /root/.dotfiles-git
cp -r /root/.dotfiles-git /etc/skel
# dotfiles setup for skel folder so all new users will have them
for dir in /root /etc/skel
do
cd $dir
for file in .zshrc .zsh .zprofile .vim .toprc .tmux.conf .jshintrc .gittemplate
do
ln -s .dotfiles-git/$file
done
tail -$[$(wc -l $dir/.dotfiles-git/.gitconfig | awk '{print $1}') - 3] $dir/.dotfiles-git/.gitconfig > $dir/.gitconfig
done
# get sources for vim and tmux
rootSrcDir=/root/src
mkdir $rootSrcDir
git clone git://git.code.sf.net/p/tmux/tmux-code $rootSrcDir/tmux
hg clone https://vim.googlecode.com/hg/ $rootSrcDir/vim
# build tmux
cd $rootSrcDir/tmux
git checkout 1.8
sh autogen.sh && ./configure && make && make install
# build vim
cd $rootSrcDir/vim
./configure --with-features=huge --enable-python{,3}interp=yes --with-python-config-dir=/usr/lib/python2.7/config --with-python3-config-dir=/usr/lib/python3.2/config && make && make install
update-alternatives --install /usr/bin/vi vi /usr/local/bin/vim 99
update-alternatives --install /usr/bin/vim vim /usr/local/bin/vim 99
cd
chsh -s $(which zsh)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment