This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sessionManager = scs.NewCookieManager("...") | |
func RequireLogin(next http.Handler) http.Handler { | |
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
session := sessionManager.Load(r) | |
userID, err := session.GetInt("userID") | |
if err != nil { | |
http.Error(w, err.Error(), http.StatusInternalServerError) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################ | |
# Rather than run postgres in its own container, we want to run it on | |
# the (Ubuntu) host and allow: | |
# | |
# + peer connections on the host | |
# + local md5 connections from any docker container | |
# | |
# THIS IS COPY/PASTED FROM COMMAND LINE INPUT AND IS UNTESTED AS A SINGLE SCRIPT | |
################################################################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
# install ThinkUp on EC2 Ubuntu instance: | |
# | |
# @spara 12/23/10 | |
# @waxpancake 1/3/11 | |
# install required packages | |
sudo apt-get update |
NewerOlder