Skip to content

Instantly share code, notes, and snippets.

View gene1wood's full-sized avatar
🎩

Gene Wood gene1wood

🎩
View GitHub Profile
@gene1wood
gene1wood / build_postfix_virtual.py
Created November 29, 2022 20:03
Tool to generate postfix virtual map file based on a set of excluded usernames in a domain
#!/usr/bin/env python3
import yaml
import json
POSTFIX_VIRTUAL_FILENAME = '/etc/postfix/virtual'
def get_blocked_domain_string(blocked_domains):
@gene1wood
gene1wood / mozilla-confluence-cloud-inline-code-style-like-github.user.js
Last active November 17, 2022 02:06
A userscript to change the appearance of inline code in Mozilla's Confluence Cloud wiki so that it looks like GitHub inline code
// ==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 August 18, 2022 00:51
Example of how to run Robocopy to sync files
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 June 27, 2022 05:55
Chef stacktrace showing bug in Chef snap_package resource
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 June 26, 2022 16:25
Portable docker based DHCP server

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 February 14, 2024 16:53
Alameda to Mozilla and back via the ferry

To work

Home Dep Sea pln Arrv S.F. Arrv Werq
5:13 AM O 5:39 AM 5:47 AM
5:43 AM O 6:09 AM 6:17 AM
6:09 AM 🚲 6:30 AM 6:50 AM 7:05 AM 🚲
6:13 AM O 6:40 AM 6:48 AM
6:16 AM 🏍 6:30 AM 6:50 AM 7:06 AM
6:39 AM 🚲 7:00 AM 7:20 AM 7:35 AM 🚲
@gene1wood
gene1wood / update-repo.sh
Created September 27, 2021 21:18
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
# 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 September 17, 2021 18:06
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

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 September 12, 2021 05:05
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 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 17:49
Tool I source to get some query functions for CIS Person API
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 \