YouTube flagged me so I built a Telegram bot to proxy the videos

August 10, 2020

TLDR; I use ad blockers. YouTube flagged my account and devices. I can only watch around 1 in 4 videos. So I wrote a Telegram bot that receives YouTube URLs and replies back with the video. The problem I use adblockers to have a semi-decent experience on the Internet. I mainly use UBlock Origin plus some DNS ones. One nice feature of UBlock Origin is that it does block ads from YouTube videos. ... Read more

Automatic work session recordings with OBS Studio + TaskWarrior + TimeWarrior + YouTube

June 3, 2020

Hacker News discussion Not long ago I read a comment on Hacker News about tips to improve one’s performance as a developer; it recommended a system of recording oneself while working and someone suggested uploading the videos to YouTube (as private or unlisted) for future revision and as a backup. I liked the idea so I wanted to give it a try myself. Of course, like most of the stuff I do, the practicality of it was not as important as the chance to see how I would implement a system to support such workflow. ... Read more

Include versions in published POM file when using Gradle platforms (BOM)

May 20, 2020

Gradle platforms are a nice feature introduced back in Gradle 5. They allow you to align the versions of the dependencies across multiple projects by declaring them explicitly in a “platform module”. This is no more than Gradle implementing Maven’s BOM (bill of materials) pattern. This post is not intended to sell you the idea of Gradle platforms. In fact, it assumes familiarity with this feature. Instead, we will discuss one of the downsides and a potential solution: when publishing an artifact that uses a platform, the generated POM file will not, by default, include the version numbers of the transitive dependencies. ... Read more

Connect to VPN using Pritunl + auto 2FA

April 21, 2018

At work we use Pritunl to connect to the office VPN. This process involves entering a password and a two factor authentication token. Tired of manually connecting using the graphical user interface and pulling my phone to get a new 2FA every time, I went ahead and tried to automate the process. It turns out that, in Linux, Pritunl offers two clients: CLI and GTK. Using the CLI one, once you have imported the VPN profile, you can connect to a VPN like this: ... Read more

Idempotence layer on bloom filters

April 10, 2018

TLDR: we run several applications consuming multiple real-time streams. These applications implement idempotence using Redis sets. In this post I describe our journey moving to bloom filters (using the ReBloom module), which brought down our memory usage by almost 10x. Let’s briefly define idempotence: An operation is said to be idempotent when applying it multiple times has the same effect. There are some reasons why applications consuming a real-time stream must have an idempotence layer, e. ... Read more

So... I have an album on Spotify

March 30, 2018

First of all, let me clarify something: I’m not a musician. I don’t even know the difference between DO and RE. I’m a human just like you (unless you are some future alien reading this, in which case all I can say is: cool), so I like music. And using a synthesizer is rather easy to create your own, so I did it, and it’s live and feels great. ... Read more

Find self-references in (possibly nested) collections

March 16, 2018

I found a nice trick reading part of the ElasticSearch client for Java. Say you are given an object (could be a map, a list, an array or anything) and you need to make sure the same reference does not show up in any of the children objects (or theirs). Here is how this the ElasticSearch guys solved this problem: static void ensureNoSelfReferences(Object value) { ensureNoSelfReferences(value, Collections.newSetFromMap(new IdentityHashMap<>())); } static void ensureNoSelfReferences(final Object value, final Set<Object> ancestors) { if (value ! ... Read more

Mutability and Java 8's method references

March 12, 2018

Method references is a nice feature introduced in Java 8. It lets you make your lambdas even more concise: // from... someStream .map(item -> obj.someMethod(item)) .moreStuff... // to... someStream .map(obj::someMethod) .moreStuff... Some linting tools will even suggest you replace your lambdas with method references but, watch out, that sometimes have some unadverted consequences. For instance, this is a piece of actual code I was working one: private List<Application> applications() { return applications . ... Read more

Merge multi-project test coverage: Gradle + Jacoco + Sonarqube

March 8, 2018

I’m assuming you got here because you are using Gradle with Jacoco and noticed that integrating it with Sonarqube does not work perfectly out of the box. Specifically, when your project has multiple modules, you might have seen that Sonarqube’s coverage report ignores code in module A covered by tests in module B. In fact, this is a problem that you will find even if you are not using Sonarqube: Jacoco itself will not merge test reports by default, which makes it extra hard to find a solution online. ... Read more

© 2017 | Powered by Hugo ♥ | Art by Clip Art ETC