Skip to content

Instantly share code, notes, and snippets.


pjstein pjstein

View GitHub Profile
martinseener / gist:5247292
Last active Jul 1, 2019
Grok Sophos UTM 9.x Pattern (for logstash) (Simple)
View gist:5247292
filter {
grok {
pattern => ['(?:%{SYSLOGTIMESTAMP:timestamp}|%{TIMESTAMP_ISO8601:timestamp8601}) (?:%{SYSLOGHOST:logsource}) (?:%{YEAR}): (?:%{MONTHNUM}):(?:%{MONTHDAY})-(?:%{HOUR}):(?:%{MINUTE}):(?:%{SECOND}) (?:%{SYSLOGHOST}) (?:%{SYSLOGPROG}): (?<messagebody>(?:id=\"%{INT:utm_id}\" severity=\"%{LOGLEVEL:utm_severity}\" sys=\"%{DATA:utm_sys}\" sub=\"%{DATA:utm_sub}\" name=\"%{DATA:utm_name}\" action=\"%{DATA:utm_action}\" fwrule=\"%{INT:utm_ulogd_fwrule}\" initf=\"%{DATA:utm_ulogd_initf}\" outitf=\"%{DATA:utm_ulogd_outif}\" (?:srcmac=\"%{GREEDYDATA:utm_ulogd_srcmac}\" dstmac=\"%{GREEDYDATA:utm_ulogd_dstmac}\"|srcmac=\"%{GREEDYDATA:utm_ulogd_srcmac}\") srcip=\"%{IP:utm_srcip}\" dstip=\"%{IP:utm_dstip}\" proto=\"%{INT:utm_protocol}\" length=\"%{INT:utm_ulogd_pkglength}\" tos=\"%{DATA:utm_ulogd_tos}\" prec=\"%{DATA:utm_ulogd_prec}\" ttl=\"%{INT:utm_ulogd_ttl}\" srcport=\"%{INT:utm_srcport}\" dstport=\"%{INT:utm_dstport}\" tcpflags=\"%{DATA:utm_ulogd_tcpflags}\"|id=\"%{INT:utm_id}\" severity=\"%{LOGLEVEL:utm
rxwei /
Last active Nov 4, 2019
First-Class Automatic Differentiation in Swift: A Manifesto
ftrain / rhymes.clj
Last active Jan 4, 2021
Annotated rhyming dictionary
View rhymes.clj
;; This is at:
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up
;; this code here:
;; I'm going to study this code and learn as I go.
;; First I put it in a namespace.
johnhw /
Last active Dec 1, 2021
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
import random
syhw /
Last active Dec 22, 2021
A simple deep neural network with or w/o dropout in one file.
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
adrianhall / AppSyncAPI.yaml
Last active Jan 15, 2022
A CloudFormation template for DynamoDB + Cognito User Pool + AppSync API for the Notes tutorial
View AppSyncAPI.yaml
Description: AWS AppSync Notes API
Type: String
Description: Name of the API - used to generate unique names for resources
MinLength: 3
MaxLength: 20
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$'
markwalkom / logstash.conf
Last active Apr 29, 2022
Reindexing Elasticsearch with Logstash 2.0
View logstash.conf
input {
elasticsearch {
hosts => [ "HOSTNAME_HERE" ]
port => "9200"
size => 1000
scroll => "5m"
docinfo => true
scan => true
ddevault / Makefile
Last active May 5, 2022
Tiny Wayland compositor
View Makefile
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h
marktheunissen / pedantically_commented_playbook.yml
Last active Jun 6, 2022 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
View pedantically_commented_playbook.yml
This playbook has been removed as it is now very outdated.
karpathy /
Created May 30, 2016
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward