Skip to content

Instantly share code, notes, and snippets.

View kbourgoin's full-sized avatar

Keith Bourgoin kbourgoin

View GitHub Profile
geneA
geneB
geneC
@kbourgoin
kbourgoin / keybase.md
Created September 26, 2014 13:26
Proof for keybase.io

Keybase proof

I hereby claim:

  • I am kbourgoin on github.
  • I am kbourgoin (https://keybase.io/kbourgoin) on keybase.
  • I have a public key whose fingerprint is A1AD A8EA 7F55 6137 1568 22DD 27C3 80E0 CE67 E4C4

To claim this, I am signing this object:

(defproject streamparse-kafka-sample "0.0.1-SNAPSHOT"
:source-paths ["src/clj" "topologies"]
:aot :all
:resource-paths ["_resources"]
:target-path "_build"
:min-lein-version "2.0.0"
; :jvm-opts ["-client"]
:dependencies [[org.apache.storm/storm-core "0.9.2-incubating"]
[org.apache.storm/storm-kafka "0.9.2-incubating" :exclusions [org.slf4j/slf4j-api]]
[org.apache.kafka/kafka_2.9.2 "0.8.1.1" :exclusions [com.sun.jmx/jmxri com.sun.jdmk/jmxtools javax.jms/jms org.slf4j/slf4j-api]]
# First, lets make some (slightly) malicious code I want to run.
# The import proves we could delete the entire disk, but really we have
# access to the whole machine if we can import anything we want.
code = """import shutil
print "\tI could have just done bad things"
"""
# Obviously you're scanning for "import", so let's obfuscate a little bit.
# I use a rot13 cipher because it's easy, but any two-way cipher
# is sufficient to hide what we're really doing.
@kbourgoin
kbourgoin / logging_snippet.py
Created April 3, 2013 22:26
Useful for turning on logging quickly
formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(name)s - %(message)s')
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
handler.setFormatter(formatter)
root_logger = logging.getLogger()
root_logger.addHandler(handler)
root_logger.setLevel(logging.INFO)
@kbourgoin
kbourgoin / gist:2915148
Created June 12, 2012 04:57
zerorpc Pusher tester
# To run pusher and puller: start with "push" or "pull" as arguments
# Note how pusher blocks until puller starts and then memory grows unbounded
#
# To see HWM setting:
# Add "self.setsockopt(_zmq.HWM, 10)" to line 49 in gevent_zeromq.py
# NOTE: Line 15 below doesn't work and I don't know why.
import zmq
from zerorpc import Pusher, Puller
@kbourgoin
kbourgoin / gist:1644196
Created January 20, 2012 01:08
Remove trailing whitespace from all *.py files
find ./ -not -path '.git' -iname '*.py' -exec sed -i 's/ *$//' '{}' ';'
@kbourgoin
kbourgoin / github irc service hook optimization
Created December 12, 2011 22:35 — forked from jessor/github irc service hook optimization
this is how you can omit having join/parts of github's irc bot in your channel
1. Set your channel invite only but allow messages from outside:
/mode #yourchannel +i-n
2. Set an inite exception for any user whose ident is longer than two chars, this
/mode #yourchannel +I *!??*@*
3. In the repository administration, give the irc bot a nick like 'G'
<!-- START Parse.ly Include: Standard -->
<div id="parsely-root" style="display: none">
<a id="parsely-cfg" data-parsely-site="kotaku.com"
href="http://parsely.com">Powered by the Parse.ly Publisher Platform (P3).</a>
</div>
<script>
(function(s, p, d) {
var h=d.location.protocol, i=p+"-"+s,
e=d.getElementById(i), r=d.getElementById(p+"-root");
if (e) return;