Skip to content

Instantly share code, notes, and snippets.

View mgvazquez's full-sized avatar
:octocat:
Focusing

Manuel Andres Garcia Vazquez mgvazquez

:octocat:
Focusing
View GitHub Profile
@mgvazquez
mgvazquez / gnu_getopt_example.sh
Created April 2, 2024 19:13 — forked from bobpaul/gnu_getopt_example.sh
An example showing how to use getopt
#!/usr/bin/env bash
# Time-stamp: <2017-04-27 09:57:21 kmodi>
# Time-stamp: <2018-03-20 12:58:02 bobpaul>
# derived from kmodi's gist: https://gist.github.com/kaushalmodi/74e9875d5ab0a2bc1010447f1bee5d0a
#
# Example of using getopt to parse command line options
# http://stackoverflow.com/a/29754866/1219634 Limitation: All the options
# starting with - have to be listed in --options/--longoptions, else getopt will
# error out.
# The downside is that if you intend to use this as a wrapper to some other program,
@mgvazquez
mgvazquez / jenkins_restart_dead_executors.groovy
Created November 24, 2016 19:11 — forked from p0deje/jenkins_restart_dead_executors.groovy
Restart all dead executros on Jenkins (use from Script Console)
def deadExecutors = Jenkins.instance.computers.collect { c ->
c.executors.findAll { !it.isActive() }
}.flatten()
deadExecutors.each { it.doYank() }
@mgvazquez
mgvazquez / gist:81f1dcd0731c038d6d88941319de2488
Created August 3, 2016 14:35 — 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.*;
for (node in Jenkins.instance.nodes) {

Keybase proof

I hereby claim:

  • I am mgvazquez on github.
  • I am mvazquez (https://keybase.io/mvazquez) on keybase.
  • I have a public key whose fingerprint is 11B7 E08C C32F B4EB 7F84 E35B 055A D08D F42C 3E48

To claim this, I am signing this object: