Skip to content

Instantly share code, notes, and snippets.

View breiter's full-sized avatar
🖖

Brian Reiter breiter

🖖
View GitHub Profile
@breiter
breiter / gist:2a1e7cbda86f37cf14405317ed7e03f0
Created September 16, 2026 14:44
Dark Reader detects dark mode with screen sharing in macOS on Chrome
This happens because macOS ScreenCaptureKit captures screen buffers in standard sRGB color space. When Chrome is set to Display P3, starting a screen share forces macOS to dynamically convert display color spaces, sending a display environment update that Dark Reader misinterprets as a system appearance change.
Locking Chrome to sRGB prevents Chrome from listening to those display profile shifts entirely. However, if you want to keep wide-gamut P3 rendering or avoid sRGB, here are the viable workarounds:
chrome://flags/#force-color-profile
Default => sRGB
This hypothetically means that Chrome cannot render HDR images and video because it is locked to sRGB but Chrome also does not support HDR DRM-protected video on macOS becuase only Windevine L2 (not L1) is supported by Chrome on macOS and Linux.
@breiter
breiter / inspector-code-export.sh
Created May 26, 2026 18:38
export aws inspector code repo findings to markdown
#!/usr/bin/env bash
set -euo pipefail
PROFILE="${1:-default}"
OUTDIR="$(PROFILE)_inspector_reports"
mkdir -p "$OUTDIR"
fetch_all_findings() {
local filter="$1"
local outfile="$2"
@breiter
breiter / archive-guardduty-sample-findings.sh
Created May 8, 2026 16:22
archive findings generated with the "generate findings" button in aws guardduty
#!/usr/bin/env bash
set -e
PROFILE="${1:?Usage: $0 <profile> [region]}"
REGION="${2:-us-east-2}"
AWS="aws --profile $PROFILE --region $REGION"
DETECTOR_ID=$($AWS guardduty list-detectors \
--query 'DetectorIds[0]' \
@breiter
breiter / start-unbound.sh
Created February 12, 2026 16:19
encrypt dns with unbound
#!/bin/sh
# start unbound service and bind DNS to localhost
current_userid=$(id -u)
if [ "$current_userid" -ne 0 ]; then
echo "$(basename "$0") requires superuser privileges to run" >&2
exit 1
fi
# unbound from macports
@breiter
breiter / touchid-sudo
Created November 5, 2025 22:24
enable pam_tid.so for TouchID support for sudo
#!/bin/sh
sed "s/^#auth/auth/" /etc/pam.d/sudo_local.template|sudo tee /etc/pam.d/sudo_local
@breiter
breiter / dotnet-install.sh
Last active August 17, 2026 18:51
Install the latest dotnet LTS and STS SDK and remove the old ones
#!/bin/sh
dotnet_root="$HOME/.dotnet"
# Installs the .NET SDK(s) into a non-admin path (~/.dotnet), rustup-update style:
# wipe the tree and reinstall the supported channels. Requires shell config to work.
#
# FOR EXAMPLE in ~/.zshenv:
#
# export DOTNET_ROOT="$HOME/.dotnet"
# # disable dotnet sdk telemetry
@breiter
breiter / start-pgadmin4.sh
Last active March 17, 2025 16:27
pgadmin4 local docker
#!/bin/sh
# change to your email
EMAIL=user@domain.com
PASSWORD=password
# note that the hostname of postgres database running on the same docker host is
# host.docker.internal
docker run --rm --pull always \
@breiter
breiter / .zshenv
Created October 28, 2024 15:20
macos zsh config with macports
#!/usr/bin/env zsh
# shellcheck shell=zsh
# globally manipulate paths wiht /etc/paths and /etc/paths.d
# globally manipulate manpath with /etc/manpath and /etc/manpaths.d
# set linux-style command-line with GNU utils
# ********************************************************************************************
# sudo port install bash bash-completion coreutils findutils grep gnutar gawk gsed gwhich wget
# ********************************************************************************************
@breiter
breiter / instructions.md
Created October 10, 2024 10:16
Azure CLI install script is broken on macOS

With MacPorts on macOS 15, install python312. Install py-pip. Install py-virtualenv.

sudo port select --set pip3 pip312   
sudo port select --set python3 python312 
sudo port select --set python python312 
sudo port select --set virtualenv virtualenv312
curl -L -O https://aka.ms/InstallAzureCli 
@breiter
breiter / gist:f40b12e297fa21418275883401267fae
Created January 23, 2023 14:58
change macOS /bin/sh from /bin/bash to /bin/dash
sh is a POSIX-compliant command interpreter (shell). It is implemented
by re-execing as either bash(1), dash(1), or zsh(1) as determined by the
symbolic link located at /private/var/select/sh. If
/private/var/select/sh does not exist or does not point to a valid shell,
sh will use one of the supported shells.
$ ls -l /private/var/select
total 0
lrwxr-xr-x 1 root wheel 9 Jan 23 09:47 sh -> /bin/dash
lrwxr-xr-x 1 root wheel 9 Dec 2 06:37 sh.ori -> /bin/bash