Skip to content

Instantly share code, notes, and snippets.

@WebDragon
WebDragon / makeboothdates.pl
Created January 27, 2025 22:47
Generate a list of table/booth seatings for copy-paste via macros into a ticketing system for valentines day week so as to ease the burden of data entry by pre-generating the repetitive bits along with the changing ones
#!/usr/bin/perl
# MakeBoothDates - Scott R. Godin for MAD House Graphics
# generate booth/table text for hand-copying laboriously into the somewhat archaically designed
# bentobox ticket information options
use warnings;
use strict;
use v5.16;
use Getopt::Long;
@WebDragon
WebDragon / sshdsecure.pl
Created December 16, 2024 19:19
inspect /var/log/secure looking for connection attempts happening in egregious numbers and report those counts so we can proactively block them and also look them up in GEOIP bulk lookup
#!/usr/bin/perl
use warnings;
use strict;
use v5.16;
use DateTime qw();
use Regexp::Common qw(net);
use Sort::Key::IPv4 qw(ipv4sort);
# default daysago = 1, mincount = 80
my ( $daysago, $min, $monthdate, %addrs, $verbose, $help, $usage ) = ( 1, 80 );
@WebDragon
WebDragon / binarytest.pl
Created September 9, 2024 16:07
speed test for unpacking binary data into text
#!/usr/bin/perl
use warnings;
use strict;
use v5.36;
print pack('B8', $_) for map { split(/\s+/, $_) } <DATA>;
__DATA__
01010111 01100101 00100111 01110010 01100101 00100000 01101110 01101111 00100000 01110011 01110100 01110010 01100001 01101110 01100111 01100101 01110010 01110011 00100000 01110100
01101111 00100000 01101100 01101111 01110110 01100101 00001010 01011001 01101111 01110101 00100000 01101011 01101110 01101111 01110111 00100000 01110100 01101000 01100101 00100000
@WebDragon
WebDragon / wordlehelper.pl
Last active July 11, 2024 16:37
a stab at a commandline wordle helper in the absence of an actual list of wordle words
#!/usr/bin/perl
use warnings;
use strict;
use v5.18;
use Getopt::Long;
my ($exact, $letterlist, $not, @letters, @miss);
GetOptions (
@WebDragon
WebDragon / stylus_for_gmail_ads.md
Last active July 14, 2024 14:43
Use Stylus to highlight which lines in your email are now Ads in Gmail, so you are less likely to click on them accidentally but still can go view the ad if you want.

Ads! In my Gmail! Mixed in with the rest?! Hooligans!

So I used this little chrome extension called Stylus to add a style to any mail.google.com/* domain, which subsequently fixes that problem for me by highlighting the sponsored links in such a way that I won't accidentally click on them, while they're mixed in randomly with my email.

https://chromewebstore.google.com/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne?pli=1

tr:has( td > div.yW span.aPd ), 
tr:has( td > div.yW span.ast ) {
 background: palevioletred;
@WebDragon
WebDragon / .htaccess
Created November 15, 2023 00:45
force https but allow validation from LetsEncrypt among others
# Force HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
@WebDragon
WebDragon / formsample.html
Last active September 20, 2023 15:59
Javascript and css to take required and placeholder-shown fields and mark them with warning colors automatically, and clear the marks after they are valid fields
<form action="" enctype="multipart/form-data" method="post">
<p>
<label for="name">Name: </label>
<input id="name" name="name" required="" size="65" type="text" />
</p>
<p>
<label for="jobtitle">Job Title:</label>
<input id="jobtitle" name="jobtitle" required="" size="65" type="text" />
</p>
<p>
@WebDragon
WebDragon / iptrack.pl
Last active December 16, 2024 19:50
inspect /var/log/secure and look for attempts on root, N days ago, and report if an IP attempted access more than X times, and additionally check for an entry in /etc/csf/csf.deny
#!/usr/bin/perl
use warnings;
use v5.16;
use Sort::Key::IPv4 qw(ipv4sort);
my (%ipcounts, $monthdate);
my ($min, $daysago, $verbose, $help, $usage) = ( 8 , 1 );
use Getopt::Long;
use Pod::Usage;
#!/usr/bin/perl
## Author: Scott R. Godin - MAD House Graphics
## Created: Wed Nov 9 12:42:52 EST 2022
## Last Updated: Fri, Nov 11, 2022 11:32:04 AM
use warnings;
use strict;
use Getopt::Long;
use Pod::Usage;
use Regexp::Common qw/ number /;
use POSIX qw/ ceil /;
@WebDragon
WebDragon / latest.log
Created November 12, 2021 06:08
latest.log with minecolonies AI exception for gravedigger, from minecolonies-1.0.118-ALPHA-universal
[12Nov2021 01:00:52.741] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, WebDragonG3, --version, 1.16.5-forge-36.2.2, --gameDir, C:\Users\macte\AppData\Local\.ftba\instances\9ee2def6-6bd9-448f-9ce5-906fbdf17fc8, --assetsDir, C:\Users\macte\AppData\Local\.ftba\bin\assets, --assetIndex, 1.16, --uuid, bbaca6f71b4e47ef982cee3e559736a8, --accessToken, ????????, --userType, mojang, --versionType, release, --width, 1680, --height, 1050, --launchTarget, fmlclient, --fml.forgeVersion, 36.2.2, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20210115.111550]
[12Nov2021 01:00:52.747] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 8.0.9+86+master.3cf110c starting: java version 1.8.0_51 by Oracle Corporation
[12Nov2021 01:00:52.770] [main/WARN] [cpw.mods.modlauncher.SecureJarHandler/]: LEGACY JDK DETECTED, SECURED JAR HANDLING DISABLED
[12Nov2021 01:00:53.419] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Adde