Skip to content

Instantly share code, notes, and snippets.


Gene Wood gene1wood

View GitHub Profile
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
gene1wood / postfix-debconf-get-selections.txt
Last active Apr 15, 2021
postfix debconf-get-selections using as an example domain name
View postfix-debconf-get-selections.txt
# Internet protocols to use:
# Choices: all, ipv6, ipv4
postfix postfix/protocols select all
# System mail name:
postfix postfix/mailname string
# Add a 'mydomain' entry in for upgrade?
postfix postfix/mydomain_warning boolean
# Correct tlsmgr entry in for upgrade?
postfix postfix/tlsmgr_upgrade_warning boolean
# Root and postmaster mail recipient:
View set-whitebalance
#!/bin/bash -x
if [ -n "$2" ]; then
camera="$(v4l2-ctl --list-devices | grep -A1 "$1" | tail -1 | awk '{print $1}')"
$(v4l2-ctl -d "$camera" -l | awk '$1 == "white_balance_temperature" {print "export "$5" "$6}')
(( range = max - min ))
gene1wood /
Created Sep 8, 2020
How to configre ngrok and flask to redirect to https
gene1wood / example-aws-api-gateway-lambda-proxy-mode-event.json
Created Jul 30, 2020
Example Lambda event from API Gateway in Proxy mode
View example-aws-api-gateway-lambda-proxy-mode-event.json
"resource": "/{proxy+}",
"path": "/post",
"httpMethod": "POST",
"headers": {
"accept": "*/*",
"Authorization": "Bearer REDACTED",
"content-type": "application/x-www-form-urlencoded",
"Host": "",
"User-Agent": "curl/7.58.0",
gene1wood /
Last active Jul 30, 2020
A 2015 script to apply the old cipersuite settings to AWS ELBs
#!/usr/bin/env python
# Apply recommendation from
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at
# Contributors:
# Gene Wood [:gene]