Skip to content

Instantly share code, notes, and snippets.


Gene Wood gene1wood

View GitHub Profile
gene1wood / chef-stacktrace.out
Created Jun 27, 2022
Chef stacktrace showing bug in Chef snap_package resource
View chef-stacktrace.out
Generated at 2022-06-26 22:26:03 -0700
ArgumentError: snap_package[plex-htpc] (wendy::packages line 321) had an error: ArgumentError: wrong number of arguments (given 1, expected 2)
/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.3/lib/chef/provider/package/snap.rb:266:in `install_snaps'
/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.3/lib/chef/provider/package/snap.rb:69:in `install_package'
/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.3/lib/chef/provider/package.rb:120:in `block (3 levels) in <class:Package>'
/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.3/lib/chef/provider/package.rb:267:in `multipackage_api_adapter'
/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.3/lib/chef/provider/package.rb:119:in `block (2 levels) in <class:Package>'
/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.3/lib/chef/mixin/why_run.rb:51:in `add_action'
/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.3/lib/chef/provider.rb:293:in `converge_by'
gene1wood /
Last active Jun 26, 2022
Portable docker based DHCP server

This is an easy method to spawn a portable DHCP server. It uses the docker container.

  1. mkdir data
  2. wget -O data/dhcpd.conf
  3. INTERFACE=eth0
  4. docker run -it --rm --init --net host -v "$(pwd)/data":/data networkboot/dhcpd $INTERFACE
gene1wood /
Last active Jun 3, 2022
Alameda to Mozilla and back via the ferry

To work by MC

Home - MC Depart Alameda Seaplane Arrive Downtown S.F. Arrive Mozilla Target Departure
6:16 AM 6:30 AM 6:50 AM 6:58 AM 3:20 PM to Ferry Gate F (9:02)
6:46 AM 7:00 AM 7:20 AM 7:28 AM 3:20 PM to Ferry Gate F (8:32)
7:11 AM 7:25 AM 7:45 AM 7:53 AM 3:20 PM to Ferry Gate F (8:07)
8:06 AM 8:20 AM 8:40 AM 8:48 AM 4:20 PM to Ferry Gate F (8:12)
9:01 AM 9:15 AM 9:35 AM 9:43 AM 5:20 PM to Ferry Gate F (8:17)

To work by bus + ferry

gene1wood /
Created Sep 27, 2021
Update a local git repo by switching to master, fetching all remotes, deleting all local branches that track a remote branch that's now gone, fast forward merge upstream into local master and push local master to origin
#!/bin/bash -e
log() {
echo -e "\e[92m${1}\e[0m"
if ! git status >/dev/null 2>&1; then
log "Must be in a git repo"
gene1wood /
Created Sep 17, 2021
Here's a thread I've started with the Mozilla GitHub owners to try to agree on a standard for how maintainers assert their role

With the recent Travis CI security issue, it's again become necessary for Mozilla security folks to need to be able to contact maintainers of our GitHub repos (in this case to coordinate rotation of leaked credentials). I wanted to see if we (GitHub owners) could come up with a standard (either an existing one or make one) for how people can assert and communicate their role as a maintainer of a given GitHub repo. I don't know if an email thread is the best channel, but I thought I'd start this and we could switch to a zoom call if folks want. Here are some potential solutions that have come to mind

This standard ( ) is so repo maintainers can assert how to report security vulnerabilities.

  • It's public so maintainers might be reluctant to put email addresses in there
gene1wood /
Last active Sep 12, 2021
Duplicacy GitHub issues disabled earlier this year

It looks like GitHub issues were disabled on the Duplicacy GitHub repo sometime between April and July this year (2021). I noticed this while checking back on a bug to see if I still needed to continue to use a workaround or if it had been fixed.

I searched through the repo README, on the website and here in the forums but don't see any mention of the disabling of issues, or where one is meant to report or track bugs now.

Gilbert, if the intent is to prevent opening new issues (I'm guessing here, but as a maintainer of open source software I'm familiar with the challenges of getting low quality issues), would it be possible to, instead of disabling GitHub issues, re-enable GitHub issues and instead create a [6 month interac

gene1wood /
Created May 11, 2021
Tool I source to get some query functions for CIS Person API
export person_api_client_id=xxx
export person_api_client_secret=xxx
if [ -z "$person_api_bearer_token" ]; then
echo "Fetching bearer token"
export person_api_bearer_token=$(curl \
--silent \
--request POST \
gene1wood / delete_all_s3_bucket_files
Created Apr 29, 2021
Command to delete all objects from S3 bucket using lifecycle configuration
View delete_all_s3_bucket_files
for bucket in `cat list-of-s3-buckets.txt`; do
aws s3api put-bucket-lifecycle \
--bucket $bucket \
--lifecycle-configuration '{"Rules":[{"ID":"cleanup","Status":"Enabled","Prefix":"","Expiration":{"Days":1}}]}';
gene1wood /
Created Feb 26, 2021
Fix for the peertube error "Cannot retrieve OAuth Client credentials: undefined" and "client invalid"

I deployed Peertube via Docker but did not use the included nginx docker container and instead put Peertube behind an Apache httpd reverse proxy.

I was getting the error : Cannot retrieve OAuth Client credentials: undefined when loading the peertube page and the error client invalid when attempting to log in.

The cause was that I wasn't passing the host header through Apache because I was missing the ProxyPreserveHost On directive.

I added this and resolved the issue

gene1wood / bugzillarc-for-use-at-Mozilla
Created Feb 24, 2021
The ~/.config/python-bugzilla/bugzillarc file to use for
View bugzillarc-for-use-at-Mozilla
url =
api_key = xxxxxxxxxxxxxxx