Skip to content

Instantly share code, notes, and snippets.

@westurner
westurner / podman-rootless
Created May 22, 2026 06:33
.devcontainer/podman-rootless
#!/bin/bash
# podman-rootless -- Call through to podman w/ CLI flags for rootless containers
# Usage:
# 1. Include podman-rootless on $PATH:
# sudo cp ./podman-rootless /usr/local/bin/
# ln -s ./podman-rootless ~/.local/bin/
#
# 2. In vscode settings.json:
# "dev.containers.dockerPath": "/home/user/.local/bin/podman-rootless"
@westurner
westurner / fix_rpmostree.sh
Created August 13, 2025 02:19
Install latest rpm-ostree in order to workaround [sysusers] package layering issues
#!/bin/sh
# # fix_rpmostree.sh
# Install latest rpm-ostree in order to workaround [sysusers] package layering issues
#
# ## References:
# - https://github.com/coreos/rpm-ostree/pull/5403#issuecomment-3046706179
# - https://github.com/coreos/rpm-ostree/pull/5403#issuecomment-3139129186
# - https://packages.fedoraproject.org/pkgs/rpm-ostree/rpm-ostree-libs/
# - https://packages.fedoraproject.org/pkgs/rpm-ostree/rpm-ostree/
# - https://bodhi.fedoraproject.org/updates/?packages=rpm-ostree
@westurner
westurner / install_roblox_studio__with_vinegar_flatpak_for_linux.sh
Last active February 20, 2025 04:15
install_roblox_studio__with_vinegar_flatpak_for_linux.sh
#!/bin/sh
echo "### Install Roblox Studio on Linux with the Vinegar flatpak"
echo "## Vinegar"
echo "- https://vinegarhq.org/"
echo "- https://vinegarhq.org/Installation/index.html"
echo "- https://vinegarhq.org/Configuration/index.html"
type -a flatpak || echo "ERROR: Flatpak not found. You must install flatpak to install Vinegar" && exit 2
// example SVG url: https://jupyter.org/assets/homepage/main-logo.svg
//$x("//*[name()='svg']");
//$x("//*[name()='use']);
//$x("//*[name()='use'][@*[name()='fill']]");
$x("//*[@*[name()='fill']]");
@westurner
westurner / subprocess_Popen_with_logging.py
Last active August 29, 2024 00:56
Patch subprocess.Popen to log args, kwargs, and the cmd string
from functools import partial
class Popen_with_logging(subprocess.Popen):
"""Patch subprocess.Popen to log args, kwargs, and the cmd string"""
def __init__(self, *args, cmdprefix='+', **kwargs):
print = kwargs.get("printfunc",
partial(__builtins__.print, file=sys.stderr))
# print = log.debug ; printfunc=log.debug
if kwargs.get('shell'):
@westurner
westurner / test_demo_taskw.sh
Last active August 17, 2024 01:56
Demo of TaskWarrior (`task`)
#!/bin/sh
# # A demo/test of taskwarrior (`task`)
#
# ## Usage
# ```sh
# ./test_demo_taskw.sh
# ```
# Note: Interactive input is required:
# - [read and] type "yes" or "y"
# - [read and] type "all" to indeed delete all tasks without further prompting
#!/bin/sh
pipx install --include-deps -f ruff black isort mypy bandit pylint autopep8 pyflakes yapf python-lsp-server[all] pylsp-rope pre-commit pre-commit-hooks
@westurner
westurner / forgot_to_check_out_with_recurse_submodules.md
Created September 12, 2023 19:54 — forked from cnlohr/forgot_to_check_out_with_recurse_submodules.md
Git forgot to clone recursively (forgot to check out with recurse submodules)
@westurner
westurner / savings_interest_and_future_value.ipynb
Last active July 13, 2023 23:15
savings_interest_and_future_value.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

From "Options for giving math talks and lectures online" https://news.ycombinator.com/item?id=22539537 :

One option: screencast development of a Jupyter notebook.

Jupyter Notebook supports LaTeX (MathTeX) and inline charts. You can create graded notebooks with nbgrader and/or with CoCalc (which records all (optionally multi-user) input such that you can replay it with a time slider).

Jupyter notebooks can be saved to HTML slides with reveal.js, but if you want to execute code cells within a slide, you'll need to install RISE: https://rise.readthedocs.io/en/stable/

Here are the docs for CoCalc Course Management; Handouts, Assignments, nbgrader: https://doc.cocalc.com/teaching-course-management.html