I hereby claim:
- I am elithrar on github.
- I am silverlock (https://keybase.io/silverlock) on keybase.
- I have a public key whose fingerprint is 73E6 AFB3 9131 E24C A140 F660 D6E8 9C78 40EB 8D6B
To claim this, I am signing this object:
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"github.com/gocraft/web" | |
) |
import ( | |
"fmt" | |
"html/template" | |
"net/http" | |
"github.com/oxtoacart/bpool" | |
) | |
var bufpool *bpool.BufferPool |
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"html/template" | |
"github.com/gorilla/sessions" |
I hereby claim:
To claim this, I am signing this object:
// GenerateRandomBytes generates a crytographically secure random byte string using crypto/rand. | |
func GenerateRandomBytes(s int) ([]byte, error) { | |
b := make([]byte, s) | |
n, err := rand.Read(b) | |
if n != len(b) || err != nil { | |
return nil, fmt.Errorf("Unable to successfully read from the system CSPRNG (%v)", err) | |
} | |
return b, nil | |
} |
r := mux.NewRouter() | |
// Single handler | |
r.HandleFunc("/form", use(http.HandlerFunc(formHandler), csrf, logging) | |
// All handlers | |
http.Handle("/", recovery(r)) | |
// Sub-routers | |
apiMiddleware := []func(http.Handler) http.Handler{logging, apiAuth, json} |
[unix_http_server] | |
file=/var/run/supervisor.sock | |
chmod=0770 | |
chown=root:supervisor | |
[supervisord] | |
pidfile=/var/run/supervisord.pid | |
nodaemon=false | |
logfile=/var/log/supervisord/supervisord.log | |
loglevel=error |
package main | |
import ( | |
"encoding/base64" | |
"github.com/gorilla/mux" | |
"net/http" | |
"strings" | |
) | |
func main() { |
A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E
GetObject
, ListBucket
and PutObject
on the bucket you want to use (and that it's not public).package main | |
import ( | |
"errors" | |
"github.com/garyburd/redigo/redis" | |
"net/http" | |
"time" | |
) | |
type RateStore struct { |