Skip to content

Instantly share code, notes, and snippets.

View TyrfingMjolnir's full-sized avatar
💭
in my scriptorium whipping up some whoopass

Tyrfing Mjølner TyrfingMjolnir

💭
in my scriptorium whipping up some whoopass
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TyrfingMjolnir
TyrfingMjolnir / dhcpd.conf
Created April 7, 2016 19:50
Host Apple's netboot images from ISC DHCPD
class "Apple-Intel-Netboot" {
# Limit this class to only Intel Apple machines
match if substring (option vendor-class-identifier, 0, 14) = "AAPLBSDPC/i386";
option dhcp-parameter-request-list 1,3,17,43,60; # Send these options to the client (possibly forcing it, if the client didn't request it)
# From: http://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xml
# 1 - Subnet Mask
# 3 - Router
# 17 - Root Path
# 43 - Vendor Specific
# 60 - Class ID
@TyrfingMjolnir
TyrfingMjolnir / guacamole.properties
Last active April 15, 2016 07:31
Guacamole sample properties file
# Hostname and port of guacamole proxy
guacd-hostname: localhost
guacd-port: 4822
# Auth provider class (authenticates user/pass combination, needed if using the provided login screen)
auth-provider: net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvider
basic-user-mapping: /etc/guacamole/user-mapping.xml
@TyrfingMjolnir
TyrfingMjolnir / apt-getinstallguacamole.md
Last active June 8, 2023 16:14
Guacamole sample local authentication file

apt-get install guacamoleprereq

No dressing, simply pure nudity from: https://guacamole.apache.org/doc/1.5.2/gug/installing-guacamole.html

apt-get install git vim neovim htop tmux tidy
apt-get install openjdk-8-jdk-headless tomcat9

JAVA did not come easy, I ended up doing some fingerly labour to get $JAVA_HOME in place. So here is some dressing

ls /usr/lib/jvm/
@TyrfingMjolnir
TyrfingMjolnir / _INSTALL.md
Created May 4, 2016 19:23 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

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

@TyrfingMjolnir
TyrfingMjolnir / dhcpd.conf
Created May 21, 2016 23:04 — forked from robinsmidsrod/dhcpd.conf
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN
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;
@TyrfingMjolnir
TyrfingMjolnir / templatevalues.dsmanifest
Last active July 15, 2016 20:35
templatevalues.dsmanifest
echo "\"path\": \"/opt/artifacts/win2012r2template.zfs.gz\"" >> /opt/artifacts/my.dsmanifest
echo "\"sha1\": \"$(digest -a sha1 /opt/artifacts/win2012r2template.zfs.gz)\"" >> /opt/artifacts/my.dsmanifest
echo "\"size\": \"$(ls -l /opt/artifacts/win2012r2template.zfs.gz | awk '{ print $5 }')\"" >> /opt/artifacts/my.dsmanifest
echo "\"uuid\": \"$(uuid)\"" >> /opt/artifacts/my.dsmanifest
echo "\"creator_uuid\": \"$(uuid)\"" >> /opt/artifacts/my.dsmanifest
echo "\"vendor_uuid\": \"$(uuid)\"" >> /opt/artifacts/my.dsmanifest
echo "\"created_at\": \"$(date "+%Y-%m-%dT%H:%M:%SZ")\"" >> /opt/artifacts/my.dsmanifest
echo "\"updated_at\": \"$(date "+%Y-%m-%dT%H:%M:%SZ")\"" >> /opt/artifacts/my.dsmanifest
echo "\"published_at\": \"$(date "+%Y-%m-%dT%H:%M:%SZ")\"" >> /opt/artifacts/my.dsmanifest

Keybase proof

I hereby claim:

  • I am TyrfingMjolnir on github.
  • I am ggt667 (https://keybase.io/ggt667) on keybase.
  • I have a public key whose fingerprint is B46A 44A1 D9BD 715C 2A3E 0F25 B92D 2F17 34E4 B761

To claim this, I am signing this object:

@TyrfingMjolnir
TyrfingMjolnir / listen.js
Last active September 16, 2017 10:29
chokidar RxJS 4.x
const Rx = require( 'rx' ),
chokidar = require( 'chokidar' ),
dirWatcher = chokidar.watch( '/tmp' ),
changedFiles = Rx.Observable.fromEvent( dirWatcher, 'change' ),
subscription = changedFiles.subscribe(
function( filenamefullpath ) {
console.log( filenamefullpath );
},
function( err ) {
console.log( 'Error: ' + err );
#!/usr/bin/env node
const Rx = require( 'rxjs' ),
s$ = Rx.Observable
.interval( 100 )
.take( 10 )
.filter( function( v ) {
if( v % 2 == 0 ) {
return v;
}