Skip to content

Instantly share code, notes, and snippets.

View edwardgeorge's full-sized avatar
🍉

Edward George edwardgeorge

🍉
  • Manchester, UK
  • 18:22 (UTC)
View GitHub Profile
@edwardgeorge
edwardgeorge / automasq.py
Created January 6, 2010 18:33
save dhcp provided dns servers to resolv.conf compatible file (OSX)
#!/usr/bin/env python
"""OSX-based script to watch for changes to network state and write out a
second resolv.conf file containing the DHCP provided nameservers, intended
for use with a local resolver such as dnsmasq. This is to workaround the
changes in Snow Leopard from Leopard with regards to DNS resolution.
ie: the inability to have both manually configured nameservers and
DHCP provided ones as well as the issues with split-DNS.
usage: python automasq.py /path/to/second/resolv.conf
@edwardgeorge
edwardgeorge / followerdiff.py
Created January 6, 2010 21:34
show changes in twitter followers
#!/usr/bin/env python
"""Script to inform you of changes to your twitter followers.
ie: who just unfollowed you.
"""
from __future__ import with_statement
import bsddb
import contextlib
import functools
import pickle
@edwardgeorge
edwardgeorge / unusedselectors.py
Created January 7, 2010 11:21
identify unused css selectors in a page, proof of concept
#!/usr/bin/env python
"""identify unused css selectors."""
from functools import partial
import re
import sys
import urlparse
import cssutils
from lxml import cssselect
from lxml import html
@edwardgeorge
edwardgeorge / syncgiststohg.py
Created January 8, 2010 21:53
sync gists to local hg repos
#!/usr/bin/env python
import os
import subprocess
import sys
import urlparse
from lxml import html
BASE_URL = 'http://gist.github.com/%s'
@edwardgeorge
edwardgeorge / pbclient.py
Created February 4, 2010 18:05
os-x pastebin server and client. intended for sending text from a vm to the host computer's clipboard.
#!/usr/bin/env python
from __future__ import with_statement
import ConfigParser
import fileinput
import os
import socket
import sys
def get_config():
configfile = os.path.expanduser('~/.pbclient')
@edwardgeorge
edwardgeorge / libdlna.patch
Created April 5, 2010 15:02
mac homebrew patches
diff -r d0965fd3703b configure
--- a/configure Mon Apr 05 15:52:33 2010 +0100
+++ b/configure Mon Apr 05 16:14:48 2010 +0100
@@ -610,9 +610,9 @@
fi
echolog "Checking for libavformat ..."
-check_lib ffmpeg/avformat.h av_register_all -lavformat || die "Error, can't find libavformat !"
+check_lib libavformat/avformat.h av_register_all -lavformat || die "Error, can't find libavformat !"
echolog "Checking for libavcodec ..."
@edwardgeorge
edwardgeorge / gist:396622
Created May 10, 2010 22:18
BREAKING the missing mercurial patch
--- mercurial/ui.py 2010-05-10 23:10:13.944672249 +0100
+++ mercurial/ui.py 2010-05-10 23:11:19.804626239 +0100
@@ -336,6 +336,11 @@
except EOFError:
raise util.Abort(_('response expected'))
def status(self, *msg):
+ try:
+ msg = list(msg)
+ msg[0] = 'BREAKING %s' % msg[0]
+ except IndexError, e:
@edwardgeorge
edwardgeorge / cciphonethings_device.py
Created July 18, 2010 23:08
research into fake devices for syncing cultured code's Things task management application with other apps.
import gzip
import logging
import plistlib
import rfc822
import StringIO
class config:
DEVICE_NAME = "Fake iPod"
DEVICE_MODEL = "iPod touch"
CLIENT_API_VER = "1520"
@edwardgeorge
edwardgeorge / gist:544112
Created August 22, 2010 18:34
fix for macfuse installation on snow leopard if you're encountering Input/Output errors.
--- /usr/local/lib/pkgconfig/fuse.pc
+++ /usr/local/lib/pkgconfig/fuse.pc
@@ -6,5 +6,5 @@
Name: fuse
Description: File System in User Space (MacFUSE)
Version: 2.7.3
-Libs: -L${libdir} -lfuse -pthread -liconv
+Libs: -L${libdir} -lfuse_ino64 -pthread -liconv
Cflags: -I${includedir}/fuse -D__FreeBSD__=10 -D_FILE_OFFSET_BITS=64
@edwardgeorge
edwardgeorge / jack.rb
Created November 8, 2010 12:59
Homebrew formula to install JackOSX binary package.
require 'formula'
class Jack <Formula
homepage 'http://jackaudio.org'
version '0.87'
if MACOS_VERSION < 10.6
url 'http://downloads.sourceforge.net/project/jackosx/JackOSX/0.87/JackOSX.0.87_32bits.zip'
md5 '431b35cab4b3928e66e8accb2a1dee80'
else
url 'http://downloads.sourceforge.net/project/jackosx/JackOSX/0.87/JackOSX.0.87_64-32bits.zip'