Skip to content

Instantly share code, notes, and snippets.

View gene1wood's full-sized avatar
🎩

Gene Wood gene1wood

🎩
View GitHub Profile
@gene1wood
gene1wood / disable-native-login.php
Last active October 30, 2023 00:14
Disable Wordpress native username password login when using Google Apps Login
<?php
/**
* Plugin Name: Disable Native Login
* Plugin URI: https://cs.cementhorizon.com/
* Description: Disable the native username password login in wordpress
* Version: 1.0.0
* Author: Gene Wood
* Author URI: https://cs.cementhorizon.com/
* License: GPL2
@gene1wood
gene1wood / syslog.txt
Created June 26, 2020 18:56
Syslog on Ubuntu 18.04 when activating Soundcore Life P2 headset
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
gene1wood / 0001-6305_Vista_Win7_PG537.zip
Last active June 2, 2020 00:06
Realteak AC'97 Audio Codecs Software Vista/Win7 (32/64 bits) Driver only (ZIP file)
@gene1wood
gene1wood / watch-for-new-media.bash
Created May 10, 2020 20:19
Script to create inotifywait on directories to trigger Subsonic media scanning
#!/bin/bash
dirs="/path/to/first/dir /path/to/second/dir /path/to/third/dir"
act="/usr/local/bin/act-on-new-media.bash"
# act="cat"
/bin/inotifywait --monitor --recursive --quiet --format '%w' --event create,moved_to $dirs | while read f
do
$act "$f"
done
@gene1wood
gene1wood / rescan_subsonic_media.py
Created May 10, 2020 20:17
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
gene1wood / who_has_access.py
Last active June 9, 2021 19:38
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
gene1wood / How-to-deal-with-a-Google-Pixel-with-a-broken-power-button.md
Created January 22, 2020 04:05
How to deal with a Google Pixel with a broken power button
@gene1wood
gene1wood / cloudformation-custom-resource-event-sequence.md
Created December 31, 2019 18:48
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": "https://cloudformation-custom-resource-response-uswest2.s3-us-west-2.amazonaws.com/arn%3Aaws%3Acloudformation%3Aus-west-2%3A656532927350%3Astack/genetest2/c6c0c040-c5ee-11e9-9ec7-0ad236afdc80%7CExample%7Cef8641a2-cac0-4eaf-aed6-df08cd9aae26?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20190823T214203Z&X-Amz-SignedHeaders=host&X-Amz-Expires=7199&X-Amz-Credential=AKIA54RCMT6SG7Y5BKPL%2F20190823%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=a5f9d0ac53360f385b20e9f71a36746d691b2d161bf45ab867a76a858de3e1e0",
        "ResourceProperties": {
            "ServiceToken": "arn:aws:lambda:us-west-2:656532927350:function:genetest2-ExampleFunction-NQLOVV15EHNT",
            "Param": "alpha"
@gene1wood
gene1wood / explore-automating-releasing-python-packages.md
Created December 20, 2019 17:01
Some exploration around what would be needed to simplify (through code) the process of releasing python package versions
  • Make sure CHANGELOG.md 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 CHANGELOG.md to ensure

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