Skip to content

Instantly share code, notes, and snippets.

View 62mkv's full-sized avatar

Kirill M 62mkv

  • Breakwater Technology
  • Tallinn, Estonia
View GitHub Profile
62mkv /
Last active May 11, 2024 21:32
OpenStreetMap / OverPass cheatsheet

Find all car repairs services, open on Saturday:

Open and paste this into query area, then press "Run"

This has been generated by the overpass-turbo wizard.
The original search was:
62mkv /
Created October 11, 2019 08:46
How to add a custom trusted certificate for making HTTP requests against external sites

Thoughts on how to add trusted store for connection to external sites that use that certificate for HTTPS

Option 1: global configuration

One can just provide the<path/to/store><password> options when running the Java application

However, this is not always possible (for example, when run in the cloud).

And if you want to use options from Spring Boot, be aware that with those you also have to provide key-store options as well. And, basically that would be an abuse, because this configuration is specifically for server side of your application.

When we have source.json file with a following structure:

    "groupId": "bla-bla-bla",
    "members": 25,
    "topics": 25,
    "simple": false,
    "partitionAssignor": "range",
    "state": "STABLE",
62mkv /
Last active December 14, 2023 13:14
Wikidata SPARQL queries

Examples of SPARQL Wikidata queries:

List of hills in Estonia without defined elevation

SELECT ?item ?itemLabel ?geo ?elevation WHERE {
  ?item wdt:P31 wd:Q54050;
    wdt:P17 wd:Q191;
        wdt:P625 ?geo.
    OPTIONAL { ?item wdt:P2044 ?elevation }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "et" } 
62mkv /
Created November 22, 2023 15:34
Postgre recipes

Show table size in bytes with a percentage of all tables size

with t as (select * from pg_catalog.pg_tables
where schemaname = 'public'), 
sizes as (
select t.tablename, pg_total_relation_size(t.tablename::regclass) _size from t
order by 2 desc),
total as (select sum(_size) _size from sizes)
select sizes.tablename, sizes._size, to_char(sizes._size / total._size * 100.0,'999D99%') from sizes, total;
62mkv /
Last active May 28, 2023 10:39
How to run "Zipkin2 + Elasticsearch" with Docker Desktop on Windows 10 with WSL2 backend


Turns out, Zipkin, when run "simply" with something like docker run openzipkin/zipkin:latest, dies out of OOM very soon, under any meaningful load. To prevent this from happening, one would want to run it together with a storage backend, like Elasticsearch. Unfortunately, Zipkin docs are probably hopelessly outdated, at least, I could not achieve this based on their README alone.


Create this docker-compose.yaml:

package org.example;
import io.opentelemetry.api.trace.SpanKind;
import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.api.trace.Span;
import io.r2dbc.proxy.core.*;
import io.r2dbc.proxy.listener.ProxyMethodExecutionListener;
import static;
62mkv /
Created March 6, 2020 10:10
Docker Desktop is not respecting proxy settings under Windows 10 Professional

Docker Desktop is not respecting proxy settings under Windows 10 Professional


  • Option 1:configure Docker Desktop to use Manual proxy settings: the "whale" context menu / Settings / Resources / Proxies / Manual proxy configuration
  • Option 2: (might work, didn't test) set HTTP_PROXY / HTTPS_PROXY / NO_PROXY as system environment variables, not user ones

In both cases, restart Docker Server

Original Problem:

It's very annoying when you write some code at work, say, reproducible cases for OSS issues, but then commit those under work-related credentials and push on GH

To avoid this from happening, I've wrote such a pre-push hook and put it into .git-templates folder (see recipe on global hooks)

#!/bin/bash -e
# Git pre-push hook that blocks push if commits are authored or committed using non-personal credentials
# Source:
62mkv / remove-merged-branches
Last active October 12, 2022 09:19
Oneliner to remove remote branches from "origin", that are already merged into "master" (runs in MINGW shell under Windows 10)
git branch -r --merged master | grep -v master | grep -v develop | grep -w "origin" | awk '{print gensub(/origin\//,"","g",$1)}' | xargs git push origin --delete
git remote prune origin