Skip to content

Instantly share code, notes, and snippets.

View danudey's full-sized avatar
🐪

Daniel Fox danudey

🐪
View GitHub Profile
@danudey
danudey / 12lines.py
Last active August 29, 2015 14:11
Twelve lines of Christmas
#!/usr/bin/env python
gifts = ("partridge in a pear tree", "turtle doves", "french hens",
"calling birds", "golden rings", "geese-a-laying", "swans-a-swimming",
"maids-a-milking", "ladies dancing", "lords-a-leaping", "pipers piping",
"drummers drumming",)
for i in xrange(1,len(gifts)+1):
print "On the {} day of Christmas, my true love gave to me:".format(
str(i)+("th" if 4<=i%100<=20 else {1:"st",2:"nd",3:"rd"}.get(i%10, "th")))
for j, gift in list(enumerate(gifts[:i],1))[::-1]:
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://new.server.com/
ProxyPassReverse / http://new.server.com/
ProxyPreserveHost On
1 <Proxy *>
2 Order deny,allow
3 Allow from all
4 </Proxy>
5
6 ProxyPass / http://fantasy2.livecurrent.com/
7 ProxyPassReverse / http://fantasy2.livecurrent.com/
8 ProxyPreserveHost On
# $Id: Portfile 52077 2009-06-09 19:30:08Z blb@macports.org $
PortSystem 1.0
name libmemcached
version 0.30
description libmemcached is a C and C++ client library to the memcached server
long_description libmemcached is a C and C++ client library for memcached. \
It has been designed to be light on memory usage, thread safe, \
and provide full access to server side methods.
09-06-11 2:25:33 PM Nambu[26269] Failed to call designated initializer on NSManagedObject class 'NBDataManager'
09-06-11 2:25:33 PM GrowlHelperApp[244] Auto-discovered registration ticket in Nambu (located at /Applications/Nambu.app)
09-06-11 2:25:33 PM Nambu[26269] change: <NBTwitterMessageListViewController: 0x455e20>
09-06-11 2:25:33 PM Nambu[26269] NSExceptionHandler has recorded the following exception:
NSInvalidArgumentException -- Unlocking Focus on wrong view (<NSClipView: 0x362bd0>), expected <NBTCView: 0x364860>
Stack trace: 0x93368d24 0x988d90fd 0x95e83478 0x95ecf43a 0x91605414 0x91609b6c 0x916cbca1 0x916cb06a 0x91723429 0x91661b97 0x9166177f 0x91661624 0x915ad017 0x915b895a 0x915b8605 0x6b877 0x6b5d7 0x6a3f1 0x91601d22 0x916020ba 0x916020ba 0x916020ba 0x916020ba 0x916020ba 0x916020ba 0x91704bc3 0x91be19a0 0x91be6685 0x915ff1b3 0x915ff631 0x915ff631 0x915ff631 0x915ff631 0x915ff631 0x915fd78b 0x916f59b4 0x915f9936 0x915f70bf 0x9161a895 0x91cc83be 0x935be316
@danudey
danudey / gist:136801
Created June 26, 2009 22:47
Fantasy Balancer Config
<Proxy balancer://fantasyappcluster>
BalancerMember http://fantasyweb1int retry=2
BalancerMember http://fantasyweb2int retry=2
BalancerMember http://fantasyweb3int retry=2
BalancerMember http://fantasyweb5int retry=2
BalancerMember http://fantasyweb6int retry=2
BalancerMember http://fantasyweb7int retry=2
</Proxy>
@danudey
danudey / gist:151046
Created July 21, 2009 01:37
Crasher on Snow Leopard
#!/usr/bin/env python
from SOAPpy import WSDL
WSDLFILE = 'http://www.xmethods.net/sd/2001/TemperatureService.wsdl'
class wsdl(object):
def __init__(self,apikey):
self._server = WSDL.Proxy(WSDLFILE)
f = wsdl("blah blah blah")
>>> start = time.gmtime(time.time()-(3600*24*10))
>>> end = time.gmtime()
>>> downtimes = p.downtimesFor(p.checks[0],start,end)
>>> for downtime in downtimes:
... print downtime
...
{'duration': 0, 'to': (2009, 7, 28, 19, 0, 0.0), 'from': (2009, 7, 27, 19, 0, 0.0)}
{'duration': 0, 'to': (2009, 7, 29, 19, 0, 0.0), 'from': (2009, 7, 28, 19, 0, 0.0)}
{'duration': 0, 'to': (2009, 7, 30, 19, 0, 0.0), 'from': (2009, 7, 29, 19, 0, 0.0)}
{'duration': 0, 'to': (2009, 7, 31, 19, 0, 0.0), 'from': (2009, 7, 30, 19, 0, 0.0)}
>>> import pingdom
>>> p = pingdom.Pingdom("user@example.com","your_password","your_api_key")
>>> p.locations
['Dallas, TX, USA', 'Dallas 2, TX, USA', 'Singapore', 'Sydney, Australia', 'Mumbai, India', 'Gloucester, England', 'Sacramento, CA, USA', 'Amsterdam, Holland', 'San Francisco, CA, USA', 'Vasteras, Sweden', 'Berkeley, CA, USA', 'Vasteras 2, Sweden', 'Dallas 3, TX, USA', 'Houston, TX, USA', 'Reading, England', 'Stockholm, Sweden', 'Stockholm 2, Sweden', 'Stockholm 3, Sweden', 'Houston 2, TX, USA', 'Montreal, Canada', 'London, UK', 'Dallas 4, TX', 'Herndon, VA', 'Paris, France', 'Houston 3, TX', 'Amsterdam 2, Netherlands', 'London 2, UK']
>>> p.checks
['webserver 1', 'webserver 1 ssl', 'imap server', 'incoming smtp', 'outgoing smtp', 'DNS server 1', 'DNS server 2', 'staging webserver', 'staging DB server', 'webserver 2', 'webserver 3']
>>> for state in p.states:
... print state
...
{'checkName': 'webserver 1', 'checkState': 'CHECK_UP', 'lastCheckTime': (2009, 8, 6, 19, 3, 13.0)}
{'checkName': 'webserver 1 ssl', 'checkState': 'CHECK_UP', 'lastCheckTime': (2009, 8, 6, 19, 2, 59.0)}
{'checkName': 'imap server', 'checkState': 'CHECK_UP', 'lastCheckTime': (2009, 8, 6, 19, 3, 27.0)}
{'checkName': 'incoming smtp', 'checkState': 'CHECK_UP', 'lastCheckTime': (2009, 8, 6, 18, 58, 39.0)}
{'checkName': 'outgoing smtp', 'checkState': 'CHECK_UP', 'lastCheckTime': (2009, 8, 6, 18, 57, 41.0)}
{'checkName': 'DNS server 1', 'checkState': 'CHECK_UP', 'lastCheckTime': (2009, 8, 6, 19, 2, 38.0)}
{'checkName': 'DNS server 2', 'checkState': 'CHECK_UP', 'lastCheckTime': (2009, 8, 6, 19, 2, 39.0)}