Skip to content

Instantly share code, notes, and snippets.

@javajack
javajack / remove-all-from-docker.sh
Created August 22, 2019 11:26 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@javajack
javajack / Dockerfile
Last active April 16, 2023 12:33 — forked from jakubigla/Dockerfile
Dockerfile for multistage build of spring boot application using maven with SonarQube and proxy support https://blog.pavelsklenar.com/spring-boot-run-and-build-in-docker/
### BUILD image
FROM maven:3-jdk-11 as builder
#Copy Custom Maven settings
#COPY settings.xml /root/.m2/
# create app folder for sources
RUN mkdir -p /build
WORKDIR /build
COPY pom.xml /build
#Download all required dependencies into one layer
RUN mvn -B dependency:resolve dependency:resolve-plugins
@javajack
javajack / JsonBinder.java
Created June 26, 2018 07:59 — forked from schaloner/JsonBinder.java
Supporting PostgreSQL JSON types in jOOQ using Jackson. Adapted from the GSON example found at https://www.jooq.org/doc/3.9/manual/code-generation/custom-data-type-bindings/
package be.objectify.example.jooq;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.Types;
import java.util.Objects;
import com.fasterxml.jackson.databind.JsonNode;
import org.jooq.Binding;
import org.jooq.BindingGetResultSetContext;
import org.jooq.BindingGetSQLInputContext;
@javajack
javajack / ejabberd.yml
Created December 14, 2017 07:39
ejabberd configuration with mysql message archive and external auth
###
###' ejabberd configuration file
###
###
### The parameters used in this configuration file are explained in more detail
### in the ejabberd Installation and Operation Guide.
### Please consult the Guide in case of doubts, it is included with
### your copy of ejabberd, and is also available online at
### http://www.process-one.net/en/ejabberd/docs/

Keybase proof

I hereby claim:

  • I am javajack on github.
  • I am rakeshwaghela (https://keybase.io/rakeshwaghela) on keybase.
  • I have a public key whose fingerprint is 8C09 18EE FBF9 E70C EF4E F42B 1A8A D7DA DC03 6002

To claim this, I am signing this object:

@javajack
javajack / Graph.java
Created May 9, 2017 12:59
Java Graph App Paths Between Two Nodes
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
class Graph<T> implements Iterable<T> {
/*
* A map from nodes in the graph to sets of outgoing edges. Each set of edges
@javajack
javajack / sec_tutorial.md
Created April 12, 2016 05:10 — forked from tgrall/sec_tutorial.md
MongoDB Security Tutorial

#Simple MongoDB Security Tutorial

###1 - Start mongod without any "security option"

$ mongod --port 27017

@javajack
javajack / gist:04422d5a95d8e8dae1aa
Last active May 11, 2022 18:03 — forked from eogiles/gist:5718170
SOAP JAX WS Password Digest Nonce Date Created Handler generator
package sample;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.SecureRandom;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@javajack
javajack / gist:da3c65f4f37f1ed78bf7
Last active July 6, 2017 19:42 — forked from carloprad/gist:10dbfbeea3be120d348d
wsse usernametoken password digest soap generator
import org.apache.ws.security.WSConstants;
import org.apache.ws.security.message.WSSecHeader;
import org.apache.ws.security.message.WSSecUsernameToken;
import org.apache.ws.security.WSSConfig;
import org.apache.xalan.processor.TransformerFactoryImpl;
import org.apache.xerces.jaxp.DocumentBuilderFactoryImpl;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import javax.xml.transform.OutputKeys;
@javajack
javajack / A_maven.md
Created October 1, 2015 12:09 — forked from ashrithr/A_maven.md
build java projects using maven

Intro to Maven

###Create a project from Maven Template:

To start a new maven project, use the maven archetype plugin from the command line using the archetype:generate goal.

The following command will tell maven to create a java project from maven-archetype-quickstart template, if you ignore the archetypeArtifactId argument, then a list of the templates will be listed for you to choose.