Skip to content

Instantly share code, notes, and snippets.

View JadedDragoon's full-sized avatar

Jeremy Armstrong JadedDragoon

  • Alabama, USA
View GitHub Profile
@JadedDragoon
JadedDragoon / suricata-alert-mail.pl
Last active March 5, 2020 21:33
A script for automating sending suricata alerts via email.
#!/usr/bin/env perl
use strict;
#
# Script for parsing json data from suricata-eve log lines and mailing them to
# the configured email address.
#
# Exit Codes:
# 0 - success
# >0 - failure
#
@JadedDragoon
JadedDragoon / _etc_dhcpcd.exit-hook
Last active February 10, 2022 18:53
Robust scripts for managing DHCP6-PD templating for configurations which must have the actual IPv6 address. Requires jq, tsp, and dhcpcd.
#!/bin/bash
# we need seperate logging because dhcpcd-run-hooks eats stdout and stderr
# rather doing something sane like passing it back to dhcpcd (and then systemd)
. /usr/local/lib/logging.bash
################################################################################
# Configuration begins here.
################################################################################
. /usr/local/etc/dhcp-template.conf
@JadedDragoon
JadedDragoon / svg-inliner.php
Last active May 5, 2022 12:29
WordPress filter to convert image tags for locally-hosted SVG files into inline SVG (and thus enabling the SVG to be styled with CSS)
<?php
/*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
@JadedDragoon
JadedDragoon / vi-jumboframe.sh
Last active September 17, 2017 11:34
A requested script for setting jumbo frames on thousands of unknowable interfaces
#!/bin/bash
#===============================================================================
# MIT License
#
# Copyright (c) 2017 Jeremy Cliff Armstrong
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@JadedDragoon
JadedDragoon / badips-ipset.sh
Last active June 10, 2020 17:48
A script to create and update an ipset with ip addresses retrieved from the badips.com blacklist. (With just a little effort should work with url to any source of IPs separated by newlines)
#!/bin/bash
# Script for blocking IPs which have been reported to www.badips.com
# via ipsets.
#
# - THIS SCRIPT DOES NOT BLOCK ANYTHING -
# This script only updates ipsets with applicable data from
# badips.com. Actually blocking the ips in that ipset is left
# up to the user (so that you may do so however you prefer).
#
# Additionally, this script does not persist the ipsets through