Skip to content

Instantly share code, notes, and snippets.

View arjunKumbakkara's full-sized avatar
💭
Focus

Arjun Kumbakkara arjunKumbakkara

💭
Focus
  • 6d Technologies pvt ltd.
  • Bangalore ,Karnataka , India
View GitHub Profile
@arjunKumbakkara
arjunKumbakkara / Messages.java
Created February 6, 2017 06:39 — forked from jonikarppinen/Messages.java
Example of using message resources in Spring Boot service layer code, in as simple way as possible (hopefully!)
package com.company.project.components;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Locale;
@arjunKumbakkara
arjunKumbakkara / CustomErrorController.java
Created February 13, 2017 07:20 — forked from jonikarppinen/CustomErrorController.java
Example of replacing Spring Boot "whitelabel" error page with custom error responses (with JSON response body)
package com.company.project.controllers;
import com.company.project.model.api.ErrorJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.web.ErrorAttributes;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestAttributes;
@arjunKumbakkara
arjunKumbakkara / LDAPIntegrationModule.java
Last active May 10, 2017 18:05
LDAP Server Java Integration [Active Directory Integration with CRUD Operations]
package ldapmodule;
import javax.naming.*;
import javax.naming.directory.*;
import java.util.ArrayList;
import java.util.Properties;
/**
*
* @author Arjun Kumbakkara
@arjunKumbakkara
arjunKumbakkara / LDAPIntegrationModule.txt
Last active May 18, 2017 11:34
LDAP Integration Protocol V2.0 API
package ldap;
import javax.naming.*;
import javax.naming.directory.*;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Properties;
/**
@arjunKumbakkara
arjunKumbakkara / dbDumpCron.sh
Last active May 24, 2017 06:21
Automated DATABASE BackUp script [Use as a Cron job]
#!/bin/sh
#----------------------------------------------------
# a simple mysql database backup script.
# version 0.1, updated April 28, 2017.
# copyright 2017 Arjun Kumbakkara
#----------------------------------------------------
#Author:Arjun Kumbakkara
#Organization : 6D Telecom Solutions.
@arjunKumbakkara
arjunKumbakkara / PaginationDiscoverabilityListener.java
Created December 7, 2017 10:11 — forked from eugenp/PaginationDiscoverabilityListener.java
Pagination with REST - the Discoverability Listener full
package org.baeldung.web.hateoas;
import javax.servlet.http.HttpServletResponse;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.web.util.UriComponentsBuilder;
import com.google.common.base.Preconditions;
@arjunKumbakkara
arjunKumbakkara / PaginationDiscoverabilityListener.java
Created December 7, 2017 10:11 — forked from eugenp/PaginationDiscoverabilityListener.java
Pagination with REST - the Discoverability Listener full
package org.baeldung.web.hateoas;
import javax.servlet.http.HttpServletResponse;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.web.util.UriComponentsBuilder;
import com.google.common.base.Preconditions;
@arjunKumbakkara
arjunKumbakkara / AutomatedJmeterLoadTesting.sh
Last active January 8, 2018 12:38
A Script to Automate Jmeter Load testing and the calculated TPS (Througput) is clipped into a file. With Hardcoded JMXs. #NOTE : Hardcode your JMX Test Plans and Happy running !
#!/bin/bash\
# Author : Arjun Kumbakkara
# Copyright (c) 2k17, 6dTechnologies
# Automates the Jmeter Test plan Execution and Clips the value Average Rate (which translates to Throughput aka TPS )
#PreRequisite: The JMX Test Plan (*.jmx) has to have the pattern ##-ValidToken-## (As Token expiration can occur any unmonitored timestamp)
#__________________________________________________________
#<elementProp name="" elementType="Header">
#<stringProp name="Header.name">X-Authorization</stringProp>
@arjunKumbakkara
arjunKumbakkara / Asserts.java
Created January 8, 2018 13:23
Just a utility of assert collection.Do look in , Modify and use up.! Could be handy
/**
*
* @author Arjun Kumbakkara
* @version 1.0.0
*
* <p>
* <b><u>Development History</u></b><br>
* <table border="1" width="100%">
* <tr>
* <td width="15%"><b>Date</b></td>
@arjunKumbakkara
arjunKumbakkara / ClientHelper.java
Last active April 28, 2019 08:17 — forked from outbounder/ClientHelper.java
jersey client helper for trusting all certificates in SSL/TLS
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;