Skip to content

Instantly share code, notes, and snippets.

View GuyPaddock's full-sized avatar

Guy Elsmore-Paddock GuyPaddock

View GitHub Profile
@GuyPaddock
GuyPaddock / CheckAzureAdAppSecretExpiry.ps1
Last active May 10, 2023 19:53
Use the "Az" PowerShell module to export Azure AD secret expiration dates to CSV.
##
# @file
# Check the expiration dates for all Azure AD App Registration Secrets.
#
# All applications that have secrets that have expired or that will expire in
# the next 60 days are exported to CSV.
#
# Adapted from:
# https://learn.microsoft.com/en-us/azure/active-directory/manage-apps/scripts/powershell-export-apps-with-expriring-secrets
#
@GuyPaddock
GuyPaddock / list-issues.sh
Last active January 17, 2023 19:22
Extract Issue Tags from Commit History in a Branch Based Off develop
#!/usr/bin/env bash
##
# @file
# Extracts all of the issue tags in commit messages of a branch_ref and lists them.
#
# Usage:
# list-issues.sh [branch_ref ref] [base branch_ref ref]
#
# - If [branch_ref ref] is not specified, it defaults to "HEAD" (whatever is
@GuyPaddock
GuyPaddock / wistia_starwars.html
Created July 13, 2022 19:45
Wistia's "Star Wars" Terms of Service
<html>
<body>
<iframe src="https://fast.wistia.net/embed/iframe/7epq4bhukx?videoFoam=true" title="Star Wars Terms of Service - July 2022 v2 Video" allow="autoplay; fullscreen" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" msallowfullscreen="" width="633" height="356" data-dashlane-frameid="8008" style="width: 633px; height: 356px;"></iframe>
</body>
</html>
@GuyPaddock
GuyPaddock / watchdog.sh
Created April 12, 2022 14:28
Drupal Watchdog Queries via CLI
# BUGBUG: Putting "username" in the field list crashes Drush
terminus drush SITE_ID.ENVIRONMENT watchdog:show -- \
--format=csv \
--count=1000 \
--extended \
--type=taxonomy \
--fields=date,wid,message
@GuyPaddock
GuyPaddock / fpsync.sh
Created March 5, 2022 19:33
Using fpsync to sync two folders
#!/usr/bin/env bash
fpsync -E -vvvv -n 5 /path/to/src /path/to/dest
@GuyPaddock
GuyPaddock / PrettierConsideredHarmful.md
Last active January 31, 2022 21:15
Reconsider Prettier

Prettier Considered Harmful

This is about the Prettier code formatting tool.

  1. Prettier runs counter to the Agile Manifesto. Several key tenets of the agile manifesto are about empowering small teams to make decisions for themselves:
    • "Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done."
    • "Continuous attention to technical excellence and good design enhances agility."
@GuyPaddock
GuyPaddock / file_sizes_to_csv.sh
Last active December 14, 2021 16:01
Get sizes of files in a folder in CSV format
#!/usr/bin/env bash
echo "filename,size_bytes"
find "${1}" -type f | while read filename; do
stat --format="%n,%s" "${filename}";
done
@GuyPaddock
GuyPaddock / gradle_aop_agent.gradle
Created March 25, 2017 15:52
Getting Gradle to resolve path to agent dependencies
// BEGIN: Dynamic agent JAR config
configurations {
runtimeAgent
}
// END: Dynamic agent JAR config
buildscript {
ext {
springBootVersion = '1.5.2.RELEASE'
}
@GuyPaddock
GuyPaddock / encode_files.sh
Created June 12, 2021 02:43
Synology Encryption Key(s) to Base64-Encoded FIles
find . -name '*.key' | while read file; do
encoded=$(echo "${file}" | sed 's/\.key/\.b64/');
base64 -w0 "${file}" >"${encoded}";
done
@GuyPaddock
GuyPaddock / add_tiff_extension.sh
Created May 3, 2021 15:26
Add TIFF extension to all files
#!/usr/bin/env bash
find . -not -name '*.tiff' -type f -exec mv '{}' '{}.tiff' ';'