Skip to content

Instantly share code, notes, and snippets.

View tomislacker's full-sized avatar

Ben Tomasik tomislacker

View GitHub Profile
@tomislacker
tomislacker / aws_route53_delete.sh
Created January 15, 2019 16:32 — forked from earljon/aws_route53_delete.sh
Delete a Route 53 Record Set in AWS CLI
#!/bin/sh
# NOTE:
# Make sure that the value of Name, Type, TTL are the same with your DNS Record Set
HOSTED_ZONE_ID=<YOUR_HOSTED_ZONE_ID>
RESOURCE_VALUE=<YOUR_DNS_RESOURCE_VALUE-ex:IP or dns>
DNS_NAME=<YOUR_DNS_NAME-ex: subdomain.domain.com>
RECORD_TYPE=<DNS_RECORD_TYPE-ex: A, CNAME>
TTL=<TTL_VALUE>
@tomislacker
tomislacker / ec2_kill_with_fire.py
Last active November 14, 2018 06:33
Kill EC2 Instances With Fire
#!/usr/bin/env python
"""
EC2 Instance Killer
Usage:
ec2_kill_with_fire.py [options] <instance_id>...
Options:
-h, --help Show this dialog
-r, --region NAME EC2 region [default: us-east-1]
@tomislacker
tomislacker / all_aws_lambda_modules.txt
Created October 22, 2018 18:44 — forked from gene1wood/all_aws_lambda_modules_python.md
AWS Lambda function to list all available Python modules and post the list to Pastebin
# module list (generated by listmodules.py)
#
# timestamp='20160226T200954Z'
# sys.version='2.7.10 (default, Dec 8 2015, 18:25:23) \n[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]'
# sys.platform='linux2'
# platform='Linux-4.1.13-19.31.amzn1.x86_64-x86_64-with-glibc2.2.5'
#
BaseHTTPServer
Bastion
CDROM
@tomislacker
tomislacker / microtime.sh
Last active September 11, 2018 15:10
Shell Get 'microtime(TRUE)'
#!/bin/bash
DEFAULT_SCALE=4
getMicrotime ()
{
date +%s%N
}
microElapse ()
@tomislacker
tomislacker / 2015.10.21_alembic_primer.md
Last active September 11, 2018 15:03
2015.10.21 Alembic Primer
@tomislacker
tomislacker / never-buy-samsung-t1.md
Last active September 4, 2018 20:45
Do Not Buy: Samsung T1 SSD
@tomislacker
tomislacker / unused_security_groups.sh
Last active July 25, 2018 16:33
Find Unused Security Groups.sh
#!/bin/bash
find_all_groups ()
{
aws ec2 describe-security-groups \
--query 'SecurityGroups[*].GroupId' \
--output text \
| tr '\t' '\n' \
| sort -u
}
@tomislacker
tomislacker / vpc.ipynb
Created July 10, 2018 16:49
VPC Network Designer
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

How to create a publicly-accessible SNS topic that sends messages when objects are added to a public Amazon S3 bucket.

1. Create something within AWS that triggers notifications.

In this case, that's an S3 bucket that is continually updated by the addition of new sensor data. For the purposes of this tutorial, we’ll use s3://noaa-nexrad-level2 – one of our NEXRAD on AWS buckets – as an example.

2. Create an SNS topic and appropriate policy.

The SNS topic should be in the same region as the bucket. It will need to have a policy that allows our S3 bucket to publish to it, and anyone to subscribe to it using Lambda or SQS.

@tomislacker
tomislacker / elasticache_benchmarking.ipynb
Last active May 4, 2018 21:10
Benchmarking ElastiCache (Redis) Bandwidth Performance
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.