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 multiprocessing import Pool | |
import time | |
import random | |
import collections | |
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
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
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
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
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 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
#!/usr/bin/env python3 | |
import json | |
import re | |
import subprocess | |
import libzfs | |
zfs = libzfs.ZFS() |