Category Archives: Programming

Java – Spring unit test with custom provided configuration.

The following example will show how to define the custom Spring configuration for unit test with @ContextConfiguration annotation. Full example can be found the below github. https://github.com/nsclass/java-timezone/blob/master/src/test/java/com/ns/timezone/javatimezone/JavaTimezoneServiceApplicationTests.java Advertisements

Posted in Java, Programming | 3 Comments

JVM – Profiling and GC analysis tool

The easiest GC log analysis web site. https://gceasy.io/ Profiling Adding a JVM Option +XX:+PreserveFramePointer https://github.com/jvm-profiling-tools/perf-map-agent https://github.com/brendangregg/FlameGraph $ perf-java-flames [pid] https://github.com/Netflix/flamescope

Posted in Java, Programming | Leave a comment

Simple way to generate ssh pub/private key

Very simple way to generate ssh pub/private key in Linux. Copy the content of .ssh/id_rsa.pub to .ssh/authorized_keys

Posted in Programming | Leave a comment

Spark – Cassandra connector example

Github https://github.com/nsclass/spark-cassandra-example

Posted in Programming, Spark | Leave a comment

Client side load balancing

Posted in Programming | Leave a comment

Kafka – Docker compose example for Kafka

Kafka docker compose example. Please set value of KAFKA_ADVERTISED_HOST_NAME for local host IP address.

Posted in kafka, Programming | Leave a comment

Time – days of clock vs Monotonic clocks

Getting days of clocks – Linux: clock_gettime(CLOCK_REALTIME) – Java: System.currentTimeMillis() Getting monotonic clocks – Linux: clock_gettime(CLOCK_MONOTONIC) – Java: System.nanoTime() It’s important to know difference between days of clocks and monotonic clocks because days of clocks is measured from a certain … Continue reading

Posted in Programming | Leave a comment