Skip to content

Instantly share code, notes, and snippets.

@jonstacks
jonstacks / bootstrap-kind-helm-v2.sh
Created August 27, 2020 17:48
Bootstrap a kubernetes in docker cluster with helm v2 installed
#!/bin/bash
set -e
kind create cluster --image kindest/node:v1.18.6
NAMESPACE="kube-system"
helm init --wait
kubectl --namespace $NAMESPACE create serviceaccount tiller
@jonstacks
jonstacks / kube-purge-namespace.sh
Created January 9, 2020 04:08
Purge a kubernetes namespace but only if it is empty
#!/bin/bash
set -e
NAMESPACE="$1"
echo "Checking if we can purge namespace $NAMESPACE"
OUTPUT=$(kubectl -n "$NAMESPACE" get all 2>&1)
echo "$OUTPUT"
@jonstacks
jonstacks / Dockerfile
Last active March 21, 2024 14:40
Ember multi-stage docker image example
FROM node:8.16.2-jessie as production
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Add npm binaries to path
ENV PATH node_modules/.bin:$PATH
# Install yarn
RUN curl --compressed -o- -sSL https://yarnpkg.com/install.sh | bash
@jonstacks
jonstacks / Dockerfile
Created November 10, 2019 22:02
Golang Example of docker multi-stage build
FROM golang:1.13-alpine as builder
WORKDIR /my-proj
ADD . .
RUN CGO_ENABLED=0 go install ./cmd/my-cmd/...
FROM alpine:latest
COPY --from=builder /go/bin/my-cmd /usr/local/bin/my-cmd
ENTRYPOINT ["/usr/local/bin/my-cmd"]
@jonstacks
jonstacks / LICENSE
Created July 11, 2019 02:06
Slack Webhook Cloud Function handler
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
@jonstacks
jonstacks / git-branch-cleanup.py
Created January 23, 2018 22:24
Cleanup Git branches
"""
Usage:
python git-branch-cleanup.py <repo_name>
Run this script from the /tmp directory. It will clone the
repo locally and then proceed to delete branches.
"""
import os, errno, logging, sys
@jonstacks
jonstacks / rocket.chat.yml
Created November 11, 2015 04:47
Docker Compose file for Rocket.Chat
db:
image: mongo
command: mongod --smallfiles
rocketchat:
image: rocketchat/rocket.chat
links:
- db
ports:
- 80:3000
@jonstacks
jonstacks / elk.yml
Created November 4, 2015 05:27
Docker Compose file for Elasticsearch and Kibana
# Template for the Elasticsearch and Kibana portion of an ELK stack
elasticsearch:
image: elasticsearch
# Have to overwrite command because elasticsearch:2 binds to 127.0.0.1 by default
command: ["elasticsearch", "-Des.network.host=0.0.0.0"]
ports:
- "9200:9200"
kibana:
image: kibana
links: