Skip to content

Instantly share code, notes, and snippets.

View mwkorver's full-sized avatar

Mark Korver mwkorver

View GitHub Profile
set -x
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
# fix for "unable to resolve host" error even when dns hostnames/resolution are turned on for VPC
echo " $(hostname)" >> /etc/hosts
# copy shapefiles from S3 bucket
mwkorver / leaflet_example.html
Last active March 12, 2016 01:30
Workshop leaflet example HTML
<!DOCTYPE html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Tile-maker Demo using NAIP on S3</title>
<script type='text/javascript' src='//'></script>
<link rel="stylesheet" href="" />
<script src=""></script>
mwkorver / s3redirect
Last active March 25, 2016 20:57
S3 redirect for TMS
mwkorver / mapserver.user-data
Last active August 24, 2016 14:36
EC2 user data script to deploy MapServer container mounting USDA NAIP data (about 100TB) in aws-naip bucket.
set -x
# This EC2 user-data file will run a Mapserver docker container.
# Still working on getting it to reboot properly. See this link for more info on user-data scripts
# Because this setup uses data stored in an S3 bucket located in the standard region, it needs to be run in us-east-1 (Virginia Region).
# It mounts S3 data by using danilop/yas3fs. USDA CONUS NAIP data, Mapfile and shapefile indexes are made available to Mapserver in this way.
# Just running this instance will give you access to all of the NAIP data via the EC2 instance's filesystem.
# One caveat is that the combination of mapfile and UTM projected geotifs only supports WMS requests near native 1m/pixel resolution or level 17,