Skip to content

Instantly share code, notes, and snippets.

@skdangi
skdangi / kafka performance benchmark
Last active December 13, 2021 04:34
Kafka performance benchmark summary
Kafka benchmarks summary prepared from:
https://engineering.linkedin.com/kafka/benchmarking-apache-kafka-2-million-writes-second-three-cheap-machines
https://gist.github.com/jkreps/c7ddb4041ef62a900e6c
I had six machines each has the following specs
Intel Xeon 2.5 GHz processor with six cores
Six 7200 RPM SATA drives
32GB of RAM
@skdangi
skdangi / install_gradle_version_with_homebrew.sh
Created March 9, 2017 05:33 — forked from l1x/install_gradle_version_with_homebrew.sh
Installing a specific version of Gradle with Homebrew
brew tap homebrew/versions
brew search gradle
brew install homebrew/versions/gradle112
gradle -version
brew link --overwrite gradle112
gradle -version

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Common Vagrant Commands

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
  • vagrant status -- outputs status of the vagrant machine
  • vagrant halt -- stops the vagrant machine
  • vagrant reload -- restarts vagrant machine, loads new Vagrantfile configuration
  • vagrant provision -- forces reprovisioning of the vagrant machine
@skdangi
skdangi / ReverseKList
Last active December 28, 2015 04:49
Reverse a list by k slots
public class ReverseKList {
public static class Node{
Node next;
int value;
public Node(int value){
this.value = value;
}
public class CheckBalanced {
private static class Node<T> {
public Node(T value) {
this.value = value;
}
Node successor;
Node left;
Node right;
@skdangi
skdangi / PalindromeUtil.java
Created November 8, 2013 19:55
Solution for - find the next smallest palindrome larger than given number [http://www.geeksforgeeks.org/given-a-number-find-next-smallest-palindrome-larger-than-this-number/]
import java.util.Arrays;
public class PalindromeUtil {
final static char NINE = '9';
final static char ZERO = '0';
public static char[] nextPalindrome(char[] sourceNumber) {
if (null == sourceNumber || sourceNumber.length == 0) {
throw new IllegalArgumentException("Not valid value");
public class NodeSuccessor {
// Node class;; ignoring getters and setters for simplicity
private static class Node {
public Node(int value) {
this.value = value;
}
Node successor;
Node left;
@skdangi
skdangi / LRUCache
Last active December 27, 2015 18:39
LRUCacheImplementation
import java.util.HashMap;
import java.util.Map;
public class LRUCache {
private static class Database {
private Map<Integer, Integer> map = new HashMap<Integer, Integer>() {
{
put(1, 1);
put(2, 2);
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms