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
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active Sep 17, 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

@robinsmidsrod
robinsmidsrod / _README.md
Last active Sep 6, 2019
Embedded iPXE menu to choose which network adapter to boot from (autodetects up to 10 adapters)
View _README.md

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)

@robinsmidsrod
robinsmidsrod / ubuntu-amd64-installer.ipxe
Created Mar 27, 2012
Boot Ubuntu x64 installer directly from the network. Only iPXE needed
View ubuntu-amd64-installer.ipxe
#!ipxe
dhcp
echo Starting Ubuntu x64 installer for ${hostname}
set base-url http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${base-url}/linux
initrd ${base-url}/initrd.gz
#imgargs linux auto=true url=http://yourserver/some/path/preseed.cfg
boot ||
# If everything failed, give the user some options
echo Boot from ${base-url} failed
@robinsmidsrod
robinsmidsrod / gist:18a559af2680f85a72134a6d3093f62f
Last active Aug 22, 2019
BitDefender Rescue CD iPXE boot script (non-working because missing /bin/mount.nfs in initramfs)
View gist:18a559af2680f85a72134a6d3093f62f
:bitdefender
echo Booting BitDefender Rescue ${bitdefender-version} x86 for ${initiator-iqn}
set base-url bitdefender-rescue-${bitdefender-version}/
kernel ${base-url}boot/kernel.i386-pc root=/dev/nfs nfsroot=${nfs-server}:${nfs-root}${base-url} ip=dhcp real_root=/dev/nfs loop=/rescue/livecd.squashfs looptype=squashfs livecd.nfsif=${netX/mac} initrd udev cdroot
initrd ${base-url}boot/initfs.i386-pc
boot || goto failed
goto start
@robinsmidsrod
robinsmidsrod / dhcpd.conf
Last active Aug 18, 2019
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
View dhcpd.conf
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 / git-branch-sizes
Last active Aug 8, 2019
Output all non-merged refs in a git repo, ordered by number of changed lines in the diff output
View git-branch-sizes
#!/bin/bash
#
# Output all non-merged refs in a git repo, ordered by number of changed lines in the diff output
#
git for-each-ref --shell --format="ref=%(refname)" --no-merged | \
while read entry
do
eval "$entry"
size=$(git diff -U0 "master...$ref" | grep -vP '^(diff|index|@@|\-\-\-|\+\+\+)' | wc -l)
@robinsmidsrod
robinsmidsrod / sysrcd.ipxe
Last active Jun 9, 2019
SystemRescueCD iPXE menu script and monkeypatch for preloading sysrcd.dat with iPXE instead of loading from local storage
View sysrcd.ipxe
#!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
@robinsmidsrod
robinsmidsrod / nic-menu.ipxe
Created Apr 7, 2016
iPXE embedded menu that tries to boot each network adapter in turn
View nic-menu.ipxe
#!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
@robinsmidsrod
robinsmidsrod / logstash.conf
Created Dec 5, 2012
Logging Windows event log information to Logstash using nxlog and JSON transport
View logstash.conf
input {
tcp {
type => "syslog"
host => "127.0.0.1"
port => 3514
}
tcp {
type => "eventlog"
host => "10.1.1.2"
port => 3515
@robinsmidsrod
robinsmidsrod / gist:395097
Created May 9, 2010
Win32::API x64 compile fail
View gist:395097
g++ -o ..\blib\arch\auto\Win32\API\Callback\Callback.dll -mdll -s -L"C:\Programs\strawberry-perl\perl\lib\CORE" -L"C:\Programs\strawberry-perl\c\lib" Callback.o -Wl,--image-base,0x21000000 C:\Programs\strawberry-perl\perl\lib\CORE\libperl511.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp
C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 ..\blib\arch\auto\Win32\API\Callback\Callback.dll
C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e "cp" -- Callback.bs ..\blib\arch\auto\Win32\API\Callback\Callback.bs
C:\Programs\strawberry-perl\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 ..\blib\arch\auto\Win32\API\Callback\Callback.bs
C:\Programs\strawberry-perl\perl\bin\perl.exe C:\Programs\strawberry-perl\perl\lib\ExtUtils\xsubpp -typemap C:\Programs\strawberry-perl\perl\lib\ExtUtils\typemap -typemap typemap AP
You can’t perform that action at this time.