Skip to content

Instantly share code, notes, and snippets.

View benschw's full-sized avatar

Ben Schwartz benschw

View GitHub Profile
@benschw
benschw / gist:7980697
Created December 16, 2013 00:46
socat docker ambassador
The svendowideit/ambassador Dockerfile
The svendowideit/ambassador image is a small busybox image with socat built in. When you start the container, it uses a small sed script to parse out the (possibly multiple) link environment variables to set up the port forwarding. On the remote host, you need to set the variable using the -e command line option.
-expose 1234 -e REDIS_PORT_1234_TCP=tcp://192.168.1.52:6379 will forward the local 1234 port to the remote IP and port - in this case 192.168.1.52:6379.
#
#
# first you need to build the docker-ut image using ./contrib/mkimage-unittest.sh
# then
@benschw
benschw / golang-install.sh
Last active December 30, 2015 19:19
install golang 1.1
sudo apt-get install python-software-properties # 12.04
sudo add-apt-repository ppa:duh/golang
sudo apt-get update
sudo apt-get install golang
$ mkdir $HOME/go
bashrc
@benschw
benschw / auth.md
Last active December 26, 2015 13:09
Loscon Notes

User Auth

  • rate limiting
  • cryptographically secure tokens (not rand() or guid())
  • expire sessions

workflows

account creation

  • sanitize for xss
  • upper cross: 26" (2x4)
  • lower cross: 60" (2x8)
  • legs: 30" + miter
  • braces: table top, seats (2x4)

list

  • 2.5" deck screws
  • 3/8" x 3.5" carriage bolts (8)
@benschw
benschw / auth.md
Last active December 23, 2015 22:49

Roles

Client (The Third-Party Application)

The client is the application that is attempting to get access to the user's account. It needs to get permission from the user before it can do so.

Resource Server (The API)

The resource server is the API server used to access the user's information.

@benschw
benschw / docker.md
Created September 25, 2013 14:18 — forked from skyrocknroll/docker.md

cd /etc/init vim docker.conf

replace /usr/bin/docker -d with this /usr/bin/docker -H 0.0.0.0:5555 -d so that we can connect through http api.

alias docker="docker -H 0.0.0.0:5555"
cd /var/lib/docker/containers

in the above locations you can find all the containers which are all executed

@benschw
benschw / gist:6299449
Created August 21, 2013 20:02
disable screen blanking... run inside current session
xset -dpms
xset s noblank
xset s off
@benschw
benschw / sublime text markdown.md
Last active December 21, 2015 11:19
Markdown for Sublime Text 3
public abstract class JdbiIntegrationTest {
private DBI dbi;
private Handle handle;
private Liquibase liquibase;
protected abstract DatabaseConfiguration getDatabaseConfiguration();