01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140
Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.
[Laughter]
<?php | |
/* | |
* Script to count DNS queries for each domain associated to Cloudflare Account | |
* | |
* Params | |
* email Cloudflare Email | |
* token Cloudflare Global API Token | |
* start Start date in UTC ISO-8601 format Ex: 2017-10-20T00:00:00.000Z | |
* end End date in UTC ISO-8601 format | |
* domains (Optional) list of domains to compute DNS totals for; separate with comma. If this is empty, all domains will be checked. Ex: google.com,yahoo.com |
# Defaults / Configuration options for homebridge | |
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others) | |
HOMEBRIDGE_OPTS=-U /var/lib/homebridge | |
# If you uncomment the following line, homebridge will log more | |
# You can display this via systemd's journalctl: journalctl -f -u homebridge | |
# DEBUG=* |
package main | |
import ( | |
"log" | |
"net/http" | |
"net/http/httputil" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
The official instructions for installing Nominatim are complete, but brief in places, and several steps must be changed in the Amazon Linux environment (which is roughly CentOS / Redhat). The steps below are rough record of what I did to get it working, but I didn't keep perfect track so you shouldn't rely on them as a shell script. Just follow each step, make sure it worked, and hopefully you'll need to adapt very little (version numbers, for one thing). (I also skip in and out of root, but you can be more careful if you like.)
<?php | |
/** | |
* Tile utility class | |
* | |
* Handles converting slippy map tile numbers to lat/lon values | |
* Ported from: | |
* http://svn.openstreetmap.org/applications/routing/pyroute/tilenames.py | |
* http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Java | |
*/ | |
class Util_Tile { |
The difference between XYZ and TMS tiles and how to convert between them
Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles
ending in /0/0/0.png
or something. Sometimes if it's a script, it'll look like
&z=0&y=0&x=0
instead. Anyway, these are usually maps in Spherical Mercator.
Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.
Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.
#!/bin/sh | |
TMPFILE="/tmp/xtrabackup-runner.$$.tmp" | |
USEROPTIONS="--user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --host=${MYSQL_HOST}" | |
BACKDIR=/srv/mysql-bak | |
BASEBACKDIR=$BACKDIR/base | |
INCRBACKDIR=$BACKDIR/incr | |
FULLBACKUPCYCLE=604800 # Create a new full backup every X seconds | |
KEEP=1 # Number of additional backups cycles a backup should kept for. | |
START=`date +%s` |