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
function findHandler(err, docs) { | |
if (!err) { | |
// Return Success & JSON Content-type | |
var length = docs.length; | |
writeMeta(self.res,200,url,length); | |
// Process results from Mongo | |
docs.forEach(function(e,i,a) { | |
//console.log(e,i,a); |
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
function findHandler(err, docs) { | |
if (!err) { | |
// Return Success & JSON Content-type | |
var length = docs.length; | |
writeMeta(self.res,200,url,length); | |
// Process results from Mongo | |
docs.forEach(function(e,i,a) { | |
//console.log(e,i,a); |
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
#!/bin/bash | |
matches=() | |
directory='/opt/graphite/storage/whisper' | |
for file in $(find $directory -type f -name '*.wsp' -print); do | |
$(python /usr/local/bin/whisper-info.py $file > /dev/null 2>&1) | |
retval=$? | |
echo "checking $file" | |
[ $retval -ne 0 ] && matches+=($file) |
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
//Node.js script to act as a listener for webhooks. | |
// | |
// Copyright (c) 2014, PagerDuty, Inc. <info@pagerduty.com> | |
// All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions are met: | |
// * Redistributions of source code must retain the above copyright | |
// notice, this list of conditions and the following disclaimer. | |
// * Redistributions in binary form must reproduce the above copyright |
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
#!/bin/bash | |
options=('find' 'delete') | |
PS3='state your wish: ' | |
echo -e "\nfind/delete corrupt whisper-files" | |
select opt in "${options[@]}"; do | |
case $REPLY in | |
[12] ) option=$opt; break;; | |
* ) exit;; |
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
import sys, time, subprocess, socket, telnetlib | |
from datetime import datetime | |
from collections import defaultdict | |
from boto.ec2.cloudwatch import CloudWatchConnection | |
MAPPINGS = { | |
# Memcached name: (AWS Name, AWS Metric Type, Calculation Method) | |
'uptime': ('Uptime', 'Count', 'gauge'), |
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
# A guide to prevent pain and suffering while upgrading to OS X Mavericks | |
# This will vary greatly depending on system set up, so read the instructions carefully | |
# Back up Virtulenvs | |
#################### | |
# Very important! | |
# For each virtualenv you have, run "pip freeze > requirements.txt" while in the activated virtualenv | |
# in order to prevent loss of dependencies during the upgrade. |
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
for f in $(find $1 -iname "*.wsp"); do | |
if [ -a $f ]; | |
then /opt/graphite/bin/whisper-set-aggregation-method.py $f max; | |
fi; | |
done |
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
import boto3 | |
import botocore | |
from random import randint | |
from time import sleep | |
def client_throttle(action, **kwargs): | |
while True: | |
try: | |
return action(**kwargs) | |
except botocore.exceptions.ClientError as e: |
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
# encoding: UTF-8 | |
require 'optparse' | |
require 'net/http' | |
require 'json' | |
def parse_options(argv) | |
opts = {} | |
@parser = OptionParser.new do |o| |
OlderNewer