Skip to content

Instantly share code, notes, and snippets.

View ibejohn818's full-sized avatar

John Hardy ibejohn818

  • GoDaddy Inc
  • Los Angeles, Ca
View GitHub Profile
ansible==2.3.2.0
asn1crypto==0.24.0
awacs==0.8.1
bcrypt==3.1.5
boto==2.49.0
boto3==1.9.64
botocore==1.12.64
certifi==2018.11.29
cffi==1.11.5
cfn-flip==1.1.0.post1
@ibejohn818
ibejohn818 / Dockerfile
Created May 13, 2018 01:58
MP4Box Docker
FROM alpine:3.6 AS gpac_builder
WORKDIR /app
RUN apk update && \
apk add --no-cache \
wget \
g++ \
make \
&& \
@ibejohn818
ibejohn818 / get-region.sh
Created January 24, 2018 19:49
ec2 metadata get region
EC2_REGION="`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`"
@ibejohn818
ibejohn818 / Jenkinsfile
Created January 6, 2018 20:29
Jenkinsfile starter
#!/usr/bin/env groovy
import hudson.model.*
import hudson.EnvVars
node {
try {
stage("blank") {
@ibejohn818
ibejohn818 / infra.py
Last active December 31, 2017 22:19
proto-infras
import stackformation
from stackformation import BotoSession, Infra
from stackformation.aws.stacks import ( iam, vpc, ec2,
ebs, s3, eip, elb, sns,
logs, alarms, asg, codedeploy
)
from stackformation.aws import Ami
from stackformation.aws import user_data
@ibejohn818
ibejohn818 / install-cfn-init.sh
Last active January 1, 2018 09:39
Cloudformation-init-scripts
#!/usr/bin/env bash
if [ -d /etc/yum.repos.d ]; then
curl -L https://gist.github.com/ibejohn818/aa2bcd6743a59f62e1baa098d6365a61/raw/redhat-init.sh -o /tmp/redhat-install.sh
chmod +x /tmp/redhat-install.sh
/tmp/redhat-install.sh
/opt/aws/bin/cfn-signal --resource $1 --stack $2 --region $3
else
curl -L https://gist.github.com/ibejohn818/aa2bcd6743a59f62e1baa098d6365a61/raw/ubuntu-init.sh -o /tmp/ubuntu-install.sh
chmod +x /tmp/ubuntu-install.sh
import stackformation
from stackformation.aws import ( iam, vpc, ec2, user_data,
ebs, s3, eip, elb, sns,
logs, alarms, ami
)
def common_stacks(infra):
# VPC
@ibejohn818
ibejohn818 / mock-request.json
Last active December 10, 2017 07:39
Mock Lambda Proxy Request
{
"body": "{\"test\":\"body\"}",
"pathParameters": {
"proxy": "foo"
},
"httpMethod": "POST",
"stageVariables": {
"baz": "qux"
},
"resource": "/{proxy+}",
@ibejohn818
ibejohn818 / MT_WP_TOOLS
Last active June 8, 2017 15:58
Media Temple Wordpress PHP Utils
/***
* (mt) Media Temple
* PHP Tools for Wordpress migrations
*
*
*/
class MT_WP_TOOLS
{
private static $_wpDBConfig = false;
@ibejohn818
ibejohn818 / mysql-dump-import-table.sh
Last active May 2, 2017 18:01
MySQL Dump & Import between two databases a single table at a time
#!/usr/bin/env bash
###EXAMPLE USAGE
#./mysql-dump-import-table.sh {OUTHOST:OPTIONAL-PORT} {OUTUSER} {OUTDB_NAME} {INHOST:OPTIONAL-PORT} {INUSER} {INDB_NAME}
#Export Vars
DB_host=$1
DB_user=$2
DB=$3