View filter_emails.script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function filter_emails() { | |
/// 1day is the smallest increment | |
var threads = GmailApp.search("newer_than:1d"); | |
for (var i = 0; i < threads.length; i++) { | |
// get all messages in a given thread | |
var messages = threads[i].getMessages(); | |
for (var j = 0; j < messages.length; j++) { |
View backupbuddy-email-template-lw.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Email Template | |
* | |
* @package BackupBuddy | |
*/ | |
?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> |
View WordPressDatabaseBackupsEE4.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -d /var/backups/wpdb/ ]; then | |
mkdir -p /var/backups/wpdb/ | |
fi | |
for x in `/usr/local/bin/ee site list --format=text | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"`; do | |
cd /opt/easyengine/sites/$x/app/htdoc | |
/usr/bin/wp --allow-root db export --add-drop-table /var/backups/wpdb/$x.sql | |
done |
View toxicity-meter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( empty( $_POST['command'] ) || $_POST['command'] != '/toxic' ) { | |
return false; | |
} | |
$command = $_POST['command']; | |
if ( empty( $_POST['text'] ) ) { | |
return false; |
View slack.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// cronjob: | |
// 0 8 * * * /usr/bin/php /path/to/file.php unmute > /dev/null 2>&1 | |
// 0 18 * * * /usr/bin/php /path/to/file.php mute > /dev/null 2>&1 | |
if ( 1 < $argc ) { | |
$channels = array( | |
'CHANNEL_ID', | |
); |
View Domain.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/local/bin/aws ec2 describe-tags --filters "Name=resource-id,Values=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id`" "Name=key,Values=domain" | grep Value | tr -d ' ' | cut -f2 -d: | tr -d '"' | tr -d ',' | |
#/usr/local/bin/aws ec2 describe-tags --filters "Name=resource-id,Values=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id`" | grep -b1 domain | grep Value | tr -d ' ' | cut -f2 -d: | tr -d '"' | tr -d ',' |
View wotd.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$wotd = get_wotd(); | |
if ( !empty( $wotd ) ) { | |
send_to_slack( $wotd ); | |
} | |
function get_wotd() { | |
$rss = new DOMDocument(); | |
$rss->load( 'https://www.merriam-webster.com/wotd/feed/rss2' ); |
View dj_yonder.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <FastLED.h> | |
//Using these LEDs: https://amzn.to/2qkaduF | |
//INVOLT WS2812B LED Strip Individually Addressable 60LED/M 3.2FT 1M, No Waterproof Flexible for DIY Decoration, DC 5V with Smart IC Chip Built-in Self Adhesive | |
#define LED_PIN 3 //Using pin 3 on an Adafruit Pro Trinket - 3V 12MHz: https://amzn.to/2yKQMQp | |
#define NUM_LEDS 52 //Didn't use all the LEDs in the strip | |
#define LED_TYPE WS2812B | |
#define COLOR_ORDER GRB | |
#define BRIGHTNESS 255 |
View RenewSSL.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for x in `/usr/local/bin/ee site list | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"`; do | |
/usr/local/bin/ee site update $x --le=renew | |
done | |
/usr/sbin/service nginx reload |
View WordPressDatabaseBackups.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -d /var/backups/wpdb/ ]; then | |
mkdir -p /var/backups/wpdb/ | |
fi | |
for x in `/usr/local/bin/wo site list | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"`; do | |
cd /var/www/$x/htdocs/ | |
/usr/local/bin/wp --allow-root db export --add-drop-table /var/backups/wpdb/$x.sql | |
done |
NewerOlder