Skip to content

Instantly share code, notes, and snippets.

View jsteiner's full-sized avatar

Josh Steiner jsteiner

View GitHub Profile

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

  1. Get an OAuth Token from GitHub

First you will need to get an OAuth Token from GitHub using your own username and "note"

find ~ -name '*.log' -print0 | xargs -0 -L1 stat -f'%z %N' | sort -rn | tee fat-logfiles.txt | head
awk '{ total += $1 } END { printf "total: %5.2f MiB\n", total/1024/1024 }' < fat-logfiles.txt
@jsteiner
jsteiner / gist:2957762
Created June 20, 2012 02:12 — forked from croaky/gist:2957583
Getting a production dump from Heroku backups
curl -o latest.dump `heroku pgbackups:url --app project-production`
pg_restore --verbose --clean --no-acl --no-owner -d project_development latest.dump
rm latest.dump