Skip to content

Instantly share code, notes, and snippets.

@heizusan
heizusan / gist:2831551
Created May 30, 2012 00:00 — forked from smoovej/gist:2831159
Clear memcached on Heroku
heroku run bundle exec rails console --app flixmaster
require "dalli"
dc = Dalli::Client.new
dc.flush
@heizusan
heizusan / gist:2831549
Created May 30, 2012 00:00 — forked from kagemusha/gist:1569836
Dump Heroku Postgres DB and load locally
Get the Heroku db as detailed here:
http://devcenter.heroku.com/articles/pgbackups#exporting_via_a_backup
1. heroku pgbackups:capture
2. heroku pgbackups:url <backup_num> #=>backup_url
- get backup_num with cmd "heroku pgbackups"
3. curl -o latest.dump <backup_url>
Then locally do:
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump