Skip to content

Instantly share code, notes, and snippets.

@agoddard
agoddard / index.html
Created September 21, 2019 07:47
crossing
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Add a GeoJSON line</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.45.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.45.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@agoddard
agoddard / working.kml
Created February 5, 2018 15:39
working kml
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>KML Export 2/5/2018 3:38:47 PM</name>
<Style id="style_emergency">
<IconStyle>
<colorMode>normal</colorMode>
<Icon>
<href>http://maps.google.com/mapfiles/kml/shapes/caution.png</href>
</Icon>
@agoddard
agoddard / test.kml
Created February 5, 2018 15:37
Empty KML
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>KML Export 2/5/2018 3:34:04 PM</name>
<Style id="style_emergency">
<IconStyle>
<colorMode>normal</colorMode>
<Icon>
<href>http://maps.google.com/mapfiles/kml/shapes/caution.png</href>
</Icon>
@agoddard
agoddard / ghetto_git_check.sh
Created December 3, 2014 05:10
poor mans git checker
#!/bin/sh
for i in $(ls -d */); do
cd ${i%%/};
if [ -d .git ]; then
modified=`git status --porcelain | grep M`
untracked=`git status --porcelain | grep "?"`
unpushed=`git status | grep ahead`
if ! [ -z "$modified" ]; then
echo "${i%%/} contains uncommitted changes"
fi
THREEDAYS = 60 * 60 * 24 * 3
files = ::Dir["/tmp/open-uri*"]
files.each do |agoddard|
file agoddard do
action :remove
only_if ( ::File.stat(agoddard).gid == 5001 && ::File.stat(agoddard).mtime.to_i >= THREEDAYS )
end
end
@agoddard
agoddard / finding_data
Created October 14, 2013 17:23
AAAAARGH.
~ $ curl -I http://gdex.cr.usgs.gov/gdex/
HTTP/1.1 503 Service Unavailable
Connection: Close
Content-Type: text/html
~ $ curl -I http://www.add.scar.org
curl: (7) couldn't connect to host
~ $ curl -I https://lta.cr.usgs.gov/GTOPO30
curl: (35) error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112)
@agoddard
agoddard / dod_global_thoughts.md
Created September 8, 2013 19:49
DoD Global thoughts

DevOpsDays Global disccusion August '13

@geekle & @anthonygoddard (Melbourne represent yo.)

decentralization

We talked about the need to decentralize DoD as much as possible, with the aim of reducing dependence on Patrick for the small stuff, letting him concentrate on the Big Stuff™

But we need to stay true to what makes DoD awesome

herinlies the challenge. One idea we discussed was to follow the "TEDx" model, where independent organizers are given a time-limited 'license' to run a single event. The license is applied for online, approved by core-organizers who can run through a simple checklist (is the event name too ambiguous (devopsdays USA, devopsdays california, is the event scheduled too close to another geographically close event etc) and in applying for the license, the licensee has to agree to some simple terms (tickets must be available to the general public, videos must be recorded of the talks, tickets mustn't cost more than $x, no vendor talks etc). Licenses would be simple to renew,

[root@testing-sensu01 ~]# /opt/sensu/embedded/bin/ruby campfire_test.rb
/opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:917:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (Faraday::Error::ConnectionFailed)
from /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:917:in `block in connect'
from /opt/sensu/embedded/lib/ruby/2.0.0/timeout.rb:51:in `timeout'
from /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:917:in `connect'
from /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:861:in `do_start'
from /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:850:in `start'
from /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:1366:in `request'
from /opt/sensu/embedded/lib/ruby/2.0.0/net/http.rb:1125:in `get'
from /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/faraday-0.8.7/lib/faraday/adapter/net_http.rb:73:in `perform_request'
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
puts "Everything is fine, you have plenty of credits, things are just great."
puts "None of your checks are down, you don't even need to worry."
puts "Also, " + JSON.parse(open('http://irish-toast.herokuapp.com').read)['toast']
@agoddard
agoddard / Vagrantfile
Last active December 15, 2015 14:08
sensu demo Vagrantfile
Vagrant::Config.run do |config|
config.vm.box = "sandbox"
config.vm.box_url = "http://repos.sensuapp.org/box/sandbox.box"
config.vm.forward_port 4567, 4567
config.vm.forward_port 8080, 8080
end