Skip to content

Instantly share code, notes, and snippets.

View leepa's full-sized avatar

Lee Packham leepa

View GitHub Profile
@leepa
leepa / jessie.rb
Created April 30, 2015 15:11
Jessie 'Service' Provider for Puppet - it will work around https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=705254 to ensure services don't keep getting enabled.
Puppet::Type.type(:service).provide :jessie, :parent => :systemd do
desc "Manages `systemd` services using `systemctl` on jessie."
defaultfor :osfamily => :debian, :operatingsystem => :debian, :operatingsystemmajrelease => "8"
def get_start_link_count
Dir.glob("/etc/rc*.d/S??#{@resource[:name]}").length
end
def enabled?
proxy_pass http://REGISTRY_PORT_5000_TCP_ADDR:REGISTRY_PORT_5000_TCP_PORT;
proxy_set_header Host $http_host; # required for docker client's sake
proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
proxy_set_header Authorization "";
proxy_read_timeout 900;
@leepa
leepa / runtime-gdb.py
Created March 30, 2015 16:12
Supports pointers to strings as well as normal strings in Go
# Copyright 2010 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""GDB Pretty printers and convenience functions for Go's runtime structures.
This script is loaded by GDB when it finds a .debug_gdb_scripts
section in the compiled binary. The [68]l linkers emit this with a
path to this file based on the path to the runtime package.
"""

Keybase proof

I hereby claim:

  • I am leepa on github.
  • I am leepa (https://keybase.io/leepa) on keybase.
  • I have a public key whose fingerprint is 3520 6F84 C7DC 9A78 C42A 797B 3DBF A2EE 6695 0D40

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am leepa on github.
  • I am leepa (https://keybase.io/leepa) on keybase.
  • I have a public key whose fingerprint is 453D F3DA 55C4 9897 310D 60F2 B931 14D3 5EC0 BA6E

To claim this, I am signing this object:

@leepa
leepa / gist:090e1611181eb232b544
Created August 19, 2014 13:49
Highlighting bad whitespace
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
@leepa
leepa / gist:accb6068b22312eb0ef8
Created April 29, 2014 20:28
Google Sense of Humor
➜ ~ dig +short TXT google-public-dns-a.google.com
"http://xkcd.com/1361/"
➜ ~ dig TXT google-public-dns-a.google.com
; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> TXT google-public-dns-a.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11456
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
@leepa
leepa / CVE-2014-1912.patch
Created March 4, 2014 17:50
CVE-2014-1912
# HG changeset patch
# User Benjamin Peterson <benjamin@python.org>
# Date 1389671978 18000
# Node ID 87673659d8f7ba1623cd4914f09ad3d2ade034e9
# Parent 2631d33ee7fbd5f0288931ef37872218d511d2e8
complain when nbytes > buflen to fix possible buffer overflow (closes #20246)
# HG changeset patch
# User Stefan Krah <skrah@bytereef.org>
# Date 1390341952 -3600
[leepa@joolzbsd ~]$ pkg info python27
python27-2.7.6_4
Name : python27
Version : 2.7.6_4
Installed on : Mon Mar 3 20:39:53 UTC 2014
Origin : lang/python27
Architecture : freebsd:10:x86:64
Prefix : /usr/local
Categories : python lang ipv6
Licenses : PSFL
[leepa@joolzbsd ~]$ pkg info python27
python27-2.7.6_4
Name : python27
Version : 2.7.6_4
Installed on : Mon Mar 3 20:39:53 UTC 2014
Origin : lang/python27
Architecture : freebsd:10:x86:64
Prefix : /usr/local
Categories : python lang ipv6
Licenses : PSFL