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
@zcapper
zcapper / canary.yaml
Created July 1, 2020 02:05
AWS Synthetics Canary CloudFormation template
Parameters:
CanaryName:
Type: String
Default: my-canary
MaxLength: 21
Resources:
CloudWatchSyntheticsRole:
Type: AWS::IAM::Role
Properties:
@marcuscaisey
marcuscaisey / Makefile
Last active February 19, 2021 19:23
Makefile for managing Python requirements.txt with pip-tools (based on https://jamescooke.info/a-successful-pip-tools-workflow-for-managing-python-package-requirements.html)
objects = $(wildcard *.in)
outputs = $(objects:.in=.txt)
sync-targets = $(objects:%.in=sync-%)
upgrade-targets = $(objects:%.in=upgrade-%)
.PHONY: all check clean $(sync-targets) $(upgrade-targets)
all: $(outputs)
%.txt: %.in
@onyb
onyb / curve.py
Created January 9, 2020 23:21
secp256k1 Python workshop code
from dataclasses import dataclass
from field import FieldElement, PrimeGaloisField
@dataclass
class EllipticCurve:
a: int
b: int
@dorneanu
dorneanu / plugin_architecture.md
Last active April 9, 2025 16:18
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
@simpsoka
simpsoka / Leadership-CI.md
Last active December 20, 2023 15:40
This is a list of questions to check our decision making.

Do I want to die on this hill?

  • Pass: This is morally good and if not handled has long term consequences
  • Fail: This if self serving

Am I including everyone?

  • Pass: My ego is not driving this conversation
  • Fail: The people in this conversation will only tell me I'm right and not push back
@ppoffice
ppoffice / asn1.py
Last active December 19, 2023 18:13
Textbook/RAW RSA & RSA with OAEP+SHA1+MGF1 Python Implementation
from typing import Tuple
import pyasn1.codec.der.encoder
import pyasn1.type.univ
import base64
import rsa
def private_key_pem(n: int, e: int, d: int, p: int, q: int, dP: int, dQ: int, qInv: int) -> str:
'''Create a private key PEM file
@dekassegui
dekassegui / sqlite_string_split.sql
Last active December 3, 2022 19:35
SQlite only -- snippet to demonstrate how to SPLIT STRING in substrings separated with custom separators.
with separators as ( values (' '), (','), ('-'), ('.') ),
source (s) as ( select " Will, thought and action." ),
bag (q) as ( -- POSITIONS OF ALL SEPARATORS
with dim (len) as ( select length(s) from source ),
ndx (n) as (
select 1 union all select n+1 from ndx, dim where n < len
) select 0 --> PSEUDO SEPARATOR IN FRONT OF SOURCE STRING
union all select n from ndx, source where substr(s, n, 1) in separators
union all select len+1 from dim --> PSEUDO SEPARATOR AT BOTTOM
),
@dannguyen
dannguyen / README.md
Last active September 26, 2021 04:20
Using just pure SQLite, create a tidy and normalized table from a recordset in which some columns contain multiple delimited values. Kudos to Samuel Bosch for this solution http://www.samuelbosch.com/2018/02/split-into-rows-sqlite.html

Pure SQLite solution to creating a tidy/normalized data table from a column of delimited values

The problem: we have a data table in which one of the columns contains a text string that is meant to be multiple values separated by a delimiter (e.g. a comma). For example, the LAPD crime incidents data has a column named MO Codes (short for modus operandi). Every incident may have several MO's -- for example, a particular RESISTING ARREST incident may have a MO Codes value of 1212 0416, which corresponds, respectively, to: LA Police Officer and Hit-Hit w/ weapon:

![image](https://user-ima

@trexx
trexx / onc_converter.py
Last active March 13, 2023 11:23
The .ovpn to .onc converter
#!/usr/bin/python
# The .ovpn to .onc converter
# This tool parses an 'inline' OpenVPN profile (certs and keys are included within the .ovpn file)
## and spits out a Open Network Configuration file which can be imported in to ChromeOS.
# Open Network Configuration specs can be found here
## https://chromium.googlesource.com/chromium/src/+/master/components/onc/docs/onc_spec.md
# Original credit goes to Steve Woodrow (https://github.com/woodrow)
@pbzona
pbzona / vpn-cloudformation-template.yaml
Created November 14, 2017 23:43
Roll your own VPN with AWS CloudFormation - Part two
# Credit to John Creecy
# Original can be found at https://gist.github.com/zugdud/f5453af2c827eba38bb036b19e10b371
AWSTemplateFormatVersion: '2010-09-09'
Description: OpenVPN Stack
Parameters:
OpenVPNPort:
Type: Number
Default: 1194