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 / ipxe.sh
Created Aug 3, 2016
Bash functions for building iPXE in different ways
View ipxe.sh
#!/bin/bash
make_ipxe() {
pushd "$HOME/src/forked/ipxe/src" >/dev/null &&
make CONFIG=chain bin/undionly.kpxe bin/ipxe.lkrn bin/ipxe.pxe bin/ipxe.usb &&
sudo install -v -m 0644 -g root -o root bin/undionly.kpxe /srv/salt/tftpd/files/undionly.kpxe &&
sudo install -v -m 0644 -g root -o root bin/ipxe.lkrn /srv/salt/tftpd/files/ipxe.lkrn &&
sudo install -v -m 0644 -g root -o root bin/ipxe.pxe /srv/salt/tftpd/files/ipxe.pxe &&
sudo salt-call -l quiet state.single file.recurse name=/srv/tftp source=salt://tftpd/files dir_mode=755 file_mode=644 &&
popd >/dev/null
@robinsmidsrod
robinsmidsrod / elive.ipxe
Created Jul 7, 2016
Booting Elive 2.6.18 beta using iPXE and NFS
View elive.ipxe
:elive
echo Starting Elive ${elive-version} for ${initiator-iqn}
# Get the ISO from http://www.elivecd.org/download/beta/
set base-url elive-${elive-version}
set kernel-args \
boot=live swap=off \
ip=dhcp root=/dev/nfs nfsroot=${nfs-server}:${nfs-root}${base-url} \
config username=eliveuser
kernel ${base-url}/live/vmlinuz1 ${kernel-args}
initrd ${base-url}/live/initrd1.img
View query.sql
select *
from history
where trigger_table = 'object'
and trigger_old->>'object_id' = '155c705d-7c21-4828-ba6f-15172046a169'
order by triggered_at desc
@robinsmidsrod
robinsmidsrod / lio_start.sh
Last active Jul 6, 2016
Configuration for iscsi targets using LIO on Linux (generated via targetcli application)
View lio_start.sh
mkdir /sys/kernel/config/target/iscsi
#### iSCSI Discovery authentication information
echo -n 0 > /sys/kernel/config/target/iscsi/discovery_auth/enforce_discovery_auth
#### Network portals for iSCSI Target Portal Group
mkdir -p /sys/kernel/config/target/iscsi/iqn.2011-02.lan.smidsrod:testvm.boot.ubuntu/tpgt_1/np/10.1.1.10:3260
#### iSCSI Target Ports
mkdir -p /sys/kernel/config/target/iscsi/iqn.2011-02.lan.smidsrod:testvm.boot.ubuntu/tpgt_1/lun/lun_0
ln -s /sys/kernel/config/target/iscsi/iqn.2011-02.lan.smidsrod:testvm.boot.ubuntu/tpgt_1/lun/lun_0/../../../../../../target/core/iblock_7/testvm.boot.ubuntu /sys/kernel/config/target/iscsi/iqn.2011-02.lan.smidsrod:testvm.boot.ubuntu/tpgt_1/lun/lun_0/0acc9b6c97
lio_node --aluasecmd iqn.2011-02.lan.smidsrod:testvm.boot.ubuntu 1 0
#### Attributes for iSCSI Target Portal Group
View gist:7c0be3662073da16db7330149177d5ee
#!ipxe
chain https://d11xdyzr0div58.cloudfront.net/static/netboot/ipxe.2cfc24c4bb9a.pxe
@robinsmidsrod
robinsmidsrod / all_ipxe_debug_files.txt
Last active Sep 20, 2017
find src/ -type f -name \*.c | while read name; do basename "$name" .c; done | grep -v '_test$' | grep -v '^keymap_' | xargs echo DEBUG=
View all_ipxe_debug_files.txt
DEBUG=wep,wpa_psk,wpa_ccmp,net80211,wpa_tkip,sec80211,rc80211,wpa,pccrd,aoe,ipv4,neighbour,eapol,infiniband,vlan,httpbasic,httpdigest,syslogs,httpconn,ftp,http,iscsi,httpcore,https,httpauth,oncrpc,httpblock,tcpip,nfs_uri,nfs,oncrpc_iob,mount,nfs_open,portmap,dhcp,dhcpv6,tftp,slam,ntp,dns,syslog,fragment,tls,ipv6,retry,socket,icmp,eth_slow,dhcppkt,validator,fcns,icmpv4,dhcpopts,peerdist,ib_mcast,ib_service,xsigo,ib_cmrc,ib_pathrec,ib_packet,ib_mi,ib_smc,ib_sma,ib_srp,ib_cm,pccrc,ndp,iobpad,fcp,stp,fcels,tcp,peermux,udp,fcoe,ethernet,fakedhcp,ping,peerblk,rndis,rarp,peerdisc,nullnet,arp,icmpv6,netdev_settings,fc,netdevice,zbin,hijack,iccfix,einfo,efirom,efifatbin,elf2efi,nrv2b,ifmgmt,imgmgmt,imgtrust,prompt,ipstat,ntpmgmt,dhcpmgmt,lotest,fcmgmt,profstat,ibmgmt,route_ipv6,pingmgmt,pxemenu,iwmgmt,autoboot,sync,route_ipv4,nslookup,route,neighmgmt,__udivmoddi4,__udivdi3,__umoddi3,__divmoddi4,__divdi3,__moddi3,implicit,icc,pinger,assert,linebuf,fbcon,profile,nvo,cwuri,stringextra,gdbstub,xferbuf,xfer,getkey,basename
View gist:e1196cf4b3e07090ca42aa9c46d3c3db
/> ls
o- / ......................................................................................................................... [...]
o- backstores .............................................................................................................. [...]
| o- fileio ................................................................................................... [0 Storage Object]
| o- iblock .................................................................................................. [8 Storage Objects]
| | o- fdvm.boot.freedos ............................................................ [/dev/zvol/raid/fdvm.boot.freedos activated]
| | o- hp.boot.freedos ................................................................ [/dev/zvol/raid/hp.boot.freedos activated]
| | o- hp.boot.vmware .................................................................. [/dev/zvol/raid/hp.boot.vmware activated]
| | o- htpc.boot.ubuntu .............................................................
View Blobs.pm
#!perl
use strict;
use warnings;
package BlobMachine::Resource::Blobs;
use parent 'BlobMachine::Resource';
use HTTP::Headers::ActionPack::DateHeader;
use List::Util ();
View gist:61e583f806845bedd4f16980f69f5658
if "file" in [type] {
if [program] =~ /^beats_input_codec_.*_applied$/ {
mutate {
replace => [ "program", "%{[program][0]}" ]
}
}
}
@robinsmidsrod
robinsmidsrod / make_vbox.sh
Created May 16, 2016
Build script for custom iPXE ROM for VirtualBox
View make_vbox.sh
make_vbox() {
pushd "$HOME/src/forked/ipxe/src" >/dev/null &&
#make bin/intel--virtio-net--pcnet32.dsk EMBED=../nic-menu.ipxe &&
make CONFIG=vbox bin/intel--virtio-net--pcnet32.isarom && #EMBED=config/vbox/embedded.ipxe &&
#perl util/padimg.pl --verbose --blksize 4096 bin/intel--virtio-net--pcnet32.isarom &&
echo "Max size of VirtualBox ROM is 56KB, 57344 bytes" &&
ls -l bin/intel--virtio-net--pcnet32.isarom &&
prefix=$(date +%Y%m%d-%H%M%S) &&
mkdir -p /ipxe/$prefix &&
cp -v bin/intel--virtio-net--pcnet32.isarom /ipxe/$prefix/ &&
You can’t perform that action at this time.