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. 

Recent content on madhead

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


 
 

 
 
 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…

 A (click)bait? Let me explain. 


 
 

 
 
 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…

 
 

 
 
 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…

 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! 


 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. 
 
 
 
 



 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…

 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. 
 
 
…

 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 is a Telegram bot to simplify shared expenses in chats.
It’s like Splitwise, but simpler and doesn’t required any apps except Telegram.. 


 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: 
 
 
 
 


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

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


 GitHub Actions are so cool! 
 
 
 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.
And it wasn’t hard at all, thanks to the way they work (although I’m going to rant about that in future articles). 


 @ImgMacroBot is was an inline Telegram bot for image macros . 


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

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


 Imagine you have a few cool ideas for Telegram bots .
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.
But who the heck uses polling today?
Right, nobody does that, and webhooks are the option. 
 
 
 And here be dragons. 


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


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

 A short story about a newbie’s mistake I’ve made recently. 


 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. 


 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.
Out of the box it supports binary-safe strings, sets, lists, hashes, bit arrays, streams and HyperLogLogs.
Redis also provides a simple C API for custom data structures, called native…

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


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

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


 I noticed recently that I’ve (almost) never used a local master branch in Git.
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. 
 
 
 So, is it really required? 


 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.
Actually, forget what I’ve said about bugfixes: Gradle works like a charm. 
 
 
 I could just check Gradle’s distributions page periodically, or subscribe to their releases on GitHub to get notified about new versions…

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

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


 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. 


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


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


 Sometimes I’m trying to show others that there is a better alternative to Maven: Gradle.
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.
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?”.…

 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.
But it has some flaws.
For example, weeks begin on Sunday in USA.
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.
Unfortunatelly, there is no knob…

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


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


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


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


 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.
E.g: JDK size is ~200 MB and it may take a dozen of minutes to download during the execution of the java recipe.
You can save precious seconds of your life with Squid .
Though some configuration is required, it…

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