Skip to content

Instantly share code, notes, and snippets.

View robskillington's full-sized avatar
⌨️

Rob Skillington robskillington

⌨️
View GitHub Profile
@robskillington
robskillington / value_pack.go
Created May 22, 2017 18:39
A value pack and unpacker
package valuepack
import (
"container/list"
"fmt"
)
type value struct {
metadata ValueMetadata
elem interface{}
@robskillington
robskillington / counter_vector.go
Created October 18, 2017 17:15
Metrics Vector Prototype
package main
import (
"fmt"
"sync"
"sync/atomic"
)
const (
offset64 = 14695981039346656037
# originally courtesy of https://gist.github.com/pkuczynski/8665367
# note: only supports 2 space indented YAML.
# additions:
# - only set environment variable if not already set
# - uppercase parsed variables to avoid case sensitivity
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
@robskillington
robskillington / git-author-stats.sh
Last active January 14, 2019 01:28
git log stats for author over time window with exclusion of vendor directories
#!/bin/bash
read -r -d '' REPOS << EOM
$GOPATH/src/github.com/uber-go/tally
EOM
FROM="500 weeks ago"
UNTIL="1 day ago"
curr=$(pwd)
metrics:
prometheus:
handlerPath: /metrics
timerType: histogram
sanitization: prometheus
samplingRate: 1.0
extended: detailed
@robskillington
robskillington / README.md
Last active April 1, 2019 21:20
M3 FOSDEM demo

M3 Demo

This repository contains a docker-compose file which can be used to setup a demo of the M3 stack. It runs the following containers:

  1. M3DB
  2. M3Coordinator
  3. Prometheus
  4. Grafana

Setup

@robskillington
robskillington / keys.png
Last active December 5, 2021 23:43
iTerm escape codes (delete word, forward delete word, word skip left, word skip right)
keys.png
@robskillington
robskillington / prometheus.proto
Last active November 7, 2025 23:14
Example Python Prometheus remote write client
// Copyright 2016 Prometheus Team
// 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
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@robskillington
robskillington / m3coordinator-deploy.yaml
Created May 13, 2019 04:20
m3coordinator k8s manifest (dedicated)
---
apiVersion: v1
kind: Service
metadata:
labels:
app: coordinator
name: coordinator-dedicated
spec:
ports:
- name: coordinator
@robskillington
robskillington / m3dbops-nodes-add.sh
Created June 19, 2019 07:54
m3dbops-nodes-add.sh
#!/bin/bash
echo "Example usage: KV_ZONE=embedded KV_ENV=default_env COORD_HTTP_HOST=\"host1\" COORD_HTTP_PORT=\"7201\" HOSTS=\"host1 host2 host3\" ISOLATION_GROUP=\"group\" ./m3dbops-nodes-add.sh"
if [ "$HOSTS" = "" ]; then
echo "must set HOSTS"
exit 1
fi
if [ "$ISOLATION_GROUP" = "" ]; then