Skip to content

Instantly share code, notes, and snippets.

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/bootstrap.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@johnko
johnko / ttc2ttf.py
Created September 4, 2013 21:01 — forked from kayahr/ttc2ttf.py
ttc2ttf
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#First released as C++ program by Hiroyuki Tsutsumi as part of the free software suite “Beer”
#I thought porting it to Python could be both a challenge and useful
from sys import argv, exit, getsizeof
from struct import pack_into, unpack_from
def ceil4(n):

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@johnko
johnko / ssh-multi.sh
Last active July 28, 2022 15:34 — forked from dmytro/ssh-multi.sh
a script to ssh multiple servers over multiple tmux panes
#!/bin/sh
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# Modified by johnko https://gist.github.com/johnko/a8481db6a83ec5ea2f37
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
# this config needs haproxy-1.1.28 or haproxy-1.2.1
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#chroot /usr/share/haproxy
user haproxy
group haproxy
We couldn’t find that file to show.
We couldn’t find that file to show.
We couldn’t find that file to show.
@johnko
johnko / couch-clone.py
Created October 26, 2015 09:27 — forked from dustin/couch-clone.py
Make a couch have all the stuff another couch has.
#!/usr/bin/env python
import sys
import couchdb
if __name__ == '__main__':
srcurl, desturl = sys.argv[1:]
@johnko
johnko / derpfs.py
Created October 29, 2015 05:51 — forked from HarryR/derpfs.py
PyFilesystem driver for GridFS
#!/usr/bin/env python
# based on the tahoelafs project
# requires modification to pyfilesystem for mknod etc.
# but provides enough to extract a minimal linux install
# and then chroot into it :)
import pymongo
import gridfs
import os
import fs
import math