Skip to content

Instantly share code, notes, and snippets.

Tony Fendall TonyFNZ

Block or report user

Report or block TonyFNZ

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@TonyFNZ
TonyFNZ / s3-to-s3-cross-accounts.py
Created Oct 18, 2018
This script will download a file from a S3 bucket in one AWS account and stream it directly into another S3 bucket in another account. File is streamed as it arrives, so memory usage is low (typically <100MB)
View s3-to-s3-cross-accounts.py
#! /bin/python
# This script will download a file from a S3 bucket in one AWS account
# and stream it directly into another S3 bucket in another account.
# File is streamed as it arrives, so memory usage is low (typically <100MB)
import boto3
# Create two S3 clients, one in each AWS account
# If wanting to use an instance role for one client, remove the access key parameters
@TonyFNZ
TonyFNZ / url-to-s3.py
Created Oct 17, 2018
This script will download a file from a URL and stream it directly into AWS S3 without persisting the file to local disk. File is streamed as it arrives, so memory usage is low (typically <100MB)
View url-to-s3.py
#! /bin/python
# This script will download a file from a URL and stream it directly
# into AWS S3 without persisting the file to local disk.
# File is streamed as it arrives, so memory usage is low (typically <100MB)
import boto3, urllib2
source_url = 'http://<Your URL Here>'
View blogexport.sh
#!/bin/bash
tempdir="blog-export/"
editdomain=editor.example.com
publishdomain=blog.example.com
# fail on any errors
set -e
# clean up previous run
@TonyFNZ
TonyFNZ / dnsupdate.sh
Created Oct 9, 2016
Script to update Route53 with the current public IP of an instance
View dnsupdate.sh
#!/bin/bash
hosted_zone_id="<your Route53 hosted zone id>"
domain_name="<your domain name>"
# Abort script on any errors
set -e
# Get new IP address
ip_address=`curl http://169.254.169.254/latest/meta-data/public-ipv4`
You can’t perform that action at this time.