Skip to content

Instantly share code, notes, and snippets.

View clee's full-sized avatar

Chris Lee clee

  • Denver
View GitHub Profile
#ifndef RUMPV3_1_PIC18F4550
#define RUMPV3_1_PIC18F4550
#if defined(SCANMAP_PIC18F4550)
// scanmap for PIC18F4550
#pragma udata
const unsigned rom char keymap[16][8] = { // IBM Model M keymap, 16 rows, 8 columns
{ 0, 0, MOD_LCTRL, 0, 0, 0, MOD_RCTRL, 0 }, // row 1 (RA0)
{ 0, MOD_LSHIFT, 0, 0, 0, 0, MOD_RSHIFT, 0 }, // row 2 (RA1)
{ KEY_esc, KEY_tab, KEY_grave, KEY_1, KEY_Q, KEY_A, KEY_Z, 0 }, // row 3 (RA2)
@clee
clee / iptables.go
Last active April 3, 2016 17:13
watchdog daemon for reconfiguring multihome routing setups
package main
import (
"io"
"log"
"strconv"
"os/exec"
"bytes"
"github.com/moovweb/gokogiri"
"github.com/moovweb/gokogiri/xpath"
@clee
clee / parsejson.go
Last active December 9, 2015 03:08
parsing newznab results in go
package main
import (
"fmt"
"io/ioutil"
"encoding/json"
)
type NewznabAttr struct {
Name string
@clee
clee / JavaClassNameGenerator.clj
Last active August 29, 2015 14:01
Port of @airencracken's JavaClassNameGenerator into a language that actually runs on the JVM for maximum lulz
(def nonsense [
"Serializer"
"Listener"
"XML"
"Builder"
"Interface"
"Manager"
"Handler"
"Factory"
"Observer"
@clee
clee / broken-cloud.log
Last active August 29, 2015 14:00
cloud-config user issue
Apr 23 07:31:02 localhost systemd[1]: Starting Load cloud-config from /usr/share/oem/cloud-config.yml...
Apr 23 07:31:02 localhost coreos-cloudinit[2929]: 2014/04/23 07:31:02 Fetching user-data from datasource of type "local-file"
Apr 23 07:31:02 localhost coreos-cloudinit[2929]: 2014/04/23 07:31:02 Parsing user-data as cloud-config
Apr 23 07:31:02 localhost coreos-cloudinit[2929]: 2014/04/23 07:31:02 Wrote /etc/oem-release to filesystem
Apr 23 07:31:02 localhost coreos-cloudinit[2929]: 2014/04/23 07:31:02 Wrote file /run/systemd/system/etcd.service.d/10-oem.conf to filesystem
Apr 23 07:31:02 localhost coreos-cloudinit[2929]: 2014/04/23 07:31:02 Writing unit ec2-ssh-key.service to filesystem
Apr 23 07:31:02 localhost coreos-cloudinit[2929]: 2014/04/23 07:31:02 Placed unit ec2-ssh-key.service at /run/systemd/system/ec2-ssh-key.service
Apr 23 07:31:02 localhost coreos-cloudinit[2929]: 2014/04/23 07:31:02 Enabling unit file /run/systemd/system/ec2-ssh-key.service
Apr 23 07:31:02 10-10-10-2 coreos-cloudinit[2929]
@clee
clee / keybase.md
Created April 13, 2014 20:38
Keybase proof

Keybase proof

I hereby claim:

  • I am clee on github.
  • I am clee (https://keybase.io/clee) on keybase.
  • I have a public key whose fingerprint is 32EF 25A2 BA27 0268 2C0F 0662 7A6B DC1F F1DD 2862

To claim this, I am signing this object:

@clee
clee / ssl.conf
Created April 10, 2014 19:09
nginx SSL configuration
ssl_session_cache shared:SSL:32m;
ssl_session_timeout 10m;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-RC4-SHA:HIGH:!MD5:!aNULL:!EDH;
ssl_prefer_server_ciphers on;
@clee
clee / form.html
Created October 21, 2013 21:21
DreamObjects snippets for DreamScape article
<form action="https://promethean.objects.dreamhost.com/" method="POST" enctype="multipart/form-data">
<input type="hidden" name="key" value="uploads/${filename}">
<input type="hidden" name="AWSAccessKeyId" value="nr-q3_Rsprv94CdsuEpI">
<input type="hidden" name="acl" value="private">
<input type="hidden" name="success_action_redirect" value="http://c133.org/tmp/dho-success.html">
<input type="hidden" name="policy" value="eyJleHBpcmF0aW9uIjogIjIwMTUtMDEtMDFUMDA6MDA6MDBaIiwKICAiY29uZGl0aW9ucyI6IFsKICAgIHsiYnVja2V0IjogImNsZWUifSwKICAgIFsic3RhcnRzLXdpdGgiLCAiJGtleSIsICJ1cGxvYWRzLyJdLAogICAgeyJhY2wiOiAicHJpdmF0ZSJ9LAogICAgeyJzdWNjZXNzX2FjdGlvbl9yZWRpcmVjdCI6ICJodHRwOi8vYzEzMy5vcmcvdG1wL2Roby1zdWNjZXNzLmh0bWwifSwKICAgIFsic3RhcnRzLXdpdGgiLCAiJENvbnRlbnQtVHlwZSIsICIiXQogIF0KfQo=">
<input type="hidden" name="signature" value="zYcruOMR6qr7o6/Syj001g/trms=">
<input type="hidden" name="Content-Type" value="image/jpeg">
File to upload to DreamObjects: <input name="file" type="file">
<input type="submit"
@clee
clee / tailpipe.go
Created August 20, 2013 22:10
tailpipe uses 'tail -f' to read a file, and spits out the result over EventSource to whoever's listening.
package main
import (
eventsource "github.com/msgehard/goEventSource"
"encoding/json"
"net/http"
"os/exec"
"flag"
"log"
// "fmt"
@clee
clee / agealyzer.clj
Last active April 14, 2018 08:41
agealyzer: given a root directory, spits out histogram of ages of files
(ns clee.agealyzer)
(require '[clojure.java.io :as io])
(defn date [x] (java.util.Date. x))
(defn is-file? [f] (.isFile f))
(defn last-modified [f] (.lastModified f))
(defn get-year [x] (.getYear x))
(defn process-dir