Skip to content

Instantly share code, notes, and snippets.

View mjpitz's full-sized avatar
🏳️‍🌈
out and proud

Mya mjpitz

🏳️‍🌈
out and proud
View GitHub Profile
@mjpitz
mjpitz / runbook.md
Last active November 2, 2020 15:25
runbook.md

Runbook Template

General

A quick description of the services. 1 to 2 sentences max. Why does this service matter? What is it's core functionality? What Features does it provide users?

Failure Mode and Effect Analysis

[FMEA] is a method of failure analysis that helps teams create reliable systems and develop comprehensive on-call response patterns.

@mjpitz
mjpitz / 00-docker-registry.md
Last active November 5, 2020 14:45
Simple docker-registry deployment

Simple docker registry deployment

  • docker-registry (mirror of dockerhub, backed by S3 and redis)
  • docker-auth (restricts access to images unauthenticated users can pull)
  • Ingress that sets both up behind a common domain

This gist contains snippets for my "Adventures in Path Based Routing" blog post. In the post, I use kubernetes to demonstrate several useful path based routing techniques. This is mostly the skeleton for setting something up. Nothing end to end.

Blog Post

Supporting configuration for my next blog post on using consul connect to deploy a service mesh on raspberry pis.

Shows how to connect Hashicorp's memberlist to Golang's groupcache for dynamic cluster membership. Memberlist gossip can be encrypted by setting the SecretKey or Keyring attributes on cfg.

@mjpitz
mjpitz / kube-zsh-rprompt.zsh
Created March 9, 2021 04:14
embed some kube context in your zsh shell
kubeconfig="${KUBECONFIG}"
if [[ -z "${kubeconfig}" ]]; then
kubeconfig="$(mktemp):$(ls -1 ${HOME}/.kube/*.yaml | tr $'\n' ':')${HOME}/.kube/config"
fi
export KUBECONFIG="${kubeconfig}"
function zsh_kube_prompt() {
zsh_kube_context=$(kubectl config current-context)
zsh_kube_authinfo=$(kubectl config get-contexts "${zsh_kube_context}" --no-headers | awk '{print $4}')
zsh_kube_ns=$(kubectl config get-contexts "${zsh_kube_context}" --no-headers | awk '{print $5}')
@mjpitz
mjpitz / _README.md
Last active May 29, 2021 00:58
dgraph troubles

Three files:

  • schema.gql contains the type definitions I inserted into dgraph.
  • seed.rdf contains the set definition used to populate the database with associated information.
  • query.gql contains the dql query I'm trying to execute based on the examples...

When I run the query I get no results back. I've tried this at all sorts of different parts of the simple tree. Can't get any information anywhere. Can see data stored in the system just can't access it.

@mjpitz
mjpitz / _README.md
Last active August 1, 2024 21:43
comparison of embedded databases for raft

As an exercise, I started to design and implement a database in some of my free time. As I started working through some of the details, there were a few things that I knew I wanted to work with and a few things I wanted to evaluate. Since I'm looking at more of a CP system, my mind immediately jumped to Raft. But which implemenation to use? And what storage mechanism? Since I had more familiarity with Hashicorps implemenation, I started there.

The first thing I wanted to do was consider the performance characteristics of the underlying data stores. One of the nice features of the hashicorp implementation is it allows callers to plugin in different stores for logs, stable, and snapshots. There's a whole slew of community implementations.

@mjpitz
mjpitz / Dockerfile
Created July 8, 2021 15:26
Dockerfile for RedisRaft build
FROM ubuntu:21.04 AS builder
WORKDIR /scratch
RUN apt-get update -y && apt-get install -y ca-certificates git build-essential libtool cmake libbsd-dev peg
ARG REDISRAFT_VERSION="4bbf5af1"
RUN git clone https://github.com/RedisLabs/redisraft.git redisraft && \
cd redisraft && \
git checkout ${REDISRAFT_VERSION} && \
@mjpitz
mjpitz / io_performance.go
Last active October 15, 2021 13:41
A quick look at the performance of different encoding / serialization protocols
package io_test
import (
"bytes"
"encoding/binary"
"encoding/hex"
"encoding/json"
"testing"
"time"