For excessively paranoid client authentication.
See other tutorials.
const FEED_ID = "HERE"; | |
const API_KEY = "YOUR KEY"; | |
function send_xively(body) { //take in csv value | |
local xively_url = "https://api.xively.com/v2/feeds/" + FEED_ID + ".csv"; //setup url for csv | |
server.log(xively_url); | |
server.log(body); //pring body for testing | |
local req = http.put(xively_url, {"X-ApiKey":API_KEY, "Content-Type":"text/csv", "User-Agent":"Xively-Imp-Lib/1.0"}, body); //add headers | |
local res = req.sendsync(); //send request | |
if(res.statuscode != 200) { | |
server.log("error sending message: "+res.body); |
#!/usr/bin/perl -w | |
# check_zfs Nagios plugin for monitoring ZFS zpools | |
# Copyright (c) 2014-2015 | |
# Written by James Badger | |
# Released under the GNU Public License | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env ruby -KU | |
# Convert output from osmosis to CSV for spreadsheets. | |
# Usage: ./convert.rb output | |
file = ARGV[0] | |
def parse(line) | |
matches = line.match(/^\[([^\]]+)\] \d+ start import from seq-nr (\d+), replag is (\d+) day\(s\) and (\d+) hour\(s\)$/) | |
{ | |
date: matches[1], |
This note is about building a web map tile server using OpenStreetMap data and the Mapnik stack.
osm2pgsql is a tool for importing data from OpenStreetMap database extracts into PostgreSQL. By default, it imports into Spherical Mercator (900913) and that is great if you want to build a web map tile server that serves tiles in Spherical Mercator projection. If however you want to use a custom projection to enhance the display of geometry in a specific region, you can import using a custom projection.
For this example I will use EPSG:3573, a projection that vastly improves visualization of geography in the Arctic. To do the import, you can modify your osm2pgsql import command to include a reprojection (-E
):
$ sudo docker run -d --
#!/bin/bash -e | |
# check_replag Nagios plugin for monitoring mod_tile replag value | |
# Copyright (c) 2015 | |
# Written by James Badger | |
# Released under the GNU Public License | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or |
From 12c8326e8c6c1f21a6b56f4d0a5fcdb932d0fa56 Mon Sep 17 00:00:00 2001 | |
From: James Badger <Jamesbadger@gmail.com> | |
Date: Wed, 15 Dec 2010 15:55:51 -0700 | |
Subject: [PATCH] Fix find_or_create_by_x on association bug [#6147 state:resolved] | |
Commit fdfc8e3b9c4905057677fd009f463a377be60b93 fixed the | |
find_or_create_by_x find() being confused by the extra parameters, | |
but the create_by_x code from b64d1fe637d16916c59e2ddec403d9c7cd54b0f8 | |
does not convert the array properly for create(). This patch allows | |
sending of params with additional hash attributes by changing the |
(* | |
Return the quoted paths of the currently selected tracks in iTunes | |
Returns error if iTunes is not running | |
Call from command line with 'osascript -e itunes_selection.scpt' | |
*) | |
on run | |
tell application "System Events" | |
if (name of processes) contains "iTunes" is false then | |
return "Error: iTunes is not running" |
#!/usr/bin/env ruby | |
require 'date' | |
require 'net/smtp' | |
# Who to send the report to | |
RECIPIENTS = %w( me@example.com ) | |
# Who the message will be sent as | |
FROM_ADDRESS = "root@example.com" |