This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FlexibleRequest(urllib2.Request): | |
VALID_METHODS = [ 'GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'TRACE', 'OPTIONS', 'CONNECT', 'PATCH' ] | |
def __init__(self, *args, **kwargs): | |
if 'method' in kwargs: | |
if not kwargs['method'] in self.VALID_METHODS: | |
raise ValueError("Invalid method specified: %s" % kwargs['method']) | |
self.method = kwargs.pop('method') | |
else: | |
self.method = None | |
urllib2.Request.__init__(self, *args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'cloudkick' | |
require 'json' | |
require 'timeout' | |
module MC | |
class CloudkickHandler < Chef::Handler | |
CHECK_NAME = 'chef-clientRun' | |
TIMEOUT = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def loadClass(self,className, classLoader): | |
""" loadClass(className) | |
Load a class in classLoader and recursively load any dependencies. """ | |
# From what I'm told there's no better way... | |
try: | |
classLoader.findClass(className) | |
except LinkageError: | |
pass | |
except ClassNotFoundException: | |
pass # i dunno.. sometimes findClass throws this but loadClass works |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[solarized-dark] | |
background = #002b36 | |
foreground = #839496 | |
majorLine = #fdf6e3 | |
minorLine = #eee8d5 | |
lineColors = #268bd2,#859900,#dc322f,#d33682,#db4b16,#b58900,#2aa198,#6c71c4 | |
fontName = Sans | |
fontSize = 10 | |
fontBold = False | |
fontItalic = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[pre] | |
# I dont like statsd's "buckets" | |
# separate statsd's wonky and confusing summary counts | |
^(stats[.])(?!timers[.])(.+?)$ = stats.statsd.\2 | |
# Put all metrics under the 'stats' prefix | |
^(stats[.])(timers[.])(.+?)$ = \1\3 | |
^(stats_counts[.])(.+?)$ = stats.\2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- webapp/graphite/render/glyph.py.orig 2012-02-14 17:40:44.000000000 -0600 | |
+++ webapp/graphite/render/glyph.py 2012-02-14 17:41:11.000000000 -0600 | |
@@ -1352,6 +1352,9 @@ | |
while f <= end: | |
yield f | |
f += step | |
+ if f == start: | |
+ yield end | |
+ return | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== modified file 'webapp/graphite/render/functions.py' | |
--- webapp/graphite/render/functions.py 2011-10-04 21:06:09 +0000 | |
+++ webapp/graphite/render/functions.py 2012-02-28 16:05:35 +0000 | |
@@ -225,44 +225,49 @@ | |
series[i] = value | |
return seriesList | |
-def asPercent(requestContext, seriesList1, seriesList2orNumber): | |
+def asPercent(requestContext, seriesList, total=None): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, os, time, traceback | |
import whisper | |
from optparse import OptionParser | |
now = int(time.time()) | |
option_parser = OptionParser( | |
usage='''%prog path timePerPoint:timeToStore [timePerPoint:timeToStore]* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Initialize a shell from the directory the graphite webapp's manage.py lives in. e.g.: | |
## /opt/graphite/webapp/graphite/ | |
## /usr/lib/python2.6/site-packages/graphite/ | |
## etc | |
# | |
# python manage.py shell | |
from graphite.render.datalib import CarbonLinkPool | |
# Connect to the carbon-cache instance 'a' on localhost: | |
carbon = CarbonLinkPool([ ('localhost', 7002, 'a') ], 1.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, time, whisper, shutil | |
from optparse import OptionParser | |
now = int( time.time() ) | |
option_parser = OptionParser( | |
usage='''%prog path from''') |
OlderNewer