Skip to content

Instantly share code, notes, and snippets.

@rjsocha
rjsocha / nic-menu.ipxe
Created Aug 16, 2020 — forked from robinsmidsrod/nic-menu.ipxe
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
@rjsocha
rjsocha / powershell_script_sign.ps1
Last active Feb 26, 2021
PowerShell self-signed script
View powershell_script_sign.ps1
# CA Generation
# {hex}30030101FF => ASN.1 BasicConstraints: CA:TRUE
# $asn1=([System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension]::new($true, $flase, 0,$true)).RawData
# $asn1 | Format-Hex -Encoding Ascii
$ca_params =@{
"Type" = "Custom";
"Subject" = "CN=Local CA";
"FriendlyName" = "Local CA";
"KeyAlgorithm" = "RSA";
@rjsocha
rjsocha / rjslibrary.sh
Last active Jan 29, 2020
BASH support library
View rjslibrary.sh
function trim-string() {
local _var="$1"
_var="${_var#"${_var%%[![:space:]]*}"}" # remove leading whitespace characters
_var="${_var%"${_var##*[![:space:]]}"}" # remove trailing whitespace characters
echo -n "$_var"
}
function dns-query() {
local _r
if [[ -n $1 ]]