Skip to content

Instantly share code, notes, and snippets.

@btoone
btoone / nginx_rails_3_1
Created August 19, 2012 00:59 — forked from shapeshed/nginx_rails_3_1
Nginx Config for Rails 3.1 with Unicorn and Asset Pipeline
upstream app {
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name www.app.com;
rewrite ^/(.*) http://app.com/$1 permanent;
}
server {
@btoone
btoone / unicorn_example.sh
Created August 20, 2012 19:50 — forked from tualatrix/unicorn_example.sh
An example of unicorn init script for Ubuntu
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# 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 unicorn web server
# Description: starts unicorn
@btoone
btoone / compile_image_magick.txt
Created August 21, 2012 16:58 — forked from rgo/compile_image_magick.txt
Compile latest ImageMagick version (useful for old distros)
## From http://johannes.jarolim.com/blog/2011/11/21/extreme-slow-imagemagick-on-vps-with-ubuntu/
#
# Execute as root
apt-get update
apt-get install build-essential
apt-get build-dep imagemagick
cd /usr/local/src
VERSION = "6.7.9-0"
# Basic commands
:Git [args] # does what you'd expect
all of your `~/.gitconfig` aliases are available.
:Git! [args] # same as before, dumping output to a tmp file
Moving inside a repo.
@btoone
btoone / eval_gist.rb
Last active February 1, 2023 21:53 — forked from petekeen-cf/eval_gist.rb
Eval Gist
# Usage:
#
# Rails
# Step 1: write a gist with a file named __script__.rb
# Step 2: copy and paste the function def below into Rails console
# Step 3: run `eval_gist("the-gist-id-from-the-url")`
# Step 4: GOTO Step 3
#
# Ruby
# Start an IRB session and load this file