How to decrypt PDF files on macOS

Some companies send encrypted PDF documents. If you’re a macOS user, Preview will ask you for the password each time you use quick look or open the document. Moreover, if you print that document, you’ll end up with a blank sheet of paper. At least I got it. So secure.

Read more →

Missing article image on Twitter due to GetMatch in Hugo template

Recently I received notification that somebody post information about my article on Twitter (thanks!). Twitter usually renders a link to blog posts as nice-looking cards. The card to my article shown up without a featured image.

I checked my Twitter feed, and some of my other entries also suffer from missing featured images.

Read more →

Line break in Markdown

There are a few different methods to enforce a line break in the same paragraph in Markdown syntax: HTML’s <br />, backslash and double space. Let’s consider each case.

Read more →

Restore files from encrypted iPhone backup

I do not use iCloud backup for my iPhone. Instead, I do local encrypted backup, more or less regularly. I wanted to browse and find something from one of these backup.

Did you know, that there is no native way on macOS to browse and restore something from your encrypted iPhone backup? I didn’t.

Read more →

Using local DNS in dhcpcd causes to ignore others DNS

I struggled with the strange behavior of dhcpcd on my Raspberry Pi powered by Raspbian. The RPi does many things on my local network, including ad-blocking thanks to the pihole service.

I run pihole1 as a docker container, and it does its job perfectly well. Thanks to the port binding, I could bind port 53 (DNS) directly to the host and use its address as a DNS server.

Read more →

Specify timezone for tests in Node to get deterministic results

In one of my side projects in Node, I wanted to test if the object with the date is formatted correctly as a Markdown entry. The setup of the test was the easiest part. However, comparing the outcome of the formatted Date object wasn’t so convenient because of the timezone. Because I live in the Europe/Warsaw timezone, I experience an offset relative to UTC.

Read more →

Synchronize two collections with different representations

We get used to reading about big things – high-level architectural solutions, design patterns in action, or big data processing. However, most of our problems are small and lie at the low-level in our code. One of them is: how to synchronize a collection of entities with another collection, which is its simplified representation?

Imagine you have a collection of entities. You receive an updated version of that collection, e.g., from the API endpoint. But what if data are transferred using DTOs? We should add new entities based on data in DTO, update existing entities, and remove elements that don’t appear in the edited collection.

In this article, I’ll show you a generalized solution to this particular problem.

Read more →

Selective serialization using serialization groups

When you ever develop an API in the Symfony framework1, you probably heard of the serializationGroup option. It allows you to define different groups of attributes to serialize and deserialize. However, defining these groups without proper consideration may make the whole development hard, e.g., if you need to deal with different scopes of the object’s attributes in many other endpoints.

I want to show you our approach to serialization groups in one of our projects. Together with my team, we use them to control the serialization of related entities on various endpoints in our API.

Read more →

Why deprecation process is important, on the example of restic

I use restic as my backup solution, and I haven’t had any problem so far, but recently one of my health checks suddenly stopped working, telling me that something is wrong with my backup. On the other side, restic has done its job, and everything works fine, so what was the problem?

Read more →

Following in Social Media

This post is also available in: Polski 🇵🇱

The problem with Social Media lies in its social component, where we treat everyone as a friend. Some people take it seriously, and they share almost everything with people who often don’t really care. As long as the publisher does it consciously, know the consequences, and have fun with sharing – it’s OK. However, the problem occurs on the consumer’s side because not everyone is interested in somebody else’s life details, political opinion, religion, or other stuff that friends actively share. Why people let that content appear in front of them? Because of friendship.

Read more →