This note will walk you though setting up and securing a Ubuntu 10.04 LTS then deploying a Rails application with mulit-stage deployment.
TODO:
- Add section for NGINX setup
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# ... or force ignoredups and ignorespace | |
HISTCONTROL=ignoredups:ignorespace |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
COLOR_NONE="\[\e[0m\]" |
default: &local_defaults | |
adapter: postgresql | |
host: localhost | |
port: 5432 | |
min_messages: warning | |
encoding: utf8 | |
username: postgres | |
password: | |
template: template0 |
#!/bin/bash | |
# License: Public Domain. | |
# Author: Joseph Wecker, 2012 | |
# | |
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile? | |
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux? | |
# Are you tired of not having your ~/.bash* stuff work the way you expect? | |
# | |
# Symlink all of the following to this file: | |
# * ~/.bashrc |
require 'yaml' | |
# Simple loading of environment-namespaced config files with local overrides. | |
# | |
# LiteConfig(:foobar) | |
# | |
# loads and caches the current environment section from: | |
# | |
# config/foobar.yml | |
# |
# config/initializers/clear_logs.rb | |
# This snippet simply clears your logs when they are too large. | |
# Large logs mean looooong search in TextMate. You know it :) | |
# Every time you run rails server or rails console it checks log sizes | |
# and clears the logs for you if necessary. | |
if Rails.env.development? | |
MAX_LOG_SIZE = 2.megabytes | |
# Quick fork by @mcjim to add stash status and tweak to suit his style. | |
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# host dir master $ # clean working directory | |
# host dir master* $ # dirty working directory | |
# host dir master*^ $ # dirty working directory with stash | |
# host dir master^ $ # clean working directory with stash | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" |
# install rvm | |
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) | |
# install ruby 1.9.2 + some global gems | |
rvm install 1.9.2 | |
rvm use 1.9.2@global | |
gem install awesome_print map_by_method wirble bundler builder pg cheat | |
gem install -v2.1.2 builder |