Skip to content

Instantly share code, notes, and snippets.

@igolden
Last active February 8, 2017 21:14
Show Gist options
  • Save igolden/14886c5371bafc5dffe17a4072755127 to your computer and use it in GitHub Desktop.
Save igolden/14886c5371bafc5dffe17a4072755127 to your computer and use it in GitHub Desktop.
Provisioning files for new eC2 instance
[ -z "$PS1" ] && return
HISTCONTROL=ignoredups:ignorespace
shopt -s histappend
HISTSIZE=1000
HISTFILESIZE=2000
shopt -s checkwinsize
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
if [ -f ~/.bashrc.local ]; then
. ~/.bashrc.local
fi
alias ll='ls -lG'
alias vim="sudo vi"
alias be="bundle exec"
alias es="exec $SHELL"
source /usr/local/share/chruby/chruby.sh
chruby ruby-2.3.0
# Basic vimrc for ubuntu instances
# nginx config here for rails
# default nginx reverse proxy to react app
sudo su
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install git -y && sudo apt-get install wget -y
sudo apt-get install make -y
sudo apt-get install postgresql postgresql-contrib libpq-dev -y
sudo apt-get install nodejs -y
sudo apt-get install nginx -y
sudo apt-get install vim -y
wget -O chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz
tar -xzvf chruby-0.3.9.tar.gz
cd chruby-0.3.9/
sudo make install
wget -O ruby-install-0.6.1.tar.gz https://github.com/postmodern/ruby-install/archive/v0.6.1.tar.gz
tar -xzvf ruby-install-0.6.1.tar.gz
cd ruby-install-0.6.1/
sudo make install
cd ../../ && rm -rf chruby-0.3.9/
ruby-install ruby-2.3.0
cd
rm .bashrc
curl https://gist.githubusercontent.com/igolden/14886c5371bafc5dffe17a4072755127/raw/148a8ba0058c0d3e818a29d9cb07c498fd479763/.bashrc.local >> .bashrc.local
curl https://gist.githubusercontent.com/igolden/14886c5371bafc5dffe17a4072755127/raw/148a8ba0058c0d3e818a29d9cb07c498fd479763/.bashrc >> .bashrc
exec $SHELL
gem install bundler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment