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 / 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
@robinsmidsrod
robinsmidsrod / gist:f8227a22ae1109b4a9ab
Created May 27, 2014
Unable to upgrade OmniOS from r151006 to r151008
View gist:f8227a22ae1109b4a9ab
# /usr/bin/pkg update -nv --be-name=omnios-r151008 entire@11,5.11-0.151008
Creating Plan /
pkg update: No matching version of entire can be installed:
Reject: pkg://omnios/entire@11,5.11-0.151008:20131204T230829Z
pkg://omnios/entire@11,5.11-0.151008:20131205T191306Z
pkg://omnios/entire@11,5.11-0.151008:20131205T195242Z
Reason: This version is excluded by installed incorporation pkg://ms.omniti.com/omniti/network/tcpdump@4.3.0,5.11-0.151006:20130816T193600Z
This version is excluded by installed incorporation pkg://perl.omniti.com/omniti/perl/class-load@0.20,5.11-0.151006:20140312T200321Z
This version is excluded by installed incorporation pkg://perl.omniti.com/omniti/perl/class-singleton@1.4,5.11-0.151006:20140312T200347Z
This version is excluded by installed incorporation pkg://perl.omniti.com/omniti/perl/common-sense@3.6,5.11-0.151006:20140312T194315Z
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active Apr 30, 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 / remote_logging.conf
Created Jul 4, 2012
rsyslogd setup for remote logging
View remote_logging.conf
$ cat /etc/rsyslog.d/remote_logging.conf
# provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
# provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
# Limits reception to our subnet
$AllowedSender UDP, 10.1.1.0/24
$AllowedSender TCP, 10.1.1.0/24
@robinsmidsrod
robinsmidsrod / _README.md
Last active Apr 18, 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 / dhcpd.conf
Last active Apr 17, 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 / sysrcd.ipxe
Last active Mar 30, 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 / 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
View list_container_by_parent.sql
CREATE FUNCTION public.list_container_by_parent(in_parent_id uuid, in_locale text, in_sort_key text, in_custom_init_key text) RETURNS SETOF public.node
LANGUAGE sql STABLE COST 30 ROWS 20
AS $$
-- Returns the child containers of the specified parent container in the
-- sort order specified by the sort key and locale.
-- If sort key is not specified, the sort key of the parent container,
-- or default for parent container type, is used.
-- If custom_init key is specified, containers that have this key set are
-- excluded from output. The value of the custom_init key doesn't matter.
WITH
View datatype_or_null.sql
CREATE FUNCTION public.datatype_or_null(data anyelement, datatype text)
RETURNS anyelement
LANGUAGE plpgsql IMMUTABLE
AS $$
BEGIN
RETURN CAST(data AS datatype);
EXCEPTION
WHEN OTHERS THEN
RETURN CAST(NULL AS datatype);
END;
You can’t perform that action at this time.