Skip to content

Instantly share code, notes, and snippets.


Gene Wood gene1wood

View GitHub Profile
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
gene1wood / syslog.txt
Created Jun 26, 2020
Syslog on Ubuntu 18.04 when activating Soundcore Life P2 headset
View syslog.txt
Jun 26 11:34:54 judy /usr/lib/gdm3/gdm-x-session[32177]: (--) modeset(G0): HDMI max TMDS frequency 300000KHz
Jun 26 11:34:55 judy dbus-daemon[32393]: [session uid=1000 pid=32393] Activating via systemd: service name='org.bluez.obex' unit='dbus-org.bluez.obex.service' requested by ':1.79' (uid=1000 pid=1277 comm="gnome-control-center bluetooth " label="unconfined")
Jun 26 11:34:55 judy systemd[32111]: Starting Bluetooth OBEX service...
Jun 26 11:34:55 judy obexd[1289]: OBEX daemon 5.48
Jun 26 11:34:55 judy dbus-daemon[32393]: [session uid=1000 pid=32393] Successfully activated service 'org.bluez.obex'
Jun 26 11:34:55 judy systemd[32111]: Started Bluetooth OBEX service.
Jun 26 11:35:03 judy bluetoothd[1462]: a2dp-source profile connect failed for E8:07:BF:A6:3D:26: Device or resource busy
Jun 26 11:35:04 judy kernel: [62680.010423] input: E8:07:BF:A6:3D:26 as /devices/virtual/input/input91
Jun 26 11:35:04 judy /usr/lib/gdm3/gdm-x-session[32177]: (II) config/udev: Adding input device E8:07:BF:A6:3D:26 (/dev/inpu
gene1wood /
Last active Jun 2, 2020
Realteak AC'97 Audio Codecs Software Vista/Win7 (32/64 bits) Driver only (ZIP file)
gene1wood / watch-for-new-media.bash
Created May 10, 2020
Script to create inotifywait on directories to trigger Subsonic media scanning
View watch-for-new-media.bash
dirs="/path/to/first/dir /path/to/second/dir /path/to/third/dir"
# act="cat"
/bin/inotifywait --monitor --recursive --quiet --format '%w' --event create,moved_to $dirs | while read f
$act "$f"
gene1wood /
Created May 10, 2020
Script to trigger a Subsonic media rescan with locking
#!/bin/env python
import sys
import requests
import os
import os.path
import time
import logging
import subprocess
import json
gene1wood /
Last active Jun 9, 2021
Script to check what AWS IAM users and roles have rights to perform an action
#!/usr/bin/env python
import sys
import boto3
def get_paginated_results(product, action, key, credentials=None, args=None):
args = {} if args is None else args
return [y for sublist in [x[key] for x in boto3.client(product, **({} if credentials is None else credentials)).get_paginator(action).paginate(**args)] for y in sublist]
gene1wood /
Created Jan 22, 2020
How to deal with a Google Pixel with a broken power button
gene1wood /
Created Dec 31, 2019
The sequence of events triggered for a CloudFormation custom resource backed by an AWS Lambda function

Create a stack

    "event": {
        "StackId": "arn:aws:cloudformation:us-west-2:656532927350:stack/genetest2/c6c0c040-c5ee-11e9-9ec7-0ad236afdc80",
        "ResponseURL": "",
        "ResourceProperties": {
            "ServiceToken": "arn:aws:lambda:us-west-2:656532927350:function:genetest2-ExampleFunction-NQLOVV15EHNT",
            "Param": "alpha"
gene1wood /
Created Dec 20, 2019
Some exploration around what would be needed to simplify (through code) the process of releasing python package versions
  • Make sure has all new functionality you want in the release

    • Summarize changes since last release that are missing from Unreleased
  • Pick new version based on semver rules

  • Run unit tests / tox

  • Run flake8

  • Check to ensure

    • There are contents in unreleased
    • The new version number isn't present
  • Verify version is newer than newest version in