Skip to content

Instantly share code, notes, and snippets.

View ccharlton's full-sized avatar
🎯
Focusing

Chris Charlton ccharlton

🎯
Focusing
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
@ccharlton
ccharlton / cloudflare_firewall_bulk_ip_whitelist.sh
Created August 4, 2018 20:39
Cloudflare firewall bulk IP whitelist
#!/bin/bash
IPADDRESS=("123.123.123.124" "456.456.456.457" "890.890.890.891")
echo "Adding IP addresses to Cloudflare Firewall..."
echo ''
for i in "${IPADDRESS[@]}"
do
:
# do whatever on $i
@ccharlton
ccharlton / quicksilver.yml
Last active February 25, 2024 05:56
Pantheon Quicksilver profiles pack
#
# Quicksilver configuration file
#
# Requirements:
# - Terminus Quicksilver plugin: https://github.com/pantheon-systems/terminus-quicksilver-plugin)
#
# Copy to $HOME/.quicksilver/quicksilver.yml
#
# To create your own repository with installable examples:
#
@ccharlton
ccharlton / Text Substitutions Additions.plist
Created April 11, 2022 04:00
MacOS Keyboard Test Substitution Additions
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>phrase</key>
<string>[email protected]</string>
<key>shortcut</key>
<string>;email</string>
</dict>
@ccharlton
ccharlton / github-actions-workflows-get-secrets.sh
Created February 22, 2024 05:13
Extract variables & secrets from CI/CD workflow folders
#!/bin/sh
# Lists all workflows folder secrets in a simple list
echo ""
echo "List all secrets/variables in one simple list...\n"
grep -oh '\${{ secrets\.[^}]*}}' *.yml | sed 's/\${{ secrets\.\([^}]*\)}}/\1/' | sort | uniq
# Extract 'name' from each YML file
echo "\n--------------------\n"
echo "What does each file do?\n"
@ccharlton
ccharlton / newrelic-nrql-labeled-http-status-codes
Created June 14, 2024 20:51
New Relic (NRQL) query with labeled HTTP Status Codes
SELECT count(http.statusCode)
FROM Transaction
WHERE appName = {{appName}}
FACET CASES(
WHERE http.statusCode = 100 AS '100 Continue',
WHERE http.statusCode = 101 AS '101 Switching Protocols',
WHERE http.statusCode = 102 AS '102 Processing',
WHERE http.statusCode = 103 AS '103 Early Hints',
WHERE http.statusCode >= 104 AND http.statusCode <= 199 AS '104-199 Unassigned',
WHERE http.statusCode = 200 AS '200 OK',
@ccharlton
ccharlton / cachetag_inject.info.yml
Created July 10, 2024 17:21
CacheTag Inject module for Drupal
name: 'CacheTag Inject'
type: module
description: 'Allows developers to edit an array of Node IDs or URI paths to assign specific CacheTags.'
core_version_requirement: ^10
package: Custom
dependencies:
- drupal:node
@ccharlton
ccharlton / maintenance.sh
Created November 6, 2024 21:39
Maintenance shell script for local workstation updates
#!/bin/zsh
# Charlton's workstation maintenance script
# This script is a simple shell script that updates the shell and various libraries.
# It’s a good idea to run this script every week or so to keep a workstation up to date.
# The script can be saved in the `~/bin` directory as executable.
# $ chmod +x ~/bin/maintenance.sh