Skip to content

Instantly share code, notes, and snippets.

View AlexAtkinson's full-sized avatar

Alex Atkinson AlexAtkinson

  • Toronto
View GitHub Profile
@AlexAtkinson
AlexAtkinson / pdf-extract-attachments
Last active November 27, 2024 14:06
A PDF Attachment Extractor -- BC I don't want to install Adobe...
#!/usr/bin/env python
# Copy into /usr/local/bin or as appropriate for your $PATH
import argparse
from pypdf import PdfReader
from pypdf.errors import PdfReadError
parser = argparse.ArgumentParser()
parser.add_argument("pdf", help="The PDF to extract attachments from.", type=str)
@AlexAtkinson
AlexAtkinson / REGEX.md
Last active November 25, 2024 15:25
REGEX Cheat

REGEX

Reference

Character Sets/Ranges   []                  : Match any characters within. Required expression.
Qualifiers              {}                  : Quantity or range of an expression. IE: {3}, {2,200}
Groups                  ()                  : Group expressions. Subgroups supported.
Non-Capturing Group     (?:foo)             : Does not "remember" matches. Lower overhead.
Kleen Star              *                   : May occur 0 or more times.
@AlexAtkinson
AlexAtkinson / AcceptanceCriteria.md
Created October 4, 2024 16:31
On Acceptance Criteria

On Acceptance Criteria

🗒️ An excerpt from my good, ol' Jira Team Runbook.

Acceptance Criteria tactices are ever evolving, but this is a good skeleton to start from.

  • User story
  • Functional requirements
  • Link to design docs / supporting resources
  • Technical breakdown and analysis to identify infrastructure dependencies
@AlexAtkinson
AlexAtkinson / build_mesos_agent.sh
Created September 12, 2024 14:13
BASH from the PAST: Create a Mesos Agent Instance
#!/bin/bash
# ----------------------------------------------------------------------
# /root/build_mesos-slave.sh
# mesos-master auto-build
#
# ----------------------------------------------------------------------
# Variables
# ----------------------------------------------------------------------
user="root"
dir="/root"
@AlexAtkinson
AlexAtkinson / build_mesos_master.sh
Created September 12, 2024 14:11
BASH from the PAST: Create a Mesos Master Instance
#!/bin/bash
# ----------------------------------------------------------------------
# /root/build_mesos-master.sh
# mesos-master auto-build
#
# ----------------------------------------------------------------------
# Variables
# ----------------------------------------------------------------------
user="root"
dir="/root"
@AlexAtkinson
AlexAtkinson / make-ca-cert.sh
Last active October 3, 2024 17:54
Create a CA & Server Cert
#!/usr/bin/env bash
# ----------------------------------------------------------------------------------------------------------------------
#
# make-ca-cert.sh
#
# SYNOPSIS
# Creates a CA if one doesn't already exist, and installs it (debian).
# Creats a server certificate (including wildcard SAN) signed by the CA.
#
@AlexAtkinson
AlexAtkinson / CORS.md
Last active May 29, 2024 20:58
A CORS Cheat...

CORS -- Just the edge knowledge

localhost

To set cookies on the localhost, either have a self signed cert setup (see refs), or exclude the 'secure', and 'sameSite' directives.

CORS

@AlexAtkinson
AlexAtkinson / Modernization_Dockerization Enablement.md
Last active September 18, 2024 19:47
Modernization/Dockerization Enablement

Modernization/Dockerization Hazards Enablement

Despite Digital Transformation and application modernization being well established practices, there are always unforeseen issues the creep up. This exceedingly truncated list of hazards will hopefully help identify some issues early.

💡 This is a companion to -- not a replacement for -- the decadeds of retrospective material that exists on the subject. While it's advisable to engage an outside consultancy if you're unfamiliar with the topic, tackling this list early can offset those costs as their runbook will contain similar content as they assess your application.

Resources

Here are a few vids that give more context to this issue.

@AlexAtkinson
AlexAtkinson / check_failover_dhcp.ps1
Created April 2, 2024 14:08
PS1 From The Past: Nagios DHCP Failover Check
# ----------------------------------------------------------------------
# File: check_failover_dhcp.ps1
# Description: NRPE Nagios Check for Windows Server 2012 DHCP Failover Servers
# https://exchange.nagios.org/directory/Plugins/Network-Protocols/DHCP-and-BOOTP/Windows-2012-DHCP-Failover-and-Scope-Health-Check/details
#
# Checks: Failover State
# Failover Mode
# Scope State of Each Scope
# Scope Statistics (PercentInUse) of Each Scope
#