Skip to content

Instantly share code, notes, and snippets.

View djmitche's full-sized avatar

Dustin J. Mitchell djmitche

View GitHub Profile
@djmitche
djmitche / gist:08c41b8b16ca3b969df4
Created November 4, 2014 19:07
ttyrec-1.0.8.RHEL5.patch
diff -rupN original/Makefile new/Makefile
--- original/Makefile 2006-06-11 10:52:50.000000000 -0500
+++ new/Makefile 2012-04-23 18:34:05.000000000 -0500
@@ -1,5 +1,5 @@
CC = gcc
-CFLAGS = -O2
+CFLAGS = -O2 -DHAVE_openpty
VERSION = 1.0.8
TARGET = ttyrec ttyplay ttytime
@djmitche
djmitche / dir-layout.txt
Last active August 29, 2015 14:02
Upgrade to directory environments..
/etc/puppet/production - prod checkout
/etc/puppet/environments/$username - user checkout
@djmitche
djmitche / The Question
Created May 20, 2014 16:24
git-remote-hg fails, fails, fails
Why is it that the only ref I can push to is this ref named after the remote?
@djmitche
djmitche / notes.md
Last active January 2, 2016 20:19
Notes on rabbitmq-java-client's heartbeat beahavior

The heartbeat timeout is calculated as the minimum nonzero value (using the badly-named negotiatedMaxValue) of the heartbeat field in the the server's and client's tune frames.

Heartbeats are sent by a heartbeat sender. The heartbeat sender's activity timeout is reset on every write. The sender sends a heartbeat packet after no activity for more longer than the negotiated timeout value. It checks for activity at twice the negotiated rate, so at most it will send a heartbeat packet 1.5x the timeout value after the last activity.

While reading, any data from the server resets _missedHeartbeats to 0. The socket timeout is set to one quarter of the heartbeat timeout, and when this timeout expires, handleSocketTimeout will raise an exception and sever the connection if 8 consecutive timeouts have occurred, meaning two times the negotiated timeout value.

#! /bin/bash
## NOTE:
## This script requires the follwing in /etc/hosts:
## 127.0.0.2 puppet master1.example.org
# This will fail with a stock puppet 3.1.1, but will succeed if all of the
# certificate subjects contain only the "CN" portion, and no O, OU, or
# emailAddress.
@djmitche
djmitche / class.py
Created September 21, 2012 15:13 — forked from tomprince/class.py
class MyRenderable(object):
def getRenderingFor(self, props):
return someStuff
properties.render(MyRenderable())
@djmitche
djmitche / test.md
Created September 19, 2012 23:21
markdown playground

What? This doesn't look like a README!

Right, this is the TODO list for Buildbot-0.9.0. We'll delete this once it's empty. Pitch in!

Infrastructure

  • Parsing of endpoint options is currently left to the endpoint, which will lead to inconsistencies. Add and document some helper methods to base.Endpoint for parsing e.g., boolean options (supporting on/off, 0/1, true/false, etc.)
  • Optimize the type verification system by dynamically creating verifier functions once.
objc[7643]: Class WebCoreMovieObserver is implemented in both /opt/local/lib/libQtWebKit.4.dylib and /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore. One of the two will be used. Which one is undefined.
objc[7643]: Class WebCoreSharedBufferData is implemented in both /opt/local/lib/libQtWebKit.4.dylib and /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore. One of the two will be used. Which one is undefined.
objc[7643]: Class WebVideoFullscreenWindow is implemented in both /opt/local/lib/libQtWebKit.4.dylib and /System/Library/Frameworks/WebKit.framework/Versions/A/WebKit. One of the two will be used. Which one is undefined.
objc[7643]: Class WebVideoFullscreenController is implemented in both /opt/local/lib/libQtWebKit.4.dylib and /System/Library/Frameworks/WebKit.framework/Versions/A/WebKit. One of the two will be used. Which one is undefined.
objc[7643]: Class WebVideoFullscreenHUDWindowController is
@djmitche
djmitche / gist:3189746
Created July 27, 2012 18:48 — forked from glarizza/gist:3185860
User Declaration for OS X 10.7 and 10.8
$password_data = $macosx_productversion_major ? {
'10.7' => { password => 'aaa6c1f945132d2599079fe90c9d20e608e607344b86328c1ef8ad8dc820c1bb5a31fd816b8ae546fed6dcf58ff023794f8250a66935d6d0687b737f24aae2ed' },
'10.8' => {
password => '0590ade19e6953c135ae872ae77618235df7d46c63de7f9a0fcdf2cd9e7d85e4b7ca868101235b6158e05a309805ee4814b027a4be9c23ec2926bc8172269affba5c9a5985e81091fa6898076d297f1faa75fa617551ef1671d7520055c4a0d97b9b9c5805aa322baedbcd8ee9c523811653ac2ea9e9c8d8f1ac519a0f2b595e',
salt => 'somesalthere',
iterations => '12390',
}
}
user { 'test':
@djmitche
djmitche / README.rst
Created May 26, 2012 22:51
A git extension to merge a pull request given just its pull req number

This is a quick script to allow you to merge a pull request for a project with something as simple as

git ghpull 124

(where 124 is the pull request number)

Installation

To install, just make git-ghpull executable and put it somewhere on your path.