Skip to content

Instantly share code, notes, and snippets.

View alexgleith's full-sized avatar

Alex Leith alexgleith

View GitHub Profile
@alexgleith
alexgleith / awscli-currentAmzLinux.sh
Created April 1, 2017 00:17 — forked from rdp-cloud/awscli-currentAmzLinux.sh
When run from an EC2 instance this snippet will return the CURRENT ami id for Amazon Linux in the REGION that the instance is running in and load it up into a variable called currentAMI.
#!/bin/bash -xe
# grab the Availability Zone from the Meta Data service
az=$(curl http://169.254.169.254/latest/meta-data/placement/availability-zone/)
# drop the trailing zone to get the REGION the instance is running in.
currentRegion=${az%?}
# retirve the source AMI (latest Amazon Linux image in this case)
currentAMI=$(aws ec2 describe-images --owners self amazon --filters "Name=name,Values=amzn-ami-hvm-*gp2" --query 'Images[].[CreationDate,ImageId]' --output text --region $currentRegion | sort -k1 | tail -n1 | awk '{print $2}')
@alexgleith
alexgleith / geojsonCircleMarker.html
Last active November 26, 2016 20:06 — forked from clhenrick/geojsonCircleMarkerHTML
added sample data
<!doctype html>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<html>
<head>
<title>test</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />