Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -euo pipefail
# --------- Requirements / Config ----------
: "${S3_ENDPOINT_URL:?Set S3_ENDPOINT_URL (e.g., https://<accountid>.r2.cloudflarestorage.com)}"
: "${AWS_ACCESS_KEY_ID:?Set AWS_ACCESS_KEY_ID}"
: "${AWS_SECRET_ACCESS_KEY:?Set AWS_SECRET_ACCESS_KEY}"
INPUT_BUCKET="${INPUT_BUCKET:-inputs-bucket}"
OUTPUT_BUCKET="${OUTPUT_BUCKET:-outputs-bucket}"
@Milz0
Milz0 / worker.py
Last active December 24, 2025 23:45
#!/usr/bin/env python3
import os, time, subprocess, requests, socket
SERVER = os.environ["JOB_SERVER_URL"]
INSTANCE_ID = os.environ.get("INSTANCE_ID", socket.gethostname())
POLL = int(os.environ.get("JOB_POLL_SECONDS", "20"))
print(f"[worker] instance={INSTANCE_ID}")
print(f"[worker] server={SERVER}")
#!/usr/bin/env bash
set -euo pipefail
: "${R2_BUCKET:?R2_BUCKET is required}"
DEST_BASE="${DEST_BASE:-$HOME}"
PARALLEL_DOWNLOADS="${PARALLEL_DOWNLOADS:-4}"
REMOTE="r2:${R2_BUCKET}"
current_path=""
@Milz0
Milz0 / qp-init.sh
Last active December 24, 2025 09:41
#!/usr/bin/env bash
# --------------------------------------------------
# VERY EARLY LOGGING (NO strict mode yet)
# --------------------------------------------------
LOG_FILE="/var/log/qp-init.log"
mkdir -p /var/log
touch "$LOG_FILE"
chmod 644 "$LOG_FILE"
@Milz0
Milz0 / gist:f891668a8b47d88baf13374cd6bd29e5
Created February 12, 2023 21:10
Cassandra PHP-Driver PHP 7.4 Ubuntu 22.04
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php -y
wget http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1.6_amd64.deb
sudo dpkg -i multiarch-support_2.27-3ubuntu1.6_amd64.deb
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list