Skip to content

Instantly share code, notes, and snippets.

@PhilGeek
PhilGeek / README.markdown
Created July 22, 2008 11:21
LaTeX preamble and associated scripts

README

LaTeX Preamble

Created by Mark Eli Kalderon on 2008-07-30

Introduction

LaTeX preamble and associated files. Meant to be used as a submodule of a Git repository. The file, preamble.tex, needs to be included in the LaTeX document under version control. See the provided template. For more information about keeping your LaTeX preamble in a Git submodule see this blog post.

@eqhmcow
eqhmcow / hfsc-shape.sh
Last active August 2, 2023 11:59
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.
@jof
jof / gist:1281122
Created October 12, 2011 12:37
Cisco CDPviaSNMP-to-Graphviz Creator
#!/usr/bin/env ruby
require 'getoptlong'
require 'rubygems'
require 'snmp'
SNMP_COMMUNITY = 'public'
HOSTNAME_BLACKLIST = [ "that_one_switch_thats_down_but_in_dns" ]
ZONE_FILE = /path/to/dns/zone/file
HOSTNAME_REGEX = /^\s?(switch[0-9]+)/i
@kaleb
kaleb / aliases
Created October 15, 2011 15:51
Gmail on Mutt
#~/.mutt/aliases
alias nick Nicholas Levandoski <nick.levandoski@auglug.org>
alias tim Timothy Pitt <timothy.pitt@auglug.org>
alias steven Steven Jackson <sjackson@auglug.org>
alias kaleb Kaleb Hornsby <kaleb.hornsby@auglug.org>
alias alug-admin nick, tim, steven
@stevenhaddox
stevenhaddox / server_certificates_to_pem.md
Last active May 8, 2024 07:13
Convert .crt & .key files into .pem file for HTTParty

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hostname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hostname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample

@ga2arch
ga2arch / gist:1621666
Created January 16, 2012 16:34
clj-sudoku (backtracking)
(ns clj-sudoku.core
(:gen-class))
;;; Records
(defrecord Square [pos x y num hints sure unit])
;;; Grids
(def easy-grid ".931.564.7.......55.12.93.72.......3.369.752.9.......13.24.81.96.......4.473.285.")
@bdha
bdha / vbox_to_kvm.txt
Created March 1, 2012 04:04
Migrating from VirtualBox to KVM on ZFS
# It's important to convert the vbox image (VMDK or VDI or whatever) using
# the same version of VirtualBox that created it. You can try converting the image
# with qemu-img or kvm-img, but weird version mismatches will possibly make it not
# work.
# On your VirtualBox machine:
cd $VBOX_ROOT/$MACHINE_ROOT/
VBoxManage clonehd machine.vmdk machine.img --format RAW
scp machine.img root@kvm-host:/somewhere
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active July 26, 2024 01:29
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

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/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

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

@rlander
rlander / hiccup-demo.clj
Created April 17, 2012 19:45
Old hiccup demo
(ns hiccup-demo
(:use hiccup))
(def core-examples
["Simple tags" [:br]
"Tags with content" [:span "baz"]
"Tag with attributes" [:span {:id "foo" :class "bar"} "baz"]
"Attribute shortcuts" [:span#foo.bar "baz"]
"Encode HTML character entities" '(escape-html "<\"foo\"&\"bar\">")
"Shortcut for escape-html" '(h "<\"foo\"&\"bar\">")])
@cadar
cadar / smart os nat
Created May 8, 2012 20:36
make nat work with kvm running debian, raw file, I will redo this tomorrow and make sure nothing unnecessary is here
vmadm list
# remove your previous try
export ID=`vmadm list|grep run|cut -b-36` ; echo $ID
export ID=`vmadm list|grep stop|cut -b-36` ; echo $ID
vmadm stop $ID
vmadm destroy $ID
script
dladm show-phys -m
dladm show-link