Skip to content

Instantly share code, notes, and snippets.

View autumnjolitz's full-sized avatar

Autumn Jolitz autumnjolitz

View GitHub Profile
@autumnjolitz
autumnjolitz / citrusleaf_2.1.11_osx.patch
Created August 20, 2013 20:31
A patch to make Aerospike 2.1.11 client for Python and Perl compile and be usable on MacOSX Lion. Wrote the missing kqueue handling code.
diff -Naur citrusleaf_client_swig_2.1.11/include/citrusleaf/cf_byte_order.h citrusleaf_client_swig_2.1.11-macosx/include/citrusleaf/cf_byte_order.h
--- citrusleaf_client_swig_2.1.11/include/citrusleaf/cf_byte_order.h 2013-03-27 10:12:05.000000000 -0700
+++ citrusleaf_client_swig_2.1.11-macosx/include/citrusleaf/cf_byte_order.h 2013-07-11 17:17:40.000000000 -0700
@@ -12,8 +12,7 @@
#include <libkern/OSByteOrder.h>
-#define cf_byteswap64p(_p) (OSSwapBigToHostInt64(*(_p)))
-
+#define cf_byteswap64p(_p) (OSSwapBigToHostInt64( *(uint64_t *) _p ))
#!/usr/bin/env python
import collections
import subprocess
import shlex
import re
import pprint
import optparse
ips = set(optparse.OptionParser().parse_args()[1])
16c16
< (==) Log file: "/var/log/Xorg.0.log", Time: Sun May 18 14:27:26 2014
---
> (==) Log file: "/var/log/Xorg.0.log", Time: Sun May 18 14:27:32 2014
44c44
< (II) Loader magic: 0x7fadbff2dd20
---
> (II) Loader magic: 0x7f2b31971d20
368,385c368
< (II) evdev: Acer WMI hotkeys: Close
X.Org X Server 1.14.5
Release Date: 2013-12-12
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-37-generic x86_64 Ubuntu
Current Operating System: Linux Terranova 3.11.0-19-generic #33-Ubuntu SMP Tue Mar 11 18:48:34 UTC 2014 x86_64
Kernel command line: BOOT_IMAGE=/@/boot/vmlinuz-3.11.0-19-generic root=UUID=dfc56055-5855-44e7-a18d-03921098b480 ro rootflags=subvol=@ acpi_osi=Linux quiet splash i915.i915_enable_rc6=0
Build Date: 17 December 2013 10:06:15AM
xorg-server 2:1.14.5-1ubuntu2~saucy1 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.30.2
X.Org X Server 1.14.5
Release Date: 2013-12-12
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-37-generic x86_64 Ubuntu
Current Operating System: Linux Terranova 3.11.0-19-generic #33-Ubuntu SMP Tue Mar 11 18:48:34 UTC 2014 x86_64
Kernel command line: BOOT_IMAGE=/@/boot/vmlinuz-3.11.0-19-generic root=UUID=dfc56055-5855-44e7-a18d-03921098b480 ro rootflags=subvol=@ acpi_osi=Linux quiet splash i915.i915_enable_rc6=0
Build Date: 17 December 2013 10:06:15AM
xorg-server 2:1.14.5-1ubuntu2~saucy1 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.30.2
from collections import defaultdict
class ObjectPool(object):
DEFAULT_CAPACITY = 1000
IDENTITY = lambda x: x
def __init__(self, max_capacity=DEFAULT_CAPACITY):
self.pool = defaultdict(lambda: [])
self.max_capacity = max_capacity
@autumnjolitz
autumnjolitz / citrusleaf_client_libevent2_2.1.20-osx.patch
Last active August 29, 2015 14:02
This allows the Aerospike 2 Libevent 2 Client driver to build of OSX. See comments for how to apply.
diff -Naur citrusleaf_client_libevent2_2.1.20-original/example/Makefile citrusleaf_client_libevent2_2.1.20/example/Makefile
--- citrusleaf_client_libevent2_2.1.20-original/example/Makefile 2013-08-05 17:34:00.000000000 -0700
+++ citrusleaf_client_libevent2_2.1.20/example/Makefile 2014-06-05 12:38:52.000000000 -0700
@@ -23,7 +23,11 @@
LDFLAGS = $(CFLAGS_NATIVE) -L$(DIR_LIB) -L$(DIR_CF_LIB)
#LIBRARIES = -lev2citrusleaf -levent -levent_openssl -lssl -lpthread -lrt
#LIBRARIES = -lev2citrusleaf /usr/local/lib/libevent-2.0.so.5.1.3 -lssl -lpthread -lrt
-LIBRARIES = -lev2citrusleaf -levent -lssl -lcrypto -lpthread -lrt
+SYSTEM = $(shell uname -s)
+LIBRARIES = -lev2citrusleaf -levent -lssl -lcrypto -lpthread
@autumnjolitz
autumnjolitz / fix-tal-engine.patch
Last active August 29, 2015 14:11
Zope2.11+ has a problem as the TALInterpreter expects an ITALExpressionCompiler but instead got passed the ZopeContext (which has such INSIDE IT as _engine)
diff --git a/lib/python/zope/tal/talgenerator.py b/lib/python/zope/tal/talgenerator.py
index cf2c440..9dc37e8 100644
--- a/lib/python/zope/tal/talgenerator.py
+++ b/lib/python/zope/tal/talgenerator.py
@@ -23,12 +23,13 @@ from zope.tal.taldefs import NAME_RE, TAL_VERSION
from zope.tal.taldefs import I18NError, METALError, TALError
from zope.tal.taldefs import parseSubstitution
from zope.tal.translationcontext import TranslationContext, DEFAULT_DOMAIN
+from zope.tal.interfaces import ITALExpressionCompiler
@autumnjolitz
autumnjolitz / Makefile_patches
Last active August 29, 2015 14:13
Aerospike 2 Linux Patch
diff -Naur citrusleaf_client_libevent2_2.1.37-orig/aero_libevent2_v.spec citrusleaf_client_libevent2_2.1.37/aero_libevent2_v.spec
--- citrusleaf_client_libevent2_2.1.37-orig/aero_libevent2_v.spec 1970-01-01 00:00:00.000000000 +0000
+++ citrusleaf_client_libevent2_2.1.37/aero_libevent2_v.spec 2014-07-22 23:24:08.785676010 +0000
@@ -0,0 +1,30 @@
+Name: Aerospike
+Version: 2.1.37
+Release: 1
+Summary: The Aerospike Libevent2 SDK
+License: Proprietary
+Group: Application
diff -Naur liblfds6.1.1/liblfds611/inc/liblfds611.h liblfds6.1.1-patched/liblfds611/inc/liblfds611.h
--- liblfds6.1.1/liblfds611/inc/liblfds611.h 2013-01-02 06:21:45.000000000 -0800
+++ liblfds6.1.1-patched/liblfds611/inc/liblfds611.h 2015-08-04 18:03:20.000000000 -0700
@@ -93,7 +93,8 @@
#define _InterlockedCompareExchangePointer(destination, exchange, compare) _InterlockedCompareExchange((volatile long *) destination, (long) exchange, (long) compare)
#endif
- #if (defined __unix__ && defined __x86_64__ && __GNUC__)
+ #if ( ( defined(__unix__) || defined(__unix) || \
+ (defined(__APPLE__) && defined(__MACH__))) && defined __x86_64__ && __GNUC__)