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 https://github.com/brendangregg/FlameGraph
# cd FlameGraph
# ./flamegraph.pl < ../asdf > out.svg
View 0.md

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
burke / genkey.rb
Created Oct 12, 2016
Create an Elliptic Curve keypair in ruby
View genkey.rb
require 'openssl'
k = OpenSSL::PKey::EC.new('secp384r1').generate_key
p = OpenSSL::PKey::EC.new(k.public_key.group)
p.public_key = k.public_key
puts k.to_pem, p.to_pem
View 0.md
  1. Build app like this
  2. Open app
  3. open omgscheme://whatever
View run-in-terminal.scpt
-- compiled from https://github.com/janko-m/vim-test/tree/master/bin
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
burke / APKBUILD
Created Oct 28, 2015
Alpine Linux APKBUILD for runc
View APKBUILD
# Contributor: Burke Libbey <burke@libbey.me>
# Maintainer:
pkgname=runc
pkgver=0.0.4
pkgrel=0
_gitcommit=b0fd9fb7
pkgdesc="CLI tool for spawning and running containers according to the OCF specification"
url="http://runc.io/"
arch="x86_64"
license="ASL 2.0"
View bashwtf.md

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: http://www.tldp.org/LDP/abs/html/parameter-substitution.html.

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