Skip to content

Instantly share code, notes, and snippets.

Ashwin Jayaprakash AshwinJay

Block or report user

Report or block AshwinJay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
AshwinJay /
Last active Aug 27, 2017
Simple Java lambda tests
import java.util.LinkedList;
import java.util.List;
public class LambdaCapture {
public static void main(String[] args) {
List<String> strings = new LinkedList<>();
AshwinJay /
Last active Aug 27, 2017
Java logger invocation style benchmark
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import java.util.Random;
import java.util.function.Supplier;
AshwinJay /
Last active Jan 14, 2020
My notes on maintaining a low distraction environment and avoiding information overload

Computer setup

Email with simple prioritization

Gmail with Multiple inboxes enabled:

  1. Inbox (Only certain important unclassified emails stay in Inbox
  • The other emails have filters such as this: Do this: Skip Inbox, Apply label "gerrit_or_build" )
  1. JIRA/Wiki (label:jira-wiki (mentioned OR "P1" OR label:starred) -in:trash)
  2. BitBucket ( is:unread {"Fred Flintstone" "Homer Simpson" "Mickey Mouse"} )
  3. Misc (-in:trash AND label:misc)
AshwinJay /
Last active Jan 28, 2018
Tech reading list to help people get started with programming, design and Java
AshwinJay /
Last active May 20, 2016
How to: Basic GNU Linux/Mac command line tools (Also mostly works with GOW on Windows)
#! /bin/bash
a=(user1 pass1 user2 pass2)
for ((i=0; i<${#a[@]}; i+=2)); do
echo "Loop 1: ${a[i]}: ${a[i+1]}"
a1=(user1 user2)
a2=(pass1 pass2)
for ((i=0; i<${#a1[@]}; i+=1)); do
package com.javaforu.rsync;
import com.javaforu.rsync.Sync.CharRingBuffer.Visitor;
import rollinghash.RabinKarpHash;
import java.util.*;
* Author: Ashwin Jayaprakash / /
View Log4J programmatic
View Simple Java keytool key pair and trust store
Create self signed key pair and add to new key store:
keytool -genkey -alias mykey -keyalg RSA -keystore keystore.jks -keysize 2048
Export public key and import into new trust store:
keytool -keystore keystore.jks -export -alias mykey -file my.cer
keytool -import -alias mypub -file my.cer -keystore truststore.jks
(Alternate way) Manually import certificate from HTTPS server to trust store:
Firefox: Add Exception -> Get Certificat -> View -> Details -> Export as "a.der"
keytool -importcert -keystore truststore.jks -file a.der
import redis.clients.jedis.Jedis;
import redis.clients.jedis.PipelineBlock;
* Author: Ashwin Jayaprakash
* <p/>
* Email: Web:
public class RedisJavaDemo {
public static void main(String[] args) throws InterruptedException {
You can’t perform that action at this time.