This file contains 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
// https://gist.github.com/nextrevision/d11b2df4e8b229c6855b | |
def matchedJobs = Jenkins.instance.items.findAll { job -> | |
job.name =~ /my_regex_here/ | |
} | |
matchedJobs.each { job -> | |
println job.name | |
//job.delete() | |
} |
This file contains 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
# Get a clean list of processes with listeners. Provides process name, pid, address, and port | |
sudo lsof -P | grep LISTEN | tr -s " " | cut -d " " -f 1,2,9- | sed -e s/TCP\ //g | sort -u |
This file contains 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 | |
#In early development, sometimes you've got a hand-built instance, but you also don't want to leave it up all the time | |
# We've got an m4xl instance running Spinnaker (http://spinnaker.io) but we only really need it during the day | |
# As a cost-saving measure, we shut it down overnight. However, we want it to be consistently accessible | |
# So this script is in a Jenkins job that runs every morning, | |
# starting up the instance then updating its DNS record to the new IP. | |
#If you have multiple DNS records for a single instance, | |
# you can safely run a second copy of the script with the ZONEID and RECORDSET updated appropriately. |