Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
##
# stop.py (short for Salt TOP)
# A quick and dirty way to check out running Salt-master processes without having to dig through a bunch of JSON
# Seems to work OK with Python 3
#
# Example Output:
#
# Start_Time, Key, Running, Arguments, KillString
# 2018, Jul 17 08:24:39.379270 , 20180717082439379270 , SERVER1.local , state.apply , [], KILL_STRING: salt 'SERVER1.local' saltutil.kill_job 20180717082439379270
@idlethreat
idlethreat / GraylogMessageSender.sh
Last active December 19, 2017 01:32
Graylog Message Sender
#!/bin/bash
# set your sleep in seconds. remove the sleep line to have no sleep
SLEEP="1"
# ip of your graylog server
GRAYLOG="192.168.1.1"
# loripsum.net API URL
LORIPSUM="https://loripsum.net/api/1/long/plaintext"
@idlethreat
idlethreat / content_pack.json
Created August 4, 2017 19:45
Graylog Windows Login Events
{
"name":"Windows Logon Events",
"description":"Windows Logon Events",
"category":"Windows",
"inputs":[
],
"streams":[
],
@idlethreat
idlethreat / gelf-listener.py
Last active May 23, 2022 11:26
Gelf Log Listener in Python
#!/usr/bin/env python
############### // gelfListener 0.2 // ###############
#
# Listens on UDP 12201 for Gelf messages
# Extracts the event data and writes the message to disk
# updated to handle both zlib (nxlog) and gzip (graylog server) compressed events
# not perfect, but works okay
#
# Bugs:
@idlethreat
idlethreat / gist:64e412f7ca46f8b4f949
Created July 17, 2015 02:34
Powershell Logging Loop
# Implement FreePhysicalMemory log item, if necessary. This runs once.
try
{
# create a new event log type of "FreePhysicalMemory"
[System.Diagnostics.EventLog]::CreateEventSource("FreePhysicalMemory", "System")
}
catch
{
# ignore if the above fails.
}
@idlethreat
idlethreat / gist:be2e92b465744bf78790
Created April 15, 2015 02:48
graylog-search-for-stale-devices
#!/usr/bin/env python
import requests
import sys
from gelfclient import UdpClient
# Please install the latest Python Requests and gelfclient libraries to take advantage of this script
# http://docs.python-requests.org/
# https://github.com/Graylog2/gelfclient