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 / gtk+-2.24.10_nodocs.patch
Created July 5, 2012 04:35
gtk+-2.24.10: patch: remove doc compilation to avoid gtk-doc prereq
diff --git Makefile.am Makefile.am
index 8e3a2f1..fe3901b 100644
--- Makefile.am
+++ Makefile.am
@@ -2,7 +2,7 @@
include $(top_srcdir)/Makefile.decl
SRC_SUBDIRS = gdk gtk modules demos tests perf
-SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
+SUBDIRS = po po-properties $(SRC_SUBDIRS) m4macros build
@brandt
brandt / patch-deprecated-macro_configure.in.diff
Last active December 10, 2015 19:18
Fixes deprecated m4 macro issue that was preventing libnet from being compiled with newer versions of automake.
--- configure.in.orig 2013-01-07 16:33:30.000000000 -0800
+++ configure.in 2013-01-07 16:33:59.000000000 -0800
@@ -8,9 +8,9 @@
AC_MSG_RESULT(beginning autoconfiguration process for libnet-${PACKAGE_VERSION} ...)
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([src/libnet_build_ip.c])
+AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
-AM_CONFIG_HEADER([include/config.h])
@brandt
brandt / rpmrebuild.mac-compat.patch
Last active December 19, 2015 01:08
Use portable arguments so that `rpmrebuild` can build on systems that don't have GNU Coreutils installed.
diff --git c/src/Makefile.include w/src/Makefile.include
index b6384ff..b75516c 100644
--- c/src/Makefile.include
+++ w/src/Makefile.include
@@ -1,11 +1,11 @@
-INSTALL_RUN := install --mode=555
-INSTALL_RO := install --mode=444
-INSTALL_MAN := install --mode=644
-INSTALL_LOCALE := install --mode=644
-LN := ln --symbolic --force --no-dereference
@brandt
brandt / fix-dup-case-value.patch
Created September 13, 2013 08:38
Patch to fix conflicting uses of the '-t' option
diff --git c/src/main.cc w/src/main.cc
index ee16e7b..d60ce98 100644
--- c/src/main.cc
+++ w/src/main.cc
@@ -42,21 +42,23 @@ bool ShotApp::OnInit () {
void show_help (char **argv) {
printf ("\nShotdetect version \"%s\", Copyright (c) 2007-2013 Johan Mathe\n\n"
"Usage: %s \n"
- "-h : show this help\n"
- "-n : commandline mode (disable GUI)\n"
@brandt
brandt / patch-mac-bundle-dest.patch
Created September 13, 2013 08:39
Patch to fix issue preventing Shotdetect from building on Mac OS X
diff --git c/CMakeLists.txt w/CMakeLists.txt
index f13542a..95759ef 100644
--- c/CMakeLists.txt
+++ w/CMakeLists.txt
@@ -208,6 +208,7 @@ ENDIF()
# Taken from official documentation (http://www.cmake.org/cmake/help/cmake2.6docs.html#command:install)
install(
TARGETS ${TARGETS_TO_INSTALL}
+ BUNDLE DESTINATION .
RUNTIME DESTINATION bin
@brandt
brandt / com.runlevel1.homebrew.update.plist
Created January 10, 2014 16:24
Homebrew automatic formula updater daemon. Install to: ~/Library/LaunchAgents/com.runlevel1.homebrew.update.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.runlevel1.homebrew.update</string>
<key>EnvironmentVariables</key>
<dict>
<key>TERM</key>
<string>ansi</string>
@brandt
brandt / symlinks-test.sh
Last active August 29, 2015 13:59
Symlinks Big File Handling Test
@brandt
brandt / keybase.md
Last active August 29, 2015 14:07
keybase.md

Keybase proof

I hereby claim:

  • I am brandt on github.
  • I am brandt (https://keybase.io/brandt) on keybase.
  • I have a public key whose fingerprint is 2BB3 3104 E95E 7F40 201C ED32 D983 4D42 37F9 8C50

To claim this, I am signing this object:

@brandt
brandt / grant-drac-web-privileges.rb
Created November 18, 2014 17:33
Grant a user created with IPMI privileges to login to the Dell DRAC web management interface.
#!/usr/bin/env ruby
# Description:
#
# Quick hack to grant a user the privileges necessary to login to the Dell DRAC web management interface.
#
# This is a workaround for a bug where a user created in IPMI can't login to the Dell DRAC web management portal.
# The user would be denied with error: Login failed. User does not have 'Login to Dell BMC' privilege.
#
# We assume that the default user and password are still enabled (root:root).
@brandt
brandt / bloom-filter-calculator.rb
Created February 17, 2015 17:19
Calculate the required bloom filter size and optimal number of hashes from the expected number of items in the collection and acceptable false-positive rate
# Optimal bloom filter size and number of hashes
# Tips:
# 1. One byte per item in the input set gives about a 2% false positive rate.
# 2. The optimal number of hash functions is ~0.7x the number of bits per item.
# 3. The number of hashes dominates performance.
# Expected number of items in the collection
# n = (m * ln(2))/k;
n = 300_000