This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ipxe | |
ifstat | |
ifopen && goto chain || | |
dhcp | |
:chan | |
chain --replace http://${next-server}/netboot.ipxe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# vim: ts=4 sw=4 et | |
use warnings; | |
use strict; | |
use autodie; | |
use Data::Dumper; | |
exit(0) unless ($ENV{FAI_ACTION} // '' eq 'install' and $ENV{disklist} // '' eq 'nvme0n1'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make edit_lovelace-ui.yml | |
edit_lovelace-ui.yml: | |
TMPFILE=$$(mktemp /tmp/XXXXXX-lovelace-ui.yml) ; \ | |
~/lap/homeassistant/bin/hass-cli raw ws lovelace/config > "$${TMPFILE}" ; \ | |
perl -pi -e 'BEGIN {undef $$/;} s/^id: 1\ntype: result\nsuccess: true\nresult:\n/config:\n/' "$${TMPFILE}"; \ | |
vim "$${TMPFILE}" ; \ | |
~/lap/homeassistant/bin/hass-cli raw ws lovelace/config/save --yaml "@$${TMPFILE}" && \ | |
rm -f "$${TMPFILE}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If we're running with the right systemd env, run our heartbeat to systemd. | |
execute2={/bin/systemd-notify,--ready} | |
execute2={/bin/bash,-c,systemd-notify MAINPID=`ps -p "$\{1:-$$\}" -o ppid= | tr -d " "`} | |
execute2={/bin/systemd-notify,WATCHDOG_USEC=480000000} | |
schedule=systemd_watchdg, 10, 60, "execute2={/bin/systemd-notify,WATCHDOG=1}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install with ln -s ../../.git-pre-commit.sh .git/hooks/pre-commit | |
AUTHORINFO=$(git var GIT_AUTHOR_IDENT) || exit 1 | |
NAME=$(printf '%s\n' "${AUTHORINFO}" | sed -n 's/^\(.*\) <.*$/\1/p') | |
EMAIL=$(printf '%s\n' "${AUTHORINFO}" | sed -n 's/^.* <\(.*\)> .*$/\1/p') | |
[ "${NAME}" != root ] && [ "${NAME}" != "Your Name" ] && [[ ! "${EMAIL}" =~ root@.* ]] || { | |
cat <<EOF >&2 | |
Please commit under your own name and email instead of "${NAME} <${EMAIL}>": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def c = com.nirima.jenkins.plugins.docker.DockerCloud.getCloudByName('Host docker') | |
// We're going to hack java final fields here... | |
import java.lang.reflect.Field | |
import java.lang.reflect.Modifier | |
for (def jt in c.getJobTemplates().values()) { | |
Field field = jt.getClass().getDeclaredField("instanceCap") | |
Field modifiersField = Field.class.getDeclaredField("modifiers") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vim: noet sw=4 ts=4 cindent | |
// This is a helper that runs as privileged code, to get the LockableResource to pipeline jobs | |
package PipelineHelpers; | |
import org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.Whitelisted | |
// Wrapper class to expose a safe subset to the client code | |
class LockableResourcesHelper implements Serializable { |