Skip to content

Instantly share code, notes, and snippets.

@chmac
chmac / replication-delay.sh
Created February 12, 2014 12:48
Script called from monit to check replication delay
#!/bin/bash
# Specify the threshold over which an error should be flagged
# Defaults to 60, but can be passed like ./script threshold
if [ -z $1 ]
then
threshold=60
else
threshold="$1"
if [[ $threshold != +([0-9]) ]]
@chmac
chmac / wp-cron.sh
Created May 2, 2012 10:49 — forked from fcingolani/wp-cron.sh
Bash Script to execute wp-cron.php on a Multisite Wordpress installation, extracting database info from wp-config.php.
#!/bin/bash
# Script inspired by https://gist.github.com/1025598
#### WARNING ####
#### Please be careful with this script. The use of eval $(find) is dangerous.
#### If a user can upload a file called wp-config.php anywhere onto your site,
#### they can probably execute arbitrary commands via this script.
#### You have been warned. GPL, no warranty.
# Inspired by http://stackoverflow.com/questions/7586995/read-variables-from-wp-config-php