Skip to content

Instantly share code, notes, and snippets.

View jhunt's full-sized avatar
🎧
codin'

James Hunt jhunt

🎧
codin'
View GitHub Profile
# Internship Projects
#sw
These are write-ups for potential internship projects. These projects are fully self-contained (though they most assuredly exist within the confines of a larger project like SHIELD or Cloud Foundry), and can be executed within 3 months by a team of 3-4 moderately talented junior-year computer science students.
## SHIELD etcd Data Protection Plugin
The Kubernetes container orchestration system relies on a single persistent data store for its metadata and configuration needs: etcd. This distributed key-value store is vital to the proper operation of Kubernetes and, assuming identical replacement hardware / component configuration, the data in etcd is all that an operator needs to resurrect a dead cluster.
Design and build a SHIELD Data Protection Plugin for backing up the data in etcd, and restoring data to etcd from those archives. This plugin must work within the existing contract SHIELD has for "target" plugins. To enable this effort, you will need to be able to deploy and va
@jhunt
jhunt / hunternetes.sh
Created November 22, 2018 20:16
hunternetes - A Kubernetes bootstrap script for Linode
#!/bin/bash
set -eu
useradd jhunt -Nm -c 'James Hunt' -d /home/jhunt -g staff -G staff -s /bin/bash
cat >/etc/sudoers.d/staff <<EOF
%staff ALL=(ALL:ALL) NOPASSWD:ALL
EOF
install -d -o jhunt -g staff -m 0700 ~jhunt/.ssh
@jhunt
jhunt / top.md
Created September 29, 2018 17:57

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Fri, 29 Sep 2017 17:55:27 GMT till Sat, 29 Sep 2018 17:55:27 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)
@jhunt
jhunt / codesign_gdb.md
Last active August 26, 2018 05:38 — forked from hlissner/codesign_gdb.md
Codesign gdb on OSX

Note: these instructions are for pre-Sierra MacOS. Sierra Users: see https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d by @gravitylow.

If you are getting this in gdb on OSX while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
@jhunt
jhunt / API.md
Last active August 24, 2018 17:35

Hush API

Hush is a dead-simple, no-frills credentials management and secure storage vault. It aims to be secure, stable, and simple, in that order.

Vault Operations

To query the status of the Vault:

package main
import "fmt"
func main() {
chans := make([]chan int, 4)
for i := range chans {
chans[i] = make(chan int, 0)
}
@jhunt
jhunt / cc.yml
Created March 19, 2018 00:31
Genesis Example Lab Cloud Configs
# to use this file, first get cc-me from https://github.com/jhunt/cc-me
# then, run this:
# spruce merge cc.yml | spruce json | cc-me
---
vsphere:
cc:
azs:
- name: z1
cloud_properties:
datacenters:
for org in $(cf curl /v2/organizations | jq -r .resources[].metadata.guid); do
echo "==ORG"
cf curl /v2/organizations/$org | jq -r .
echo ; echo ; echo
for space in $(cf curl /v2/organizations/$org/spaces | jq -r .resources[].metadata.guid); do
echo "==SPACE"
cf curl /v2/spaces/$space | jq -r .
echo ; echo ; echo
for org in $(cf curl /v2/organizations | jq -r .resources[].metadata.guid); do
echo "==ORG"
cf curl /v2/organizations/$org | jq -r .
echo ; echo ; echo
for space in $(cf curl /v2/organizations/$org/spaces | jq -r .resources[].metadata.guid); do
echo "==SPACE"
cf curl /v2/spaces/$space | jq -r .
echo ; echo ; echo
/* for execvpe(...): */
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>