Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
from airtable import Airtable
import os, glob, json
# Debugging
#folder = "./monit-sites/"
folder = '/etc/monit/conf-available'
scriptsfolder = '/opt/monit-scripts/'
try:
@doofusdavid
doofusdavid / wp-update.sh
Created October 21, 2020 17:50 — forked from pacoorozco/wp-update.sh
Backup and update a Wordpress Site using wp-cli
#!/usr/bin/env bash
##########################################################################
# Shellscript: Backup and update WordPress using wp-cli
# Author : Paco Orozco <paco@pacoorozco.info>
# Requires : wp-cli
##########################################################################
# Changelog
# 20170125: 1.0
# Adds a default option to upgrade only when it's needed.
# 20161220: 0.1
@doofusdavid
doofusdavid / checkCertExpire.sh
Created June 25, 2020 18:32
Check SSL Cert Expiration Date (usage sh checkCertExpire.sh domain.colostate.edu)
DOMAIN=$1
echo | openssl s_client -servername $DOMAIN -connect $DOMAIN:443 2>/dev/null|openssl x509 -noout -dates
@doofusdavid
doofusdavid / PY0101EN-2-2-Lists.ipynb
Created November 10, 2019 01:46
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@doofusdavid
doofusdavid / PY0101EN-2-1-Tuples.ipynb
Created November 10, 2019 01:41
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@doofusdavid
doofusdavid / gist:daf47a90b965720bd9e64bbf44d75972
Created August 22, 2018 15:04
Use WP-CLI to update plugin settings (purge-varnish) in multisite network
wp site list --field=url | xargs -n1 -I % wp option update --url=% varnish_version 4
wp site list --field=url | xargs -n1 -I % wp option update --url=% varnish_control_terminal 127.0.0.1:6082
wp site list --field=url | xargs -n1 -I % wp option update --url=% varnish_control_key SECRET_KEY_HERE
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
@doofusdavid
doofusdavid / speedtest.py
Created October 29, 2017 23:32
Take a speedtest and post the speed on Twitter
#!/usr/bin/python
import os
import sys
import csv
import datetime
import time
import twitter
def test():
@doofusdavid
doofusdavid / filecount.gs
Created February 13, 2017 22:59
Google Script to get file counts.
/**
* Google Apps Script - List all files & folders in a Google Drive folder, & write into a speadsheet.
* - Main function 1: List all folders
* - Main function 2: List all files & folders
*
* Hint: Set your folder ID first! You may copy the folder ID from the browser's address field.
* The folder ID is everything after the 'folders/' portion of the URL.
*
* @version 1.0
* @see https://github.com/mesgarpour
CREATE TABLE `movies` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`MovieName` varchar(45) DEFAULT NULL,
`Rating` double DEFAULT NULL,
`DateAdded` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
CREATE TABLE `Rating` (
`ID` int(11) NOT NULL AUTO_INCREMENT,