Skip to content

Instantly share code, notes, and snippets.

Avatar
🎩

Gene Wood gene1wood

🎩
View GitHub Profile
@gene1wood
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 http://cs.cementhorizon.com
// @include https://mozilla-hub.atlassian.net/wiki/*
// @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
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
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'
/opt/chef/embedded/lib/ruby/ge
@gene1wood
gene1wood / _Portable-DHCP-Server.md
Last active Jun 26, 2022
Portable docker based DHCP server
View _Portable-DHCP-Server.md

This is an easy method to spawn a portable DHCP server. It uses the https://github.com/networkboot/docker-dhcpd docker container.

  1. mkdir data
  2. wget -O data/dhcpd.conf https://gist.githubusercontent.com/gene1wood/381582ec03d63b0b4770ed831de8e667/raw/cd2b61c64e04934ec41c38b7a3cc53ead48aea5c/dhcpd.conf
  3. INTERFACE=eth0
  4. docker run -it --rm --init --net host -v "$(pwd)/data":/data networkboot/dhcpd $INTERFACE
@gene1wood
gene1wood / alameda-to-mozilla-and-back.md
Last active Sep 28, 2022
Alameda to Mozilla and back via the ferry
View alameda-to-mozilla-and-back.md

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
gene1wood / update-repo.sh
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
View update-repo.sh
#!/bin/bash -e
# https://gist.github.com/gene1wood/ddd66d79fc472f351a04c643aecbcf75
log() {
echo -e "\e[92m${1}\e[0m"
}
if ! git status >/dev/null 2>&1; then
log "Must be in a git repo"
@gene1wood
gene1wood / thread-on-how-maintainers-assert-their-role.md
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
View thread-on-how-maintainers-assert-their-role.md

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

SECURITY.md

This standard ( https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository ) 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
gene1wood / duplicacy_github_issues_disabled_earlier_this_year.md
Last active Sep 12, 2021
Duplicacy GitHub issues disabled earlier this year
View duplicacy_github_issues_disabled_earlier_this_year.md

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 duplicacy.com 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
gene1wood / person_api.sh
Created May 11, 2021
Tool I source to get some query functions for CIS Person API
View person_api.sh
export person_api_client_id=xxx
export person_api_client_secret=xxx
export audience=api.sso.mozilla.com
export api_domain=person.api.sso.mozilla.com
if [ -z "$person_api_bearer_token" ]; then
echo "Fetching bearer token"
export person_api_bearer_token=$(curl \
--silent \
--request POST \
@gene1wood
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}}]}';
done