Skip to content

Instantly share code, notes, and snippets.

View davidpanofsky's full-sized avatar

David Panofsky davidpanofsky

View GitHub Profile
@davidpanofsky
davidpanofsky / postal-codes.json
Last active May 24, 2022 14:00 — forked from jamesbar2/postal-codes.json
Global postal codes regex formats
[{
"Note": "The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). Afghanistan Postal code lookup",
"Country": "Afghanistan",
"ISO": "AF",
"Format": "NNNN",
"Regex": "^\\d{4}$"
}, {
"Note": "With Finland, first two numbers are 22.",
"Country": "Åland Islands",
"ISO": "AX",
@davidpanofsky
davidpanofsky / openssl-notes.txt
Created June 15, 2020 23:51 — forked from tsaarni/openssl-notes.txt
Generate self-signed certs with different key types
*** RSA
# Generate self-signed certificate with RSA 4096 key-pair
openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout rsakey.pem -out rsacert.pem
# print private and public key
openssl rsa -in rsakey.pem -text -noout
# print certificate
openssl x509 -in rsacert.pem -text -noout
@davidpanofsky
davidpanofsky / helpers.bash
Last active November 30, 2022 15:41 — forked from wwaltersp/helpers.bash
SP bash helpers
# Latest version can be used by adding following command to your ~/.bash_profile:
# eval "$(curl -s https://gist.githubusercontent.com/davidpanofsky/a50689c0b500f43c3d7c92a5f6303fdd/raw/helpers.bash)"
# prefer brew installed awscli over local virtualenv
if [ -x /usr/local/bin/aws ]; then
AWS=/usr/local/bin/aws
else
AWS=aws
fi
@davidpanofsky
davidpanofsky / alb.sql
Created June 17, 2017 15:40 — forked from duckworth/alb.sql
AWS ALB Logs Athena RegexSerDe
CREATE EXTERNAL TABLE IF NOT EXISTS alb_logs (
type string,
timestamp string,
elb string,
client_ip string,
client_port int,
target_ip string,
target_port int,
request_processing_time double,
target_processing_time double,