Skip to content

Instantly share code, notes, and snippets.

View blockloop's full-sized avatar

Brett Jones blockloop

  • Lithic (privacy.com)
View GitHub Profile
@blockloop
blockloop / keybase.md
Created February 10, 2017 19:46
keybase.md

Keybase proof

I hereby claim:

  • I am blockloop on github.
  • I am blockloop (https://keybase.io/blockloop) on keybase.
  • I have a public key ASDZ77BAmvKbMKD0d0cKTgYpuyJAcbPCgAWcGAj3vIeFCQo

To claim this, I am signing this object:

@blockloop
blockloop / AWS Swarm cluster.md
Created November 5, 2016 04:53 — forked from ghoranyi/AWS Swarm cluster.md
Create a Docker 1.12 Swarm cluster on AWS

This gist will drive you through creating a Docker 1.12 Swarm cluster (with Swarm mode) on AWS infrastructure.

Prerequisites

You need a few things already prepared in order to get started. You need at least Docker 1.12 set up. I was using the stable version of Docker for mac for preparing this guide.

$ docker --version
Docker version 1.12.0, build 8eab29e

You also need Docker machine installed.

My sync settings. Managed by atom-sync-settings package.
package main
import (
"bufio"
"os"
"reflect"
"strconv"
"strings"
log "github.com/Sirupsen/logrus"
@blockloop
blockloop / crontab
Last active April 3, 2016 14:18
Automatically update letsencrypt certificates with crontab/cronjob
0 3 1 * * /var/www/_utils/update_certs.sh > /dev/null
@blockloop
blockloop / upsearch.sh
Created January 7, 2016 05:34
Search upward to find a certain file or directory. I don't know where I found this or if I wrote it myself.
upsearch() {
origdir=${2-$(pwd)}
test / == "$PWD" && cd "$origdir" && return || \
test -e "$1" && echo "$PWD" && cd "$origdir" && return || \
cd .. && upsearch "$1" "$origdir"
}
@blockloop
blockloop / server.go
Created May 12, 2015 03:10
Listening to RPC and HTTP simultaneously with golang
package main
import (
"errors"
"io"
"log"
"net"
"net/http"
"net/rpc"
)
@blockloop
blockloop / upgrade-ghost-openshift.sh
Created January 11, 2015 03:22
Upgrade your openshift ghost blog to the latest version
#!/usr/bin/env bash
if [ ! -f package.json ]; then
echo "This script must be run from the ghost blog directory"
exit 1
fi
ZIP_URL=https://ghost.org/zip/ghost-latest.zip
PROJ_DIR=$(pwd)
TMP_DIR=$(mktemp -d -t ghost)
@blockloop
blockloop / gvim
Last active August 29, 2015 14:05
Launch gvim with cygwin like it should (reuse windows for files)
#!/usr/bin/env ruby
args=''
filepath=''
files=ARGV[0..-1]
if files
for file in files do
if File.exist? file
fp=`cygpath -w '#{file}'`.strip.gsub '\\', '/'
#!/usr/bin/python
import json
import bottle
from bottle import static_file, route, run, request, abort, response
import simplejson
import pymongo
from pymongo import Connection
import datetime