Skip to content

Instantly share code, notes, and snippets.

View freeformz's full-sized avatar

Edward Muller freeformz

View GitHub Profile
@freeformz
freeformz / gist:3153672
Created July 20, 2012 22:28
Getting Asgard Running on Heroku
git clone git://github.com/Netflix/asgard.git
cd asgard
<modify some files>
<add Procfile>
heroku create <my>-asgard-test
heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-grails.git
heroku addons:add heroku-postgresql:basic (dev may work)
heroku pg:promote HEROKU_POSTGRESQL_<COLOR>_URL
@freeformz
freeformz / README.md
Created August 16, 2012 23:49
Using Heroku's Postgres's Fork feature to make/update staging dbs

This script assumes the following:

  1. Your app is named 'something' and that your staging app is named 'something-staging'. This seems to be a common thing.
  2. You only have a single staging HEROKU_POSTGRESQL databae.

Totally untested. 😏

What does it do?

  1. Grabs the current db name
puts "Hello from gist.github.com"
APP=<myapp>
heroku logs --tail --ps run -a $APP &
heroku run:detached "curl -s https://raw.github.com/gist/4121163/74722afb2fb6b40accdf01b62782c0b1e3b0f552/gistfile1.txt | ruby" -a $APP
CREATE INDEX on logs (source);
CREATE INDEX on logs (process);
CREATE INDEX on logs (drain);
CREATE INDEX on logs (timestamp);
CREATE INDEX on logs (severity);
CREATE INDEX on logs (facility);
@freeformz
freeformz / gist:4422458
Created December 31, 2012 20:21
Unicorn config
#....
before_fork do |server, worker|
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end
end
after_fork do |server, worker|
defined?(ActiveRecord::Base) and
@freeformz
freeformz / main.go
Last active December 10, 2015 22:49
package main;
// build +cgo
import "fmt"
/*
#include <unistd.h>
*/
import "C"
@freeformz
freeformz / gist:4552031
Last active August 5, 2017 20:18
statvfs (cgo)
package main
// build +cgo
import (
"fmt"
"os"
"unsafe"
)
@freeformz
freeformz / usage.go
Last active December 12, 2015 01:08
package utils
import "fmt"
func main() {
for line := range FileLineChannel('/etc/hosts') {
fmt.Println(line)
}
}

Tales From a Heroku User

Here are some things I have learned along the way.

Last Updated: 2013-02-08

Original Audience: Hack Reactor

About