This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from concurrent import futures | |
import collections | |
import time | |
def job(job_id): | |
time.sleep(job_id) | |
return job_id | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import re | |
with open("AARON1.DAT", "r") as f: | |
workoutfile = f.read().strip() | |
workouts_json = "[" + workoutfile.replace(" }\n}\n{", "},\n{").replace("}\n{", "},\n{").strip()[0:-1] + "]" | |
try: | |
workouts = json.loads(workouts_json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ ! -d ~/code/aws-login-windows ]]; then | |
mkdir -p ~/code/aws-login-windows | |
git clone https://github.com/Root-App/aws-login-windows.git ~/code/aws-login-windows | |
fi | |
pushd ~/code/aws-login-windows | |
git pull | |
popd | |
if [[ "$ZSH_NAME" != "" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find(func, i): | |
""" | |
Finds the first match in an iterable | |
Works like `filter` but returns a single item | |
""" | |
try: | |
return next(filter(func, i)) | |
except StopIterator: | |
raise ValueError("No matching item found") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# In[27]: | |
import logging | |
import json | |
import requests | |
import uuid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspired by https://github.com/ejsiron/hvkvp | |
# explanation of format https://www.altaro.com/hyper-v/key-value-pair-data-exchange-3-linux/ | |
# pool_3 host->guest (read-only) | |
with open("/var/lib/hyperv/.kvp_pool_3", "r") as f: | |
data = f.read() | |
# Each k, v is a nul terminated string. k is 512 bytes, v 2048 bytes | |
# so 2560 bytes is a single item | |
n = 2560 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up a jail | |
iocage create -r 12.1-RELEASE -n wheelhouse | |
iocage set dhcp=on bpf=on vnet=on wheelhouse | |
iocage start wheelhouse | |
# Build some wheels inside the jail | |
iocage console wheelhouse | |
env ASSUME_ALWAYS_YES=yes pkg update | |
pkg install -y python38 libzmq4 bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1/bin/sh | |
# --line-buffer to prevent json from accidentally getting split in the middle | |
# -n 128 cat-ing large quantities of files is faster since the programs aren't re-invoked as often (too high and you risk not using all the threads in the final batches) | |
# -P 125% slightly over subscribe the CPU to lessen the chance of wasting cycles if something becomes blocked | |
# -q -m 4M make a small file buffer to smooth out I/O (don't make it too large as a single cat process could starve the other threads) | |
# -rc for single line per json object and "raw" output | |
# final jq is just to format and colorize the results | |
# zcat can be used to read json.gz files. This examples read off zfs compressing with zstd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Section "InputClass" | |
Identifier "DELL08AF:00 06CB:76AF Touchpad" | |
MatchProduct "DELL08AF:00 06CB:76AF Touchpad" | |
MatchIsTouchpad "on" | |
MatchOS "Linux" | |
MatchDevicePath "/dev/input/event*" | |
Driver "mtrack" | |
#Option "Ignore" "on" | |
Option "IgnorePalm" "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
encrypted_file=some_file | |
cert=certificate.pem | |
openssl x509 -pubkey -noout -in $cert -out certificate.key | |
openssl rsautl -pubin -inkey certificate.key -in some_file |