Quick Tip: Sync fork with original repo

1. Clone fork:

2. Add remote from original repository:

3. Update fork with changes from original repo:




Spring Boot CLI Hello World

Spring Boot CLI

For quickly getting some http endpoints up for prototyping I usually go with Spark for Java or Flask for Python. I’m also a fan of Spring Framework though I haven’t had a chance to work with it lately. Thinking of catching up again and checking out version 5, maybe with Kotlin. Spring Boot is great for getting a solid application up quickly. Looks like Spring Boot CLI might be an option for Java prototyping. I’m adding the minimal steps to expose an endpoint with plans to expand it later.



Create App

View in browser


  • http://www.baeldung.com/spring-boot-cli
  • http://zetcode.com/springboot/groovycli
  • https://www.concretepage.com/spring-boot/spring-boot-cli-example
  • https://www.infoq.com/articles/microframeworks1-spring-boot

Working with Elasticsearch Snapshots

Create a snapshot

View existing repositories
curl -XGET 'localhost:9200/_snapshot/_all?pretty=true'

Create a directory accessible to the user running elasticsearch
mkdir backup
chown -R elasticsearch:elasticsearch /path-to/backup

Let elasticsearch know about path.repo (or in elasticsearch.yaml)
./bin/elasticsearch -Dpath.repo=/path-to/backup

Create a snapshot repo

Take a snapshot
curl -X PUT "localhost:9200/_snapshot/osm/snapshot_1?wait_for_completion=true"

Restore from Snapshot


Hungarian trunk prefix 06. To use or not to use.

…. another day at work and another question about phone numbers and formats. This time a question about Hungarian phone numbers and more specifically the usage of the 06 trunk prefix.  For a random number +36 1 20 22222, Google’s libphonenumber library currently formats the “NATIONAL” format as (1) 202 2222

(v 8.8.10)

The customer says this should include the 06 prefix which from looking at the Telephone numbers in Hungary I tend to agree with.

However, it seems this has already been brought up as a libphonenumber issue but it was closed with the explanation that  (1) 202 2222 is how you write it down on a paper(?) and  06 (1) 202 2222 is how you dial it from a mobile phone. But from what I can tell the 06 prefix is included in all the dialing permutations:


With the exception of landline-landline within the same area as well as possibly mobil-mobile within the same network. Based on that I think the suggested solution of using the formatNumberForMobileDialing is not satisfactory.

I posted the question on Quora: https://www.quora.com/When-do-I-include-the-06-trunk-prefix-when-dialing-within-Hungary and got conflicting answers.

Found some Hungarian coworkers to suggested that 06 the norm and referring to government webpages like:

Website of the Hungarian goverment
http://www.kormany.hu/hu/nemzetgazdasagi-miniszterium/elerhetosegek 06-1-795-7977

Tax Authority
https://nav.gov.hu/nav/kapcsolat 06 (80) 20-21-22

Seems it’s also getting more common these days to just dial using the country code +36 1 808 8125 even within the country and in many cases that’s the only number format provided.
Let’s see if I the libphonenumber maintainers will reconsider changing the default national format to include 06 so I don’t have to do a one off fix for Hungarian. What’s next?

Java Iterator and Iterable

So this question came up in a job interview not too long ago:

Implement a method that takes as a parameter a varargs of Iterables and returns a unified Iterator (without merging the the passed in Iterables into some collection)

Creating a custom Iterator and/or Iterable is pretty basic stuff but admittedly I can’t remember the last time I’ve done it. While I know that implementing Iterator requires at least implementing the hasNext and next method and I kinda forgot what the purpose of Iterable basically just means that you are providing the iterator() method, duh. Anyway, I obviously need some refreshers but in the mean time here’s my future white boarding solution


Shortcuts and Cheat sheets

Bash Scripting Cheat Sheet


Emacs Edit Mode Keyboard Shortcuts


Emmet Cheat Sheet


IntelliJ Keyboard Shortcuts


Mac Keyboard Shortcuts


Markdown Cheat Sheet


Scala Cheat Sheet


Vim Cheat Sheet







SSH (Secure Shell)

SCP (Secure Copy Protocol)

SFTP (Secure FTP)

References and Resources

Bash Keyboard Shortcuts