Skip to content

Instantly share code, notes, and snippets.

@john-g-g
john-g-g / jq-cheetsheet.md
Created May 25, 2021 17:12 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@john-g-g
john-g-g / iptables.grok
Created January 30, 2020 14:16 — forked from Caligatio/iptables.grok
iptables Grok Pattern
# GROK Custom Patterns (add to patterns directory and reference in GROK filter for iptables events):
# GROK Patterns for iptables Logging Format
#
# Created 6 Aug 2016 by Brian Turek <brian.turek@gmail.com>
# Most of this was taken from another source but now I cannot find it for credit
#
# Usage: Use the IPTABLES pattern
NETFILTERMAC %{MAC:dest_mac}:%{MAC:src_mac}:%{ETHTYPE:ethtype}
ETHTYPE (?:(?:[A-Fa-f0-9]{2}):(?:[A-Fa-f0-9]{2}))
@john-g-g
john-g-g / make-time-machine-work.sh
Created August 25, 2016 19:45 — forked from aaronzirbes/make-time-machine-work.sh
Script to setup SMB share for time machine backup
#!/bin/bash
###
### This is the script I use to setup time machine to work with my LinkSys attched NAS (USB 3.0 Hard Drive)
###
#### Configurable Parameters #########
SIZE=300g
NAME="Z.org Time Machine Backup"
@john-g-g
john-g-g / slackme
Last active August 29, 2015 14:15 — forked from onjin/slackme
#!/usr/bin/env python
"""
Usage:
using ~/.slackmerc file:
$ slackme some info # with `default` profile
$ slackme --profile alert some info # using `alert` profile
put profile in filename:
@john-g-g
john-g-g / pyp_beta
Last active August 29, 2015 14:07 — forked from apuignav/pyp_beta
#!/usr/bin/env python
#version 2.13
#author tobyrosen@gmail.com
"""
Copyright (c) 2011, Sony Pictures Imageworks
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
#!/bin/bash -xe
#THIS SCRIPT MUST BE RUN AS ROOT
#update packages
echo "deb http://apt.opscode.com/ precise-0.10 main" | tee /etc/apt/sources.list.d/opscode.list
mkdir -p /etc/apt/trusted.gpg.d