Skip to content

Instantly share code, notes, and snippets.

View eredding-rmn's full-sized avatar

Erik Redding eredding-rmn

  • RetailMeNot, Inc.
View GitHub Profile
# python hash_ring_selector2.py
DESTINATIONS : ['10.4.0.1:2104:a', '10.4.0.1:2204:b',
'10.4.0.2:2104:a', '10.4.0.2:2204:b']
CARBONLINK_HOSTS: ['10.4.0.1:7102:a', '10.4.0.1:7202:b']
result metric carbon-relay webapp
[ OK ] some.metric ('10.4.0.1', 'b') ('10.4.0.1', 'b')
[ OK ] mymetric ('10.4.0.1', 'a') ('10.4.0.1', 'a')
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def archive_to_bytes(archive):
def to_seconds(s):
SECONDS_IN_A = {
's': 1,
'm': 1 * 60,
'h': 1 * 60 * 60,
@eredding-rmn
eredding-rmn / README
Last active August 29, 2015 14:06 — forked from matetsu/README
* cloudtrail_template_1.json
dateのformatを YYYY-MM-dd'T'HH:mm:ssZ としたもの。
* cloudtrail_template_2.json
dateのformatを date_time_no_millis としたもの。
* mapping_after_insert.json
cloudtrail_template_1.json でデータ投入後のmapping (dynamic_templateが効いていない?のは要調査)
* data.json
#!/usr/lib64/fluent/ruby/bin/ruby
require 'json'
require 'aws-sdk'
require 'msgpack'
require 'logger'
#log = Logger.new("/tmp/debug.log", 3)
#log.level = Logger::DEBUG
<VirtualHost *:80>
ServerName es.yourhost.com
<Proxy balancer://main>
BalancerMember http://127.0.0.1:9200 max=1 retry=5
<Limit GET >
order deny,allow
deny from all
allow from 127.0.0.1
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName elasticsearch.domain.tld
ServerAlias kibana.domain.tld
DocumentRoot /path/to/kibana/docroot
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /path/to/kibana/docroot>
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import socket
import pickle
import random
import time
import struct
import threading
import urllib2
#from sc_watchdog.logger import log