- I did this as root:
$ sudo su
, although it may not be necessary. - Download AWS command line tools:
$ curl https://raw.github.com/timkay/aws/master/aws -o aws
- Install:
- Automatically:
$ perl --install aws
- Manually:
$ mv aws /usr/local/bin/ && chmod +x /usr/local/bin/aws
- Automatically:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 2; | |
worker_rlimit_nofile 65000; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 2048; | |
multi_accept on; | |
use epoll; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream app_upstream { | |
server unix:/home/user/app_folder/current/tmp/sockets/app.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name domain-name.com www.domain-name.com; | |
root /home/user/app_folder/current/public; | |
try_files $uri /system/maintenance.html @app_upstream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build dependencies for OpenResty. | |
sudo apt-get install build-essential libpcre3-dev libssl-dev libgeoip-dev | |
# Install standard Nginx first so that you get the relevant service scripts installed too | |
sudo apt-get install nginx | |
# If you want to access Postgres via Nginx | |
sudo apt-get install libpq-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Installation script for Ubuntu Trusty 14 with rbenv, haproxy, monit | |
# Author: Yacobs Reinhart <yacobus.reinhart@gmail.com> | |
set -e | |
CURRENT=`pwd` | |
echo "..... UPDATE UBUNTU PACKAGES ....." | |
apt-get update | |
apt-get install -y --force-yes build-essential curl git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# README: Start server with em-stream-tail.rb tail-filename | |
# Connect to server with curl http://localhost:8083 | |
# Observe log events on curl. | |
# | |
require 'rubygems' | |
require 'eventmachine' | |
if ARGV.empty? |
( Source: the mongoid cheatsheet )
class User
include Mongoid::Document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TaxCode | |
GENERATORS = { | |
:us => lambda { |id| "US-#{id}" }, | |
:br => lambda { |id| "#{id + 9}-BRA" }, | |
} | |
def self.generate(code, id) | |
gen = GENERATORS[code] || raise ArgumentError, "No generator for country #{code}" | |
gen.call(id) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Application Generator Template | |
# Modifies a Rails app to use Devise with RSpec and Cucumber | |
# Usage: rails new APP_NAME -m https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-devise-rspec-cucumber-template.rb -T | |
# Information and a tutorial: | |
# https://github.com/RailsApps/rails3-devise-rspec-cucumber | |
# Generated using the rails_apps_composer gem: | |
# https://github.com/RailsApps/rails_apps_composer/ |
OlderNewer