Skip to content

Instantly share code, notes, and snippets.


Gene Wood gene1wood

View GitHub Profile
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 Feb 18, 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]
gene1wood /
Created Jul 20, 2020
Small script to get users from CIS
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 --url --header "Content-Type: application/json" --data "{\"client_id\":\"${person_api_client_id}\",\"client_secret\":\"${person_api_client_secret}\",\"audience\":\"\",\"grant_type\":\"client_credentials\"}" | jq -r '.access_token')
function url_quote {
echo $1 | python3 -c "import urllib.parse; print(urllib.parse.quote(input()))"
function get_auth0_user {
gene1wood / disable-native-login.php
Last active Jul 4, 2020
Disable Wordpress native username password login when using Google Apps Login
View disable-native-login.php
* Plugin Name: Disable Native Login
* Plugin URI:
* Description: Disable the native username password login in wordpress
* Version: 1.0.0
* Author: Gene Wood
* Author URI:
* License: GPL2