Skip to content

Instantly share code, notes, and snippets.

View StevenACoffman's full-sized avatar

Steve Coffman StevenACoffman

View GitHub Profile
@StevenACoffman
StevenACoffman / Makefile
Last active May 14, 2018 16:22
For Ryan
NAME := acmecorp/foo
TAG := $$(git log -1 --pretty=%!H(MISSING))
IMG := ${NAME}:${TAG}
LATEST := ${NAME}:latest
build:
@docker build -t ${IMG} .
@docker tag ${IMG} ${LATEST}
push:
@StevenACoffman
StevenACoffman / Programmer Quotes.md
Last active May 24, 2025 17:54
Programmer quotes.md

That being said, I think that, as engineers, we tend to discount the complexity we build ourselves vs. complexity we need to learn.

— Joe Beda

Don't spend more time discussing a reversible change than it would take to make (& potentially reverse) the change

Kent Beck

@StevenACoffman
StevenACoffman / golang_kinesis.go
Created May 9, 2018 00:16 — forked from coboshm/golang_kinesis.go
Golang + Kinesis firehose
package main
import (
"log"
"encoding/json"
"fmt"
"os"
"math/rand"
@StevenACoffman
StevenACoffman / streams_to_firehose.go
Created May 9, 2018 00:09 — forked from harlow/streams_to_firehose.go
Golang lambda function to send Streams data to Firehose
package main
import (
"github.com/apex/go-apex"
"github.com/apex/go-apex/kinesis"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/firehose"
)
package main
import (
"fmt"
"reflect"
)
func main() {
a := []int{1, 2, 3, 4}
#!/bin/bash -e
# Usage ./k8s-service-account-kubeconfig.sh ( namespace ) ( service account name )
TEMPDIR=$( mktemp -d )
trap "{ rm -rf $TEMPDIR ; exit 255; }" EXIT
SA_SECRET=$( kubectl get sa -n $1 $2 -o jsonpath='{.secrets[0].name}' )
@StevenACoffman
StevenACoffman / keyfob.go
Created April 27, 2018 15:47
Add or remove SSH Certificate based on expiration and source ip
package main
import (
"os"
"io/ioutil"
"time"
"golang.org/x/crypto/ssh"
"net"
"golang.org/x/crypto/ssh/agent"
"crypto/rsa"
@StevenACoffman
StevenACoffman / kms_auth.go
Created April 17, 2018 11:03 — forked from alsmola/kms_auth.go
Confidant style KMS-based authentication in Go
/*
Copyright 2016 Alex Smolen (https://alexsmolen.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@StevenACoffman
StevenACoffman / struct_generator.go
Created April 9, 2018 19:07 — forked from objectx/struct_generator.go
Q: How to construct a generator whose types are generated via `gopter/gen`
func genStruct() gopter.Gen {
return genStrucType().FlatMap(
func(arg interface{}) gopter.Gen {
// typ := arg.(reflect.Type)
// Q: How to construct a generator?
return nil
},
reflect.TypeOf((interface{})(nil)),
)
}