Skip to content

Instantly share code, notes, and snippets.

@nerdegem
nerdegem / gist:6c919288c32de469b4c63b2a45a045f9
Created August 22, 2025 12:40
A bash script which gets active IP addresses from the ExtremeIQ Cloud portal, and then runs the LibreNMS snmp-scan tool to ensure that any new devices are added to Libre.
#!/bin/bash
########################################
# === LOAD CONFIGURATION FROM .xiq ===
########################################
CONFIG_FILE="$HOME/.xiq"
if [[ ! -f "$CONFIG_FILE" ]]; then
echo "[ERROR] Config file $CONFIG_FILE not found."
exit 1
@nerdegem
nerdegem / block_rds_miscreants.ps1
Created August 19, 2025 11:45
Reduce Bruteforce attacks on RDS Servers
# This script behaves like a tripwire, somewhat replicating the Fail2Ban capabilities on Linux, and can be called on a regular interval on an RDS Server
# or in fact, any IIS Server, if there is a regular abuse of URLs, by modifying the target URL and POST
# to parse through the log files and generate a unique list of IPs. This may then be read by your firewall (the standard output is Palo-Alto compatible)
# and used as a dynamic blocking list to reduce the number of successful brute force attacks
# Configurable Parameters
$logDir = "C:\\inetpub\\logs\\LogFiles\\W3SVC1"
$targetUrl = "/RDWeb/Pages/en-US/login.aspx"
$method = "POST"
@nerdegem
nerdegem / checklibredbrrd.sh
Created July 16, 2025 09:25
Checks LibreNMS post move, to compare hosts recorded in the database with the rrd directory to ensure that they match.
#!/bin/bash
# Set LibreNMS directory
LIBRENMS_DIR="/opt/librenms"
RRD_DIR="$LIBRENMS_DIR/rrd"
ENV_FILE="$LIBRENMS_DIR/.env"
# Extract DB credentials from .env
DB_HOST=$(grep DB_HOST "$ENV_FILE" | cut -d '=' -f2 | tr -d '"')
DB_USER=$(grep DB_USERNAME "$ENV_FILE" | cut -d '=' -f2 | tr -d '"')
@nerdegem
nerdegem / ffmpegbuildopts
Last active September 17, 2025 09:20
FFMpeg VAAPI Build-opts
./configure --enable-nonfree --enable-gpl --enable-libx264 --enable-libx265 --enable-libxvid --enable-libass --enable-libmp3lame --enable-libvpx --enable-openssl --enable-libvorbis --enable-libopus --enable-libdav1d --enable-libwebp --enable-libtheora --enable-libxcb --enable-zlib
And Deb Packages---
apt install -y autoconf automake build-essential cmake git libtool pkg-config libx264-dev libx265-dev libxvidcore-dev libass-dev libmp3lame-dev libvpx-dev libssl-dev libvorbis-dev libopus-dev libdav1d-dev libwebp-dev libtheora-dev libx11-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev texinfo zlib1g-dev
@nerdegem
nerdegem / IRS.m3u8
Last active May 25, 2025 22:20
Internet Radio Stations
#EXTM3U
# URLs from https://fmstream.org/index.php
#EXTINF:-1,Kiss FM
https://s9.nexuscast.com:9565/kissfm.ogg
#EXTINF:-1,Radio X UK
https://ice-sov.musicradio.com/RadioXLondon
#EXTINF:-1,Planet Rock
https://edge-bauerall-01-gos2.sharp-stream.com/planetrock.aac
#EXTINF:-1,Greatest Hits Radio
https://edge-bauerall-01-gos2.sharp-stream.com/net2westmidlands.aac
@nerdegem
nerdegem / hdhometables.txt
Created April 26, 2025 11:17
HDHomeRun - IPTables proxy
# These rules seem to work well for passing HDHomeRun traffic beyond the local LAN network, especially if your TVHeadend Proxy is on a separate VLAN.
# This applies DSCP tagging to the packet to mark it as streamed video (CS3) if the intermediary devices support QoS
# It changes the TTL from ~2 hops from the HDHomeRun to a more sensibe 64
# It then connects the main traffic from the proxy server to the HDHomeRun IP.
# Should sit in the IPTables location (often /etc/iptables/rules.v4)
# Generated by iptables-save v1.8.9 (nf_tables) on Sat Jan 01 00:01:02 2023
*mangle
:PREROUTING ACCEPT [0:0]
@nerdegem
nerdegem / get-pnpdevice
Created April 2, 2025 08:27
Use PowerShell to get Connected Devices
Use PowerShell to get Connected Devices
Get-PnpDevice will return all Plug and Play devices registered on a computer.
Return connected screens:
Get-PnpDevice -Class Monitor -PresentOnly
Return USB devices:
Get-PnpDevice -Class USB -PresentOnly
@nerdegem
nerdegem / gist:72630c1bf9cd3bac670475f7e5b0da57
Created March 8, 2025 15:10
Monitoring CPU Temperature on GL-iNet x3000 router with snmp
This is tested using LibreNMS.
1) Install SNMPD and any related packages
2) Follow the LibreNMS guide for installing the OpenWRT extend packages
https://docs.librenms.org/Support/Device-Notes/Openwrt/
3) cat /proc/gl-hw-info/temperature and see where the temperature probe lives
4) add the following to the /etc/config/snmpd config you created in section 2).2
where the second prog parameter is the path found in 3), e.g.
config extend
@nerdegem
nerdegem / virtualisolocation.txt
Created February 1, 2025 13:48
Finding where a Virtual ISO is mounted FROM in Windows.
If a programme mounts a virtual ISO file in Windows, and you'd like to know where that disk is stored,
Raise an elevated Powershell command and enter
get-volume [DriveLetter] | get-diskimage
E.g.
PS C:\WINDOWS\system32> get-volume F | get-diskimage
Attached : True
BlockSize : 0
@nerdegem
nerdegem / Defender.txt
Last active October 28, 2024 13:46
Onboard Deb into Microsoft Defender
##########
## Script for installing Microsoft Defender for Endpoint on Linux devices.
##
## Get your onboarding configuration from
## Security.microsoft.com
## Settings
## EndPoints
## Device Management
## Onboarding
##