Skip to content

Instantly share code, notes, and snippets.


Kyle Brandt kylebrandt

View GitHub Profile
View gist:89dc754c658340e87d97
package main
import (
type Meeting struct {
Who []Person
When time.Time
kylebrandt / gist:92671689da33c3075326
Last active Aug 29, 2015
Convert Windows 100NS Epoch (Timestamp_Sys100NS) To a Unix Epoch
View gist:92671689da33c3075326
func TSys100NStoEpoch(nsec uint64) int64 {
//nsec is really 100*NS
//Got this constant from, not sure where it comes from, but seems to work
nsec -= 116444736000000000
seconds := nsec / 1e7
return int64(seconds)
View gist:b2906d990d0e762ad87e
package main
import (
kylebrandt /
Last active Aug 29, 2015
No promises...
#Parse Nginix Logs and insert results into either MySQL or SQLite
#Then run various reports on the data
#Kyle Brandt 2010
import re, optparse
import cProfile
from datetime import datetime
from time import time
from sqlalchemy import create_engine
kylebrandt / gist:04c0658828e616b5d8c5
Created Feb 29, 2016
Cloudera Not Default HBase Settings
View gist:04c0658828e616b5d8c5
zookeeper.session.timeout: 600000
HBase Service Advanced Configuration Snippet (Safety Valve) for hbase-site.xml:
Java Configuration Options for HBase RegionServer:
-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:-ResizePLAB -XX:ParallelGCThreads=17 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintAdaptiveSizePolicy
kylebrandt / gist:89a98f30680b799a6317
Created Feb 29, 2016
Cloudera Non-Default HDFS Settings
View gist:89a98f30680b799a6317
kylebrandt / gist:85218ae078e57a8d3088
Created Feb 29, 2016
Cloudera zookeeper Non-Defaults
View gist:85218ae078e57a8d3088
tickTime: 30000
maxSessionTimeout: 600000
View gist:14acacd867d67382629a
/opt/tsdbrelay/tsdbrelay -b ny-bosun01:8080 -t localhost:4242 -l -denormalize=os.cpu__host,os.mem.used__host,,,,, -r co-bosun:80 -redis ny-bosun01:6389 -db 0
kylebrandt / gist:91bd77288bdd526fa7df
Last active Mar 3, 2016
Bosun Elastic Expression Query Example, Per Minute
View gist:91bd77288bdd526fa7df
$minute = 5
$bucketSize = "${minute}m"
$index = esls("logstash")
$keyField = "logsource"
$filter = esquery("message", "scollector")
escount($index, $keyField, $filter, $bucketSize, "1d", "") / $minute
View gist:a63fbf1d36f6d4f6cc100383cf140906
$metric = "sum:5m-avg:rate{counter,,1}{host=ny-nexus02,iname=Ethernet3/1}"
$monthToDate = mtod(-4)
$commit = 150
$mtdAgo = epoch()-$monthToDate
$q = q($metric, tod($mtdAgo), "") * 8
$mtdAgo > d("1d") && percentile($q, .95) / 1e6 > $commit*.70
You can’t perform that action at this time.