Hey, I’m Bartosz! šŸš€šŸ‘‹

I’m a SWE with over 7 years of professional experience building software. Here, I’ll share my learnings, thoughts, and insights on Swift, automation, and whatever catches my interest at the moment. Enjoy your stay!

Create a Safari Extension to Extract Article Content

In this article, Iā€™ll show you how to access a web pageā€™s content, alter it using JavaScript, and display it using your Safari extensionā€™s UI. Specifically, Iā€™ll demonstrate how to display an articleā€™s content in a popover. I often use Large Language Models (LLMs) to summarize articles when Iā€™m unsure if theyā€™re worth reading. Without the extension weā€™re about to build, Iā€™d need to manually trigger Safariā€™s reader mode (āŒ˜ + ā‡§ + R), copy all content, and paste it into Claude or ChatGPT....

December 18, 2024 Ā· Bartosz Kunat

Verifying VPN Status for Docker qBittorrent on Synology

I run qbittorrent in a Docker container on my Synology NAS, with VPN configured at the Synology system level (Control Panel -> Network -> Network Interface) rather than the container level. For setup instructions, you can follow this guide. Even with killswitch enabled, I wanted to verify beyond the UIā€™s ā€œFirewalledā€ status that my torrent traffic was actually routing through the VPN. To check this, SSH into your Synology NAS and run:...

November 30, 2024 Ā· Bartosz Kunat

My Synology Setup

Iā€™ve been using Synology for the past year, and during this time itā€™s become the center of my home computing. Iā€™m still discovering new use cases, so Iā€™ll keep this post updated. Today, I want to share how I ended up with this setup - the how and why. Here are the main things I use my NAS for: Media Server - My Synology stores and serves my entire collection of movies, TV shows, and music....

October 9, 2024 Ā· Bartosz Kunat

Single-Key App Launching with Karabiner and Hammerspoon

For years, I wanted a way to launch my most-used apps with single-key shortcuts. While I knew tools like Hammerspoon could make this possible, I never found a key combination that felt right. Iā€™d always end up disabling the setup, missing the functionality of keys like right control, caps lock, or escape. Everything changed when I discovered Karabiner Elementsā€™ ability to create distinct mappings for different key events, such as short presses and long presses....

September 13, 2024 Ā· Bartosz Kunat

Setting up AdGuard Home on Synology NAS with Tailscale

Setting up AdGuard Home as a Docker Container on Synology NAS In this guide, Iā€™ll walk you through the steps to set up AdGuard Home (AGH) as a Docker container on a Synology NAS. This setup will allow you to use AGH both inside and outside of your home network. AdGuard Home is a network-wide DNS server that blocks ads and trackers for all devices on your network. It filters unwanted content before it reaches your devices, eliminating the need for individual ad blockers....

August 8, 2024 Ā· Bartosz Kunat

AdGuard Home Not Working in Safari: A Fix for Custom DNS Issues

tl;dr: If your custom DNS does not work in Safari, you might want to try disabling Advanced Tracking and Fingerprinting Protection. A few weeks back, I set up AdGuard Home on my Synology NAS. Iā€™ve been using it without any issues inside and outside of my home network thanks to Tailscale. There was one issue with this setup though: battery drainage on all of my mobile devices. I noticed that my battery usage went up by 25% on my phone....

July 24, 2024 Ā· Bartosz Kunat

Secure Remote Access to Your Synology Plex Server via Tailscale

In this article, Iā€™ll describe how to set up your Plex server so you can access it remotely through Tailscale, with Remote Access completely disabled in Plex server settings. Prerequisites Have a Plex server running as a Docker container using this guide. When youā€™re done, you should have a docker-compose.yml and a .env file with all your environment variables. Have Tailscale set up and running on your Synology. You can use this guide....

July 3, 2024 Ā· Bartosz Kunat

Xcode: Missing Package Product (local package)

When adding a local Swift package to your Xcode project, you might encounter the following error: Missing package product `PACKAGE_NAME` The issue often occurs when the package youā€™re trying to add is already open in Xcode. To resolve: Close the package in Xcode. Close your main project. Reopen your main project. Iā€™m not sure what might be causing this issue or why reopening the project is required (a clean build wonā€™t do)....

June 24, 2024 Ā· Bartosz Kunat

Keeping Safari Windows Open: A Tab Group Workaround

tldr: In order to keep the current Safari window open when you close the last tab, use tab groups. Last month, I once again switched my default web browser to Safari. It has its quirks, but I missed it in a weird way. I initially switched to Firefox because of its stellar support for vim keybindings and some other extensions I started to enjoy. Even with all those improvements, I began to miss some niceties that Safari has built-in....

May 18, 2024 Ā· Bartosz Kunat

Open Any Xcode Project Type with a Shell Script

In my current role, we have around 30 projects distributed across roughly 20 different repositories. Most of them are Swift packages for various features used in our apps. This setup requires me to frequently switch between multiple projects. Just a few days ago, I was working on the login flow. This involved modifying two Swift packages and one Xcode project. Remembering whether a given project is a Swift package, a workspace (....

April 29, 2024 Ā· Bartosz Kunat

Quitting Reels: Unveiling Instagram Deep Links

Iā€™ve noticed that Iā€™ve been wasting a lot of time watching Instagram Reels lately. This would not be a problem if I actually enjoyed the time spent doing it. However, this was not the case. Iā€™m not only angry at myself after the fact, but I also usually feel miserable while mindlessly scrolling. Itā€™s just that sometimes I lack the discipline to avoid it altogether. Ideally, Iā€™d completely delete it from my phone, but I still need it for texting....

March 31, 2024 Ā· Bartosz Kunat

Working with Local Swift Packages

Imagine youā€™re working on Project A, which relies on Package B, a remote Swift package. To incorporate modifications in B and assess their impact on A, the standard approach requires committing and pushing the changes in B, updating Bā€™s version in A, and then rebuilding A to observe the outcomes. This method is slow and cumbersome. There must be a better way! Project A | ā””ā”€ā”€> Swift Package B To speed up and improve the workflow, you can convert the remote dependency B to a local one....

February 27, 2024 Ā· Bartosz Kunat

Creating Tag-Specific RSS Feeds in Hugo with PaperMod

This website uses the PaperMod theme for Hugo. The default setup offers a primary RSS feed for all posts at yoursite.com/index.xml. However, I needed more granularityā€”specifically, RSS feeds for posts tagged with certain keywords. After some exploration and experimentation, I discovered that Hugo automatically generates RSS feeds for each tag. TIL! Hereā€™s how you can access these tag-specific RSS feeds: iOS Tag Feed: https://kunat.dev/tags/ios/index.xml Swift Tag Feed: https://kunat.dev/tags/swift/index.xml Utils Tag Feed: https://kunat....

January 30, 2024 Ā· Bartosz Kunat

Alfred Snippet Converter

A few months ago, I wrote about Alfred Snippets on iOS. In that article, I described the manual process of converting Alfred text snippets into macOS text replacements. Since then, Iā€™ve had time to refine this project and add some new features. You can download the final Command Line Interface (CLI) or the macOS app from this link. Next on my list is the complete automation of the process of synchronizing Alfred text snippets with macOS text replacements....

December 27, 2023 Ā· Bartosz Kunat

Automating Adding SPM Plugins

How to automate adding plugins to all of your existing (and future) targets in a Swift package TL;DR package.targets = package.targets.map { target in var plugins = target.plugins ?? [] plugins.append(.plugin(name: "SwiftLintPlugin", package: "SwiftLint")) target.plugins = plugins return target } The Problem Last month, I was tasked with adding SwiftFormat and SwiftLint to one of the projects my team maintains. The project is medium-sized and uses Swift Package Manager (SPM) for modularization....

December 18, 2023 Ā· Bartosz Kunat

Integrating a Spm Package With Higher Deployment Target

tl;dr this is currently not possible. See Solution. Last week, I was working on extracting functionality responsible for handling Live Activities into a separate Swift Package Manager (SPM) package. Apple introduced Live Activities with the release of iOS 16.1. My projectā€™s deployment target is currently set to iOS 13. As you can imagine, this feature had lots of #if available checks. To make my life a bit easier, Iā€™ve decided to set my packageā€™s deployment target to iOS 16....

October 30, 2023 Ā· Bartosz Kunat

NextDNS: Breaking Bad Habits

My story begins with a quest for a reliable ad blocker for Safari. I used Wipr for years, but it started performing poorly. I tried AdGuard, but it required a root certificate for HTTPS traffic, which was a dealbreaker. PiHole seemed complex to configure, so I found NextDNS, a DNS-level content blocker promising effective ad and tracker filtering. I decided to try it. NextDNS: The Game Changer NextDNS turned out to be a game-changer for several reasons....

September 30, 2023 Ā· Bartosz Kunat

My Alfred Setup

Last updated: 13/08/23 Iā€™ve relied on Alfred as my daily driver for boosting productivity for years. However, I didnā€™t switch from Appleā€™s Spotlight overnight. It took three attempts before I truly embraced its capabilities. In this article Iā€™ll share my Alfred setup and explain my most frequent workflows. Letā€™s dive in! The Initial Setup Iā€™ve already described the initial setup in detail in New Mac Setup article, so be sure to check it if youā€™re interested....

August 13, 2023 Ā· Bartosz Kunat

GitLab Code Coverage for Pure Swift Packages

How to use GitLabā€™s built-in test coverage report tool for pure Swift packages? Some test coverage report generation tools do not support ā€œpureā€ Swift packages. One example is Slather. By pure, Iā€™m referring to packages that contain only the Package.swift file, without any .xcodeproj or .xcworkspace files. One solution to this problem was to generate a project file for a Swift package on the fly using Fastlane. This solution has one limitation: itā€™s not possible to generate a project file for a Swift package that contains any resources....

July 28, 2023 Ā· Bartosz Kunat

Building Long Term Investment Portfolio in Europe

Iā€™ve been putting off this project for the past ~18 months. Most resources Iā€™ve found focus primarily on US-based investors. Sadly, most of the assets listed in those resources are unavailable to investors located in other parts of the world. What came to my rescue was the Banker on Wheels blog. I did not find any other resource that came even close to this one. It was a one-stop shop for my use case....

June 21, 2023 Ā· Bartosz Kunat

New Mac Setup

This note describes the steps I take when setting up a new Mac. This process could be mostly automated, but I canā€™t get myself to do it. It takes me around 90 minutes to go through all the steps. Letā€™s get started! Files to Import .gitconfig .zshrc Apps to Install Apps marked with ā€œšŸŒ•ā€ emoji are optional (it depends if itā€™s a work or a personal Mac). App Store Pause Clean Links Dynamo Meeter Preferences -> General -> Open at login Disable non-work related calendars Disable ā€œShow countdown to next meetingā€ in Preferences -> Advanced Bear Notes Set themes Update Preferences -> Editor Set keyboard shortcuts Magnet Pixelmator Pro Balance Lock SourceryPro Vimari šŸŒ• Amphetamine šŸŒ• Color slurp šŸŒ• Boop šŸŒ• Wipr Web HomeBrew Alfred Disable both shortcuts for Spotlight Import preferences from /Users/$USER/Library/Application Support/Alfred/Alfred....

May 15, 2023 Ā· Bartosz Kunat

Xcode Development Assets with XcodeGen

Development Assets in Xcode that allow developers to provide test data to use within SwiftUI previews and other code during development. Assets marked for development will only be included in debug builds and removed once you create an archive of your app. This solution is preferred to having larger assets in the production binary size. Developers can add different types of data as Development Assets, such as JSON files for mocked network requests, images to use in SwiftUI previews, Core Data sample databases, and Swift files representing mocked or sample data....

April 10, 2023 Ā· Bartosz Kunat

Connectivity Issues with Logitech MX Keys on macOS Ventura

After installing macOS Ventura, I began experiencing connectivity issues when using MX Keys keyboard through Bluetooth. The keyboard would disconnect from my Mac whenever it was inactive for a few minutes. What made this issue especially frustrating was that it didnā€™t happen every time, and the time it took for the keyboard to reconnect varied widely. It drove me insane. Iā€™ve been following several threads in r/logitech, reaching out to Logitech support multiple times, and submitting bug reports through the Logi Options+ app....

April 4, 2023 Ā· Bartosz Kunat

How to Tackle Duplicate Test Doubles Problem in Modular Architecture

After SPM asset support has been added to Xcode 12, there is no reason not to use modularization in your iOS projects. It brings value no matter the project and team size. However, after some time, you might encounter problems like increased complexity, difficulty with integration testing, or code duplication. Today weā€™ll focus on the last one, specifically, testing doubles duplication. Letā€™s jump in! Introduction When saying ā€œmoduleā€ Iā€™m always referring to a group of related targets....

March 30, 2023 Ā· Bartosz Kunat

Kill It With Fire Review

ā€œKill It with Fireā€ exceeded my expectations. I initially anticipated a boots-on-the-ground review of technical debt handling. What Iā€™ve got instead was almost everything but that. The book has changed the way I think about technical debt and how to communicate it upwards. It provides sound advice on various topics, including how to fight tech debt, schedule maintenance work, and communicate with stakeholders. I have not come across any other book that provides this much credible advice on the topic of technical debt without exclusively catering to a particular audience....

March 17, 2023 Ā· Bartosz Kunat