Instantly share code, notes, and snippets.

View README.md

With the latest version of Docker for Mac and Windows (18.06), you can prefix all your mvn commands by RUN --mount=target=/root/.m2,type=cache:

Example:

# syntax = tonistiigi/dockerfile:runmount20180618
FROM maven:3.5-jdk-8-alpine AS build
COPY . .
RUN --mount=target=/root/.m2,type=cache mvn --batch-mode clean compile assembly:single

FROM openjdk:8-jre-alpine3.7
View graphdat-install-conntrack-tools.sh
#!/bin/bash
# Make sure we have the dev tools
yum groupinstall "Development Tools"
# Just in case you started installing dependencies from yum
# yum -y remove libnfnetlink
# lets put the source code here
mkdir -p ~/.src
View docker-compose.yml
# https://hub.docker.com/r/gocd/gocd-server/
server:
image: gocd/gocd-server:v17.10.0
hostname: go-server # Needed so the go-agent can find the server
ports:
- '8153:8153'
- '8154:8154'
environment:
- GO_SERVER_SYSTEM_PROPERTIES='-Dgo.plugin.upload.enabled=true'
# https://hub.docker.com/r/gocd/gocd-agent-alpine-3.5/
View readme.md

Fetching artifact programmatically through REST/API

Nexus 2.x

Nexus 2.x had a REST API to download artifacts like below based on some Maven GAV co-ordinates but this no longer works for Nexus 3.x

wget "http://local:8081/service/local/artifact/maven/redirect?g=com.mycompany&a=my-app&v=LATEST" --content-disposition

or

curl --insecure "https://local:8081/service/local/artifact/maven/content?r=public&g=log4j&a=log4j&v=1.2.17&p=jar&c=" > log4j.jar

View quickpick
#!/bin/bash
# Author: Thomas Berezansky <tsbere@mvlc.org>
# Author: Jason Stephenson <jstephenson@mvlc.org>
#
# Feel free to use and to share this script in anyway you like.
# This script is intended as a shortcut for the git cherry-pick
# command when you have several commits that you want to cherry-pick
# into your local branch from another branch. It often results in a
View gist:f84f2e17e6005853b89db7418e05bae9
java.lang.NullPointerException
at org.netbeans.modules.maven.queries.RecommendedTemplatesImpl.getPrivilegedTemplates(RecommendedTemplatesImpl.java:190)
at org.netbeans.spi.project.ui.support.UILookupMergerSupport$PrivilegedTemplatesImpl.getPrivilegedTemplates(UILookupMergerSupport.java:196)
at org.netbeans.modules.project.ui.OpenProjectList.getTemplateNamesLRU(OpenProjectList.java:1454)
at org.netbeans.modules.project.ui.OpenProjectList.getTemplatesLRU(OpenProjectList.java:1151)
at org.netbeans.modules.project.ui.OpenProjectList.prepareTemplates(OpenProjectList.java:1346)
at org.netbeans.modules.project.ui.OpenProjectList.notifyOpened(OpenProjectList.java:1314)
at org.netbeans.modules.project.ui.OpenProjectList.doOpenProject(OpenProjectList.java:1379)
at org.netbeans.modules.project.ui.OpenProjectList.open(OpenProjectList.java:823)
at org.netbeans.modules.project.ui.OpenProjectList$6.run(OpenProjectList.java:675)
View NbMavenProjectCache.patch
diff --git a/maven/src/org/netbeans/modules/maven/modelcache/MavenProjectCache.java b/maven/src/org/netbeans/modules/maven/modelcache/MavenProjectCache.java
index 97d902295c1..b05bb281c9d 100644
--- a/maven/src/org/netbeans/modules/maven/modelcache/MavenProjectCache.java
+++ b/maven/src/org/netbeans/modules/maven/modelcache/MavenProjectCache.java
@@ -46,6 +46,7 @@ import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
View 45834.log
16/03/30 18:46:51 ERROR NetworkClient: Node [172.18.0.2:9200] failed (Connection timed out: connect); selected next node [10.123.45.67:9200]
16/03/30 18:48:15 ERROR NetworkClient: Node [172.18.0.2:9200] failed (Connection timed out: connect); no other nodes left - aborting...
16/03/30 18:48:15 ERROR Executor: Exception in task 0.0 in stage 12.0 (TID 609)
org.elasticsearch.hadoop.rest.EsHadoopNoNodesLeftException: Connection error (check network and/or proxy settings)- all nodes failed; tried [[172.18.0.2:9200]]
at org.elasticsearch.hadoop.rest.NetworkClient.execute(NetworkClient.java:142)
at org.elasticsearch.hadoop.rest.RestClient.execute(RestClient.java:423)
at org.elasticsearch.hadoop.rest.RestClient.executeNotFoundAllowed(RestClient.java:431)
at org.elasticsearch.hadoop.rest.RestClient.exists(RestClient.java:507)
at org.elasticsearch.hadoop.rest.RestClient.touch(RestClient.java:513)
at org.elasticsearch.hadoop.rest.RestRepository.touch(RestRepository.java:491)
View elasticsearch.log
[2016-01-25 16:13:53,049][INFO ][node ] [search-wa] version[2.1.1], pid[80], build[40e2c53/2015-12-15T13:05:55Z]
[2016-01-25 16:13:53,050][INFO ][node ] [search-wa] initializing ...
[2016-01-25 16:13:53,285][INFO ][plugins ] [search-wa] loaded [], sites []
[2016-01-25 16:13:53,350][INFO ][env ] [search-wa] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [401.5gb], net total_space [432.7gb], spins? [unknown], types [rootfs]
[2016-01-25 16:13:54,557][INFO ][node ] [search-wa] version[2.1.1], pid[171], build[40e2c53/2015-12-15T13:05:55Z]
[2016-01-25 16:13:54,558][INFO ][node ] [search-wa] initializing ...
[2016-01-25 16:13:54,704][INFO ][plugins ] [search-wa] loaded [], sites []
[2016-01-25 16:13:54,749][INFO ][env ] [search-wa] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [401.5gb], net total_space [432.7gb], spins? [unknown],
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console