Skip to content

Instantly share code, notes, and snippets.

View nosmo's full-sized avatar

Hugh Nowlan nosmo

View GitHub Profile
### Keybase proof
I hereby claim:
* I am nosmo on github.
* I am nosmo (https://keybase.io/nosmo) on keybase.
* I have a public key whose fingerprint is D07E 696B 0373 7057 5314 0B17 1D0A 395C 2068 925B
To claim this, I am signing this object:
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks,
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_rbl_client sbl-xbl.spamhaus.org,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client dul.dnsbl.sorbs.net
@nosmo
nosmo / firefox_cmdline_proxy.md
Last active November 13, 2025 07:29
How to pre-configure a proxy in Firefox from the command-line

Firefox does not obey the HTTP_PROXY/http_proxy environment variables on Linux without additional plugins. There's no way to explicitly configure Firefox to use a proxy via the command-line, so workarounds are needed.

My usecase is setting up a throwaway Firefox instance in a container using an SSH SOCKS proxy for interactive browsing of restricted web interfaces.

To do the setup, create a new profile via:

mkdir /tmp/firefox_profile
echo 'user_pref("network.proxy.socks", "host.docker.internal");' >> /tmp/firefox_profile/prefs.js
echo 'user_pref("network.proxy.socks_port", 9000);' >> /tmp/firefox_profile/prefs.js
echo 'user_pref("network.proxy.type", 1);' >> /tmp/firefox_profile/prefs.js
NAME="note"
if [ $# == 1 ]; then
NAME=$1
fi
emacs ~/Documents/`date +"%Y%m%d.%H%M"`."$NAME".md
@nosmo
nosmo / WD80EZAZ.md
Created December 19, 2019 21:11
Fixing issues with WD80EZAZ drives blocking boot

I just added a shucked WD80EZAZ to my system after doing the pin masking fix. My system failed to boot, even the BIOS was inaccessible. However, my RAID controller recognised the drives and it seemed like all was well otherwise. It appears that a corrupted GPT is at least partially to blame as others have seen this issue. On Linux the solution is as follows:

Boot the system as normal with the drive plugged into the power supply as normal but with the SATA connector disconnected.

Once your OS has booted, log in and fix the GPT when prompted. I also deleted the existing FAT partition.

~ # parted /dev/$THE_DISK
GNU Parted 3.2
Using /dev/sdg
Welcome to GNU Parted! Type 'help' to view a list of commands.
@nosmo
nosmo / chart-bump-pre-commit.py
Last active July 1, 2025 08:45
pre-commit hook to prevent committing a Helm chart change without bumping Chart.yaml
#!/usr/bin/env python3
"""Check a git commit for changes to charts with no bumps of Chart.yaml"""
import os
import re
import subprocess
import sys
def command(command_s: str) -> (str, str):