Skip to content

Instantly share code, notes, and snippets.

  1. General Background and Overview
@astanway
astanway / keybase.md
Created December 17, 2014 05:01
keybase.md

Keybase proof

I hereby claim:

  • I am astanway on github.
  • I am abe (https://keybase.io/abe) on keybase.
  • I have a public key whose fingerprint is 3A3E E5C6 7DBB 0BA5 20C2 56EA ACBE 2571 DDB6 2338

To claim this, I am signing this object:

@astanway
astanway / gist:b28868b315a598d75fc0
Last active August 29, 2015 14:08
basic python uwsgi nginx sock proxy
# nginx
server {
listen 80;
rewrite (.*) https://$http_host$1 permanent;
}
server {
listen 80 default_server;
location / {
@astanway
astanway / rf.py
Created November 6, 2014 02:26
random forest
from sklearn.naive_bayes import MultinomialNB
from sklearn.linear_model import LogisticRegression
from sklearn.feature_extraction import DictVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn import metrics
from operator import itemgetter
from sklearn.metrics import classification_report
from random import shuffle
from scipy.stats import mode
import numpy as np
@astanway
astanway / format.py
Created November 6, 2014 02:25
vowpal wabbit format
from sklearn.naive_bayes import MultinomialNB
from sklearn.linear_model import LogisticRegression
from sklearn.feature_extraction import DictVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn import metrics
from operator import itemgetter
from sklearn.metrics import classification_report
from random import shuffle
from scipy.stats import mode
import numpy as np
@astanway
astanway / gist:8c7f72a03ab488692dc1
Created October 30, 2014 22:51
osquery memcheck
ubuntu@ip-10-0-0-15 ~/osquery sudo valgrind --tool=memcheck --track-origins=yes osqueryd
==15362== Memcheck, a memory error detector
==15362== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==15362== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==15362== Command: osqueryd
==15362==
I1030 22:47:34.823153 15362 daemon.cpp:25] Listing all plugins
I1030 22:47:34.917042 15362 daemon.cpp:27] Logger plugins:
I1030 22:47:34.921547 15362 daemon.cpp:29] - filesystem
I1030 22:47:34.923684 15362 daemon.cpp:29] - glog
sudo tcpflow -c port 2003 -i lo
tcpflow[16873]: listening on lo
127.000.000.001.45478-127.000.000.001.02003: stats.statsd.packets_received 0 1410836215
stats_counts.statsd.packets_received 0 1410836215
stats.statsd.bad_lines_seen 0 1410836215
stats_counts.statsd.bad_lines_seen 0 1410836215
statsd.numStats 2 1410836215
stats.statsd.graphiteStats.calculationtime 4 1410836215
stats.statsd.graphiteStats.last_exception 1410593774 1410836215
stats.statsd.graphiteStats.last_flush 1410836205 1410836215
sudo npm install
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm ERR! peerinvalid The package karma does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9.3
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
# Define inputs
input {
redis {
host => "127.0.0.1"
data_type => "list"
type => "redis-input"
key => "logstash"
}
redis {
Here's my redis setting:
redis {
host => "127.0.0.1"
data_type => "list"
codec => "json"
key => "json"
}
Here's my json filter: