Skip to content

Instantly share code, notes, and snippets.

@kiasaki
Last active August 29, 2015 14:15
Show Gist options
  • Save kiasaki/921e9e6649ab1cc6731f to your computer and use it in GitHub Desktop.
Save kiasaki/921e9e6649ab1cc6731f to your computer and use it in GitHub Desktop.
Script to setup a vm in a minimum usable state
set -e
sudo apt-get update -y
sudo apt-get install -y curl tmux vim git bzr htop
curl -o $HOME/go.tar.gz https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gz
tar -xzf $HOME/go.tar.gz
rm $HOME/go.tar.gz
sudo locale-gen en_CA.UTF-8
mkdir -p $HOME/gocode
mkdir -p $HOME/.vim
mkdir -p $HOME/.vim/autoload
mkdir -p $HOME/.vim/backups
mkdir -p $HOME/.vim/swaps
mkdir -p $HOME/.vim/undo
plugLocation="https://raw.githubusercontent.com/merd/merd-orchestration/master/ansible/roles/common/files/vim/autoload/plug.vim"
curl -o $HOME/.vim/autoload/plug.vim $plugLocation
vimrcLocation="https://raw.githubusercontent.com/merd/merd-orchestration/master/ansible/roles/common/files/vimrc"
curl -o $HOME/.vimrc $vimrcLocation
tmuxConfLocation="https://raw.githubusercontent.com/kiasaki/dotfiles/master/tmux.conf"
curl -o $HOME/.tmux.conf $tmuxConfLocation
cat <<EOM >$HOME/.bashrc
alias ls='ls --color=auto -p'
alias ll='ls -alF'
alias tmux='tmux -2'
alias gaa='git add -A'
alias gc='git commit'
alias gp='git push origin HEAD'
alias gco='git checkout'
# Go
export GOROOT="$HOME/go"
export GOPATH="$HOME/gocode"
export PATH=$PATH:$GOROOT/bin
export PATH=$PATH:$GOPATH/bin
export wd=$GOPATH/src/github.com
ssh=''
if [ -n "$SSH_TTY" ]; then
ssh="\[\e[0;31m\][ssh] "
fi
export PS1="$ssh\[\e[0;35m\]\u at \h in \W \[\e[0;36m\]\n[\$?] $ \[\e[0m\]"
source $HOME/.env
EOM
cat <<EOM >$HOME/.bash_profile
source ~/.bashrc
EOM
touch $HOME/.env
echo "All done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment