Skip to content

Instantly share code, notes, and snippets.

View basilevs's full-sized avatar

Vasili Gulevich basilevs

View GitHub Profile
@EvilBeaver
EvilBeaver / cleanupJenkinsWorkspaces.groovy
Last active October 18, 2023 10:15 — forked from rb2k/gist:8372402
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.*;
@rb2k
rb2k / gist:8372402
Last active February 3, 2025 14:50
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.*;
for (node in Jenkins.instance.nodes) {
@basilevs
basilevs / vboxservice
Created March 11, 2012 09:18
Virtal box machine as linux service
#!/bin/sh
#Manages VBox machines
if [ $# -ne 3 ]; then
echo sudo -n -H -u USER $0 MACHINE SNAPSHOT {start|stop}
# -n - noninteractive
# -H - provide HOME variable (required by VBox communication link)
# -u - run as user (owns VM)
fi