Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import github
import os
from github import *
g = Github(login_or_token=os.getenv("GITHUB_TOKEN"))
esl = g.get_organization("ESL")
pb = g.get_organization("postbasho")
#!/usr/bin/env python
import github
import os
from github import *
g = Github(login_or_token=os.getenv("GITHUB_TOKEN"))
rrc = g.get_repo("basho/riak_core")
#!/usr/bin/env python
import github
import os
from github import *
g = Github(login_or_token=os.getenv("GITHUB_TOKEN"))
b = g.get_organization("basho")
def num_branches(repo):
@bryanhuntesl
bryanhuntesl / count-riak-loc.sh
Last active October 16, 2017 14:46
How many lines of code are there in riak 2.2.3?
find . -regex '.*\(\.erl$\|\.cc$\|\.c$\|\.h$\|\.hrl$\|\.yrl$\|\.rebar.config$\|\.java$\)' -exec wc -l {} \; | awk
'START{count=0} {count=count + $1} END{print count}'
@bryanhuntesl
bryanhuntesl / determine.system.arch.markdown
Last active October 23, 2017 23:21
Which of these is the more pleasing way to determine system architecture ?

Pure sed

ARCH=$(sed -ne '/flags/{
                        / lm /{s/.*/x86_64/p;q;};
                        / tm /{s/.*/i386/p;q;};
                        /.*/{s/.*/unknown/p;q;}
                        }' < /proc/cpuinfo)

❯ brew install ArangoDB Updating Homebrew... ==> Auto-updated Homebrew! Updated Homebrew from cd61430b to 8be34a98. Updated 1 tap (homebrew/core). ==> New Formulae massren ==> Updated Formulae sdl2_image swiftgen

dockerex

socat -d TCP-LISTEN:2376,range=127.0.0.1/32,reuseaddr,fork UNIX:/run/docker.sock &
# curl localhost:2376/containers/json
[{"Id":"47d8a2db2b0b64408f23e65d28e10a44d90b029b29b89b1427407bfddad8a61e","Names":["/objective_jepsen"],....
@bryanhuntesl
bryanhuntesl / Dockerfile
Created November 6, 2017 12:19
Dockerfile to build erlang with wx on Ubuntu xenial
FROM ubuntu:xenial AS apt_builder
RUN apt-get update -y && apt-get install -y curl autoconf autoconf2.59 build-essential curl default-jdk devscripts flex git libncurses5-dev libwxbase3.0-dev libwxgtk3.0-dev unixodbc-dev wx-common xsltproc
ARG otp_github_url="https://github.com/erlang/otp"
@bryanhuntesl
bryanhuntesl / deploy-ssh-keys-to-every-docker-stack-node.yml
Created November 15, 2017 19:58
Deploy ssh keys to every docker-stack node
authorizedkeys:
image: dockercloud/authorizedkeys
deployment_strategy: every_node
autodestroy: always
environment:
- AUTHORIZED_KEYS=ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhN/j5QC3YtUC6ezD2qjGiO65R/uvIFbWR2TXsb8QTJxbT4GYQ3Jt9zH0XhDsdkd87B+GmCLQKC8Q1bz7G+4CbT9Lhqn2ThwoMKpG/ctwo2i1KdV7N/fpOo8nK27BwlQr0pNCK74hjUDxX46EjoPslrxaLlw5c4ggIlTjp0kJAlKrKsLqZko0LbwVEt5WkbcVOVJbLSUqmWchyqBysUs4xF9uq73+UCjRIh5+Ak+xzuSSRRgrV6py0hW62md4VFzSrUfvR/AHSaSHeEaqSqEtO7IuiLfLxdiI0Mi93A++TNTMD2RPaCoOj/3xpjWCR86Hh8mPOljGfB3cuA4ucn0hr bossman@hawg
volumes:
- /root:/user:rw
@bryanhuntesl
bryanhuntesl / thumbex.ex
Created November 16, 2017 13:55
trying out gen_statem via GenStateMachine
defmodule Thumbex do
@moduledoc """
Thumbex keeps the contexts that define your domain
and business logic.
Contexts are also responsible for managing your data, regardless
if it comes from the database, an external API or others.
"""
end