Skip to content

Instantly share code, notes, and snippets.

@jth0
jth0 / docker.sh
Created October 7, 2025 05:03
Shell script to build & deploy a docker image for Posit Workbench in GCP Artifact Registry (GAR)
#!/usr/bin/env bash
# Script for building & pushing a docker image to Google Cloud (GCP) Artifact Registry (GAR)
# Not a ton of "special sauce" here, and you may be able to tell by the emoji that it's been
# AI-enhanced. Major happy paths tested, not all edge cases have been fully vetted though.
# So far only found one hallucination and one set of parameters where code was added but the
# help output and runtime didn't actually reference the var/param or run the code...
set -euo pipefail
@jth0
jth0 / Dockerfile
Last active October 7, 2025 04:46
Dockerfile for Posit Workbench in GCP
# Base image that includes Posit session components
FROM rstudio/workbench-session:ubuntu2204-r4.4.3_4.3.3-py3.12.11_3.11.13
# External build script passes in these values, either parsed out of the image name above or defined externally
# to manually specify a different version to use.
ARG PYTHON_VERSION
ARG R_VERSION
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@jth0
jth0 / op-cleanup.py
Created April 27, 2023 16:11
Process JSON output from 1Password CLI to rename imported vaults, grant admins manage access, and delete old vaults.
#!/opt/homebrew/bin/python3
# Process JSON output from 1Password CLI to rename imported vaults, grant admins manage access, and delete old vaults.
# run `op signin` prior to running script.
# script takes as input the output from `op vault list --group Owners --format=jsonimport json, sys, pathlib, subprocess > filename.json`
def main():
# grab filename and validate exists:
if len(sys.argv) != 2:
sys.exit("Error: Please provide one filename as argument")
@jth0
jth0 / private_fork.md
Created March 14, 2023 15:50 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

Keybase proof

I hereby claim:

  • I am jth0 on github.
  • I am jth (https://keybase.io/jth) on keybase.
  • I have a public key ASAhB-03B7Qbi_qLWuVKg66NJXoU0R4l3P8GeNUS9vJPxgo

To claim this, I am signing this object:

@jth0
jth0 / sizeup.bash
Last active August 29, 2015 14:13 — forked from ttscoff/sizeup.bash
__sizeup_build_query () {
local bool="and"
local query=""
for t in $@; do
query="$query -$bool -iname \"*.$t\""
bool="or"
done
echo -n "$query"
}