Instantly share code, notes, and snippets.

View gist:f6fdbbfe37b4f47cc630054dd2817619
execute a job from inside another job
Add build step -> Trigger/call builds on other projects
Check "Block until the triggered projects finish their builds"
Add Parameters -> Predefined parameters
in "Predefined parameters":
GIT_REPO=$git_repo <-- this $git_repo is a defined paramter in the calling job
GIT_OUTPUT=/opt/policyengine
CHEF_JSON=policyengine.json
View get_oracle_jdk_linux_x64.sh
#!/bin/bash
# You must accept the Oracle Binary Code License
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html
# usage: get_jdk.sh <jdk_version> <ext>
# jdk_version: 8(default) or 9
# ext: rpm or tar.gz
jdk_version=${1:-8}
ext=${2:-rpm}
View gist:e6c90d1783ba93229b9e238b4e6ac0da
Windows keyloggers
http://www.spyrix.com/download.php
https://www.logixoft.com/en-us/index
https://github.com/MinhasKamal/StupidKeylogger
View gist:55ef80f5beaf1115ed89ae888ade2804
FROM golang:1.11.1-alpine3.7
ENV GOPATH=/usr/share/golang
RUN apk update && apk add git && \
git clone https://github.com/go-zkcli/zkcli /home && \
go get github.com/codegangsta/cli && \
go get github.com/go-zkcli/zkcli/output && \
go get github.com/go-zkcli/zkcli/zk && \
go get github.com/outbrain/golib/log && \
cd /home/ && sh build.sh && \
ls /tmp/zkcli/ && \
View gist:bf560b1e63f1708786cfbc52be8b7d96
### double quotes are so bloody muy fucking importante!!!
ruby -e "$(curl -s 10.10.60.101:1982/goll.rb)"
View gist:9b341eaa0b54815f28422384092e0f80
Preferences -> Profiles -> Keys
Left Key change from "Normal" to "Esc+"
Add Keyboard Shortcut
Keyboard Shortcut: ⌥←
Action: Send Escape Sequence
Esc+: b
Keyboard Shortcut: ⌥→
Action: Send Escape Sequence
Esc+: f
View gist:be7ce4f62e21a898fe4a9a334dc67f5e
So, looking into the Jenkins CLI docs, it mentions the preferred method of auth is to set up an SSH Public Key in your Jenkins user account, then referencing that with the CLI like:
java -jar /opt/jenkins-cli.jar -s "http://localhost:8080" -i path/to/key.rsa who-am-i
Digging down deeper into the CLI jarfile options, I found that the username/password combo is still usable with the -auth option:
java -jar /opt/jenkins-cli.jar -s "http://localhost:8080" -auth username:password who-am-i
The docs do state you should use your Jenkins user token if possible, but it's much harder to automate the user setup and token retrieval, than to use a username and password setup by automated build scripts.
View gist:2a929afa21f94d0e08d8c158149f4bf5
Sometimes, it helps to route just some traffic over a VPN. It doesn’t make sense to add a lot of latency to your vpn if you don’t need it. So here’s the magic. This only works if you have your own OpenVPN server. (See my post on using Amazon’s free tier to make it happen).
Simply comment out the redirect-gateway def1 statement in your openvpn server.conf file.
and on the client, just put in the following line:
route 12.12.12.0 255.255.255.0 vpn_gateway
Obviously this routes only the 12.12.12.0 subnet out the vpn connection and everything out your non vpn connection.
View gist:0e2addaa8bd35e7581be9700000f7c80
re = /[(]\d{2}[)]/m
str = '19
20
(24)
'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end