Skip to content

Instantly share code, notes, and snippets.

View seansummers's full-sized avatar
:octocat:
South Bend, IN

Sean Summers seansummers

:octocat:
South Bend, IN
View GitHub Profile
Job Description
Job Title
AWS Sr. Software Engineer – Specialty (M1S)
Location
La Crosse, WI or Telecommute
JOB SUMMARY
@seansummers
seansummers / case_insensitive_dict.py
Last active September 8, 2024 14:19
Utility Functions in Python
from collections import UserDict
class CaseInsensitiveDict(UserDict):
"""Dict that preserves key case, but will compare and set insensitively.
>>> 'test' in CaseInsensitiveDict({'Test':'value'})
True
>>> CaseInsensitiveDict({'Test':'value'})['teSt']
'value'
>>> d = CaseInsensitiveDict({'Test':'value'})
Title: Customer Experience Operations Engineer
Position Overview:
Our Technical Support Department is recognized globally for delivering premier support. Support is of substantial importance to the business of all WebPros brands. The CX Operations Engineer facilitates and enables front-line Support staff through the development, administration, and maintenance of essential back-end systems. This role additionally performs a variety of complex tasks utilizing discretion and independent judgment to support high impact WebPros customers, including consulting with customers and development to determine system functional specifications, analyzing and recommending system changes, coaching and training members of Technical Support, and will collaborate with the rest of the CX Operations team to ensure any issues are resolved as effectively as possible. The CX Operations Engineer additionally manages internal support systems & scripts by analysis, recommendations, and modifications of these tools.
Responsibilites
@seansummers
seansummers / plugin_architecture.md
Created August 1, 2024 13:53 — forked from dorneanu/plugin_architecture.md
Python: Implement basic plugin architecture with Python and importlib

Implementing a basic plugin architecture shouldn't be a complicated task. The solution described here is working but you still have to import every plugin (inheriting from the base class).

This is my solution:

Basic project structure

$ tree
# how do we get credentials in here? Who knows....
data "external" "stack" {
program = [ "xargs", "-0",
"aws", "cloudformation", "describe-stack-resource", "--output", "json",
"--query", "StackResourceDetail.{id:PhysicalResourceId}" ]
query = {
StackName: "StackName",
LogicalResourceId: "LogicalResourceName",
}
}
@seansummers
seansummers / most_recent_first.py
Created April 30, 2024 20:06
Python Test Code
from typing import List
def most_recent_first(versions: List[str]) -> List[str]:
"""Return the list of SemVers sorted by the newest first.
>>> versions = ['0.1.0','3.2.1','2.2.3','0.1.1','2.15.3']
>>> most_recent_first(versions)
['3.2.1', '2.15.3', '2.2.3', '0.1.1', '0.1.0']
"""
import doctest
@seansummers
seansummers / naovid-flatcar.ign
Last active January 25, 2022 13:24
PXE configs
systemd:
units:
- name: etcd2.service
enable: true
etcd:
discovery: https://discovery.etcd.io/cfb401f0c192894e72c78cbd03a65442
passwd:
users:
- name: core
ssh_authorized_keys:
@seansummers
seansummers / walk.py
Last active August 17, 2021 01:23
Walk a Visitor to Leaves on a Graph in Python
from collections.abc import MutableMapping, MutableSequence
from typing import Callable, Iterable, Union
MutableCollection = Union[MutableMapping, MutableSequence]
Visitor = Callable[[str], str] # we only support string scalars for now
def visit(value: str) -> str:
"""Visit a string scalar, and mutate it if needed before returning it."""
if len(value) > 4: # example criteria
@seansummers
seansummers / jwks2asn1.py
Last active October 26, 2021 12:32 — forked from jonlundy/conv.py
JWKS parsing
#!/usr/bin/env python3
#
# openssl asn1parse -noout -out private_key.der -genconf <(python jwks2asn1.py private_key.json)
# openssl rsa -in private_key.der -inform der > private_key.pem
#
# rfc7517.3 : urlsafe_b64decode
# rfc7517.A.1 : ints are big-indian
#
import base64
@seansummers
seansummers / s3_buffered_writer.py
Last active September 24, 2023 23:31
S3 Utilities
import contextlib
import os
import tempfile
half_lambda_memory = 10**6 * (
int(os.getenv('AWS_LAMBDA_FUNCITON_MEMORY_SIZE', '0')) / 2)
@contextlib.contextmanager