RSSAmplifier

Blog

Random Notes by agilob

Recent content on Random Notes by agilob

b.agilob.netRSS feed ↗32 posts

Latest posts

Grafana OnCall using ArgoCD

Quick command to get OnCall running using ArgoCD: argocd app create oncall \ --repo https://grafana.github.io/helm-charts \ --helm-chart oncall \ --revision 'v1.3.*' \ --dest-namespace oncall \ --dest-server https://kubernetes.default.svc \ --values-literal-file values.yaml \ --project oncall

Java agent to unfinalize class

That one boring Saturday I wanted to learn something more about agents and thought it would be a really cool idea to “unfinalize” java.lang.String. I started working on the project, developed simple transformer: if (name.equals('java/lang/String')) { ClassPool classPool = ClassPool.getDefault(); final CtClass ctClass; try { ctClass = classPool.get(name.replace('/', '.')); } catch…

Native memory leak in a cloud environment

A Java project with published container image that contains intentionally leaky native code to observe symptoms of a memory leak in Java in podman/docker or Kubernetes. Native code intentionally “leaks” provided number of megabytes in a loop. The project runs by default with -XX:NativeMemoryTracking=summary enabled. I wanted to observe how JVM will report native memory, crash and what…

HeapDumpOnOutOfMemoryError on K8s

There are a few reasons why OOM might happen in a JVM. For some of them a JVM will crash with an option to write heap dump to a file system. None of us wants to get OOM on prod, and have to reconfigure deployments and hope for the worst to happen again, this time with some fallback plan. In a JVM this can be configured with: -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/heapDumpDirectory' but…

Pod size considerations for JVM

In this post I’ll describe things you want to consider to let JVM use own ergonomic configuration, without drastically overriding them, for which you need more advanced tuning and more metrics. Pod sizing for GC The limit numbers of processors and memory impacts how JVM will tune its own performance characteristics. Most importantly it impacts what GC will be used and how many threads it will…

Resource allocation strategies

This page lists deployment strategies I use to run JVM on Kubernetes. Below you will find 3 sections describing more common deployment practices of JVM. The practices are listed from the most to the least expensive to run, but each strategy has other drawbacks too. The described practices are more “realistic”, as cost-optimised ways to run Kubernetes deployments. I am for a predictable utilisation…

Tdarr kubernetes deployment files

apiVersion: apps/v1 kind: Deployment metadata: namespace: media name: tdarr spec: selector: matchLabels: app: tdarr revisionHistoryLimit: 10 replicas: 1 strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 1 maxSurge: 1 template: metadata: labels: app: tdarr spec: volumes: - name: tdarr-server hostPath: path: /mnt/tdarr/server type: Directory - name: tdarr-config hostPath: path:…

Running multiple scenarios at once

Our test pack is configured dynamically from environment variables. Each scenario can be configured independently with different target VUs, duration or even executor. Let’s start from a file called main.js. It imports all our scenarios, each as a default function: export { default as cacheCreateAll } from './runners/cacheCreateAll.js'; export { default as cacheCreateUpdateRemove } from…

Coordinating k6 runners on kubernetes

My team is preparing our company to acquire another customer who at initial stages will be 5x bigger than our current biggest customer. To do it, we had to rewrite our performance tests from Gatling to k6. Improve reporting, metrics and scalability of our whole infrastructure and tune set of microservices. To test our infrastructure we had to scale up our perf test runners too and to do that we…

Building custom k6 container image

Our performance tests project is complex, we have +40 .js files, csv feeder files and use custom extensions, so we need to bundle all of that in a single image. We want things to be version controlled, deploy performance tests in a cloud-native way and the image to be compatible with official k6 image. # Build the k6 binary with the extension FROM golang:1.20 as builder RUN go install…

Horizontal Pod Autoscaler

An example of HPA that scales up and down depending on CPU and memory consumption. apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: identity spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: deploymentname minReplicas: 2 maxReplicas: 10 behavior: scaleUp: stabilizationWindowSeconds: 300 policies: - type: Pods value: 1 periodSeconds: 300 scaleDown:…

Wynajem domu

Wprowadzke do domu zaczelismy od gruntownego wysprzatania go, naprawienia usterek jak nieszczelna kuchnia gazowa, odpadajace listwy podlogowe. Wszystkie blaty i szafki zostaly umyte izopropanolem. Nieszczelna kabina prysznicowa zaizolowana. Peknieta, uszczerbiona plytka zaklejona. Peknieta rama lozka skrecona. Minely juz ponad 3 tygodnie od wprowadzki. Nadal czekamy na obiecany certyfikat CEEB bez…

Szukanie mieszkania

Dalismy sobie tydzien zeby odpoczac od przygody z Przeprowadzki Raffa zanim zaczelismy szukac domu na wynajem. Rynek mieszkaniowy w Polsce jest duzo wygodniejszy, latwiejszy, prosty i mniej zbiurokratyzowany niz w UK. Pewnie to tez glowne przyczyny czemu bezdomnosc w Polsce nie istnieje w porownaniu do UK. Oboje pracujemy z domu, wiec mamy wymogi co do zaktwaterowania: dom albo maly, a dwupietrowy…

Archive Warrior on Kubernetes DaemonSet

Run Archive Warrior in your Kubernetes cluster as DaemonSet apiVersion: apps/v1 kind: DaemonSet metadata: name: warrior namespace: archive labels: app: warrior spec: selector: matchLabels: app: warrior template: metadata: labels: app: warrior spec: nodeSelector: kubernetes.io/arch: amd64 terminationGracePeriodSeconds: 60 containers: - image: atdr.meo.ws/archiveteam/warrior-dockerfile:latest name:…

Switching cloud

Taken from a comment on HackerNews: Set up haproxy, nginx or similar as reverse proxy and carefully decide if you can handle retries on failed queries. If you want true zero-downtime migration there’s a challenge here in making sure you have a setup that lets you add and remove backends transparently. There are many ways of doing this of various complexity. I’ve tended to favour using…

Set your Garbage Collector

A less known thing about deploying a JVM in a container is what garbage collector will be set, if you do not specify one. Let’s look at the cases of JVM running in a container and see what GC will be set by default as I experiment with different Java versions and memory limits. Java 8 - OpenJDK8-alpine With memory limit 1791Mb podman run --memory=1791m -ti openjdk:8-alpine java…

Dangers of OpenCSV beans streaming

That one time I have to extract, transform and load a massive CSV file into a bunch of database entities and it was kinda slow… The class had position based CSV bindings, loaded into beans and streamed from a pretty big CSV file (+10Gb): public class CSVUserEntry { @CsvBindByPosition(position = 0) private String userId; @CsvBindByPosition(position = 1) private String username;…

Keycloak password hashing

This post doesn’t contain full context of the works performed, only benchmarking part I had to test how number of iterations impacts login request time to KeyCloak and if or how we can improve it. After investigating a few other options I decided to check what’s the difference for password hashing times using default hashing mechanism in KeyCloak. I found and extracted parts of…

Adding Desktop Icons to sdkman managed packages

When you install package like jmc or VisualVM from sdkman, the installation is for your current user only, so it doesn’t create desktop shortcuts allowing you to start program from Gnome or KDE app launchers. Unfortunately this by design forces users to start application from command line, even when it’s a desktop application. To fix it, and be able to run jmc from Alt+F2 launcher you…

Gradle run two tasks of the same type

I have this setup in a single project which handles backend and frontend generation of server and client code. This requires to run openapi-generator twice, once for backend with spring generator and once for frontend with typescript-angular generator. I need backend code to be generated to build directory - so it is not committed to version control. TypeScript code needs to be reformatted and…

Weaknesses of agile and Scrum

Jira is agile: do you use Jira and Confluence and consider this one of the main reasons contributing to your agility? Congratulations, you are part of the problem. Boring Backlog: fixed really hard bug? Implemented complex algorithm or cut processing time from 10 hours to 22 seconds? It doesn’t matter, just pick another thing from backlog. Scrum/backlog promotes code monkeys where good…

ArchUnit check if abstract classes are abstract

@Test public void abstractClassesAreAbstract() { final JavaClasses importedClasses = new ClassFileImporter() .importPackages('net.agilob.project'); LoggingRulesTest.ABSTRACT_CLASS_MUST_BE_ABSTRACT.check(importedClasses); } public static final ArchRule ABSTRACT_CLASS_MUST_BE_ABSTRACT = classes() .that() .haveSimpleNameContaining('Abstract').or().haveSimpleNameContaining('abstract') .should()…

Przeprowadzka do Polski

Zaczelo sie od znalezienia firmy, ktore przewiezie nasze rzeczy do Polski. Przeswietlilismy kilka firm, sprawdzilismy ich opinie o nich, status prawny w UK i Polsce, by ominac “firmy-krzak”, ktora wywiezie nasze rzeczy na Bialorus. Znalezlismy firme “Przeprowadzki Raffa”. Wszystko spoko, zarejestrowana w HMCR, ma jakis (nie pamietam jaki) status prawny w Polsce. Firma…

HASS saving my meat

That one day my fridge decided to give up but blasting me with hot air right when I wanted to put food in there. Thermostat failed in a really funny way. It refused to turn the cooler on, but decided to get hot itself. I spent half a day trying to find a replacement part, for such a simple thing as GE thermostat I found no help. I couldn’t ID it, repair shops or ebay were to no help.

Interface-news

It’s been nearly 3 years since my last post, so I don’t expect people to be here any longer. If anybody is here, I wanted to share with you my recent development. I wrote a simple CRUD page for storing links about topics that are of interest to me. I read the link (90% I read it, I promise), found it good quality, interesting, refreshing knowledge and I want to share this link with you, so you can…

Nominate members

Change format of your standup to make people pay attention who is talking. A person starts daily standup, it usually is the scrum master or team leader. They pass the ball and another person who starts talking. You count on people to volunteer and start talking what they are working on. It creates a blocking queue, it’s easy to be distracted and stop paying attention to what’s going…

The Standup Questions

It is often misunderstood what purpose standup questions serve. Most likely you’re familiar with the following questions: What did you do yesterday? What are you planning to do today? Do you have any blockers? These questions make you answer what you are doing, they are misaligned with purpose of “the standup questions”, tracking progress and delivering product value. In Scrum we…

Wild card points

Every now and then teams get work they don’t want to do for whatever reason: It would be wiser to pay off tech debt before starting the new work Another tech-stack is more suited for the work, but pipeline doesn’t support the tech yet There isn’t much dev-work, but turns out regression testing is massive and one (of three) tester is on holiday and second called in sick Wild card…

PostgreSQL autogenerated interval

Using postgres specific SQL syntax we can create autogenerated column which subtracts two dates and stores them as interval. The age function is also null-safe, so if time_ended or time_started it will not crash. ALTER TABLE session ADD COLUMN duration interval GENERATED ALWAYS AS (age(time_ended, time_started)) STORED;

Youtube-dl git repo in ipfs

Following this simple tutorial I put youtube-dl on IPFS. Git repo ends on commit 48c5663c5f7dd9ecc4720f7c1522627665197939. You can see the git files using any gateway under hash QmQ8rwm3guU76oSsfQpo3rYfW91MXhmZ4jZLqKpHVTR4uE. and clone ipfs repo using git command using git clone https://ipfs.io/ipfs/QmQ8rwm3guU76oSsfQpo3rYfW91MXhmZ4jZLqKpHVTR4uE :)

ZFS rename devices in pool to disk ID

zpool import -d /dev/disk/by-id poolname Converts: NAME STATE READ WRITE CKSUM poolname ONLINE 0 0 0 mdisk1 ONLINE 0 0 204 mdisk2 ONLINE 0 0 627K mdisk3 ONLINE 0 0 0 to map disks by ID (example): NAME STATE READ WRITE CKSUM poolname ONLINE 0 0 0 wwn-0x1000000 ONLINE 0 0 204 wwn-0x2000000 ONLINE 0 0 627K wwn-0x3000000 ONLINE 0 0 0

Whoops! Page not found

That page can’t be found. Our latest content is on the homepage. Photo by Aron Visuals on Unsplash