Skip to content

Instantly share code, notes, and snippets.

View seanhamlin's full-sized avatar

Sean Hamlin seanhamlin

View GitHub Profile
# Use basic filtering of `drush status` to hopefully ensure more broader support
# for various drush versions.
DRUPAL_VERSION=$(drush status | grep -i "drupal version" | awk '{print $NF}');
if [ "${DRUPAL_VERSION%.*}" == "7" ] ; then
if drush cc all; then echo "drush cc all complete"; else exit $?; fi;
elif [ "${DRUPAL_VERSION%.*.*}" -ge "8" ] ; then
if drush cr -y; then echo "drush cache:rebuild complete"; else exit $?; fi;
else \
echo "could not clear cache for found Drupal version ${DRUPAL_VERSION}";
exit 1;
@seanhamlin
seanhamlin / .lagoon.yml
Created June 23, 2022 01:53
Static Nginx container
docker-compose-yaml: docker-compose.yml
environments:
production:
routes:
- nginx:
- "www.example.com"
@seanhamlin
seanhamlin / recv.vcl
Created November 11, 2021 20:25
Strip analytics (Google, Facebook etc) query parameters in Fastly
# Query string stripping for web analytics.
#
# Currently stripped query parameteres include:
# - Google Analytics
# - Google Adwords (Doubleclick)
# - Facebook
set req.http.X-Original-Url = req.url;
set req.url = querystring.globfilter(req.url, "utm_*");
set req.url = querystring.filter(req.url,
"fbclid" + querystring.filtersep() +
#!/bin/bash
# Script to Auto Update Plex on Synology NAS
#
# Must be run as root.
#
# @author Martino https://forums.plex.tv/u/Martino
# @see https://forums.plex.tv/t/script-to-auto-update-plex-on-synology-nas-rev4/479748
mkdir -p /tmp/plex/