Skip to content

Instantly share code, notes, and snippets.

View kepstein's full-sized avatar

Kevin Epstein kepstein

View GitHub Profile
@kepstein
kepstein / gist:c97b0a2a5255a7fe79d1
Created October 6, 2014 20:41
MySQL query database size
SELECT table_schema "Data Base Name",
sum( data_length + index_length ) / 1024 /
1024 "Data Base Size in MB",
sum( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
GROUP BY table_schema ;
@kepstein
kepstein / Curated AWS Training.md
Last active August 1, 2016 04:01 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

@kepstein
kepstein / lambda_function.py
Created October 15, 2016 19:09
Lambda Event object in Python
#!/usr/bin/python
def lambda_handler(event, context):
print format(event)
@kepstein
kepstein / lambda_function.py
Last active October 16, 2016 19:12
Tag an AWS EC2 instance on instantiation or reboot
#!/usr/bin/python
# Use CloudWatch Events Trigger - Schedule:InstancePending
import boto3
import time
def main(event, context):
my_instance = str(event['detail']['instance-id'])
ec2 = boto3.client("ec2", region_name=str(event['region']))
@kepstein
kepstein / lambda_function.py
Created October 18, 2016 03:45
Print all OS environment exposed to AWS Lambda function using Python
import os
def lambda_handler(event, context):
print os.environ
@kepstein
kepstein / aws_ips_to_csv.sh
Last active November 14, 2016 23:42
Query AWS for latest IP range information, and export to CSV
# requires that jq utility be installed and in $PATH
curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[]| "\(.service),\(.region),\(.ip_prefix)"'|tr -d '"' > aws_ips.csv
@kepstein
kepstein / SugarCRM LAMP Stack Tuning
Created January 15, 2017 18:52 — forked from chicks/SugarCRM LAMP Stack Tuning
SugarCRM Performance Tweaks
Apache:
- Activated 'KeepAlive' connections
- Lowered keep alive timeout from 15 seconds to 2 seconds
- Increased the number of minimum workers from 8 to 16
- Activated server status page (/server-status)
APC (Alternative PHP Cache):
- Set cache size to 256MB (ideal for SugarCRM workload)
Memcache:
@kepstein
kepstein / polly.sh
Created January 20, 2017 19:03
AWS Polly generates TTS and downloads the result to MP3 using AWS CLI
aws polly synthesize-speech \
--output-format "mp3" \
--voice-id "Salli" \
--text "Amazon Polly is a service that turns text into lifelike speech. Polly lets you create applications that talk, enabling you to build entirely new categories of speech-enabled products. Polly is an Amazon AI service that uses advanced deep learning technologies to synthesize speech that sounds like a human voice. Polly includes 47 lifelike voices spread across 24 languages, so you can select the ideal voice and build speech-enabled applications that work in many different countries." \
polly-cli.mp3
@kepstein
kepstein / bamboo-install.sh
Created January 29, 2017 06:15 — forked from dave1010/bamboo-install.sh
Setup Bamboo
#!/bin/bash
# bamboo
mkdir /opt/atlassian
wget -O /opt/atlassian/bamboo.tar.gz http://www.atlassian.com/software/bamboo/downloads/binary/atlassian-bamboo-5.1.1.tar.gz
cd /opt/atlassian
tar xzf bamboo.tar.gz
mv atlassian* bamboo
mkdir /home/bamboo
@kepstein
kepstein / keybase.md
Last active January 30, 2017 05:25
Keybase

Keybase proof

I hereby claim:

  • I am kepstein on github.
  • I am kepstein (https://keybase.io/kepstein) on keybase.
  • I have a public key ASDPq_5BgOosJn48jsaPNZGRVM9Y1C7dj1sMgBIgWywTEgo

To claim this, I am signing this object: