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 August 26, 2023 12:24
Booting an Apple Mac into iPXE using simulated Apple Boot Server on ISC DHCPD
next-server 10.0.3.2;
if ( substring(option vendor-class-identifier, 0, 9) = "AAPLBSDPC"
and substring(option vendor-class-identifier, 10, 4) = "i386" ) {
# This needs to be there to tell the client we're an Apple boot server
option vendor-class-identifier "AAPLBSDPC";
# Normally the client asks for a list, we respond, they tell us what we want,
# then we send a select back with the information of that image.
# This skips all that and forces the select down to the client.
option vendor-encapsulated-options 01:01:02;
# Use ipxe.efi for native drivers, or snponly.efi for underlying UNDI
@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.
hass:account
hass:alert
hass:alert-circle
hass:altimeter
hass:apple-safari
hass:apps
hass:arrow-bottom-left
hass:arrow-down
hass:arrow-left
hass:arrow-right
@john-clark
john-clark / i.pxe
Last active February 27, 2023 21:46
ipxe php boot system
#!ipxe
#
# This file gets compiled into undionly.kpxe
################################################################
:vars
set next-server 192.168.2.121
cpuid --ext 29 && set arch amd64 || set arch x86
:netconfig
dhcp net0 || goto ipxeshell
:prompt
@robinsmidsrod
robinsmidsrod / inventory.ipxe
Created July 16, 2015 22:48
iPXE hardware inventory script (from svenx)
# Run a PCI/SMBios/net inventory scan and upload the results. This gives us a
# way of tracking nodes to some extent, leaving us less blind than usual.
#
# We use the iPXE pciscan command to enumerate the PCI bus. For each device, we
# check the 'header type' register at offset 0x0e. If it's type 0 (endpoint),
# we can read the subsystem vendor and device registers too. Unfortunately, if
# the 7th bit of the header type field is set (0x80), it indicates a
# multi-function device. So to check the type, this bit should be masked out.
# Masking is not possible with iPXE commands, so we have to duplicate some of
# the iseq tests.
@john-clark
john-clark / SET-WDS-PXE.CMD
Last active September 15, 2022 15:40
windows deployment server
@ECHO OFF
ECHO Before using this make sure all file types are allowed
ECHO Use clear-tftfpfilter.reg @ https://gist.github.com/john-clark/5360694/
:: Command line error check:
IF "%1"=="" GOTO Syntax
:: Check default
IF "%1"=="default" GOTO ResetWDS
@afair
afair / parse_hstore.pl
Created August 2, 2011 17:58
Perl methods to parse and create PostgreSQL hstore column data
##----------------------------------------------------------------
## 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;
@robinsmidsrod
robinsmidsrod / README.md
Created October 9, 2012 13:32
Testing out the upcoming NFS support in iPXE
@robinsmidsrod
robinsmidsrod / nic-menu.ipxe
Created April 7, 2016 10:46
iPXE embedded menu that tries to boot each network adapter in turn
#!ipxe
set timeout 1000
:menu
menu Network boot options for ${uuid}
item --key a default Try to boot (a)ll network adapters in turn
item
item --gap -- --- Detected network adapters ---
set i:int8 0
@AdamNaj
AdamNaj / about.md
Last active July 13, 2022 19:50
Z Wave Graph for Home Assistant