Skip to content

Instantly share code, notes, and snippets.

View clee's full-sized avatar

Chris Lee clee

  • Denver
View GitHub Profile
@clee
clee / binary-plist.js
Created June 3, 2011 21:36
initial binary plist implementation in nodejs
#!/usr/bin/env node
var fs = require('fs');
var sys = require('sys');
var bin = require('binary');
function bytesize(n) {
// JavaScript can't handle 64-bit ints natively.
// TODO: hack it up anyway.
// (n & 0xFFFFFFFF00000000) ? 8 : ...
@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"
#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 / .vimrc
Created April 13, 2017 16:45
vim configuration
" install with:
" mkdir -p ~/.vim/autoload ~/.vim/bundle && \
" curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
" `git clone` plugins into ~/.vim/bundle/
call pathogen#infect()
syntax on
set encoding=utf8
set noexpandtab tabstop=4 shiftwidth=4 smartindent
@clee
clee / lscpu
Created July 21, 2017 02:27
R7 1800X lscpu output
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
NUMA node(s): 1
Vendor ID: AuthenticAMD
@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
@clee
clee / YubiKey-GPG-SSH-guide.md
Last active November 26, 2018 21:03 — forked from ageis/YubiKey-GPG-SSH-guide.md
Technical guide for using YubiKey series 4 for GPG and SSH

YubiKey 4 series GPG and SSH setup guide

Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.

You'll probably be working with a single smartcard, so you'll want only one primary key (1. Sign & Certify) and two associated subkeys (2. Encrypt, 3. Authenticate).

@clee
clee / cpuinfo
Created February 13, 2019 02:54
Ryzen 1600X /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 23
model : 1
model name : AMD Ryzen 5 1600X Six-Core Processor
stepping : 1
microcode : 0x8001136
cpu MHz : 3570.951
cache size : 512 KB
physical id : 0
@clee
clee / prime-X470-pro.lsiommu.log
Last active February 4, 2020 01:12
Windows 10 guest on 3900X/Prime X470 Pro, with RTX 2080 VFIO PCIe passthrough
IOMMU Group 0:
00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge [1022:1482]
IOMMU Group 1:
00:01.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge [1022:1483]
IOMMU Group 2:
00:01.3 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge [1022:1483]
IOMMU Group 3:
00:02.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge [1022:1482]
IOMMU Group 4:
00:03.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge [1022:1482]
@clee
clee / end.gcode
Created December 29, 2017 23:28
TAZ6 start/end gcode for klipper
;
M400 ; wait for moves to finish
M104 S0 ; hotend off
M107 ; fans off
G91 ; relative positioning
G1 E-1 F300 ; retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+20 E-5 X-20 Y-20 F3000 ; move Z up a bit and retract filament even more
M117 Cooling please wait ; progress indicator message
G90 ; absolute positioning
G1 Y0 F3000 ; move to cooling position