I hereby claim:
- I am stephangarland on github.
- I am sgarland (https://keybase.io/sgarland) on keybase.
- I have a public key ASDrDTpZGTTCBe0SKCrdqbBdzYH2lC_HC0oLIxy1ZJVs9go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env bash | |
# Replace the directory on L7 with your actual location | |
echo "Stopping Plex" | |
docker stop plex | |
cd "/mnt/nvme_plex/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases" | |
existing="com.plexapp.plugins.library.db" | |
echo "Backing up $existing to $existing.bak" | |
cp $existing $existing.bak |
#!/usr/bin/env python3 | |
import argparse | |
from datetime import date | |
from PyPDF2 import PdfFileReader, PdfFileWriter | |
from PyPDF2.generic import BooleanObject, NameObject, IndirectObject | |
def setup_args(): | |
parser = argparse.ArgumentParser(description="Modify a PDF's fields for HSA contribution changes.") |
#!/usr/bin/env python3 | |
import datetime | |
import os | |
import socket | |
import subprocess | |
import sys | |
import time | |
MAC_ADDR = "0025904F3A00" |
#!/usr/bin/env bash | |
set -e | |
read -p "Enter Unifi controller's container name: " container | |
curl -s https://dlcdn.apache.org/logging/log4j/2.15.0/apache-log4j-2.15.0-bin.tar.gz -o log4j.tar.gz | |
mkdir -p ./log4j && tar xzf log4j.tar.gz -C ./log4j --strip-components=1 | |
cd log4j | |
for file in log4j-{api,core,slf4j-impl}-2.15.0.jar; do | |
docker cp "$file" "$container:/usr/lib/unifi/lib/" | |
done |
#!/usr/bin/env bash | |
remove_claim() { | |
pvc=$(export name="$1" && kubectl get pv --no-headers | awk -v name="$name" '$0~name {print $1}') | |
kubectl patch pv $pvc --type json -p '[{"op": "remove", "path": "/spec/claimRef"}]' | |
} | |
if [ -n $2 ]; then | |
namespace=$2 | |
else |
import argparse | |
from collections import deque | |
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, wait | |
from math import floor | |
from multiprocessing import Value | |
from os import urandom | |
import random | |
class Allocator: | |
def __init__(self, id_max: int): |
DELIMITER // -- This is needed so that the individual commands don't end the stored procedure | |
CREATE PROCEDURE insert_zaps(IN num_rows int, IN pct_shared float) -- Two input args are needed | |
BEGIN | |
DECLARE loop_count bigint; -- Variables are initialized with a type | |
DECLARE len_table bigint; | |
DECLARE rand_base float; | |
DECLARE rand_offset float; | |
DECLARE rand_ts timestamp; | |
DECLARE rand_user bigint; | |
DECLARE shared_with_user bigint; |
# create a simple dataset with a small record size, and chown it | |
❯ sudo zfs create -o recordsize=512 tank/foobar && sudo chown $YOUR_USER:$YOUR_GROUP tank/foobar | |
❯ cd tank/foobar | |
# make a 1K file filled with hex FF (pull from /dev/zero, then use tr to translate to FF, which is 377 in octal) | |
# if it's just zeros, there isn't much to look at with zdb | |
❯ dd if=/dev/zero bs=1k count=1 | tr "\000" "\377" >file.txt | |
1+0 records in | |
1+0 records out |