tonis.dev

Writing

Notes on software, tools and infrastructure

Follow via RSS

2026

How My Server Got Owned by a Userland Rootkit (and How I Cleaned It)

Monday morning started with an abuse report from Hetzner. My server was apparently sending SMTP brute force attacks to mail servers worldwide. Grea…

2025

AI-Driven Functional Programming in TypeScript

I use AI to write 95% of my code. While this has dramatically increased my productivity, it introduced a critical challenge: maintaining consistent…

Managing kubectl port-forwards: Why GUI Tools Are Taking Over

Comparison of kubectl port-forward tools

2024

Deploy a Vite React SPA app to CloudFront with working BrowserRouter

When I deployed my websites, then I always had problems with refreshing/sub routes like /finding/latest. Other developers posted solutions like ske…

How to ignore generated Kotlin files in Jacoco?

I am using build.gradle.kts Jacoco: id(“org.barfuin.gradle.jacocolog”) version “3.1.0” Optics from Arrow library Arrow library generates __OpticsKt…

How to achieve validatedNel with fp-ts

fp-ts is a great library, but it can be confusing some times. The last problem that I had was that I didn’t know how to implement validatedNel. Som…

2023

Lazy/conditional logging in JavaScript

I had some trace logs that I only wanted to enable conditionally, eg only when the logging level was set to TRACE. I couldn’t find a node.js librar…

How to scroll to line with codemirror-react

This is for “@uiw/react-codemirror”: “^4.20.2” capture the ref to the codemirror objects 2. on each new ref callback, call the dispatch with the ne…

2022

how to find critical bugs in code4rena contests

I have recently tried my luck with code4rena, where you can earn extra income by finding bugs in Solidity contracts. At first I didn’t find any bug…

What is a Knowledge Token?

Knowledge Token is an NFT project that allows content writers to create tokens that readers mint in order to see secret content. Knowledge Tokens a…

How to use web3-react

Tutorial about how to use web3-react and hardhat to read and execute Solidity contracts.

Knowledge Token test post

What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy …

How to use ethereum-multicall on a local hardhat node

ethers-multicall actually uses MakerDAO multicall contracts for multicall functionality. On a local chain this contract is not deployed, therefore …

vscode-jest doesn’t work for a react app in a yarn workspace/monorepo

I have created a simple yarn workspace with a single package. This package is the default CRA Typescript app. Repository code is on Github. In this…

How to transfer a DynamoDB table from one account to another?

This can be done with AWS Glue and IAM roles. Let’s assume we are transferring from account A to account B. Define a role in A to add B as trusted …

2021

Location data reduction in Android

Android LocationManager allows fine location data updates with customisable interval. This means the phone could return new coordinates even after …

Add text and images to Notion via the official API and Python

Notion has recently released the official API. With some restrictions, it allows coders to add, update and delete blocks from their pages. There is…

Aggregate Iconomi crypto strategy details

Choosing crypto currencies to invest in can be a puzzling task. Investor can look at graphs, news or read expert opinions on Twitter. A popular veh…

Create a login screen with Jetpack Compose

In a previous post I described how to create a Github Repository browser app. The UI in that app was written using XML layouts(imperative UI). In t…

Create a code editor with Compose for Desktop

Compose desktop is an upcoming cross-platform framework that promises the building of apps from a single codebase to every desktop and web platform…

Setup MacOS system-wide Vim mode

I got interested in workflow automations a while ago. With that came the understanding of Karabiner, which allows the remapping of keyboard keystro…

Kotlin native interoperability with Swift/Objective-C.

Under the Kotlin Native umbrella lie many platforms, like Linux, Windows, or even the Android NDK. Of course it is also available for Apple platfor…

Kotlin Multiplatform in a MacOS app

If a Kotlin developer is familiar with her libraries and language paradigms, it might seem superfluous to learn their counterparts in Mac developme…

Kotlin Multiplatform app architectures

The recommended architecture for Android development is MVVM. However, when using Kotlin Multiplatform Mobile(KMM), the Jetpack’s ViewModel is not …

Kotlin Hydra constructors

After 4 years of Kotlin experience, one of the confusing parts still are the constructors. It appears like every time they seem figured out, you st…

Java EC crypto with BouncyCastle

Java crypto is like an architect building a house. Architect only knows how to design a house, but needs a construction company to actually build i…

Kotlin Multiplatform logging libraries

When developing with any platform, the existence of libraries is assumed. This is to delegate common tasks to out project code, in order to reduce …

iOS app with Kotlin Multiplatform Mobile

Overview Kotlin Multiplatform Mobile(KMM) is a new feature from Jetbrains. It is an alpha feature but can already be used to create and publish app…

Create JSON manually with kotlinx.serialization

Kotlin serialization is a great library for serialisation in Kotlin. It is mainly geared towards serialising from objects to strings and back, but …

2020

Add a sequence diagram to Notion

Update I created a MacOS app that uploads PlantUML code to Notion. Check it out PlantUML to Notion uploader In order to express their ideas about a…

Callback styles for async tasks

For asynchronous tasks, the actions on completion need to be handled via a callback. There are different patterns to achieve this, with each having…

Logging in a Java library

It can be useful to emit logs in a library. When doing so, one needs to consider when to emit, how to filter and who is responsible for printing/ha…

Kotlin: Concatenating nullable strings

A null String is concatenated as “null” in Kotlin: What if the goal is to concatenate only if the second string is not null? There are a few option…

Workflow automations

Some of the smaller, repetitive tasks as a programmer can be automated and by doing so productivity improved and frustrations reduced. I am talking…

Car data points in Android Automotive

When following the Android Automotive overview, it might seem that not much of the car info is available for developers. It is even stated that onl…

Part 2: Testing with MockK and Koin

One of the best things about MVVM is the use of separation of concerns principle which by design enables testing of each component in isolation. Vi…

Android App Architecture, Part 1

Not being familiar with modern Android App architecture and coming from the ViewController world, it is confusing jumping into the recommended MVVM…

Sharing native code between Android and Java projects

In High-Mobility, we have separate libraries for Android and Linux. For each of these we use native code that handles transport protocol. After imp…

Hello World!

This is my first post. In the future I will write about my experience with software development.