Skip to content

Instantly share code, notes, and snippets.

View major's full-sized avatar
🤠
Yeehaw.

Major Hayden major

🤠
Yeehaw.
View GitHub Profile
@major
major / el9.txt
Created July 3, 2023 15:37
websockets missing modules
+ /usr/bin/python3 -s /usr/lib/rpm/redhat/import_all_modules.py -f /builddir/build/BUILD/python-websockets-11.0.3-2.el9.x86_64-pyproject-modules
Check import: websockets
Check import: websockets.speedups
@major
major / Caddyfile
Last active June 15, 2023 14:24
Caddy + Watchtower + Wordpress + MariaDB
example.com {
tls major@mhtx.net
root * /var/www/html
php_fastcgi wordpress:9000
encode gzip
file_server
@disallowed {
path *.sql
path /wp-content/uploads/*.php
@major
major / aws_ec2_pricing_pandas.py
Created May 25, 2023 19:24
EC2 Linux pricing into CSV
#!/usr/bin/env python
import json
import pandas as pd
df = pd.read_csv(
"us-east-1.csv",
header=5,
usecols=[
"Instance Type",
"vCPU",
@major
major / playlist.csv
Created April 27, 2023 13:39
Spotify - Heavy Queens playlist
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
"Track URI","Track Name","Artist URI(s)","Artist Name(s)","Album URI","Album Name","Album Artist URI(s)","Album Artist Name(s)","Album Release Date","Album Image URL","Disc Number","Track Number","Track Duration (ms)","Track Preview URL","Explicit","Popularity","ISRC","Added By","Added At"
"spotify:track:2Rw6wkd0q3LXx5xsdjLs1P","Monochrome","spotify:artist:630wzNP2OL7fl4Xl0GnMWq","BABYMETAL","spotify:album:6IoOqdEHdwLgfUONXeYvoI","Monochrome","spotify:artist:630wzNP2OL7fl4Xl0GnMWq","BABYMETAL","2022-11-17","https://i.scdn.co/image/ab67616d0000b2738e02c7c47138ffbcbb4183fa","1","1","237354","https://p.scdn.co/mp3-preview/ab2c2b09f9fa3c49b8fdb8ef384829f380571e36?cid=9950ac751e34487dbbe027c4fd7f8e99","false","60","JPTF02224108","spotify:user:","2022-11-18T01:31:53Z"
"spotify:track:2Ez8SNfzrw2bwkrZTx5B5j","Paralyzed","spotify:artist:4ZznAOb4aE3va5Jz1iDpjc","Conquer Divide","spotify:album:0DiNp9OwAkJTfYOICCyHcZ","Paralyzed","spotify:artist:4ZznAOb4aE3va5Jz1iDpjc","Conquer Divide","2022-10-26","https://i.scdn.co/ima
@major
major / azure-cli-core-test-output.txt
Created June 24, 2022 15:26
azure-cli-core test output on 3.11.0b3
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 '
+ PATH=/builddir/build/BUILDROOT/azure-cli-2.37.0-1.fc37.noarch/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
+ PYTHONPATH=/builddir/build/BUILDROOT/azure-cli-2.37.0-1.fc37.noarch/usr/lib64/python3.11/site-packages:/builddir/build/BUILDROOT/azure-cli-2.37.0-1.fc37.noarch/usr/lib/python3.11/site-packages
+ PYTHONDONTWRITEBYTECODE=1
+ PYTEST_ADDOPTS=' --ignore=/builddir/build/BUILD/azure-cli-azure-cli-2.37.0/.pyproject-builddir'
+ /usr/bin/pytest -n auto src/azure-cli-
In [10]: yf.Ticker("NQ=F").info
Out[10]:
{'exchange': 'CME',
'shortName': 'Nasdaq 100 Jun 22',
'exchangeTimezoneName': 'America/New_York',
'exchangeTimezoneShortName': 'EDT',
'isEsgPopulated': False,
'gmtOffSetMilliseconds': '-14400000',
'underlyingSymbol': 'NQM22.CME',
'quoteType': 'FUTURE',
@major
major / charts.md
Last active September 22, 2022 15:08
Charts
@major
major / screenshot-upload.sh
Created November 19, 2021 14:16
Screenshot uploads to Backblaze B2 with Cloudflare CDN caching
#!/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"
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
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