Skip to content

Instantly share code, notes, and snippets.

Jesse Crocker JesseCrocker

Block or report user

Report or block JesseCrocker

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
View valhalla

Ultimate Goal: valhalla running on AWS ECS, behind a load balancer, in multiple regions, with auto scaling, with data updating once a week.


First goal: Build with docker, then cut tiles from a small extract and get server to run locally.

jesse:projects/ $ mkdir ~/valhalla-data
jesse:projects/ $ cd ~/valhalla-data
jesse:projects/ $ wget
[output abbreviated]
jesse:projects/ $ cd ~/projects
JesseCrocker /
Last active Aug 13, 2019
A quick script for converting US Topo geoPDF maps to tiff. Based on code from Even Rouault at
#!/usr/bin/env python
#based on
from osgeo import gdal, osr
import os
import sys
from optparse import OptionParser
import tempfile
from shapely import wkt
from shapely.geometry import mapping
from fiona import collection, crs
JesseCrocker / aws.conf
Created Feb 15, 2016
How to install AWS CloudWatch Logs Agent to send logs from a docker container to AWS Cloudwatch, without using a linked container for logging.
View aws.conf
cwlogs = cwlogs
region = ap-southeast-2
JesseCrocker /
Last active Apr 14, 2019
Create a collage of images, filling all space without cropping. Implements algorithm presented in
#!/usr/bin/env python
from operator import itemgetter
from optparse import OptionParser
import logging
from PIL import Image
from math import ceil, floor
import sys
JesseCrocker /
Last active Mar 24, 2019
Use a GPX file to simulate locations in the Genymotion Android emulator. Requires gpxpy. `pip install gpxpy`
#!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
import os
import gpxpy
import gpxpy.gpx
import time
from subprocess import check_output
import math
JesseCrocker /
Last active Feb 20, 2019
Scripts for building Gdal into a static library for iOS, will build a single lib with armv7 armv7s arm64 and simulator slices
rm -rf $PREFIX
mkdir $PREFIX
rm -rf $LOG
mkdir $LOG
if [ -e ${PREFIX} ]
JesseCrocker / function.js
Created Apr 29, 2016
AWS lambda function for posting cloudwatch alarms to slack
View function.js
var AWS = require('aws-sdk');
var url = require('url');
var https = require('https');
var hookUrl, kmsEncyptedHookUrl, slackChannel;
kmsEncyptedHookUrl = ''; // Enter the base-64 encoded, encrypted key (CiphertextBlob)
slackChannel = '#alerts'; // Enter the Slack channel to send a message to
JesseCrocker /
Created Jul 28, 2015
Convert a directory of .bil files to .hgt
function gdal_pixel_count() {
if [ -z "$1" ]; then
echo "Missing arguments. Syntax:"
echo " gdal_extent <input_raster>"
EXTENT=$(gdalinfo $1 |\
grep "Size is" |\
sed "s/Size is //g;s/,//;s/\n//")
JesseCrocker /
Last active May 21, 2018
Simple ECS service deploy script

Deploy updates to aws ecs services based on github commits. Posts deploy notifications to slack.


  • Task definitions map 1:1 with services, and they have the same name.
  • Code is stored on github
  • You want to deploy the latest commit in a branch
  • Docker images are tagged with commit SHA
  • Docker images are stored on AWS ECR
JesseCrocker / cleanup.js
Created May 3, 2018
Aws lambda function that allows a user to hit a url and get added to an aws security group, and another function to cleanup old entries in the group
View cleanup.js
"use strict";
var AWS = require("aws-sdk");
var ec2 = new AWS.EC2();
var securityGroup = "sg-XXX";
exports.handler = (event, context, callback) => {
ec2.describeSecurityGroups({ GroupIds: [securityGroup] }, function(
You can’t perform that action at this time.