Skip to content

Instantly share code, notes, and snippets.

Busy bee

Lloyd Moore iolloyd

Busy bee
View GitHub Profile
iolloyd / demo.tpl
Last active Jan 8, 2020
dynamic inventory from terraform
View demo.tpl
iolloyd /
Last active Aug 1, 2019
AWS EC2 temporarily connect to an instance by id
# Allows you to temporarily connect to an ec2 instance, using
# awscli to first push your own key to the instance, then using ssh
# to log in to the instance.
# Assumes a public key called and a private
# key called ec2.
# Usage i-12345679abcdef <other-user> <other-file>
iolloyd /
Created Nov 11, 2018
a super small secure docker container for golang binaries using Alpine and multi-stage builds
# The smallest starting point is the alpine image
FROM golang:alpine as builder
RUN apk update && apk add git && add ca-certificates
RUN adduser -D -g '' appuser
COPY . $GOPATH/src/mypackage/myapp/
WORKDIR $GOPATH/src/mypackage/myapp/
RUN go get -d -v
RUN CGO_ENABLE=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-w -s" -o /go/bin/hello
iolloyd / kafka-zk.Dockerfile
Last active Oct 26, 2018
couples kafka and zookeeper together
View kafka-zk.Dockerfile
FROM java:openjdk-8-jre
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y dnsutils supervisor wget zookeeper && \
rm -rf /var/lib/apt/lists/* && \
iolloyd / booking.js
Created Apr 12, 2018
booking a resource
View booking.js
const flatten = arrays => [].concat.apply([], arrays);
const bookTime = (resource, time) => {
const newResource = => {
return (t.start < time.start && time.end < t.end)
? [{start: t.start, end: time.start}, {start: time.end, end: t.end}]
: t;
return flatten(newResource);
View proof of account
Verifying my Blockstack ID is secured with the address 1JEbu1eU9U7EUMQ1Q8VWeziA2fMcZcUi2B
iolloyd / create_hash_and_salt.js
Created Sep 5, 2017
method to create hash and salt
View create_hash_and_salt.js
import crypto from 'crypto'
import semver from 'semver'
const processVersion = '0.12.0';
const pbkdf2DigestSupport = semver.gte(process.version, processVersion);
const pbkdf2 = (pwd, salt, options, callback) => {
const { iterations, keylen, digestAlgorithm } = options;
if (pbkdf2DigestSupport) {
iolloyd /
Last active Jun 14, 2017
something about working for the man, for Pilar

From the unnatural sound from a modern thing,

a ring of a clock, a waking bot,

The dream through toil of a better day,

paid for with time and the daily grind

As slaves to a system of a fiat master

iolloyd /
Created May 9, 2017
altering permissions to createdb

sudo -u postgres psql -c 'alter user somename with createdb' postgres Or sudo -u postgres createdb -O somename somedb


Keybase proof

I hereby claim:

  • I am iolloyd on github.
  • I am iolloyd ( on keybase.
  • I have a public key ASAhk9_vHHaUrMBwWgJ0cCeGoAjI9rRsrxjox-DZD-wD7wo

To claim this, I am signing this object: