BigSnarf blog

Infosec FTW

Monthly Archives: March 2013

What side you on? Blue Team or Red Team? OSS Security Distros

Dude where’s my naive bayes?


naive Bayes classifier is a simple probabilistic classifier based on applying Bayes’ theorem with strong (naive) independence assumptions. A more descriptive term for the underlying probability model would be “independent feature model”.  An overview of statistical classifiers is given in the article on Pattern recognition.

Processing million lines logs with iPython Notebooks

Twitter Big Data Infrastructure – Redis, Lucene, Hadoop


iPython Notebooks with Redis to store lists, sets, and python objects using pickle

python hyperloglog and webscale counters

from mmhash import mmhash
from math import log
from zlib import compress
from base64 import b64encode
class HyperLogLog:
 def __init__(self, log2m):
 self.log2m = log2m
 self.m = 1 << log2m = [0]*self.m
 self.alphaMM = (0.7213 / (1 + 1.079 / self.m)) * self.m * self.def offer(self, o):
 x = mmhash(str(o), 0)
 a, b = 32-self.log2m, self.log2m
 i = x >> a
 v = self._bitscan(x << b, a)[i] = max([i], v)
def count(self):
 estimate = self.alphaMM / sum([2**-v for v in])
 if estimate <= 2.5 * self.m:
 zeros = float(
 return round(-self.m * log(zeros / self.m))
 return round(estimate)

 def _bitscan(self, x, m):
 v = 1
 while v<=m and not x&0x80000000:
 return v

 def datastr(self):
 return b64encode(compress(str.join('', map(chr,, 9))

Stacked bar charts work better to tell the story – barh not enough by itself

Bar chart reporting presents data but it doesn’t provide context alone

Screen Shot 2013-03-21 at 11.01.48 PM

In this example stacked bar chart can show you volume comparisons but it might be difficult to gauge counts

Screen Shot 2013-03-22 at 9.38.17 AM

Transition to side by side bar chart can help display counts

Screen Shot 2013-03-22 at 9.38.12 AM

Consume the data you have with tools that answer most of your questions quickly

Screen Shot 2013-03-21 at 10.12.21 AM

Facebook has committed to democratizing their data to users. In this blog post, he details his experience to get data to the masses.

Big Data Mind Map – Interesting

d3.js mixedtape tutorials – creators gotta create