Skip to content

Instantly share code, notes, and snippets.

View JamesMcMahon's full-sized avatar

James F McMahon JamesMcMahon

View GitHub Profile
@JamesMcMahon
JamesMcMahon / agent-sandboxen.md
Created October 2, 2026 05:06 — forked from wincent/agent-sandboxen.md
List of coding agent sandboxes 2026-05

Coding Agent Sandboxes — Comprehensive List

Compiled from awesome-lists (restyler/awesome-sandbox, webcoyote/awesome-AI-sandbox, bureado/awesome-agent-runtime-security) and a survey of vendor blogs / field guides published through 2026. Grouped by isolation primitive and then by deployment model.

1. OS-level primitives (no container, no VM)

These rely on kernel/userland features to constrain a normal host process. Lowest overhead, weakest boundary.

  • macOS Seatbelt / sandbox-exec — Apple's TrustedBSD-based MAC framework. Used directly by Codex CLI, Gemini CLI, and underneath Anthropic's srt.
  • Linux Landlock — Unprivileged filesystem/network LSM; default backend for Codex CLI on Linux.
@JamesMcMahon
JamesMcMahon / hdr-toggle.js
Last active October 2, 2026 04:55
HDR Toggle for Gnome - can be assigned to shortcut and run via gjs
#!/usr/bin/gjs
const {GLib, Gio} = imports.gi;
const BUS_NAME = 'org.gnome.Mutter.DisplayConfig';
const BUS_PATH = '/org/gnome/Mutter/DisplayConfig';
const ColorMode = {SDR: 0, HDR: 1};
const PERSISTENT = 2;
const connection = Gio.bus_get_sync(Gio.BusType.SESSION, null);
@JamesMcMahon
JamesMcMahon / MangoHud.conf
Last active August 26, 2026 01:24
MangoHud configuration (Generated using MangoJuice)
# Config Generated by MangoJuice #
legacy_layout=false
pci_dev=0000:03:00.0 # AMD/ATI Navi 31 Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M rev c8
gpu_stats
gpu_load_change
vram
gpu_temp
cpu_stats
cpu_load_change
cpu_temp
@JamesMcMahon
JamesMcMahon / toggle-hdr.sh
Last active August 19, 2026 02:00
Script to toggle HDR in KDE Plasma
#!/usr/bin/env bash
# Toggle HDR on a given display using kscreen-doctor
# Usage: ./toggle-hdr.sh <output-name>
# Example: ./toggle-hdr.sh DP-2
set -euo pipefail
OUTPUT="${1:-DP-1}"
@JamesMcMahon
JamesMcMahon / flatpak-all-overrides.sh
Last active June 22, 2025 19:30
List flatpak overrides for system and user packages
#!/usr/bin/env bash
for app in $(flatpak list --app --columns=application); do
user_overrides=$(flatpak override --show --user "$app")
system_overrides=$(flatpak override --show "$app")
if [[ -n "$user_overrides" || -n "$system_overrides" ]]; then
echo "Overrides for $app:"
if [[ -n "$user_overrides" ]]; then
@JamesMcMahon
JamesMcMahon / pre-push.sh
Created July 22, 2022 21:08
Pre-push script for local CI
#!/usr/bin/env sh
set -e
echo "Running pre-push hook..."
git fetch
if ! git diff-index --quiet HEAD --; then
echo "Local changes found, please commit or stash"
exit 1
fi
@JamesMcMahon
JamesMcMahon / root-crontab
Last active November 27, 2022 03:18
Pihole Autoupdate Cron
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
@JamesMcMahon
JamesMcMahon / rsync-backup.sh
Last active November 1, 2021 15:27
Remote backup Rsync
#!/usr/bin/env bash
set -e
log_file=$1
local_path=$2
remote_path=$3
time rsync --archive --verbose --new-compress --human-readable --protect-args --progress --exclude=.DS_Store --log-file=rsync_${log_file}.log ${local_path} ${remote_path}
time rsync --checksum --archive --verbose --new-compress --human-readable --protect-args --progress --exclude=.DS_Store --log-file=rsync_${log_file}_checksum-verify.log ${local_path} ${remote_path}
@JamesMcMahon
JamesMcMahon / comparedirs.py
Created February 3, 2020 01:01
Compare directories script I created for my NAS
#!/usr/bin/env python
import os
import sys
def remove_prefix(text, prefix):
if text.startswith(prefix):
return text[len(prefix):]
return text
@JamesMcMahon
JamesMcMahon / toolbox-fix.sh
Last active July 20, 2019 20:00
Fix issue with Jetbrains Toolbox apps
xattr -cr Applications/JetBrains\ Toolbox/