Skip to content

Instantly share code, notes, and snippets.

View AfroThundr3007730's full-sized avatar
🔧
Hacking all the things...

Eddie Carswell AfroThundr3007730

🔧
Hacking all the things...
View GitHub Profile
@AfroThundr3007730
AfroThundr3007730 / fix_ads_perms_flags.py
Last active May 2, 2026 14:41
Python script to convert ADS ACLs dumped in JSON format to human readable syntax
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-3.0-or-later
# For issues or updated versions of this script, browse to the following URL:
# https://gist.github.com/AfroThundr3007730/958f17bce3c631df233b14a05159d194
"""Convert ADS ACLs to human readable syntax"""
__author__ = "AfroThundr"
__modified__ = "2026-04-30"
@AfroThundr3007730
AfroThundr3007730 / Set-TokenPrivilege.ps1
Created April 16, 2026 00:04
Adjust the token privileges of a process
# Source: https://www.leeholmes.com/adjusting-token-privileges-in-powershell/
Set-StrictMode -Version Latest
enum TokenPrivilege {
SeAssignPrimaryTokenPrivilege
SeAuditPrivilege
SeBackupPrivilege
SeChangeNotifyPrivilege
SeCreateGlobalPrivilege
@AfroThundr3007730
AfroThundr3007730 / Invoke-ComObject.ps1
Last active April 18, 2026 18:27
Several powershell functions to invoke methods on raw COM objects
# Several powershell functions to invoke methods on raw COM objects
# Last updated 2026-04-18 by AfroThundr
# From: https://stackoverflow.com/questions/20248032/
Set-StrictMode -Version Latest
function Invoke-ComObject {
<# .SYNOPSIS
Invoke a method on a COM object or get/set a property #>
@AfroThundr3007730
AfroThundr3007730 / report_logger.md
Last active April 8, 2026 03:32
A basic Flask server to receive network reports

Installation steps

  • Make the directory /opt/reports/logs

  • Add configuration to /opt/reports/logger.env

    FLASK_APP=report_logger
    FLASK_RUN_HOST=0.0.0.0
    FLASK_RUN_PORT=5001
@AfroThundr3007730
AfroThundr3007730 / streamlink-save.sh
Last active April 6, 2026 23:17
Save Twitch live streams via streamlink
@AfroThundr3007730
AfroThundr3007730 / gen_services_lookup.md
Created March 27, 2026 00:27
Convert /etc/sevices to CSV lookup file

Convert /etc/sevices to CSV lookup file

out=$SPLUNK_HOME/etc/apps/search/lookups/services.csv
awk 'BEGIN {
        print "port,proto,port_name,port_desc"
    } NR > 1 && $0 !~ /^(#|\s*$)/ {
        split($2, p, "/")
        name=$1
 port=p[1]
@AfroThundr3007730
AfroThundr3007730 / zfs-module-build.service
Last active April 12, 2026 02:32
Build binary zfs-module packages for all kernel packages
[Unit]
Description=Build binary ZFS module packages and publish repo
RequiresMountsFor=/mnt/pool0/data/app /mnt/pool0/mirror/repo
[Service]
Type=exec
Restart=no
TimeoutSec=10
ExecStart=/mnt/pool0/data/app/repo/debian-zfs/bin/zfs-module-build -y
EnvironmentFile=-/mnt/pool0/data/app/repo/debian-zfs/etc/environment
@AfroThundr3007730
AfroThundr3007730 / create-pki-certs.sh
Last active January 13, 2026 15:19
Generating x509 PKI certs inline
#!/bin/bash
config='
[ca_cert]
basicConstraints=critical,CA:true,pathlen:1
authorityKeyIdentifier=keyid:always,issuer
subjectKeyIdentifier=hash
keyUsage=critical,keyCertSign,cRLSign
[sign_cert]
@AfroThundr3007730
AfroThundr3007730 / vod-splice.sh
Last active February 17, 2026 20:47
Splice VOD list via ffmpeg (in remote container)
#!/bin/bash
# Splice VOD list via ffmpeg (in remote container)
set -euo pipefail
shopt -s extdebug
export REMOTE=debsrv01.dm4productions.com
export VOD_DIR=/mnt/pool0/media/archive/twitch
export OHNO=twitch_disconnect_4s.m2t
@AfroThundr3007730
AfroThundr3007730 / fix_json_dates.py
Last active April 24, 2026 05:36
Fixup JSON dates exported by .NET JavaScriptSerializer
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-3.0-or-later
# For issues or updated versions of this script, browse to the following URL:
# https://gist.github.com/AfroThundr3007730/1ec8a10df9345b337c19363a8094ab04
"""
Fixup JSON dates exported by .NET JavaScriptSerializer
Example input file: