Skip to content

Instantly share code, notes, and snippets.

View brandt's full-sized avatar

J. Brandt Buckley brandt

  • Twilio
  • Denver, CO
View GitHub Profile
@brandt
brandt / 2.3.0-railsexpress
Created April 11, 2016 04:38
Ruby 2.3.0 rbenv / ruby-build recipe i.e. /usr/local/share/ruby-build/2.3.0-railsexpress
build_package_reconfigure() {
test -f configure || autoconf
}
build_package_patch_ruby_railsexpress() {
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master
patch -p1 < rvm-patchsets/patches/ruby/2.3.0/railsexpress/01-skip-broken-tests.patch
patch -p1 < rvm-patchsets/patches/ruby/2.3.0/railsexpress/02-improve-gc-stats.patch
patch -p1 < rvm-patchsets/patches/ruby/2.3.0/railsexpress/03-display-more-detailed-stack-trace.patch
@brandt
brandt / gdb_ruby_backtrace.py
Created June 12, 2016 14:22 — forked from csfrancis/gdb_ruby_backtrace.py
Dump an MRI call stack from gdb
string_t = None
def get_rstring(addr):
s = addr.cast(string_t.pointer())
if s['basic']['flags'] & (1 << 13):
return s['as']['heap']['ptr'].string()
else:
return s['as']['ary'].string()
def get_lineno(iseq, pos):
@brandt
brandt / README.md
Last active July 7, 2025 17:42
Creates a loopback alias with IP 127.0.0.2 at startup on Mac OS X

Loopback Alias

Creates an alias on the loopback interface (lo0) with the IP 127.0.0.2 on macOS.

Installation

  1. Install the plist to: /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  2. Set mode: sudo chmod 0644 /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  3. Set owner: sudo chown root:wheel /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  4. Load: sudo launchctl load /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
@brandt
brandt / procdemo.go
Created October 19, 2016 19:42
Program demonstrating the difference between zombie and orphan processes
// Program demonstrating the difference between zombie and orphan processes.
//
// BUILDING
//
// go build procdemo.go
//
// USAGE
//
// procdemo zombie
// procdemo orphan
@brandt
brandt / logger-v2.17.2-to-v2.29-rc2.patch
Created October 24, 2016 19:21
Changes of the logger CLI tool from util-linux-ng v2.17.2 (version included in RHEL/CentOS 6) to v2.29-rc2
From 912d6b98925a34b05fb4791a2f52225b06c420af Mon Sep 17 00:00:00 2001
From: "WUEBBELS, Josef \\(Extern\\)" <[email protected]>
Date: Fri, 28 Jan 2011 14:15:20 +0100
Subject: [PATCH 001/115] logger: support for logging to UDP socket / remote
syslog server
It adds the ability to logger to log a message to a udp socket. The -n option
followed by the hostname of the remote host is mandatory to do this. The
optional -P option can be used to change the UDP destination port (default
514). The function udpopenlog is used to open the udp socket. After that
@brandt
brandt / ipaddr.rb
Created November 4, 2016 18:39 — forked from jimsynz/ipaddr.rb
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License