Skip to content

Instantly share code, notes, and snippets.

Robin Smidsrød robinsmidsrod

Block or report user

Report or block robinsmidsrod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@eqhmcow
eqhmcow / hfsc-shape.sh
Last active Jun 20, 2019
HFSC - linux traffic shaping's best kept secret
View hfsc-shape.sh
#!/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.
@bradoaks
bradoaks / hfsc-shape.sh
Created Apr 25, 2011 — forked from eqhmcow/hfsc-shape.sh
HFSC - linux traffic shaping's best kept secret
View hfsc-shape.sh
#!/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.
@robinsmidsrod
robinsmidsrod / gist:948098
Created Apr 29, 2011
Booting PXELinux from another location than original TFTP/DHCP-specified location
View gist:948098
#!ipxe
echo
echo Booting SystemRescueCD 2.1.0 x86 for ${hostname}
# PXELinux options, see http://syslinux.zytor.com/wiki/index.php/PXELINUX for details
set 210:string http://boot.smidsrod.lan/sysrcd-2.1.0-x86/
set 209:string isolinux.cfg
set filename ${210:string}pxelinux.0
chain ${filename} ||
echo Booting ${filename} failed, dropping to shell
shell
@schwern
schwern / .gitconfig
Created May 25, 2011
My git aliases
View .gitconfig
[alias]
st = status
ci = commit -v
cii = commit -v --interactive
cia = commit -v -a
addi = add --interactive
addchanged = add -u
br = branch
co = checkout
diffwords = diff --word-diff
@afair
afair / parse_hstore.pl
Created Aug 2, 2011
Perl methods to parse and create PostgreSQL hstore column data
View parse_hstore.pl
##----------------------------------------------------------------
## HSTORE: PostgreSQL key-value store column type
##----------------------------------------------------------------
# Double-quotes the value, escaping embedded double-quotes. This is NOT the
# same as db quoting (which uses apostrophes), and any value here must also
# be quote()'ed before sending to the database.
sub double_quote {
my ($self, $v) = @_;
$v =~ s/"/\\"/g;
@briandfoy
briandfoy / gist:1342877
Created Nov 6, 2011
Perl regex escapes by version of their introduction
View gist:1342877
# compiled by Tom Christiansen
v1.0 \0, \0N,\0NN Match octal character up to octal 077.
v1.0 \N, \NN, \NNN Match Nth capture group (decimal) if not in charclass and that many seen, else (octal) character up to octal 377.
v4.0 \a Match the alert character (ALERT, BEL).
v5.0 \A True at the beginning of a string only, not in charclass.
v1.0 \b Match the backspace char (BACKSPACE, BS) in charclass only.
v1.0 \b True at Unicode word boundary, outside of charclass only.
v1.0 \B True when not at Unicode word boundary, not in charclass.
v4.0 \cX Match ASCII control character Control-X (\cZ, \c[, \c?, etc).
v5.6 \C Match one byte (C char) even in UTF‑8 (dangerous!), not in charclass.
@wki
wki / css_parser.pl
Created Dec 22, 2011
Sample CSS Parser using Marpa::XS
View css_parser.pl
use strict;
use warnings;
use feature ':5.10';
use Marpa::XS;
use Data::Dumper;
#
# a simple CSS snippet for testing
#
my $text = q{
@rubic
rubic / salt-minion.conf
Created Jan 15, 2012
Upstart configuration file for salt-minion
View salt-minion.conf
# salt-minion.conf
description "salt-minion upstart daemon"
author "Jeff Bauer <jbauer@rubic.com>"
# copy this file to /etc/init
start on (net-device-up and local-filesystems)
stop on shutdown
expect fork
@rubic
rubic / gist:1657182
Created Jan 22, 2012
Installing salt with apt-get and pip
View gist:1657182
apt-get -y install python-pip python-dev python-setuptools git-core
apt-get -y install libzmq1 libzmq-dev python-m2crypto
pip install PyYAML pycrypto pyzmq msgpack-python salt
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active Aug 25, 2019
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)
View _INSTALL.md

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

You can’t perform that action at this time.