Skip to content

Instantly share code, notes, and snippets.

💭
Global All Hands @ Elastic

Tre' wayneseymour

💭
Global All Hands @ Elastic
Block or report user

Report or block wayneseymour

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wayneseymour
wayneseymour / execute_groovy_jenkins_sample.groovy
Created Jul 10, 2019 — forked from rhuss/execute_groovy_jenkins_sample.groovy
How to execute some shell scripting on Groovy with environment variables and redirection
View execute_groovy_jenkins_sample.groovy
def exec(cmd) {
println cmd
def process = new ProcessBuilder([ "sh", "-c", cmd])
.directory(new File("/tmp"))
.redirectErrorStream(true)
.start()
process.outputStream.close()
process.inputStream.eachLine {println it}
process.waitFor();
return process.exitValue()
@wayneseymour
wayneseymour / execute_groovy_jenkins_sample.groovy
Created Jul 10, 2019 — forked from rhuss/execute_groovy_jenkins_sample.groovy
How to execute some shell scripting on Groovy with environment variables and redirection
View execute_groovy_jenkins_sample.groovy
def exec(cmd) {
println cmd
def process = new ProcessBuilder([ "sh", "-c", cmd])
.directory(new File("/tmp"))
.redirectErrorStream(true)
.start()
process.outputStream.close()
process.inputStream.eachLine {println it}
process.waitFor();
return process.exitValue()
View ssh-wft.md
 ~/development/projects/infra/ansible   master  λ ps -ef|grep ssh
  501 85469 23955   0 12:58PM ttys002    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn ssh
 ~/development/projects/infra/ansible   master  λ eval "$(ssh-agent -s)"
Agent pid 85560
 ~/development/projects/infra/ansible   master  λ ps -ef|grep ssh
  501 85560     1   0 12:58PM ??         0:00.00 ssh-agent -s
  501 85683 23955   0 12:58PM ttys002    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn ssh
 ~/development/projects/infra/ansible   master  λ ssh -vvvv -F ./ssh_config wayneseymour@10.224.0.222
OpenSSH_7.9p1, LibreSSL 2.7.3
@wayneseymour
wayneseymour / sudo-stuff.sh
Created Jun 18, 2019
Commands I use for `sudo`
View sudo-stuff.sh
# su into jenkins
sudo -iu jenkins
@wayneseymour
wayneseymour / git-current-branch.sh
Last active Jun 11, 2019
Finds the current branch.
View git-current-branch.sh
$(git branch| grep "^\*" |sed 's/\*[[:space:]]//g'
View Portable Node.js andNPM on windows.md
  1. Get node binary (node.exe) from http://nodejs.org/download/
  2. Create the folder where node will reside and move node.exe to it
  3. Download the last zip version of npm from http://nodejs.org/dist/npm
  4. Unpack the zip inside the node folder
  5. Download the last tgz version of npm from http://nodejs.org/dist/npm
  6. Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
  7. Add the the node folder and the packages/bin folder to PATH
  8. On a command prompt execute npm install -g npm to update npm to the latest version

Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.

View npm cache - win 10
This Dot Life | Jsinh This Dot Life
Get In Touch!
Desktop
Tools
Archive
Disclaimer
Get In Touch!
Desktop
Tools
View search-and-replace.sh
# search-and-replace.sh
# Custom logger
find . -name '*.java' -print0 | xargs -0 perl -pi -e 's/(.+AppLogger\.getLogger\(\)\.)log\(null\, this\, LogLevel.(DEBUG|ERROR|WARN|INFO)[a-zA-Z]*,\s*/$1\L$2\E\(/g'
(.+AppLogger\.getLogger\(\)\.)log\(null\, this\, LogLevel.(DEBUG|ERROR|WARN|INFO)[a-zA-Z]*,\s*
$1\L$2\E\(
# DEBUG|ERROR|WARN|INFO
View es6-pipe-and-compose.js
const pipe = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args)));
const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)));
// Example
const addFoo = str => str + 'foo';
const addBar = str => str + 'bar';
const addFoobar = pipe(addFoo, addBar);
const addBarfoo = compose(addFoo, addBar);
addFoobar('hello ') // hello foobar
addBarfoo('hello ') // hello barfoo
@wayneseymour
wayneseymour / debug-helpers.js
Created Mar 16, 2018 — forked from greglockwood/debug-helpers.js
Debug Helper Functions Snippet
View debug-helpers.js
const print = (param, ...args) => {
console.log(param, ...args);
return param;
};
const traceFn = (fn, context) => function () {
console.trace(`${fn.name} called with arguments: `, arguments);
return fn.apply(context || this, arguments);
};
You can’t perform that action at this time.