Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -o errexit
set -o nounset
set -x
export RETRIES=3
# Document box build time
echo "Built by Packer on $(date +'%Y-%m-%d %H:%M:%S %Z')" \
<?php
#
#
$url = $_SERVER['REQUEST_URI'];
$schoolid = explode("/", $url)[2];
$ch = curl_init();
#$consul = $_ENV['CONSUL_HOST'] . ":" . $_ENV['CONSUL_PORT'] . "/pulse/tenant/?recursive";
$consul_host = getenv('CONSUL_HOST');
sed -i "s/php_admin_value\[open_basedir.*/php_admin_value\[open_basedir\]\ \=\ \/var\/www\/html\/\:\/tmp\:\/data\/moodledata\//g" /etc/php5/fpm/pool.d/app.conf
SHOW VERSION;
@emalloy
emalloy / JSON
Created August 3, 2016 18:04
readme-extension
MongoDB shell version: 3.2.8
connecting to: admin
{
"set" : "mongoreplicas",
"date" : ISODate("2016-08-03T17:59:24.864Z"),
"myState" : 2,
"term" : NumberLong(1),
"syncingTo" : "10.253.2.135:27017",
"heartbeatIntervalMillis" : NumberLong(2000),
"members" : [
from __future__ import print_function
import boto3
route53 = boto3.client('route53')
ec2 = boto3.resource('ec2')
def lambda_handler(event, context):
instance_id = event['detail']['instance-id']
@emalloy
emalloy / mbp-pubkey
Created September 13, 2016 23:36
pubkey
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCy6tz0JrXD9gIM3uN6Gs5RN8mip/OOPKUcUjilIq2uCwA7XiwXv9V77NtzRVsvmECHowNMgdmdYb23TU7fmubQj40Za3zs1f/QhCIghI7Bqxj7KYvFBnYLTgpFm4YKdt8CRVq/mxcXZceDhbn0M4vaKUsEcDyMV+UzK0Ktx24gC7ur2aQY6+rml0/K7Jg4V52tOssmuSezSAgi4FWfOUfzs/9E0ZwRqIth+KZbxVdCvvFoezNLRz2EBU6slWp9+SsvOvaCyzkDg6R/RnWEOgmd+bDh5AF2xyveUzHfQbmebYeWlwGvW5H5VT0AAoWUxP8bQdtMv6X54AbRs0+GJSGr ericmalloy@Erics-MBP
@emalloy
emalloy / rmvb_to_mp4.sh
Created September 22, 2016 22:52
convert realMedia to mp4 , viewable over dlna
#!/usr/bin/env bash
# crafted specifically to handle filenames with a large number of spaces. hence the xargs 0 and i switches
find -name \*.rmvb -print0 \
| xargs -0 -i{} ffmpeg -i {} -c:v libx264 -crf 19 -strict experimental {}.mp4
@emalloy
emalloy / 0_reuse_code.js
Created November 16, 2016 18:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console