Skip to content

Instantly share code, notes, and snippets.

View kevin1024's full-sized avatar

Kevin McCarthy kevin1024

View GitHub Profile
@kevin1024
kevin1024 / parse_kml.py
Created March 5, 2014 23:55
kml to geojson
from xml.etree import ElementTree
from shapely.geometry import Polygon, Point
import json
poly_table = []
data = open('/tmp/chicago.kml')
tree = ElementTree.parse(data)
namespace = tree.getroot().tag[1:].split("}")[0]
placemarks = tree.findall(".//{%s}Placemark" % namespace)
@kevin1024
kevin1024 / resque_queues
Created February 16, 2013 00:44
Munin plugin for resque queue stats
#!/bin/sh
VALS=$(curl --silent http://127.0.0.1:5678/stats.txt)
QUEUES=$(echo "$VALS" | grep "queues")
case $1 in
config)
cat <<'EOM'
graph_title Resque Queues
@kevin1024
kevin1024 / resque_rate
Created February 16, 2013 00:56
Munin plugin that gives the resque rate of processing
#!/bin/sh
VALS=$(curl --silent http://127.0.0.1:5678/stats.txt)
PROCESSED=$(echo "$VALS" | grep "resque.processed")
case $1 in
config)
cat <<'EOM'
graph_title Resque Processed
Capital Ships:
Carrier:
- [Caldari Carrier 1, Gallente Carrier 1, Amarr Carrier 1, Minmatar Carrier 1]
- Jump Drive Operation 1
- Capital Ships 1
- Fighters 1
- [Capital Repair Systems 1, Capital Shield Operation 1]
- [Capital Energy Emission Systems 1, Capital Shield Emission Systems 1, Capital Remote Armor Repair Systems 1]
Dreadnought:
- [Amarr Dreadnought 1, Caldari Dreadnought 1, Gallente Dreadnought 1, Minmatar Dreadnought 1]
@kevin1024
kevin1024 / gist:bf73b7fbfb0236765d2e
Last active August 29, 2015 14:05
saigon noodle house soundtrack
Bee Gees - How Deep is Your Love
Wham! - Last Christmas
Simon and Garfunkel - The Sound of Silence
Chris De Burgh - Lady in Red
@kevin1024
kevin1024 / upgrade_mysql.sh
Last active August 29, 2015 14:02
Upgrade MySQL 5.0 -> MariaDB 10.x on Centos5
# Run this file as root and cross your fingers.
# Making a backup first is probably a good idea.
# The last step will prompt you for your mysql root password.
YUMREPO_FILEPATH="/etc/yum.repos.d/MariaDB.repo"
MYCNF_FILEPATH="/etc/my.cnf.d/server.cnf"
/bin/cat <<EOM >$YUMREPO_FILEPATH
# MariaDB 10.0 CentOS repository list - created 2014-06-20 18:47 UTC
# http://mariadb.org/mariadb/repositories/

Keybase proof

I hereby claim:

  • I am kevin1024 on github.
  • I am kevin1024 (https://keybase.io/kevin1024) on keybase.
  • I have a public key whose fingerprint is 048D 30BE 6FEA F12A D1D4 785F 4D7E 75E7 3C7F A179

To claim this, I am signing this object:

#!ipxe
set coreos-version dev-channel
set base-url http://storage.core-os.net/coreos/amd64-generic/${coreos-version}
kernel ${base-url}/coreos_production_pxe.vmlinuz root=squashfs: state=tmpfs: sshkey="sh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDWzDKMlhF44JiKOhdmDmLGbXSgqaVi5ho5tVgTR8aupQbBxK3Xp//xVGM12G8Niue0YNjHX3epHCKLqjKjzXVE/PwJBa8whf0YNZ6MGcqcSZBFWsFN6eg4EHZ81q9g1JR2SWUsTSLRdqtO6TNhBCw5qkQ9X8o/Y8I/GT7PIombMsaUOAZgXHIdua/ToJrLg4tnD+1wLXBTlV1nAvEDRchtywer5rMpBsimGg4F9ioQF7ygLJn7iJhmPS946UvQZCfwlY6+kRxMNcnMorqJwLiXUMcMes/XNgpXZJblER3uXmIRhMrjjr0CBe/wBV+uwIOQ7ie2a2YBeiX/qWHNv+5d"
initrd ${base-url}/coreos_production_pxe_image.cpio.gz
boot