Skip to content

Instantly share code, notes, and snippets.

View LukeMurphey's full-sized avatar

Luke LukeMurphey

View GitHub Profile
@LukeMurphey
LukeMurphey / half_size_images.sh
Last active August 10, 2017 19:37
A bash script to reduce the size of images by 50% using ImageMagick
#!/bin/bash
mogrify -resize 50% "$@"
@LukeMurphey
LukeMurphey / splunkuitest.py
Last active July 27, 2019 03:14
A Python module that loads test cases that were exported from the Selenium IDE and runs them against a Splunk install.
"""
This Python script loads test cases that were generated from the SeleniumIDE and executes them
against a running Splunk install. The purpose of this script is to make it possible to run tests
against Splunk without having to write code using WebDriver directly. Instead, the intent is that
testers write tests in the Selenium IDE GUI. This ought to make tests easier to write and maintain.
This is release under the Apache 2.0 Licence:
https://www.apache.org/licenses/LICENSE-2.0
@LukeMurphey
LukeMurphey / splunk_simple_request_example.py
Last active June 1, 2017 04:15
A short example of using Splunk.rest to access the REST API #splunk
import splunk.auth
import splunk.rest
import json
# Authenticate
session_key = splunk.auth.getSessionKey(username='admin', password='changeme')
# Get lookup transforms
server_response, server_content = splunk.rest.simpleRequest('/services/data/transforms/lookups?count=0&output_mode=json', sessionKey=session_key)
@LukeMurphey
LukeMurphey / entitygroups.xml
Last active December 17, 2022 18:10
An update to 7 Days to Die that removes the stripper/party girl zombies (for A20). Place this in C:\Program Files (x86)\Steam\steamapps\common\7 Days To Die\Data\Config. This file can be recreated at any time by removing the entity nodes with the name of "zombieStripper". Originally from: http://bit.ly/2um1OL0
<?xml version="1.0" encoding="UTF-8"?>
<entitygroups>
<entitygroup name="ZombiesAll">
<entity name="zombieBoe"/>
<entity name="zombieJoe"/>
<entity name="zombieSteve"/>
<entity name="zombieTomClark"/>
<entity name="zombieMoe"/>
<entity name="zombieYo"/>
@LukeMurphey
LukeMurphey / custom_lookup.py
Created July 27, 2017 22:36
A base class that can be used for making external Splunk lookup commands #splunk
"""
This is a base-class for writing custom external lookups.
This is licensed under the Apache License Version 2.0
See https://www.apache.org/licenses/LICENSE-2.0.html
To use this, you will need to:
1) A lookup command script that implements from CustomLookup
2) Create a transforms.conf that declares your lookup command
@LukeMurphey
LukeMurphey / splunk_secure_storage_example.py
Last active May 4, 2022 19:53
An example of storing the contents of a file in the secure storage system in Splunk #splunk
import splunk.auth
import splunk.rest
import json
import hashlib
# Authenticate
session_key = splunk.auth.getSessionKey(username='admin', password='changeme')
# Read in the file
with open('password.txt', 'r') as myfile:
@LukeMurphey
LukeMurphey / splunk-search-from-python-example.py
Last active August 30, 2017 18:17
An example of kicking off a saved search from Python without using the SDK #splunk
import splunk.auth
import splunk.rest
import splunk.search
import json
import time
# Authenticate
session_key = splunk.auth.getSessionKey(username='admin', password='changeme')
search_to_run = "Errors in the last 24 hours"
@LukeMurphey
LukeMurphey / splunk_tab_focus_fix.css
Created January 24, 2018 20:00
This CSS snippet fixes the issue where the focus box on tabs looks odd in Splunk
/**
* This fixes the issue where the tab focus looks weird.
*/
.nav-tabs > li > a:focus {
box-shadow: none !important;
}
.nav-tabs > li:focus-within:after {
box-shadow: inset -2px 2px 3px rgba(82, 168, 236, .5);
}
@LukeMurphey
LukeMurphey / jira_convert_attached_tickets_to_table.js
Created January 26, 2018 20:52
A snippet of JS that converts the list of tickets attached to a table (in JIRA formatting)
$('#ghx-issues-in-epic-table td:nth-child(2)').text().replace(/\s+/gi, " | | | \n |")
@LukeMurphey
LukeMurphey / scroll_left_right_to_tab_next_back.json
Created June 27, 2018 17:55
A karabiner rule for using the mouse left and right scroll wheel to the previous and next tab
"rules": [
{
"description": "Mouse right scroll to ctrl+tab (next tab)",
"manipulators": [
{
"from": {
"pointing_button": "button5"
},
"to": [
{