Skip to content

Instantly share code, notes, and snippets.


Andrew Kroh andrewkroh

View GitHub Profile
View anonymize iptables logs
# Anonymize IPTABLES logs for documentation!
import os
import re
import sys
random_macs = set()
macs = {}
andrewkroh /
Last active Mar 17, 2022
Elastic Beat Development 101

Elastic Beats Development 101

This is a short guide to get up and building Elastic Beats on a new Linux host.

Start a VM

This uses Google Compute Engine (GCE) to start an Ubuntu 20.04 virtual machine. You can use other versions of Linux or different virtualization platforms (or no virtualization), but those are not guaranteed to work with the commands here.

 gcloud auth login
soloradish / vault_logrotate
Created Sep 12, 2018
logrotate setting file for HashiCorp's Vault audit file
View vault_logrotate
# Change the path below to your own audit log path.
/var/log/vault/audit.log {
rotate 30
# Do not execute rotate if the log file is empty.
# Set compress on next rotate cycl to prevent entry loss when performing compression.
gpgconf --kill gpg-agent
# You shouldn’t need to manually restart it. GPG will restart it when it’s needed.
pamelafox / browser.js
Created Feb 13, 2013
Browser banner warning
View browser.js
(function(wndw) {
var Browsers, OS, Platform, Versions, browser_name, browser_version, os, platform;
Versions = {
Firefox: /firefox\/([\d\w\.\-]+)/i,
IE: /msie\s([\d\.]+[\d])/i,
Chrome: /chrome\/([\d\w\.\-]+)/i,
Safari: /version\/([\d\w\.\-]+)/i,
Ps3: /([\d\w\.\-]+)\)\s*$/i,
Psp: /([\d\w\.\-]+)\)?\s*$/i