Skip to content

Instantly share code, notes, and snippets.


Gene Wood gene1wood

View GitHub Profile
gene1wood / mozilla-confluence-cloud-inline-code-style-like-github.user.js
Last active Nov 17, 2022
A userscript to change the appearance of inline code in Mozilla's Confluence Cloud wiki so that it looks like GitHub inline code
View mozilla-confluence-cloud-inline-code-style-like-github.user.js
// ==UserScript==
// @name Confluence Cloud Inline Code Styling like GitHub
// @namespace
// @include*
// @grant GM_addStyle
// @version 1.0
// @author Gene Wood
// @description Cause inline code in Confluence Cloud to be styled like inline code in GitHub
// ==/UserScript==
gene1wood / robocopy-example.cmd
Created Aug 18, 2022
Example of how to run Robocopy to sync files
View robocopy-example.cmd
REM /E : recursive including empty directories
REM /R:1 : retry once on failure
REM /W:1 : wait 1 second between tries
REM /LOG+ : append to a log file
REM /TEE : output to the log file and the screen
robocopy C:\source C:\destination /E /R:1 /W:1 /LOG+:C:\robocopy-2022-01-01.txt /TEE
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 Sep 28, 2022
Alameda to Mozilla and back via the ferry

To work

Home Dep Sea pln Arrv S.F. Arrv Moz
5:13 AM O 5:39 AM 5:51 AM
5:43 AM O 6:09 AM 6:21 AM
6:02 AM 🚌 6:30 AM 6:50 AM 6:58 AM
6:13 AM O 6:40 AM 6:52 AM
6:16 AM 🏍 6:30 AM 6:50 AM 6:58 AM
6:32 AM 🚌 7:00 AM 7:20 AM 7:28 AM
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}}]}';