This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import requests | |
import timeit | |
from multiprocessing import Pool | |
from functools import partial | |
def get_result(url, depth=1): | |
r = requests.get(url) |
This file contains hidden or 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
def findRootCauseRun | |
findRootCauseRun = { def currentRun -> | |
def upstreamRun = getUpstreamCause(currentRun)?.getUpstreamRun() | |
if (upstreamRun == null) return currentRun | |
findRootCauseRun.trampoline(upstreamRun) | |
} | |
findRootCauseRun = findRootCauseRun.trampoline() | |
def getUpstreamCause(def run) { | |
run.getAction(hudson.model.CauseAction.class)?.findCause(hudson.model.Cause$UpstreamCause.class) |
This file contains hidden or 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
from functools import wraps | |
def wrap(element): | |
def decorator(func): | |
@wraps(func) | |
def inner(*args, **kwargs): | |
return "<{0}>{1}</{0}>".format(element, func(*args, **kwargs)) | |
return inner | |
return decorator |
This file contains hidden or 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
# To send cancel signal | |
<JENKINS>/job/<JOB>/<BUILD>/stop | |
# To send terminate signal | |
<JENKINS>/job/<JOB>/<BUILD>/term | |
# To send kill signal (will forcibly kill threads) | |
<JENKINS>/job/<JOB>/<BUILD>/kill |
This file contains hidden or 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
import javax.mail.Session | |
import javax.mail.Message | |
import javax.mail.Transport | |
import javax.mail.internet.MimeMessage | |
import javax.mail.internet.InternetAddress | |
def descriptor = Jenkins.instance.getDescriptor("hudson.tasks.Mailer") | |
Session session = descriptor.createSession(); |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Show all processes with trees | |
ps axf | less | |
# Show all available information for a process | |
ls -la /proc/[PID] |
This file contains hidden or 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
git update-index --chmod=+x foo.sh |
This file contains hidden or 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
Closure envVar(String key, String val) { | |
return { | |
it / 'buildWrappers' / 'EnvInjectBuildWrapper' / 'info' << { | |
propertiesContent("${key}=${val}") | |
} | |
} | |
} | |
Closure secureGroovyScript(String scriptText, boolean useSandbox) { | |
return { |
This file contains hidden or 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
#!/usr/bin/env bash | |
######################################################################################################## | |
# This is a utility script to fetch artifacts from a Nexus server. It is based on an example # | |
# from Sonartype Nexus: http://blog.sonatype.com/2011/01/downloading-artifacts-from-nexus-with-bash/ # | |
######################################################################################################## | |
set -e | |
REST_PATH=/service/local |
This file contains hidden or 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
@Configuration | |
@ComponentScan(basePackages = "sen.ansig.spring") | |
@PropertySource("classpath:config.properties") | |
@PropertySource(value = "file:${config.path:config.properties}", ignoreResourceNotFound = true) | |
public class MySpringAppWithProperties { | |
} |