Skip to content

Instantly share code, notes, and snippets.

@psychonaut
psychonaut / gist:2d36272d38cebc42fc602232ccd977fe
Last active April 14, 2017 13:35
logstash 5.* http input acting as elasticsearch
input {
http {
port => 9200
tags => ["input-http-elasticsearch"]
id => "input-http-9200"
codec => "json"
}
}
filter {
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active May 6, 2024 20:49
Jenkinsfile idiosynchrasies with escaping and quotes
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"
@vincent-zurczak
vincent-zurczak / ReactorDependenciesResolverMojoTest.java
Last active September 8, 2018 01:45
A Maven mojo that shows how to resolve dependencies locations, be it in remote or in the local repository, or even in the reactor.
package whatever;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;
@airtonix
airtonix / .profile
Last active March 10, 2023 18:25
dynamic npm .bin.
# Copy this into your `~/.profile`.
# This setup an incredibly ugly hack that recompiles your `PATH`
# everytime the prompt is printed.
# I need this to inject the nearest `node_modules/.bin` into my
# path to make it easy to use the binarys there.
# Your normal PATH exports here
export PATH=$HOME/bin:$PATH
ORIGINAL_PATH=$PATH
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong