Skip to content

Instantly share code, notes, and snippets.

@CedricGatay
CedricGatay / Jenkinsfile.cleanup
Created May 22, 2017 12:39
Workspaces cleanup Jenkinsfile
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
node('master'){
stage('Cleanup nodes'){
@CedricGatay
CedricGatay / presence.sh
Created May 23, 2017 19:06
Presence detection using https://github.com/CedricGatay/asuswrt-presence for asus wrt network presence scanning
#!/bin/bash
AUTH=AUTHTOKEN;
ASUSWRTPRESENCEIP=IP;
DOMOTICZ_IP=IP;
DOMOTICZ_PORT=PORT;
curl --silent http://$ASUSWRTPRESENCEIP:9090 > devices
function checkPresence {
import RxSwift
// trick to get a clean unwrap optional by creating an intermediate type
protocol Optionable {
associatedtype Wrapped
var value: Wrapped? { get }
}
extension Optional : Optionable {
var value: Wrapped? { return self }