Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sduff on github.
  • I am sduff (https://keybase.io/sduff) on keybase.
  • I have a public key whose fingerprint is AF46 80FD 273B CEE0 FDEE 56B9 D2A5 9C26 9D71 78FB

To claim this, I am signing this object:

@sduff
sduff / splunk_search.py
Created September 5, 2017 06:04
Splunk search via Python, using Requests
import time # need for sleep
from xml.dom import minidom
import json, pprint
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
@sduff
sduff / splunk_modify_saved_search.py
Created September 5, 2017 07:16
Modify a Splunk Saved Search via Python, using Requests
import time # need for sleep
from xml.dom import minidom
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
base_url = 'https://localhost:8089'
username = 'admin'
password = 'changeme'
@sduff
sduff / .js
Last active October 3, 2017 04:09
Splunk Custom Visualisation code to convert data.fields and data.rows into a hash map
data.rows.map(function (row) {
var _row = {};
for (var f=0; f<data.fields.length; f++) {
fn = data.fields[f].name;
_row[fn] = row[f];
}
return(_row);
});
@sduff
sduff / webhook.py
Created October 12, 2018 05:38
Splunk alert_webhook with proxy support
import sys
import json
import urllib2
import csv
import gzip
from collections import OrderedDict
def send_webhook_request(url, body, user_agent=None):
if url is None:
@sduff
sduff / elements.txt
Created July 28, 2020 01:48
List of all elements
Hydrogen
Helium
Lithium
Beryllium
Boron
Carbon
Nitrogen
Oxygen
Fluorine
Neon
@sduff
sduff / surname.txt
Created July 28, 2020 01:51
List of 20 most common Australian surnames
mith
jones
williams
brown
wilson
taylor
johnson
white
martin
anderson
@sduff
sduff / 1001 Video Games You Must Play Before You Die (2011)
Created September 8, 2020 03:00
1001 Video Games You Must Play Before You Die (2011)
## Chapter 1: 1970s
The Oregon Trail
Pong
Breakout
Boot Hill
Combat
Space Invaders
Adventure
Asteroids
Galaxian
@sduff
sduff / gist:f93e42795362552390482414b44dbb5e
Last active March 24, 2021 08:39
ANSI SQL Table joins and set operators - practice at https://livesql.oracle.com/
DROP table a;
DROP table b;
create table a (
aid NUMBER(10),
adiz VARCHAR2(10)
);
create table b (
bid NUMBER(10),
@sduff
sduff / ccloud-resource-identifiers-after-terraform.txt
Created October 6, 2021 06:29
Accessing Confluent Cloud resource identifiers after running the terraform provider
# Use jq to read the terraform state file
# all id's
jq '.resources[].instances[].attributes.id?' terraform.tfstate
# all display names
jq '.resources[].instances[].attributes.display_name?' terraform.tfstate
# all environment id's
jq '.resources[].instances[].attributes.environment[]?.id'