Skip to content

Instantly share code, notes, and snippets.

View phobos182's full-sized avatar

Jeremy Carroll phobos182

View GitHub Profile
@phobos182
phobos182 / keybase.md
Created March 20, 2014 23:41
keybase

Keybase proof

I hereby claim:

  • I am phobos182 on github.
  • I am jeremycarroll (https://keybase.io/jeremycarroll) on keybase.
  • I have a public key whose fingerprint is 77F0 B959 DAD0 3A5A F4F7 1E79 298A CF13 2ECF 0BF9

To claim this, I am signing this object:

@phobos182
phobos182 / patched.py
Last active August 29, 2015 13:58
patch detection
#!/usr/bin/env python
import argparse
import re
import sys
import subprocess
LIBSSL_NAME = 'libssl1.0.0'
LIBSSL_MODULE = 'libssl.so.1.0.0'
OPENSSL_NAME = 'openssl'
VERSION_WHITELIST = ['1.0.1-4ubuntu5.12']
@phobos182
phobos182 / hb-test.py
Created April 10, 2014 21:40
HeartBeat PoC
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@phobos182
phobos182 / elasticsearch.py
Last active August 29, 2015 13:58
Example ES Client
import elasticsearch
# Connect to cluster at search1:9200, sniff all nodes and round-robin between them
es = elasticsearch.Elasticsearch(["dataelasticsearch-a-master001:9200", "dataelasticsearch-b-master001:9200",
"dataelasticsearch-e-master001:9200"], sniff_on_start=True)
# Index a document:
es.index(
index="my_app",
@phobos182
phobos182 / mpstat_output
Last active August 29, 2015 14:05
Blog MPStat Output
11:11:48 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
11:11:49 PM all 6.38 0.00 19.15 0.00 0.00 12.41 2.84 0.00 59.22
11:11:49 PM 0 15.24 0.00 41.90 0.00 0.00 33.33 0.95 0.00 8.57
11:11:49 PM 1 1.70 0.00 5.68 0.00 0.00 0.00 3.41 0.00 89.20
---
12:14:40 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
12:14:43 AM all 5.93 0.00 13.92 0.11 0.00 6.69 0.27 0.00 73.09
12:14:43 AM 0 19.87 0.00 38.41 0.00 0.00 41.06 0.00 0.00 0.66
@phobos182
phobos182 / zk-report
Created October 6, 2014 17:21
ZooKeeper zkTraffic report viewer.
#!/usr/bin/env python
import argparse
import brood
import requests
ENDPOINT_ADDR = '127.0.0.1'
ENDPOINT_PORT = 7070
TOP_ITEMS = 10
Statistics for BinaryTreeDictionary:
------------------------------------
Total Free Space: 542384916
Max Chunk Size: 337614532
Number of Blocks: 58933
Av. Block Size: 9203
Tree Height: 124
Before GC:
Statistics for BinaryTreeDictionary:
------------------------------------
@phobos182
phobos182 / help
Created January 27, 2012 19:04
Hadoop help.
[user@dn1-r178u1 ~]$ hadoop --help
Error: No command named `--help' was found. Perhaps you meant `hadoop -help'
[user@dn1-r178u1 ~]$ hadoop -help
Error: No command named `-help' was found. Perhaps you meant `hadoop help'
[user@dn1-r178u1 ~]$ hadoop help
Exception in thread "main" java.lang.NoClassDefFoundError: help
Caused by: java.lang.ClassNotFoundException: help
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
root@jobs-aa-hdn160:/usr/share/java/logstash# java -cp ./logstash-1.1.0-monolithic.jar org.jruby.Main -S gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.15
- RUBY VERSION: 1.9.2 (2012-06-06 patchlevel 312) [java]
- INSTALLATION DIRECTORY: file:/usr/share/java/logstash/logstash-1.1.0-monolithic.jar!/META-INF/jruby.home/lib/ruby/gems/1.8
- RUBY EXECUTABLE: java -jar /usr/share/java/logstash/logstash-1.1.0-monolithic.jar
- EXECUTABLE DIRECTORY: file:/usr/share/java/logstash/logstash-1.1.0-monolithic.jar!/META-INF/jruby.home/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.6
irb(main):001:0> require "filewatch/tail"; FileWatch::Tail.new
=> #<FileWatch::Tail:0x478dabf1 @opts={:sincedb_write_interval=>10, :sincedb_path=>"/root/.sincedb", :stat_interval=>1, :discover_interval=>5, :exclude=>[]}, @lastwarn={}, @sincedb_last_write=0, @files={}, @statcache={}, @buffers={}, @watch=#<FileWatch::Watch:0x2d83e895 @exclude=[], @watching=[], @logger=#<Logger:0x2f1aa58b @logdev=#<Logger::LogDevice:0x7e6a60d5 @shift_age=nil, @filename=nil, @dev=#<IO:fd 2>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x79fb80c9 @mon_count=0, @mon_mutex=#<Mutex:0x6ec44aaf>, @mon_owner=nil>, @shift_size=nil>, @formatter=nil, @progname=nil, @default_formatter=#<Logger::Formatter:0x19035ff9 @datetime_format=nil>, @level=1>, @files={}>, @logger=#<Logger:0x2f1aa58b @logdev=#<Logger::LogDevice:0x7e6a60d5 @shift_age=nil, @filename=nil, @dev=#<IO:fd 2>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x79fb80c9 @mon_count=0, @mon_mutex=#<Mutex:0x6ec44aaf>, @mon_owner=nil>, @shift_size=nil>, @formatter=nil, @progname=nil, @defa