Serialize list of dates into JSON with Jackson

Problem Let’s imagine that we need to return JSON form of the following Java object: import java.util.Date; public class A { private String name; private List<Date> dates; public String getName() { return name; } public void setName(String name) { = name; } public List<Date> getDates() { return dates; } public void setDates(List<Date> dates) { this.dates = dates; } } If we return this class ‘as is’, without any helping directives to JSON serializer, we could get it in the following form:

Spring Boot and AWT headless

The problem with AWT headless app in Spring Boot Recently I needed to create console Java Spring Boot app that does some stuff with AWT (not so important what exactly). I found that simple run with a normat Spring Boot stub simply does not work. Running this: @SpringBootApplication public class MyAwtApplication { public static void main(String[] args) {, args); } } generates following exception when AWT-related processing happens:

AWS permissions to S3 folder

Let’s imagine that we have a project, which actually use AWS S3 as file storage. The project consists of 2 parts: one part puts files into S3, and the other part only reads them from S3. Moreover, files are stored not in the bucket root, but in some folder which is placed in the bucket root. According to best AWS practices, we need 2 security and access control policies. One policy is for that part of software which puts files into S3 folder.

How SSH get port 22

A nice story from SSH creator (Tatu Ylonen) about how SSH got its port 22. Briefly, initial SSH version was created in Spring 1995, time when FTP and Telnet were widely used. SSH was designed to replace FTP (port 21) and Telnet (port 23). Port 22 was free. So it was chosen to be used in SSH. At that time Internet was small, and port numbers were allocated by IANA, managed by Internet pioneers Jon Postel and Joyce K.

Interesting HackerNews posts by 21 April 2017

Recursive DNS Server Fingerprint They try to identify DNS hijacking by creating a database of DNS server fingerprints and comparing response of a particular DNS server (suspected to be hijacked) with its normal fingerprint. Introducing Token Token is a browser for the Ethereum network that provides universal access to financial services. It combines messaging app, Ethereum wallet and browser for Ethereum apps. Scalable, Lie-Detecting Timeserving with Roughtime Roughtime is a protocol designed to provide internet-scale secure time synchronization and address shortcomings of older protocols like NTP.

Blockchain and Bitcoin links

This posts contains links to some articles, blog posts and other materials which looks interesting for me, give good explanation/description of the field and simply put are pleasure to read. A blockchain in 200 lines of code The blockchain explained to web developers. Part 1: The Theory How migh we use blockchains outside cryptocurrencies Mastering Bitcoin - open source book on Bitcoin published by OReilly Awesome Bitcoin - GitHub repo with bitcoin-related links collection

Timus 1005. Stone pile

This is a first post which describes how to solve some particular programming task. Today we will consider Stone pile task from Timus. It is clear and easy. The task sounds like: Task Stone pile Task You have a number of stones with known weights w1, …, wn. Write a program that will rearrange the stones into two piles such that weight difference between the piles is minimal. Input Input contains the number of stones n (1 ≤ n ≤ 20) and weights of the stones w1, …, wn (integers, 1 ≤ wi ≤ 100000) delimited by white spaces.

First post

Hi, after a long pause I decided to relaunch my blog. Here I am planning to tell mostly about technical things, put some useful findings, etc.



Brute Force

Bunch Of Links


Just my blog



Programming Problems