Skip to content

Instantly share code, notes, and snippets.

Darsey Litzenberger dlitz

Block or report user

Report or block dlitz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dlitz
dlitz / hello.sh
Created Nov 3, 2018
simple hello-world script
View hello.sh
#!/bin/sh
echo "Hello world!"
View gist:fa06580b8622f10707b0
# creates a signed cert using openssl. depends on Debian's default openssl.cnf.
def _ssl_ca_signed_certificate(self, private_key, subject,
ca_key, ca_cert):
# Generate a CSR
csr = self._ssl_self_signed_cert(
private_key, subject=subject, req=True)
# Make some FIFOs, where one end is inherited across execve()
r, w = os.pipe()
fcntl.fcntl(r, F_SETFD, fcntl.fcntl(r, F_GETFD) & ~FD_CLOEXEC)
View keybase.md

Keybase proof

I hereby claim:

  • I am dlitz on github.
  • I am dlitz (https://keybase.io/dlitz) on keybase.
  • I have a public key whose fingerprint is 19E1 1FE8 B3CF F273 ED17 4A24 928C EC13 39C2 5CF7

To claim this, I am signing this object:

@dlitz
dlitz / fix-python-2.2-plat-linux3.patch
Created Feb 22, 2014
Fix Python < 2.7 looking for 'plat-linux3' instead of 'plat-linux2'
View fix-python-2.2-plat-linux3.patch
sys.platform should return "linux2" even if the system was compiled on Linux 3.x or later.
diff -ru Python-2.2.3.orig/configure Python-2.2.3/configure
--- Python-2.2.3.orig/configure 2003-03-29 14:25:14.000000000 -0800
+++ Python-2.2.3/configure 2014-02-22 14:37:36.540457776 -0800
@@ -641,6 +641,8 @@
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
+ linux1) MACHDEP="linux1";;
@dlitz
dlitz / patch-vmware-workstation-9.02_linux-3.12.sh
Created Jan 21, 2014
VMware Workstation kernel module patches VMware Workstation 9.0.2 & Linux kernel 3.12
View patch-vmware-workstation-9.02_linux-3.12.sh
#!/bin/sh
# Inspired by the vmware-any-any-update series of patches
set -e
ws_ver=`vmware-installer -l | grep vmware-workstation | awk '{ print $2 }' | cut -d. -f1-3`
if [ -z "$ws_ver" ] ; then
echo >&2 "$0: error: VMware Workstation not installed?"
exit 1
fi
View gist:6982406
diff --git a/lib/travis/github/services/fetch_config.rb b/lib/travis/github/services/fetch_config.rb
index 6d61dd7..542cd0a 100644
--- a/lib/travis/github/services/fetch_config.rb
+++ b/lib/travis/github/services/fetch_config.rb
@@ -11,7 +11,8 @@ module Travis
register :github_fetch_config
def run
- config = retrying(3) { parse(fetch) }
+ config = retrying(3) { parse(fetch(config_url)) }
@dlitz
dlitz / rails_bug_1210_schemadumper_monkeypatch.rake
Created Dec 20, 2011
Workaround for ActiveRecord bug that breaks table_name_prefix
View rails_bug_1210_schemadumper_monkeypatch.rake
# Extracted from Rails 2.3.10's active_record/schema_dumper.rb, with our patch applied.
# Put this into rakelib/rails_bug_1210_schemadumper_monkeypatch.rake in your Rails project
# see https://rails.lighthouseapp.com/projects/8994/tickets/1210-table_name_prefix-with-dbschemaload-causes-double-prefixes#ticket-1210-9
#--
# Copyright (c) 2004-2010 David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
@dlitz
dlitz / gist:1314989
Created Oct 26, 2011
this is the test that happens for if, unless, etc.
View gist:1314989
RTEST(value) returns true if the value is implicitly true
./ruby.h:
#define RTEST(v) (((VALUE)(v) & ~Qnil) != 0)
...
#define Qfalse ((VALUE)0)
#define Qtrue ((VALUE)2)
#define Qnil ((VALUE)4)
@dlitz
dlitz / rz.rb
Created Dec 10, 2010
using RubyZip to write a file without writing any intermediate files.
View rz.rb
require 'rubygems'
require 'zip/zip'
require 'base64'
red_dot_png_data = Base64.decode64 %{
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP
C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA
AAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1J
REFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jq
ch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0
@dlitz
dlitz / gist:715904
Created Nov 25, 2010
[MAC-ADDRESS]-custom.cfg
View gist:715904
<?xml version="1.0" standalone="yes"?>
<localcfg>
<phone1>
<device>
<device device.set="1" device.sec.SSL.certList.set="1" device.sec.SSL.certList="all" device.sec.SSL.customCert.set="1" device.sec.SSL.customCert="MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgY
You can’t perform that action at this time.