Skip to content

Instantly share code, notes, and snippets.

View danmou's full-sized avatar

Daniel Mouritzen danmou

  • Copenhagen, Denmark
View GitHub Profile
@danmou
danmou / gist:b0996994bd65fcf138690e30e95f6902
Created November 12, 2020 17:47
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
import org.jenkinsci.plugins.workflow.job.WorkflowRun
import org.jenkinsci.plugins.workflow.flow.FlowExecution;
@danmou
danmou / on-exit-sync.py
Last active November 26, 2018 12:35 — forked from varunagrawal/on-exit-sync.py
Script to sync Taskwarrior after each operation
#!/usr/bin/env python3
# This hooks script syncs task warrior to the configured task server without blocking.
# The on-exit event is triggered once, after all processing is complete.
# Make sure hooks are enabled and this hook script is executable.
# Run `task diag` for diagnostics on the hook.
import sys
import json