Skip to content

Instantly share code, notes, and snippets.

View GuyPaddock's full-sized avatar

Guy Elsmore-Paddock GuyPaddock

View GitHub Profile
@GuyPaddock
GuyPaddock / update_aks_node_key.sh
Created July 28, 2020 16:05
Azure Kubernetes Service (AKS) reset SSH key of azureuser account on nodes
#!/usr/bin/env bash
##
# Update the SSH key for the azureuser account on the specified AKS node.
#
cluster_resource_group="${1:-}"
node="${2:-}"
public_key_path="${3:-}"
AZURE_USER="azureuser"
@GuyPaddock
GuyPaddock / calc_similarity.sh
Created August 5, 2020 20:27
Convert images to PNG, resize them, and then compute dissimilarity
#!/usr/bin/env bash
mogrify -format png *.jpg
mogrify \
-resize 4096x4096 \
-background black \
-gravity center \
-extent 4096x4096 \
-format png \
@GuyPaddock
GuyPaddock / modulename.install.php
Created October 19, 2020 15:19 — forked from crittermike/modulename.install.php
Uninstall Multiversion and Workspace from Drupal 8. This is an update hook which successfully uninstalled the module from our fairly complicated site.
<?php
/**
* Uninstall Multiversion and related modules.
*/
function modulename_update_8000() {
// !!! IMPORTANT !!!
// First, make sure to check and see if any of the below entities have a
// value of NULL in "_deleted" or "workspace" columns, because if so,
// you'll want to update that. See this issue for more information:
@GuyPaddock
GuyPaddock / console.js
Created October 27, 2020 13:18
Extract Titles of Confluence Spaces from the Spaces Page
$('.space-name').each(function () { console.log($(this).text()); });
@GuyPaddock
GuyPaddock / NestedEntityReference.php
Created November 3, 2020 21:28
NestedEntityReference utility class for safely getting access to ER fields
<?php
namespace Drupal\my_utiilities\Utility;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Plugin\DataType\EntityAdapter;
use Drupal\Core\Field\EntityReferenceFieldItemListInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\Core\TypedData\DataReferenceInterface;
@GuyPaddock
GuyPaddock / Getting Started with UE4 Infographic.svg
Last active December 14, 2020 12:49
Notes and Tips on Getting Started with Unreal Engine (my notes follow after my infographic)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GuyPaddock
GuyPaddock / smpte.sh
Last active January 17, 2021 17:11
Adding SMPTE timecode to video recorded on Pixel 3
ffmpeg \
-i INPUT_FILE.mp4 \
-vf drawtext="fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: fontsize=96: box=1: [email protected]: boxborderw=5: fontcolor=white: x=(w-text_w)/2: y=((h-text_h)/2)-(3*((h-text_h)/8)):timecode='00\:00\:00\:00':rate=28.09" \
OUTPUT_FILE.mp4
@GuyPaddock
GuyPaddock / RenewAzureAdProxyCert.ps1
Last active June 12, 2024 15:41
PowerShell Script to Renew the SSL Certificate Used by the Application Proxy for an Azure AD Enterprise Application
################################################################################
# Script that renews a Let's Encrypt certificate for the Application Proxy of an
# Enterprise Application.
################################################################################
# This script can be run standalone from your local machine to automate the
# steps of a specific ACME renewal for Azure AD App Proxy application.
#
# Prior to using this script, you will need to ensure you have a DNS zone setup
# that points to your Azure AD App Proxy deployment. Azure AD will give you a
# hostname that will need to be referenced by a CNAME record in the zone. So,
@GuyPaddock
GuyPaddock / LiveHome3dFbxCleanupAndExport.py
Last active November 28, 2024 06:24
Blender Script for Cleaning-up a Live Home 3D FBX for UE4
# This script has moved to:
# https://github.com/GuyPaddock/BlenderScripts/blob/main/LiveHome3dFbxCleanupAndExport.py
@GuyPaddock
GuyPaddock / concave_object_to_convex_objects_by_face.py
Last active December 28, 2024 01:04
Blender 2.91 Script for Convex Hull Decomposition into Separate Shapes Using Blender's Convex using "Split Concave Faces"
##
# A script to split simple, architectural geometry into convex pieces.
#
# This script makes use of Blender's built-in "Split Concave Faces" clean-up
# algorithm to break-up the faces of an object into convex pieces. The script
# attempts to identify all the edges that represent convex boundaries, and then
# it splits objects up along those edges. Each resulting piece is then made into
# a closed object by converting it into a convex hull.
#
# Be sure to select the object you wish the split into convex pieces before