apt install p11-kit
sudo mv /usr/lib/firefox/libnssckbi.so /usr/lib/firefox/libnssckbi.so.bak
sudo ln -s /usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-trust.so /usr/lib/firefox/libnssckbi.so
[Unit] | |
Description=Maintain a reverseit SSH connection | |
After=network.target | |
StartLimitBurst=5 | |
# This line disables the "stop forever" start back off | |
StartLimitIntervalSec=0 | |
[Service] | |
Type=simple |
apt install p11-kit
sudo mv /usr/lib/firefox/libnssckbi.so /usr/lib/firefox/libnssckbi.so.bak
sudo ln -s /usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-trust.so /usr/lib/firefox/libnssckbi.so
Script for bulk cloning of Github repositories.
# Generate a 128-bit identifier, encoded entirely in b32 lowercase. No special characters. | |
function safeid() { | |
python3 -c 'import uuid, base64 ; print(base64.b32encode(uuid.uuid4().bytes).lower().rstrip(b"=").decode())' | |
} |
import argparse | |
import json | |
class KeyValueJsonAction(argparse.Action): | |
""" | |
Argparse action for generating dictionaries from key-value args with JSON support | |
""" | |
def __call__(self, parser, namespace, values, option_string=None): | |
result = {} | |
for entry in values: |
# See: https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself | |
# Note: you can't refactor this out: its at the top of every script so the scripts can find their includes. | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done | |
SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" |
cmd = [] | |
env = os.environ.copy() | |
p = subprocess.Popen( | |
cmd, env=env, cwd=os.path.realpath(os.curdir), stdin=sys.stdin, stderr=sys.stderr, stdout=sys.stdout | |
) | |
# Attach all signals and forward them to the subprocess | |
def sighandler(signum, stack): | |
p.send_signal(signum) |
def boto_results(key, fn, *args, **kwargs): | |
result = [] | |
next_token = None | |
while True: | |
r = fn(*args, **kwargs) | |
next_token = r.get("NextToken") | |
value = r[key] | |
if isinstance(value, (str, bytes)): | |
result.append(value) | |
elif isinstance(value, Mapping): |
#!/usr/bin/env python | |
# liuw | |
# Nasty hack to raise exception for other threads | |
import ctypes # Calm down, this has become standard library since 2.5 | |
import threading | |
import time | |
NULL = 0 |
from dataclasses import dataclass, field | |
from typing import List, Optional, ClassVar, Type, Union | |
import marshmallow_dataclass | |
import marshmallow_union | |
from marshmallow import fields | |
from marshmallow.validate import Equal | |
from marshmallow_polyfield import PolyField | |
from marshmallow_toplevel import TopLevelSchema |