show
kubectl create namespace mynamespace| //all job name | |
| jenkins.model.Jenkins.instance.items.each { | |
| println "Job: ${it.name}" | |
| } | |
| //method list of Jenkins instance | |
| jenkins.model.Jenkins.instance.class.methods.each { | |
| println "Jenkins method: ${it.name}" | |
| } |
| This file used to name this gist. |
kubectl create namespace mynamespace| 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" |
| How to delete an image tag/image from docker registry v2.4 | |
| 1) Re/Start registry with delete option enabled | |
| Edit the config.yml | |
| storage: | |
| delete: | |
| enabled: true |
| sed -r "/$EXCLUDING_PATTERN_1|$EXCLUDING_PATTERN_2/!s/$FIND_STRING/$REPLACE_STRING/" |
| # Linux | |
| # add the following to "~/.gitconfig" file | |
| [merge] | |
| tool = intellij | |
| [mergetool "intellij"] | |
| cmd = /usr/local/bin/idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED") | |
| trustExitCode = true | |
| [diff] |
| # How to get ClamAV working on CentOS 7 | |
| yum -y install epel-release && yum -y update | |
| yum -y install clamav clamav-data clamav-scanner clamav-scanner-systemd clamav-server clamav-server-systemd clamav-unofficial-sigs clamav-update | |
| cat <<EOF > /etc/clamd.d/freshclam.conf | |
| # Automatically created by the clamav-freshclam postinst | |
| Bytecode true | |
| CompressLocalDatabase no | |
| ConnectTimeout 30 |
| # Put the function below in your .profile or .bashrc or other suitable file | |
| # Name the function whatever you fancy - I chose wifi | |
| # Change remote & delay accordingly | |
| # Call it with no parameters, to watch and recover the existing wifi connection with feedback | |
| # Call it with any parameter(s) to check and/or recover the existing wifi connection with feedback | |
| # Capture some stats to a logfile as evidence of your crappy infrastructure. :-) | |
| function wifi () { | |
| # TODO: Use GNU date to calculate seconds instead of SECONDS |