This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 python3 | |
| import json | |
| import re | |
| import subprocess | |
| import libzfs | |
| zfs = libzfs.ZFS() |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Add-Type @' | |
| using System; | |
| using System.Runtime.InteropServices; | |
| using System.Security.Principal; | |
| public class LsaUtility | |
| { | |
| [DllImport("advapi32.dll")] | |
| private static extern int LsaOpenPolicy( | |
| ref LSA_UNICODE_STRING sysName, |
This file contains hidden or 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 hidden or 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" |