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
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
import socket
import pickle
import random
import time
import struct
import threading
import urllib2
#from sc_watchdog.logger import log
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;
========================================== ==========================================
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 &
<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>
<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
#!/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
@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/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,