Skip to content

Instantly share code, notes, and snippets.

@mattbell87
mattbell87 / HP-LaserJet-P1005.ppd
Created July 28, 2026 05:27
HP LaserJet P1005 on modern macOS (Apple Silicon) — sandbox-native CUPS driver + firmware auto-load, no Homebrew
*PPD-Adobe: "4.3"
*FormatVersion: "4.3"
*FileVersion: "1.0"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "P1005.PPD"
*Manufacturer: "HP"
*ModelName: "HP LaserJet P1005"
*Product: "(HP LaserJet P1005)"
*NickName: "HP LaserJet P1005 rastertoxqx"
@mattbell87
mattbell87 / imac-sleep-fix.md
Last active July 21, 2026 23:40
iMac12,1 (21.5" mid-2011) HD6770M — fix graphical glitch/GPU lockup on wake from sleep on Linux (radeon.dpm=0)

iMac12,1 (21.5" mid-2011) — GPU glitch / lockup on wake from sleep (Linux)

Machine: Apple iMac12,1 (21.5", mid-2011) GPU driving the panel: AMD Radeon HD 6770M — "Whistler"/Turks, Northern Islands (TeraScale 2), PCI id 1002:6740 Driver: radeon kernel module (NOT amdgpu — this chip is pre-GCN, so radeon is the only option) OS when diagnosed: Fedora Linux 44 (KDE Plasma), kernel 7.1.4, X11, EFI boot Date fixed: 2026-07-22

Symptom

After waking from suspend, the Plasma desktop shows large black-and-white "stair-step"

@mattbell87
mattbell87 / run_in_container.sh
Last active February 28, 2024 02:33
Run a command in a container
#!/bin/bash
# Link this file to /usr/local/bin/<command-name>
exec=$(basename $0)
container="container"
user="root"
dockerCmdNonInteractive="docker exec -u $user $container"
dockerCmd="docker exec -it -u $user $container"
display="🫙 $user@$container:$($dockerCmdNonInteractive pwd)\$ $exec $*"
@mattbell87
mattbell87 / docker-compose.yml
Last active March 5, 2024 02:34
Cmfive minimal docker compose setup
services:
cmfive:
image: ghcr.io/2pisoftware/cmfive:develop
environment:
- TZ=Australia/Sydney
- DB_HOST=mysql
- DB_DATABASE=cmfive
- DB_USERNAME=cmfive
- DB_PASSWORD=cmfive
- ENVIRONMENT=development
@mattbell87
mattbell87 / docker-compose-healthcheck.sh
Created February 21, 2024 13:32
Get unhealthy container logs in a docker-compose project
#!/bin/sh
services=$(docker compose config --services)
for service in $services; do
echo "Service: $service"
container=$(docker-compose ps -q $service)
if docker inspect $container --format='{{.State.Health.Status}}' >/dev/null 2>&1; then
health=$(docker inspect --format='{{json .State.Health.Status}}' $container)
if [ "$health" != "\"healthy\"" ]; then
echo "CONTAINER IS NOT HEALTHY"
echo "==== STATUS ===="
@mattbell87
mattbell87 / install.sh
Created January 31, 2024 00:54
Playwright dependencies for Fedora
sudo dnf install atk at-spi2-atk libXcomposite libXdamage libXfixes libXrandr libgbm alsa-lib
@mattbell87
mattbell87 / keybase.md
Last active September 13, 2023 00:07
Keybase proof

Keybase proof

I hereby claim:

  • I am mattbell87 on github.
  • I am mattbell87 (https://keybase.io/mattbell87) on keybase.
  • I have a public key ASA-J1e_FaU-dfkUv-CmkXW6L1AnDl-JzI541JezR5kLiQo

To claim this, I am signing this object:

@mattbell87
mattbell87 / docker-compose.yaml
Last active November 1, 2022 03:19
Run a React Native Android app in Docker
# Run a react native app on docker
#
# Ensure you have enough space (>32GB) and plenty of CPU power if you're running in Codespaces
#
# 1. docker-compose up -d (or right click this file in VS code and choose Compose Up)
# 2. Once started go to http://localhost:6080 (or right click the dev container and choose Open in Browser in VSCode). You should see the android phone starting up
# 3. Log in to your container with `docker exec -it react-native-dev bash` (or right click the dev container and choose Attach Shell in VSCode)
# 4. Run `npm run android` to start your app (can take quite a while the first time you do this)
services:
@mattbell87
mattbell87 / gist:63f2771b5432c10179530eb9d7a1ffe4
Last active July 14, 2022 23:48
When windows wont give you a port

Sometimes Windows wont let you open a port and there is no process using that port. Usually this is due to WinNat, you just need to restart it.

Open an administrator prompt (powershell/cmd) and:

net stop winnat
net start winnat
@mattbell87
mattbell87 / ort.md
Last active March 28, 2023 23:12
How to convert ONNX to ORT

This example uses Docker to install a specific Python version

One liner version

Given the file /home/matt/mobilenetv2-7.onnx as an example replace /home/matt and mobilenetv2-7.onnx as needed.

docker run --rm -v /home/matt:/mnt python:3.9-buster bash -c "pip install onnx onnxruntime && python -m onnxruntime.tools.convert_onnx_models_to_ort /mnt/mobilenetv2-7.onnx"