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 / 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
@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 / 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
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;
@robinsmidsrod
robinsmidsrod / ubuntu-installer-amd64-remote.ipxe
Created Apr 26, 2012
Ubuntu 12.04 netboot installer via iPXE
View ubuntu-installer-amd64-remote.ipxe
#!ipxe
#dhcp
echo Starting Ubuntu x64 installer for ${mac}
set base-url http://archive.ubuntu.com/ubuntu/dists/precise/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 / file_listing.txt
Last active Aug 4, 2018
Saltstack formulas for deplying networkboot/dhcpd docker hub image for guest network using VLAN 6
View file_listing.txt
/srv/salt/dhcpd/green/dhcpd.conf
/srv/salt/dhcpd/green/netboot.conf
/srv/salt/dhcpd/green/option-space.conf
/srv/salt/dhcpd/green.sls
/srv/salt/dhcpd/green/static.conf
/srv/salt/dhcpd/green.upstart
/srv/salt/dhcpd/guest/dhcpd.conf
/srv/salt/dhcpd/guest.sls
/srv/salt/dhcpd/guest.upstart
/srv/salt/dhcpd/init.sls
View logstash.conf
input {
udp {
type => "syslog"
host => "10.11.12.1"
port => 3514
}
udp {
type => "portfolio"
host => "10.11.12.1"
port => 3516
You can’t perform that action at this time.