ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
This file contains hidden or 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 pyes | |
>>> conn = pyes.es.ES("localhost:9200") | |
>>> all = conn.scan(pyes.query.MatchAllQuery(), 'index', 'type') | |
>>> for a in all: | |
... hits = a['hits']['hits'] | |
... for hit in hits: | |
... conn.index(hit['_source'], 'new_index', 'type', hit['_id'], bulk=True) |
This file contains hidden or 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 | |
VENV="$WORKSPACE/.env" | |
if [ ! -e "virtualenv.py" ]; then | |
curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py | |
fi | |
if [ -d $VENV ]; then | |
echo "**> virtualenv exists" | |
else | |
echo "**> creating virtualenv" | |
python virtualenv.py $VENV |
This file contains hidden or 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
# Need to install disper, only works on NVIDIA | |
alias clone-screen='disper -c' | |
alias dual-screen='disper -e -t right -d DFP-1,DFP-0' | |
alias pair-screen='disper -c -d DFP-1,CRT-0' | |
alias single-screen='disper -s' |
This file contains hidden or 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
env.roledefs = { | |
'hosts' : ['foo', 'bar'], | |
'local' : [] | |
} | |
@task | |
@roles('hosts') | |
def export_dummies(): | |
run("rm -rf /tmp/exports") |
This file contains hidden or 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 'socket' | |
@functions = { | |
:ADD => lambda {|a, b| a + b}, | |
:SUBTRACT => lambda {|a, b| a - b}, | |
:MULTIPLY => lambda {|a, b| a * b} | |
} | |
def build_response(msg) | |
m = msg.split(':') |
This file contains hidden or 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
## Prepare ################################################################### | |
# Remove RVM | |
rvm implode | |
# Ensure your homebrew is working properly and up to date | |
brew doctor | |
brew update | |
## Install ################################################################### |
This file contains hidden or 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 ThriftOverHttp extends Filter[ThriftClientRequest, Array[Byte], HttpRequest, HttpResponse] { | |
def apply(request: ThriftClientRequest, service: Service[HttpRequest, HttpResponse]) = { | |
val httpRequest = convertThriftRequestToHttpRequest(request) | |
val response = service(httpRequest) | |
response flatMap { res => | |
Future.value(res.getContent().array()) | |
} | |
} | |
private def convertThriftRequestToHttpRequest(request: ThriftClientRequest) = { |
This file contains hidden or 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
from itsdangerous import JSONWebSignatureSerializer, BadSignature, SignatureExpired | |
import calendar | |
import datetime | |
class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer): | |
EXPIRES_IN_AN_HOUR = 3600 | |
def __init__(self, secret_key, salt=None, serializer=None, signer=None, signer_kwargs=None, algorithm_name=None, expires_in=None): |
This file contains hidden or 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
(ns riemann.test.nagios | |
(:use riemann.nagios | |
clj-nsca.core | |
clojure.test) | |
(:require [riemann.logging :as logging])) | |
(logging/init) | |
(def test-event | |
{:host "host01" :service "test_service" :state "ok" :description "Quick brown fox"}) |