Skip to content

Instantly share code, notes, and snippets.

View jhunt's full-sized avatar
🎧
codin'

James Hunt jhunt

🎧
codin'
View GitHub Profile
@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 => user.followers > 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>
#!/bin/bash
set -u
back="\e[0m"
red="\e[1;31m"
green="\e[1;32m"
yellow="\e[1;33m"
blue="\e[1;34m"
purple="\e[1;35m"
cyan="\e[1;36m"
#!/bin/bash
cpis=0
forges=0
read -r -d '' CPI_USAGE <<EOF
BOSH Director Cloud Provider Interfaces
(you need *exactly one* of these)
vsphere - VMWare's vSphere ESXi+vCenter