Skip to content

Instantly share code, notes, and snippets.

Burke Libbey burke

Block or report user

Report or block burke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View flamegraph.rb
# Step 1:
# FlameGraph.generate(output: 'asdf') { ... },
# Step 2:
# git clone
# cd FlameGraph
# ./ < ../asdf > out.svg

CSS-ish styling for graphviz DOT

digraph {
  rb_find_file_safe [class="emph,strong"];
  search_required [class=emph];
  open_load_file [class=emph];
  rb_find_file -> rb_find_file_safe;
  search_required -> rb_find_file_safe;
  rb_require_internal -> search_required;
View fs.d
#pragma D option dynvarsize=32M
#pragma D option switchrate=1msec
#pragma D option bufsize=25m
#pragma D option quiet
syscall::open:entry /pid == $target/ { self->path = arg0; }
syscall::shm_open:entry /pid == $target/ { self->path = arg0; }
syscall::open_extended:entry /pid == $target/ { self->path = arg0; }
syscall::accept:entry /pid == $target/ { self->fd = arg0; }
syscall::accept_nocancel:entry /pid == $target/ { self->fd = arg0; }
burke / genkey.rb
Created Oct 12, 2016
Create an Elliptic Curve keypair in ruby
View genkey.rb
require 'openssl'
k ='secp384r1').generate_key
p =
p.public_key = k.public_key
puts k.to_pem, p.to_pem
  1. Build app like this
  2. Open app
  3. open omgscheme://whatever
View run-in-terminal.scpt
-- compiled from
on run argv
set command to argv
-- without doing this as a var, it will launch iterm2
set iterm to "iTerm2"
if application iterm is running then
tell application "iTerm"
set _window to (current window)
if _window is equal to missing value then
burke / APKBUILD
Created Oct 28, 2015
Alpine Linux APKBUILD for runc
# Contributor: Burke Libbey <>
# Maintainer:
pkgdesc="CLI tool for spawning and running containers according to the OCF specification"
license="ASL 2.0"

Lots of these commands have two versions: one with and one without a :. The colon modifies operators to treat a declared-but-empty variable as nonexistent.

More detailed docs and examples for all of these are at:

bash ruby
${a} a
${a-b} `a
${a:-b} `(a == "" ? nil : a)
${a=b} `a
View getrubystack.bash
if [[ $# -ne 1 ]]; then
>&2 echo "usage: $0 <pid>"
exit 1
You can’t perform that action at this time.