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 / 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
@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\\)" <Josef.WUEBBELS@mtu.de>
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 / 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 / README.md
Last active February 3, 2024 01:28
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 / 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 / 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 / birthdays_by_index.json
Created March 14, 2016 15:04
Where the last 150 years of birthdays occur in Pi
This file has been truncated, but you can view the full file.
{
"9982546": [
"1960-11-23"
],
"9695244": [
"1944-11-23"
],
"7812514": [
"2013-10-29",
"1913-10-29"
#!/bin/bash
#
# Copyright (c) 2014, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@brandt
brandt / CHANGELOG.txt
Last active February 24, 2016 18:43
Changes in RHEL/CentOS from glibc-2.12-1.132 glibc-2.12-1.149
* Tue Aug 26 2014 Siddhesh Poyarekar <siddhesh@redhat.com> - 2.12-1.149
- Remove gconv transliteration loadable modules support (CVE-2014-5119,
#1133810).
- _nl_find_locale: Improve handling of crafted locale names (CVE-2014-0475,
#1133810).
* Wed Jul 30 2014 Siddhesh Poyarekar <siddhesh@redhat.com> - 2.12-1.148
- Switch gettimeofday from INTUSE to libc_hidden_proto (#1099025).
* Fri Jun 20 2014 Siddhesh Poyarekar <siddhesh@redhat.com> - 2.12-1.147
@brandt
brandt / CHANGELOG.txt
Last active February 23, 2016 19:26
Changes in RHEL/CentOS from glibc-2.12-1.149 glibc-2.12-1.166
glibc-2.12-1.166.el6_7.7.i686 updates
* Thu Jan 28 12:00:00 2016 Carlos O'Donell <carlos@redhat.com> - 2.12-1.166.7
- Update fix for CVE-2015-7547 (#1296028).
* Mon Jan 25 12:00:00 2016 Carlos O'Donell <carlos@redhat.com> - 2.12-1.166.6
- Create helper threads with enough stack for POSIX AIO and timers (#1301625).
* Thu Jan 14 12:00:00 2016 Carlos O'Donell <carlos@redhat.com> - 2.12-1.166.5
- Fix CVE-2015-7547: getaddrinfo() stack-based buffer overflow (#1296028).