Skip to content

Instantly share code, notes, and snippets.

View perusio's full-sized avatar

António P. P. Almeida perusio

View GitHub Profile
@perusio
perusio / gist:2133228
Created March 20, 2012 09:17
Get the size of an image file using Nginx Embedded Lua module
## Get the size of the image file using Lua.
## Cf. http://wiki.nginx.org/HttpLuaModule#set_by_lua.
location ~* \.(?:gif|jpe?g|png)$ {
set_by_lua $img_file_size '
function fsize (file)
local current = file:seek() -- get current position
local size = file:seek("end") -- get file size
file:seek("set", current) -- restore position
return size
end
@perusio
perusio / sharded-balancing-nginx.txt
Created March 21, 2012 23:58 — forked from zzzcpan/sharded-balancing-nginx.txt
Sharded load balancing with nginx and perl
# Balancing over 4 nodes by hashing URI (consistently with md5)
# onto 16 shards.
upstream x0 { server 192.168.0.2; server 192.168.0.3 backup; }
upstream x1 { server 192.168.0.2; server 192.168.0.4 backup; }
upstream x2 { server 192.168.0.2; server 192.168.0.5 backup; }
upstream x3 { server 192.168.0.2; server 192.168.0.3 backup; }
upstream x4 { server 192.168.0.3; server 192.168.0.4 backup; }
@perusio
perusio / clips-mode.el
Last active January 15, 2020 06:59
Emacs CLIPS mode
;;; clips-mode.el --- Clips editing mode.
;;;************************************************************************
;;; Basado en jess-mode.el de:
;; Copyright (C) 1999 by David E. Young.
;; Author: David E. Young <david.young@fnc.fujitsu.com>
;; Keywords: languages, clips
@perusio
perusio / lake_konstanz_aoi.json
Created October 21, 2019 13:25
Lake Konstanz AOI
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@perusio
perusio / geostore-found-spot-AU.json
Created September 23, 2019 14:44
Geostore found image not available through OneAtlas API. Australia.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@perusio
perusio / job_inputs.json
Created September 19, 2019 05:56
UP42: Re-using a previously downloaded image
{
"tiling:1": {
"tile_width": 768,
"tile_height": 768,
"match_extents": false,
"output_prefix": "",
"augmentation_factor": 1,
"discard_empty_tiles": true
},
"data-conversion:1": {
@perusio
perusio / data.json
Created September 19, 2019 05:14
UP42: GeoJSON from downloaded image with order ID.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@perusio
perusio / data.json
Created September 12, 2019 17:00
ryo geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@perusio
perusio / first_workflow_aoi.json
Created August 29, 2019 11:54
UP42 Getting started: Running your first workflow AOI.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@perusio
perusio / first_job_run.sh
Last active August 29, 2019 11:23
UP42 API: Script to run your fist job via the API.
#!/bin/bash
# first_job_run.sh --- Simple bash script to run a first job via the
# UP42 API.
# Copyright (C) 2019 UP42 GmbH
# Author: António P. P. Almeida <antonio.almeida@up42.com>
# Permission is hereby granted, free of charge, to any person obtaining a