Skip to content

Instantly share code, notes, and snippets.

@kyroskoh
kyroskoh / OSRM Car (Drive) Server HTTP API.md
Last active February 23, 2018 04:05
OSRM Car (Drive) Server HTTP API

OSRM Car (Drive) Server HTTP API

Assumption

Assuming that your OSRM Service is running on the default port: 5000.


Format:

@kyroskoh
kyroskoh / Building OSRM & Setup in Production to Run on Boot (On-Premise).md
Last active February 23, 2018 04:05
Building OSRM & Setup in Production to Run on Boot (On-Premise)

Public Version

General build instructions from source

OSRM source is available via git or source archives, and is built with CMake.

Git

To download from Git, run the following commands:

git clone https://github.com/Project-OSRM/osrm-backend.git -b 5.5
@kyroskoh
kyroskoh / Building on Ubuntu 14.04 & 16.04 For OSRM (On-Premise).md
Last active January 11, 2018 03:43
Building on Ubuntu 14.04 & 16.04 For OSRM (On-Premise)

Prerequisite

Ubuntu 16.04 is recommended.

Please ensure that your username is ubuntu. Example: /home/ubuntu

If not:

sudo adduser ubuntu
@kyroskoh
kyroskoh / sed_snippets.sh
Created November 14, 2017 05:23 — forked from r2k0/sed_snippets.sh
sed examples
##FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
# triple space a file
@kyroskoh
kyroskoh / cloudfront_nginx_fix.conf
Created November 2, 2017 06:04 — forked from jpoehnelt/cloudfront_nginx_fix.conf
Fix for Cloudfront Proxy NGINX
# Look for client IP in the X-Forwarded-For header
real_ip_header X-Forwarded-For;
# Ignore trusted IPs
real_ip_recursive on;
# Set VPC subnet as trusted
set_real_ip_from 10.0.0.0/16;
# Set CloudFront subnets as trusted
@kyroskoh
kyroskoh / README.md
Created November 1, 2017 03:04 — forked from benjaminbarbe/README.md
Nginx proxy to S3 with caching
{
'kyroskoh': {},
'sgmy': {},
'kkj_9690a': {},
'xndlxss': {},
'jojo_low': {},
'kiaraakitty': {}
}
@kyroskoh
kyroskoh / aws-multipartUpload.js
Created June 27, 2017 08:31 — forked from sevastos/aws-multipartUpload.js
Example AWS S3 Multipart Upload with aws-sdk for Node.js - Retries to upload failing parts
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload
var fs = require('fs');
var AWS = require('aws-sdk');
AWS.config.loadFromPath('./aws-config.json');
var s3 = new AWS.S3();
// File
var fileName = '5.pdf';
var filePath = './' + fileName;
var fileKey = fileName;
@kyroskoh
kyroskoh / AWS_S3_File_Upload.js
Created June 27, 2017 08:15 — forked from homam/AWS_S3_File_Upload.js
How to upload files to AWS S3 with NodeJS SDK
var AWS = require('aws-sdk'),
fs = require('fs');
// For dev purposes only
AWS.config.update({ accessKeyId: '...', secretAccessKey: '...' });
// Read in the file, convert it to base64, store to S3
fs.readFile('del.txt', function (err, data) {
if (err) { throw err; }
@kyroskoh
kyroskoh / Amazon S3 Client Side Upload
Created June 27, 2017 08:10 — forked from MichMich/Amazon S3 Client Side Upload
Example of an Amazon S3 upload.
<!DOCTYPE html>
<html>
<head>
<title>AWS S3 File Upload</title>
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1.12.min.js"></script>
</head>
<body>
<input type="file" id="file-chooser" />