Skip to content

Instantly share code, notes, and snippets.

View bedge's full-sized avatar

Bruce Edge bedge

  • Roche RSS
  • Calabasas, CA
View GitHub Profile
@bedge
bedge / sumo-app.json
Last active March 20, 2021 16:04
Sumo collector json mask rule syntax for json log message field names wacky escaping required, eg: {"username":"name to redact"}
{
"api.version":"v1",
"sources":[
{
"name": "app.log",
"description": "app.log json",
"category": "product/app",
"timezone": "UTC",
"sourceType": "LocalFile",
"forceTimeZone": true,
@bedge
bedge / update_sane_hosts.sh
Last active May 12, 2018 00:46
Scripted update from someonewhocares.org preserving local changes.
#!/bin/bash -ex
# Keep /etc/hosts up to date with ad blocker site:
# http://someonewhocares.org/hosts/hosts
# Depends on my endecode.py gist or equiv for cleaning up html text.
# Excluding personal allow list
# eg: googleadservices, so google image searches are clickable.
allow=${hosts}.allow
@bedge
bedge / endecode.py
Created May 11, 2018 23:46
Script to allow html/url encode/decode of file(s)/stdin.
#!/usr/bin/env python3
# Suggested use:
# alias urldecode="endecode.py -a url_decode $*"
# alias urlencode="endecode.py -a url_encode $*"
# alias htmldecode="endecode.py -a html_decode $*"
# alias htmlencode="endecode.py -a html_encode $*"
# Encode or decode url or html encoded/plain files.
import sys