Skip to content

Instantly share code, notes, and snippets.

View onecooltaco's full-sized avatar

Jeremy Leggat onecooltaco

  • Arizona State University
  • Phoenix, AZ
View GitHub Profile
@onecooltaco
onecooltaco / force-ssl-url-scheme.php
Last active July 13, 2021 21:48 — forked from webaware/force-ssl-url-scheme.php
For WordPress, force the protocol scheme to be HTTPS when is_ssl() doesn't work, e.g. on a load-balanced server where _SERVER['HTTPS'] and _SERVER['SERVER_PORT'] don't indicate that SSL is being used. NB: may not be needed now, see SSL Insecure Content Fixer and HTTP Detection: https://ssl.webaware.net.au/https-detection/
<?php
/***
Plugin Name: Proxy SSL URL Scheme
Plugin URI: https://gist.github.com/onecooltaco/8eb7a0b0038eebc014e61c21c80c1029
Description: Force the protocol scheme to be HTTPS when HTTP_X_FORWARDED_PROTO is https
Version: 1.0.0
Author: Jeremy Leggat
Forked from https://gist.github.com/webaware/4688802
@onecooltaco
onecooltaco / md2wp
Created October 20, 2016 19:07 — forked from Gen2ly/md2wp
Convert Markdown to Wordpress blogging format
#!/bin/bash
# Convert Markdown to Wordpress blogging format
# Required program(s)
req_progs=(ascii2uni pandoc)
for p in ${req_progs[@]}; do
hash "$p" 2>&- || \
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }
done
@onecooltaco
onecooltaco / my.cnf
Created April 15, 2016 22:33 — forked from fevangelou/my.cnf
Optimized MySQL configuration
# Optimized MySQL configuration by Fotis Evangelou - Updated Jan 2016
#
# The settings provided below are a starting point for a 4GB-8GB RAM server with 4 CPU cores.
# If you have less or more resources available you MUST adjust accordingly to save CPU, RAM and disk I/O usage.
# To fine tune these settings for your system, use MySQL DB diagnostics tools like:
# https://launchpad.net/mysql-tuning-primer
# or
# http://blog.mysqltuner.com/download/
# Note that if there is no comment beside a setting, then you don't need to adjust it.
#!/usr/bin/python
'''Uses Cocoa classes via PyObjC to set a desktop picture on all screens.
Tested on Mountain Lion and Mavericks. Forked from https://gist.github.com/hunty1/548edaf7e913c8f4e06b,
which was inspired by Greg Neagle's work: https://gist.github.com/gregneagle/6957826
See:
https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWorkspace_Class/Reference/Reference.html
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html
@onecooltaco
onecooltaco / install_puppet_mac.sh
Created March 15, 2012 23:45 — forked from rija/install_puppet_mac.sh
Installing Puppet on Mac OS X
#!/usr/bin/env bash
set -o errtrace
set -o errexit
facter_version=$1
puppet_version=$2
target_volume=$3
@onecooltaco
onecooltaco / mysql_rep.sh
Created November 8, 2011 23:05 — forked from hcooper/mysql_rep.sh
A mysql replication plugin for the check_mk nagios system
#!/bin/bash
#
# A mysql replication plugin for the check_mk nagios system.
# Place me in /usr/lib/check_mk_agent/local on the client
#
# Hereward Cooper <coops@iomart.com> - 16/06/11
MYSQL_USER="root"
MYSQL_PASS="PAassw0rd"