Skip to content

Instantly share code, notes, and snippets.

package com.notmetron.stellar;
import org.apache.metron.common.dsl.Context;
import org.apache.metron.common.dsl.ParseException;
import org.apache.metron.common.dsl.Stellar;
import org.apache.metron.common.dsl.StellarFunction;
import java.util.List;
public class TimeFunction {
import sklearn
import numpy as np
import math
import pickle
import collections
class DGA:
def __init__(self):
self.model = { 'clf': pickle.loads(open('./dga_model_random_forest.model','rb').read())
, 'alexa_vc': pickle.loads(open('./dga_model_alexa_vectorizor.model','rb').read())
, 'alexa_counts': pickle.loads(open('./dga_model_alexa_counts.model','rb').read())
@cestella
cestella / dga.py
Created August 15, 2016 14:45
Mock DGA Service
from flask import Flask
from flask import request,jsonify
import socket
app = Flask(__name__)
@app.route("/apply", methods=['GET'])
def predict():
h = request.args.get('host')
r = {}
if h == 'yahoo.com' or h == 'amazon.com':
@cestella
cestella / README.md
Last active August 29, 2015 14:01 — forked from weiglemc/.block
@cestella
cestella / README.md
Last active August 29, 2015 14:01 — forked from GerHobbelt/README.md

Here's a d3 plugin that allows you to create a polygon selection. You instantiate it just like d3.svg.brush.

var brush = d3.svg.polybrush();

It has an extra public method that 'brush' does not, and that's 'isWithinExtent(x, y)'. You can use this method to test if a given point falls within the drawn extent.

if (brush.isWithinExtent(x, y)) {
  console.log("I'm inside!");
}
@cestella
cestella / README.md
Last active August 29, 2015 14:00 — forked from lgersman/README.md
  • Click into the drawing area to start the selection frame
  • move the mouse to resize the selection frame
  • Release the mouse button to resize the selection frame

(The circles are just for illustrating purposes)

Keybase proof

I hereby claim:

  • I am cestella on github.
  • I am cstella (https://keybase.io/cstella) on keybase.
  • I have a public key whose fingerprint is 50E6 D91A 3DBC 81BC B07C A91A 4B40 C1AF D0D2 850C

To claim this, I am signing this object:

@cestella
cestella / generate_patch.sh
Created May 15, 2012 03:07
use git-svn to generate patch files for a whole branch excluding the files changed only as part of a merge from a parent branch
#!/bin/bash
BRANCH_NAME=$1
shift
for project in $@;do
pushd $project >& /dev/null
MAX="";
MIN="";
CURR_FILE="";
@cestella
cestella / pomodoro.sh
Created January 31, 2012 02:43
Simple pomodoro timer in a shell
#!/bin/sh
WORK_DURATION=$(echo "60 $1 * p" | dc)
PLAY_DURATION=$(echo "60 $2 * p" | dc)
echo "WORK DURATION: $WORK_DURATION seconds"
echo "PLAY DURATION: $PLAY_DURATION seconds"
while :
do
echo "WORKING FOR $1 minutes"
sleep $WORK_DURATION && \
echo "^G" && \