Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
Yeehaw.

Major Hayden major

🤠
Yeehaw.
View GitHub Profile
@major
major / ca.py
Last active Nov 25, 2021
Making a certificate authority (CA) with python cryptography
View ca.py
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.x509.oid import NameOID
import datetime
import uuid
one_day = datetime.timedelta(1, 0, 0)
private_key = rsa.generate_private_key(
public_exponent=65537,
@major
major / screenshot-upload.sh
Created Nov 19, 2021
Screenshot uploads to Backblaze B2 with Cloudflare CDN caching
View screenshot-upload.sh
#!/bin/bash
set -euxo pipefail
# Set up the local filename and path.
FILE_STRING=$(date +%s | sha256sum | cut -c1-8)
FILE_NAME="${FILE_STRING}.png"
SCREENSHOT_PATH="/home/major/Pictures/screenshots/${FILE_NAME}"
# Configure the B2/CDN details.
CDN_URL="https://cdn.major.io"
View solar_puts.md
Ticker Strike Exp Date DTE Bid PoP % Ret. % Annual %
SPWR_011521P27 27 2021-01-15 7 0.58 75.1 2.2 114.5
SPWR_011521P26.5 26.5 2021-01-15 7 0.44 79.1 1.7 88
SPWR_011521P26 26 2021-01-15 7 0.35 82.7 1.4 71.2
SPWR_011521P25.5 25.5 2021-01-15 7 0.29 85.6 1.2 60
SPWR_011521P25 25 2021-01-15 7 0.22 88.5 0.9 46.3
TAN_021921P103 103 2021-02-19 42 4.4 75.5 4.5 38.8
CSIQ_011521P50.5 50.5 2021-01-15 7 0.35 85.9 0.7 36.4
TAN_021921P102 102 2021-02-19 42 4 76.8 4.1 35.5
View foo.md
Ticker Strike Exp Date DTE Bid PoP % Ret. % Annual %
CSIQ_011521P52.5 52.5 2021-01-15 7 0.7 75.9 1.4 70.5
CSIQ_011521P52 52 2021-01-15 7 0.6 78.8 1.2 60.9
CSIQ_011521P51.5 51.5 2021-01-15 7 0.45 81 0.9 46
CSIQ_011521P51 51 2021-01-15 7 0.4 83.8 0.8 41.2
ENPH_021921P175 175 2021-02-19 42 7.8 77.4 4.7 40.5
TAN_021921P103 103 2021-02-19 42 4.4 75.5 4.5 38.8
CSIQ_011521P50.5 50.5 2021-01-15 7 0.35 85.9 0.7 36.4
TAN_021921P102 102 2021-02-19 42 4 76.7 4.1 35.5
View foo.md
Ticker Strike Exp Date DTE Bid PoP % Ret. % Annual %
NIO_011521P54 54 2021-01-15 7 1.86 71.9 3.6 186
NIO_011521P53.5 53.5 2021-01-15 7 1.67 73.8 3.2 168
NIO_011521P53 53 2021-01-15 7 1.51 75.7 2.9 152.9
NIO_011521P52.5 52.5 2021-01-15 7 1.35 77.6 2.6 137.6
NIO_011521P52 52 2021-01-15 7 1.2 79.4 2.4 123.2
NIO_011521P51.5 51.5 2021-01-15 7 1.07 81.1 2.1 110.6
NIO_011521P51 51 2021-01-15 7 0.95 82.8 1.9 99
NIO_011521P50.5 50.5 2021-01-15 7 0.84 84.3 1.7 88.2
@major
major / investing.md
Last active Dec 29, 2020
Major's investment links
View investing.md
@major
major / big-fella.txt
Created Aug 18, 2020
Big fella depsolve
View big-fella.txt
[root@composer ~]# composer-cli blueprints depsolve big-fella
blueprint: big-fella v0.0.9
python3-ethtool-0.14-3.el8.x86_64
libevent-2.1.8-5.el8.x86_64
libassuan-2.5.1-3.el8.x86_64
perl-Scalar-List-Utils-3:1.49-2.el8.x86_64
perl-PathTools-3.74-1.el8.x86_64
libusbx-1.0.22-1.el8.x86_64
json-glib-1.4.4-1.el8.x86_64
snappy-1.1.7-5.el8.x86_64
@major
major / weather.sh
Created Jul 29, 2020
Weather + alerts lookup for i3 status bar
View weather.sh
#!/bin/bash
WTTR_URL="http://wttr.in/KRND?format=j1"
WTTR_JSON=/tmp/weather-wttr.json
ALERTS_URL=https://api.weather.gov/alerts/active/zone/TXZ207
ALERTS_JSON=/tmp/weather-alerts.json
UPDATE_JSON=yes
if [[ -f $WTTR_JSON ]]; then
View gist:a08e8cdb5bc6f02e8562473b8f033144
[root@ip-172-31-9-84 ~]# dnf list all |grep selinux
libselinux.aarch64 2.9-3.el8 @anaconda
libselinux-utils.aarch64 2.9-3.el8 @anaconda
python3-libselinux.aarch64 2.9-3.el8 @anaconda
rpm-plugin-selinux.aarch64 4.14.2-37.el8 @anaconda
selinux-policy.noarch 3.14.3-41.el8_2.2 @anaconda
selinux-policy-targeted.noarch 3.14.3-41.el8_2.2 @anaconda
container-selinux.noarch 2:2.124.0-1.module+el8.2.0+6368+cf16aa14 rhel-8-appstream-rhui-rpms
flatpak-selinux.noarch 1.
View gist:60828f200413f3cd6e5b62a393c42bd1
~/Downloads ➜ virt-filesystems --all --long -a osbuild-aws-pass.vhdx
Name Type VFS Label MBR Size Parent
/dev/sda1 filesystem xfs - - 6430916608 -
/dev/sda1 partition - - 83 6441402368 /dev/sda
/dev/sda device - - - 6442450944 -
~/Downloads took 8s ➜ virt-filesystems --all --long -a osbuild-aws-fail.vhdx
Name Type VFS Label MBR Size Parent
/dev/sda1 filesystem xfs - - 6430916608 -
/dev/sda1 partition - - 83 6441402368 /dev/sda
/dev/sda device - - - 6442450944 -