Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.
This is the base javascript:
(function (text) {
var node = document.createElement('textarea')
var selection = document.getSelection()
#!groovy | |
// imports | |
import hudson.plugins.git.* | |
import hudson.plugins.git.extensions.* | |
import hudson.plugins.git.extensions.impl.* | |
import jenkins.model.Jenkins | |
// parameters | |
def jobParameters = [ |
jenkins.model.Jenkins.getInstance().getUpdateCenter().getSites().each { site -> | |
site.updateDirectlyNow(hudson.model.DownloadService.signatureCheck) | |
} | |
hudson.model.DownloadService.Downloadable.all().each { downloadable -> | |
downloadable.updateNow(); | |
} | |
def plugins = jenkins.model.Jenkins.instance.pluginManager.activePlugins.findAll { | |
it -> it.hasUpdate() |
# ~/.ipython/profile_default/startup/01-esc-dot.py | |
from IPython import get_ipython | |
from prompt_toolkit.enums import DEFAULT_BUFFER | |
from prompt_toolkit.keys import Keys | |
from prompt_toolkit.filters import HasFocus, HasSelection, ViInsertMode, EmacsInsertMode | |
ip = get_ipython() | |
insert_mode = ViInsertMode() | EmacsInsertMode() |
import hudson.model.* | |
String newJdkName = "JDK 1.7.0_80" | |
boolean dryRun = true | |
def h = Hudson.getInstance() | |
Set jdks = new HashSet() | |
def newJdk = h.getJDK(newJdkName) | |
assert newJdk, "unable to find a configured jdk named ${newJdkName}" |
git log --oneline -1 <PR-BRANCH>
git push -f origin :
// Sometimes it's necessary to do a bit of clean-up | |
Array.prototype.forEach.call(document.querySelectorAll('.js-comment-delete button'), function(el, i) { | |
el.removeAttribute('data-confirm'); | |
el.click(); | |
}); |
node { | |
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1' | |
echo 'No quotes, pipeline command in single quotes' | |
sh 'echo $BUILD_NUMBER' // 1 | |
echo 'Double quotes are silently dropped' | |
sh 'echo "$BUILD_NUMBER"' // 1 | |
echo 'Even escaped with a single backslash they are dropped' | |
sh 'echo \"$BUILD_NUMBER\"' // 1 | |
echo 'Using two backslashes, the quotes are preserved' | |
sh 'echo \\"$BUILD_NUMBER\\"' // "1" |
Ansible is a powerful, simple, and easy to use tool for managing computers. It is most often used to update programs and configuration on dozens of servers at once, but the abstractions are the same whether you're managing one computer or a hundred. Ansible can even do "fun" things like change the desktop photo or backup personal files to the cloud. It can take a while to learn how to use Ansible because it has an extensive terminology, but once you understand the why and the how of Ansible, its power is readily apparent.
Ansible's power comes from its simplicity. Under the hood, Ansible is just a domain specific language (DSL) for a task runner for a secure shell (ssh). You write ansible yaml (.yml) files which describe the tasks which must run to turn plain old / virtualized / cloud computers into production ready server-beasts. These tasks, in turn, have easy to understand names like "copy", "file", "command", "ping", or "lineinfile". Each of these turns into shell comma
#!/bin/bash | |
IN=`echo $1 | base64` | |
SUFFIX="::::MAGIC::::" | |
MASTER_KEY=`cat /var/jenkins_home/secrets/master.key` | |
HASHED_MASTER_KEY=`echo -n $MASTER_KEY | sha256sum | cut -d " " -f 1` | |
HASHED_MASTER_KEY_16=${HASHED_MASTER_KEY:0:16} | |
openssl enc -d -aes-128-ecb -in /var/jenkins_home/secrets/hudson.util.Secret -K $HASHED_MASTER_KEY -out /tmp/hudson.key | |
HUDSON_KEY=`cat /tmp/hudson.key` | |
HUDSON_KEY_TRIMMED=${HUDSON_KEY:0:-16} | |
HUDSON_KEY_16=${HUDSON_KEY_TRIMMED:0:16} |