Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
# requires jsonnet. there's a homebrew package and it's pretty easy to build from source.
set -o nounset
set -o errexit
set -o pipefail
if [[ -z "${K8S_MASTER:-}" ]]; then
echo "Please set K8S_MASTER before running this" > /dev/stderr

Sparky- tiny unicode sparklines

Try them in a table!

product price trend
widgets 4.37 ⠉⠉⢄⡠⠤⢄⣀⠤
#!ipxe
set redacted-version 2016-04-20.v01
set domain-name host.example.net
set base-url http://x.x.x.x
prompt --key 0x02 --timeout 2000 Press Ctrl-B for the iPXE command line... && shell ||
:retry
ifconf -c dhcp || goto retry

We assume we have a set of master nodes (master-{1..N}) and a set of worker nodes (worker-{1..M}). We also assume that the container runtime (Docker, rkt) is already installed. For now, also assume that networking is configured. In my mind it is an open issue how much networking should be driven by kubernetes.

workstation$ ssh master-1

Start the kubelet. Here we just start it directly in the background for simplicity.

@jwhitlock
jwhitlock / fix01_show_constraint_violations.sql
Created August 25, 2016 00:21
SQL scripts for Bug 1293718
-- These have bad data in production
SELECT COUNT(*) AS account_emailaddress_orphan_users FROM `account_emailaddress` WHERE NOT EXISTS (SELECT * from `auth_user` WHERE `auth_user`.`id` = `account_emailaddress`.`user_id`);
SELECT * FROM `account_emailaddress` WHERE NOT EXISTS (SELECT * from `auth_user` WHERE `auth_user`.`id` = `account_emailaddress`.`user_id`);
SELECT COUNT(*) AS django_admin_log_orphan_content_types FROM `django_admin_log` WHERE NOT EXISTS (SELECT * FROM `django_content_type` WHERE `django_content_type`.`id` = `django_admin_log`.`content_type_id`);
SELECT * FROM `django_admin_log` WHERE NOT EXISTS (SELECT * FROM `django_content_type` WHERE `django_content_type`.`id` = `django_admin_log`.`content_type_id`);
SELECT COUNT(*) AS socialaccount_socialtoken_orphan_accounts FROM `socialaccount_socialtoken` WHERE NOT EXISTS (SELECT * FROM `socialaccount_socialaccount` WHERE `socialaccount_socialaccount`.`id` = `socialaccount_socialtoken`.`account_id`);
SELECT * FROM `socialaccount_socialtoken` WHERE
@vdice
vdice / pipeline_research.md
Last active September 20, 2016 17:54
Initial Jenkins Pipeline research
from moztelemetry.dataset import Dataset
# Let's start selecting the `telemetry` dataset.
# This will load all the metadata about available dimensions and file locations.
dataset = Dataset.from_source('telemetry')
#The list of dimensions is now available on the `schema` attribute.
assert dataset.schema == [
u'submissionDate',
u'sourceName',
@mikekap
mikekap / gist:640f7908e3f7c08ce3f6
Last active November 4, 2016 03:25
CFFI PCRE Implementation
from __future__ import unicode_literals
from cffi import FFI
from collections import OrderedDict
import string
import sys
assert sys.maxunicode == 0x10FFFF
ffi = FFI()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@natefaubion
natefaubion / thread-result.js
Last active January 5, 2017 23:58
Sweet.js threading macro
arg |> foo[0].bar(42)
|> baz("hello", "there")
|> quux.foo().bar()
|> new Foo()
// Expands to:
// new Foo(quux.foo().bar(baz('hello', 'there', foo[0].bar(42, arg))));
arg |> foo() |> bar
// SyntaxError: [|>] Expected function call
// 31: arg |> foo() |> bar