Skip to content

Instantly share code, notes, and snippets.

View benschw's full-sized avatar

Ben Schwartz benschw

View GitHub Profile
@benschw
benschw / Dockerfile
Last active October 1, 2018 18:30
MySQL Docker Container
FROM ubuntu
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get -y install mysql-client mysql-server
@benschw
benschw / git-origins.md
Last active September 20, 2023 08:54
fork a repo manually (set source as upstream origin) rather than with the "fork" button. e.g. for in github when you want to fork a project twice.

Ripped off from adrianshort.org

List curent remotes

$ git remote -v

origin  https://github.com/hakimel/reveal.js.git (fetch)
origin  https://github.com/hakimel/reveal.js.git (push)

Rename origin to upstream and add our new empty repo as the origin.

@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();