Skip to content

Instantly share code, notes, and snippets.

Working from home

Aki Atoji akiatoji

Working from home
Block or report user

Report or block akiatoji

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 Setup OSRM route server for North America on

OSRM North America route server on EC2


OSRM route server is an extremely useful tool for getting the driving distance/time through multiple locations. The route server requires data that has to be downloaded and processsed before it can be used to serve routes from.

Processing OSRM data for large region like North America can be a real challenge due to memory and disk size requirements. It's also really time consuming. If you cut and try from scratch, you will repeatedly run into some constraints and fail after hours of running.

The following are summary notes from trying this with eventual success.

akiatoji /
Last active Jun 25, 2019
Running Clojure on Raspberry Pi with OS X

Clojure on Raspberry Pi with OS X

"Clojure running on Raspberry Pi" sounded so cool that I just had to give it a try.

Install JDK

  • Download ARM JDK from Oracle and instlal on Raspberry Pi
  • Change visudo to contain the following
View Google Cloud Platform Load

In Cloud Console:

  • Create load balancer
  • Create Compute instances with network tag to use as load balancer target.
  • Create health check

Create target pool

gcloud compute target-pools create extloadbalancer  --region $MY_REGION --http-health-check webserver-health
akiatoji / _sns_description
Last active Jun 13, 2019
AWS SNS Sample code.
View _sns_description
Notes on how to use AWS SNS:
1. Subscribe an HTTP endpoint (i.e. http://myhost/sns_endpoint) on AWS Console
2. AWS will send subscription confirmation right away
3. SNS_controller responds to subscription confirmation by sending confirmation using Fog.
4. Once AWS is happy, you can start sending notifications to your end point via SNS.
ENV APP_HOME /app ENV PORT 8080 CMD exec gunicorn --bind$PORT \
--workers 1 --chdir $APP_HOME --threads 1 app:app
#!/usr/bin/env bash
gcloud services enable
gcloud kms keys list --location global --keyring $KEYRING
if [[ $? -ne 0 ]]; then
gcloud kms keyrings create ${KEYRING} --location global
def load_from_encrypted(app):
tempname = str(uuid.uuid4())
encrypted_file_name = "secrets-%s.cfg.encrypted" % tempname
decrypted_file_name = "secrets-%s.cfg.decrypted" % tempname
storage_client = storage.Client()
bucket = storage_client.get_bucket('vault')
blob = bucket.blob('secrets.cfg.encrypted')
import os
import uuid
from import storage, kms_v1
def load(app):
config_file_name = "secrets-%s.cfg" % str(uuid.uuid4())
storage_client = storage.Client()
bucket = storage_client.get_bucket('vault')
from my_lib import secrets
app = Flask(__name__)
# Load default config
# Overlay secure secrets
View create_geo_from_lat_lon.sql
create table zones.locations_geo
select name, value, ST_GeogPoint(lng, lat) point
from `akis-geoproject.zones.locations`
You can’t perform that action at this time.