Random recipes of JMESPath for the AWS CLI tools that I might have written or stumbled upon.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
———————————————————————————————————————————————————————————————————————————————————————————————————— | |
BBEDIT/TEXTWRANGLER REGULAR EXPRESSION GUIDE MODIFIED 2016/02/29 17:26 | |
———————————————————————————————————————————————————————————————————————————————————————————————————— | |
NOTES: | |
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use. | |
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Deny", | |
"Action": "*", | |
"Resource": "*", | |
"Condition": { | |
"ForAllValues:StringEquals": { | |
"aws:RequestedRegion": [ |
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def lambda_handler(event, context): | |
print os.environ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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'])) |