Skip to content

Instantly share code, notes, and snippets.

View agrawald's full-sized avatar
🐌
I may be slow to respond.

Dheeraj (DJ) Agrawal agrawald

🐌
I may be slow to respond.
View GitHub Profile
@agrawald
agrawald / h2-jsonb.md
Created November 22, 2019 05:17 — forked from madz0/h2-jsonb.md
jsonb work around for H2 database

Creat a package-info file in the models package and put the following contents in there:

@org.hibernate.annotations.TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
package com.ourproject.model;

import com.vladmihalcea.hibernate.type.json.JsonBinaryType;

I used JsonBinaryType in hibernate-types-52 library.

Then in the entity class, I removed columnDefinition="jsonb" from the @Column and only used @Type(type = "jsonb")

@agrawald
agrawald / gist:a6ee36831c69de473fdde93c617ff029
Created July 23, 2019 02:58 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@agrawald
agrawald / Jenkinsfile
Created May 21, 2018 02:05 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage concurrency constraints, ...
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
/*
Please make sure to add the following environment variables:
HEROKU_PREVIEW=<your heroku preview app>
HEROKU_PREPRODUCTION=<your heroku pre-production app>
HEROKU_PRODUCTION=<your heroku production app>
@agrawald
agrawald / SSLPoke.java
Created August 18, 2017 14:50 — forked from 4ndrej/SSLPoke.java
Test of java SSL / keystore / cert setup. Check the commet #1 for howto.
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {