Skip to content

Instantly share code, notes, and snippets.

Lee Packham leepa

Block or report user

Report or block leepa

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
leepa / jessie.rb
Created Apr 30, 2015
Jessie 'Service' Provider for Puppet - it will work around to ensure services don't keep getting enabled.
View jessie.rb
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
def enabled?
View gist:69ff1b6371d2f0ee51ab
# This shell script passes all its arguments to the binary inside the
# application bundle. If you make links to this script as view,
# gvim, etc., then it will peek at the name used to call it and set options
# appropriately.
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico
# Weber and Bjorn Winckler, Aug 13 2007).
View gist:30697
#!/usr/bin/env ruby
curl > gist &&
chmod 755 gist &&
sudo mv gist /usr/local/bin/gist
View gist:32293
def truncate_description(length, end_string = ' ...')
words = description.split()
words = words[0..(length-1)].join(' ') + (words.length > length ? end_string : '')
View gist:125807
[14:10:15] <Tikcus> Five surgeons from big cities are discussing who makes the best patients to operate on...
[14:10:17] <Tikcus> The first surgeon, from Bristol , says, "I like to see accountants on my operating table, because when you open them up, everything inside is numbered."
[14:10:19] <Tikcus> The second, from Manchester , responds, "Yeah, but you should try electricians! Everything inside them is colour coded."
[14:10:21] <Tikcus> The third surgeon, from Edinburgh , says, "No, I really think librarians are the best, everything inside them is in alphabetical order."
[14:10:23] <Tikcus> The fourth surgeon, from Birmingham chimes in: "You know, I like construction workers...those blokes always understand when you have a few parts left over."
[14:10:25] <Tikcus> But the fifth surgeon, from London shut them all up when he observed: "You're all wrong, Politicians are the easiest to operate on"...............................
[14:10:27] <Tikcus> .................................."There's no guts, no heart, n
View gist:137341
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(git::\1)/'
parse_svn_branch() {
parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | awk -F / '{print "(svn::"$1 "/" $2 ")"}'
parse_svn_url() {
svn info 2>/dev/null | grep -e '^URL*' | sed -e 's#^URL: *\(.*\)#\1#g '
parse_svn_repository_root() {
View gist:145257
import struct
from socket import socket
import ssl
import binascii
payload = '{"aps":{"alert":"Hello World","sound":"chime"}}'
fmt = "!cH32sH%ds" % len(payload)
command = '\x00'
token = '<<removed>>'
View gist:150195
#!/bin/sh -
"exec" "python" "-O" "$0" "$@"
__doc__ = """Tiny HTTP Proxy.
This module implements GET, HEAD, POST, PUT and DELETE methods
on BaseHTTPServer, and behaves as an HTTP proxy. The CONNECT
method is also implemented experimentally, but has not been
tested yet.
View gist:157010
VIDEO_FPS=`mkvinfo $1 | grep -A 10 'Codec ID: V_MPEG4' | grep -w fps | awk '{print $6}' | cut -d'(' -f2`
mkvinfo $INPUT | grep -qE 'Codec ID.*DTS'
if [ $? -eq 0 ]; then
You can’t perform that action at this time.