RSSAmplifier

Blog

madhead

Recent content on madhead

madhead.meRSS feed ↗42 posts

Latest posts

When being dumb is the best solution


 A small performance story about Redis, bad assumptions, and how a stupid solution turned out to be the best one. 


Modeless Keyboard Layout Switching in GNOME with Shyriiwook


 
 

 
 
 Recently, I treated myself with a few extra keys on my mechanical keyboard (just flexin' here), and I decided to set them up to switch keyboard layouts modelessly.
Little did I know that trying to make this seemingly simple feature work in GNOME would turn into a ridiculously tough challenge.
That’s how my pet project, Shyriiwook (also on GitHub as…

When ConcurrentHashMap is not concurrent and runBlocking is not blocking


 A (click)bait? Let me explain. 


No SNAPSHOTs


 
 

 
 
 SNAPSHOTs are a confusing Maven concept. 
Maven is a pre-historic build tool, invented inside The Apache Software Foundation to build its (mostly Java) projects back in the 2000s.
It is, thus, very opinionated, just like this post.
Those opinions — including SNAPSHOTs, maven-release-plugin , POM , repository and project layouts, and many more — are…

On DynamoDB's Single Table Design


 
 

 
 
 What’s a Single Table Design? 
 
 
 The world learned about the idea of Single Table Design (STD) for DynamoDB somewhere in 2019, probably when this article came out.
STD wasn’t just a weird idea by some unknown blogger like me, or an AWS DevRel, or any other kind of Internet freak, but it actually has its roots in the official Amazon DynamoDB…

Copying a file from a Kubernetes pod in a highly hostile environment


 Do you want to get a binary file from a Kubernetes pod in an highly hostile secure environment where you can’t use kubectl cp ?
Read on! 


Why Declarative Gradle is a cool thing I am afraid of: Maven strikes back


 Yesterday, JetBrains introduced Amper .
Today, Gradle published another related article, named Declarative Gradle . 
 
 
 Now, I can see the direction it is leaning towards, and I am afraid of this future. 
 
 
 
 



PR preview environments with Neon, GitHub Actions, and AWS Lambda


 You might have heard about preview environments (AKA dynamic, or ephemeral environments) in the scope of software engineering and, particularly, this term is used when speaking about the SDLC. 
 
 
 A preview environment — as opposed to a permanent one, like 'Production', or 'TST', or whatever you call them — is a short-lived environment, usually bound to a pull request.
It…

From BotFather to 'Hello World'


 Great news, everybody: a few days ago, Telegram team updated their Bot API documentation!
Among other things, they now have an end-to-end tutorial on the bot creation process: starting from bot registration in @BotFather , going all the way to database & deployment options. 
 
 
 Unfortunately, it features Java, Maven, and rubenlagus/TelegramBots library. 
 
 
…

Docker-based GitHub Actions in orphan branches


 GitHub Actions are great for sharing & reusing logic across your CI/CD pipelines.
However, sometimes sharing is not the highest priority.
Sometimes you only want to hide the complexity by exctacting & encapsulating multiple build steps and replacing them with a single action. 
 
 
 Anyway, you have to create a GitHub action. 
 
 
 You could use actions stored…

Tyzenhaus


 Tyzenhaus is a Telegram bot to simplify shared expenses in chats.
It’s like Splitwise, but simpler and doesn’t required any apps except Telegram.. 


Grand Guide Pedestrian


 Let me tell about a pet project I did recently. 
 
 
 It’s name is 'Grand Guide Pedestrian'.
It’s a virtual interactive experience where a player controls another human, a hero, who walks in the city like it’s a GTA game.
No gunfire, no car thefts, no other crimes, though. 
 
 
 Look at the demo: 
 
 
 
 


Sony α6300 as a webcam on Manjaro Lunux

&#xA; Original article . &#xA; &#xA; &#xA; Change USB connection in settings on camera to PC Remote. &#xA; &#xA; &#xA; &#xA; sudo pacman -S gphoto2 v4l-utils v4l2loopback-dkms ffmpeg&#xA;sudo modprobe v4l2loopback exclusive_caps=1 max_buffers=2&#xA;v4l2-ctl --list-devices&#xA;gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 8 -f v4l2 /dev/video<N> #from…

Reading Java properties in GitHub Actions

&#xA; Have you heard that GitHub Actions are cool? &#xA; &#xA; &#xA; I just want to share another action with you, that you may find useful in your Java projects. &#xA;

One-stop shop for working with semantic versions in your GitHub Actions workflows

&#xA; GitHub Actions are so cool! &#xA; &#xA; &#xA; Check out our recording about them @ Ministry of Testing Abu Dhabi if you want a quick sneak peek, but today I want to self-advertise one of the reusable Actions I made for you.&#xA;And it wasn’t hard at all, thanks to the way they work (although I’m going to rant about that in future articles). &#xA;

ImgMacroBot

&#xA; @ImgMacroBot is was an inline Telegram bot for image macros . &#xA;

No-bullshit guide on publishing your Gradle projects to Maven Central

&#xA; You’ve heard the news , haven’t you?&#xA;JFrog is closing JCenter — probably the best Maven-compatible repository ever.&#xA;It was kind of a 'default' in Gradle — a drop-in replacement for Maven Central Repository — for years.&#xA;Plus it hosted some extra artifacts from the projects that decided to not deploy into Central (and now I understand why).&#xA;With its own Gradle plugin, JCenter…

How I fucked up with a private key and newlines

&#xA; A short story about wasting a day on a single newline at the end of a private key. &#xA;

Hosting multiple Telegram bots with NGINX, self-signed certificates and Ansible

&#xA; Imagine you have a few cool ideas for Telegram bots .&#xA;Bots have two options of communicating with Telegram servers: either by polling the events by using getUpdates or by registering a webhook and receiving the updates as HTTPS POST requests.&#xA;But who the heck uses polling today?&#xA;Right, nobody does that, and webhooks are the option. &#xA; &#xA; &#xA; And here be dragons. &#xA;

Graphviz @ Docker

&#xA; One more article about my Docker images.&#xA;Graphviz doesn’t seem to have an official Docker image, so I’ve created my own . &#xA;

Learning Kafka: Kafka Connect &#43; Wikipedia

&#xA; I’ve been developing backend software for almost 10 years already and never had a chance to work closely with Apache Kafka .&#xA;After a couple of technical interviews recently I’ve realized that it’s a significant gap in my experience.&#xA;So, I’ve decided to learn it by playing with publicly available Wikipedia’s recent changes event stream.&#xA;Join me in this article, where I’ll be…

How I fucked up with enum&#39;s hashCode

&#xA; A short story about a newbie’s mistake I’ve made recently. &#xA;

YouTube Watch Later Telegram Bot

&#xA; YWLTB — or YouTube Watch Later Telegram Bot — is was a Telegram bot that does did one simple thing: add incoming YouTube videos into your 'Watch Later' playlist. &#xA;

Redis module in Kotlin/Native

&#xA; Those of you who have some experience with Redis may know that it is not just a simple cache or a plain key-value store, but actually a data structures server, supporting different kinds of values.&#xA;Out of the box it supports binary-safe strings, sets, lists, hashes, bit arrays, streams and HyperLogLogs.&#xA;Redis also provides a simple C API for custom data structures, called native…

Speeding up the detekt task in a multi-project Gradle build.

&#xA; I’m going to tell you how to significantly speed up the detekt task in a multi-project Gradle build.&#xA;Precise numbers vary depending on many factors, of course.&#xA;In my case, in a build with 56 subprojects and ~7000 lines of code, it was about 10 times faster . &#xA;

JUnit 5 extensions for AWS

&#xA; Do you test the code that uses AWS services?&#xA;Do you use JUnit 5 in your tests?&#xA;If you do both, I may have something useful for you. &#xA; &#xA; &#xA; JUnit 5 extensions for AWS : a few JUnit 5 extensions that could be useful for testing AWS-related code.&#xA;These extensions can be used to inject clients for AWS service mocks provided by tools like localstack .&#xA;Both AWS Java SDK…

OpenSearch

&#xA; I search online every day. I search on Google, StackOverflow, GitHub, Maven Central, Gradle Plugins repository, YouTube and dozen of other sites.&#xA;And, I won’t deny, sometimes I search on Pornhub. &#xA; &#xA; &#xA; I bet you search too. &#xA;

Do you need a local master branch?

&#xA; I noticed recently that I’ve (almost) never used a local master branch in Git.&#xA;I only use it in simple one-off playground repos that I don’t plan to support and never in professional development or in “serious” pet-projects. &#xA; &#xA; &#xA; So, is it really required? &#xA;

Keeping Gradle up-to-date

&#xA; Gradle is an awesome build tool, and I am always looking forward to new versions to enjoy the latest features, performance improvements and bug fixes.&#xA;Actually, forget what I’ve said about bugfixes: Gradle works like a charm. &#xA; &#xA; &#xA; I could just check Gradle’s distributions page periodically, or subscribe to their releases on GitHub to get notified about new versions…

Kotlin/Native for AWS Lambda

&#xA; Amazon announced Lambda Runtime API on AWS re:Invent 2018.&#xA;It allows developers, among other things, to build Lambda functions using any technology they want via so-called Custom Runtimes .&#xA;Yes, it’s now possible to author a function on PHP, Perl, Pascal (anybody?) or even Bash (they use it in the docs )! &#xA; &#xA; &#xA; Nice, isn’t it?&#xA;Let’s build an AWS Lambda function with…

Java classes for server-side App Store receipts validation

&#xA; I’m working on a bunch of apps that need to verify App Store receipts on a JVM-based server.&#xA;The process is described in Apples’s Documentation Archive but lacks of any SDK / libraries (at least for JVM).&#xA;So I made one to improve code reuse. &#xA;

Java classes for AWS Lambda Proxy Integration

&#xA; When I had to configure Lambda Proxy Integrations in AWS API Gateway for the second time for a week I thought about extracting Java classes in a small library for later reuse. &#xA;

(Alpine &#43; AWS CLI &#43; Ansible) @ Docker

&#xA; I’m using Bitbucket Pipelines widely for CI/CD at my current position.&#xA;It sucks a little if compare it with GitLab CI/CD , but I don’t complain. &#xA;

Hard lesson from NVIDIA

&#xA; Last week I’ve managed to accidentally break my Linux installation.&#xA;Probably, the first time for the last ten years where Linux behaved truly “unstable”. &#xA;

Maven is not as stable as many think

&#xA; Sometimes I’m trying to show others that there is a better alternative to Maven: Gradle.&#xA;I’m trying to show them how Gradle can make things easy & possible whereas achieving the same results in Maven are Herculean labors or literally impossible.&#xA;I often hear in reply: “Gradle sucks because it’s a hipster technology. It’s new and unstable. Will you help me if something goes wrong?”.…

Using Monday as a first day of week in KDE 5

&#xA; en_US.UTF-8 is a great locale and I am using it for my KDE desktop because it gives me full English UI, whereeas other locales can result in semi-translated UIs.&#xA;But it has some flaws.&#xA;For example, weeks begin on Sunday in USA.&#xA;It’s not how we do here in Europe and it’s really annoying to see Sunday as a first day of week in a calendar widget.&#xA;Unfortunatelly, there is no knob…

BTTF-like sticker @ Inkscape

&#xA; We’re going to organize a Java conference later this year.&#xA;And it need its stickers.&#xA;So let’s draw one! &#xA;

Preserving MongoDB shell history in Docker

&#xA; So, you run mongo in disposable Docker containers and want to preserve shell history?&#xA;Say no more, pal. &#xA;

AWS Lambda environment variables → AWS SSM parameters in one (long) bash line

&#xA; So, you want to use AWS SSM parameters instead of AWS Lambda environment variables?&#xA;But you already have dozens of variables defined? &#xA; &#xA; &#xA; Keep calm (tested in production) and use this one-liner. &#xA;

Mounting directories for Docker containers from Git Bash (Windows)

&#xA; Just use double slashes when mounting and accessing directories from Git Bash in Docker on Windows: &#xA; &#xA; &#xA; &#xA; docker run --rm -it -v //c//Users//Siarhei_Krukau//Downloads:/test alpine ls -la //test &#xA; &#xA;

Speeding up Kitchen converges with Squid

&#xA; One day, you may find yourself smoking too often or drinking a lot of coffee while waiting for the files to be downloaded during provisioning of Vagrant / Kitchen VMs.&#xA;E.g: JDK size is ~200 MB and it may take a dozen of minutes to download during the execution of the java recipe.&#xA;You can save precious seconds of your life with Squid .&#xA;Though some configuration is required, it…

Hello, world!

&#xA; Hello, world! &#xA; &#xA; &#xA; So, I’ve decided to run my own blog.&#xA;I will write my thoughts here from time to time. &#xA; &#xA; &#xA;