Skip to content

Instantly share code, notes, and snippets.

View robinsmidsrod's full-sized avatar

Robin Smidsrød robinsmidsrod

View GitHub Profile
@robinsmidsrod
robinsmidsrod / dhcpd.conf
Last active May 11, 2024 00:20
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN (private network)
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@robinsmidsrod
robinsmidsrod / _README.md
Last active May 11, 2024 00:20
Embedded iPXE menu to choose which network adapter to boot from (autodetects up to 10 adapters)

Go into your git checkout folder of ipxe.

Save the below file as nic-menu.ipxe.

Build iPXE like this:

cd src && make EMBED=../nic-menu.ipxe && cd ..

Requirements: current iPXE as of 2013-08-01 (for proper behavior of autoboot with a network device specified, netX feature, PCI vendor/device ID display and inc command)

@willurd
willurd / web-servers.md
Last active May 10, 2024 05:14
Big list of http static server one-liners

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
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@mikejoh
mikejoh / docker-dhcpd.md
Last active April 3, 2024 16:37
Short guide on how to set up a Docker container as a DHCP server

Setting up a Docker container as a DHCP server

In this guide I’ve tested a number of different commands and configurations using Docker to run a container with dhcpd (+macvlan driver) to serve my clients in my home network. In the end i’ll migrate from my Windows 2012 R2 Server running DHCP to a much more lightweight Docker container (7.42 MB in total). Wow.

My home environment:

  • Firewall (Juniper)
    • I’m running IP helper for bootp which in this case means that i relay DHCP requests from various VLANs into one where i've placed my Windows 2012 R2 server. This is also where my container will live. See the FW configuration below:
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active March 21, 2024 23:00
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

@robinsmidsrod
robinsmidsrod / sysrcd.ipxe
Last active February 15, 2024 12:47
SystemRescueCD iPXE menu script and monkeypatch for preloading sysrcd.dat with iPXE instead of loading from local storage
#!ipxe
set sysrcd-version 4.7.1
echo Booting SystemRescueCD ${sysrcd-version} x86 for ${initiator-iqn}
# Kernel command-line options are documented here:
# http://www.system-rescue-cd.org/Sysresccd-manual-en_Booting_the_CD-ROM#Network_boot_using_PXE
set base-url sysrcd-${sysrcd-version}-x86/
kernel ${base-url}isolinux/altker${archs} setkmap=no net.ifnames=0 backstore=off
initrd ${base-url}isolinux/initram.igz
initrd ${base-url}sysrcd.dat /sysrcd.dat
# Load the ramdisk again as a file inside the ramdisk, so our custom init script
@NiKiZe
NiKiZe / dnsmasq.conf
Last active January 27, 2024 06:16
Trying to chainload iPXE with full feature set from a lesser featured one. dnsmasq ProxyDHCP edition
# Known working dnsmasq version 2.85 config for iPXE proxydhcp usage
# things to replace:
# * 10.1.1.0 - your subnet
# * eth0 - interface to listen on, or switch to bind-dynamic
# * 10.1.1.2 - your tftp server ip
# * http://gentoo.ipxe.se/boot.ipxe - script to run once inside iPXE
# Debug logging
log-debug
@schwern
schwern / .gitconfig
Created May 25, 2011 22:02
My git aliases
[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
@bradoaks
bradoaks / hfsc-shape.sh
Created April 25, 2011 14:51 — forked from eqhmcow/hfsc-shape.sh
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.