Skip to content

Instantly share code, notes, and snippets.

@BenHigginbottom
BenHigginbottom / efsmount.sh
Last active July 9, 2019 15:07
EFS Userdata Mount
#!/bin/bash
EC2_AVAIL_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
mount_target_DNS_a=``
mount_target_DNS_b=``
mount_target_DNS_c=``
efs_mount_point=``
case "$EC2_AVAIL_ZONE" in
#Nicked from http://blog.ranman.org/cleaning-up-aws-with-boto3/
import boto3
from datetime import datetime, timedelta
region = "eu-west-1"
cloudwatch = boto3.client("cloudwatch", region_name=region)
today = datetime.now() + timedelta(days=1) # today + 1 because we want all of today
two_weeks = timedelta(days=14)
start_date = today - two_weeks

Keybase proof

I hereby claim:

  • I am benhigginbottom on github.
  • I am benhig (https://keybase.io/benhig) on keybase.
  • I have a public key whose fingerprint is FCE7 8F82 7647 FAB8 2556 37EB B2F4 CA18 1678 A8EC

To claim this, I am signing this object:

@BenHigginbottom
BenHigginbottom / xmlcommentor.py
Created September 1, 2015 20:55
Comment out a namespace in an xmlfile, breaking any other comments within the namespace first
from xml.dom import minidom
import os, time, shutil
xmlfile=('<xmlfile here')
resultFile='result.xml'
commentSub=('<namespacehere>')
now=str(int(time.time()))
bkup=(xmlfile+now)
shutil.copy2(xmlfile, bkup)