Skip to main content

How To

2026

Circular Favicon for Hugo Site

·364 words·2 mins
Problem # Adding a custom favicon to a Hugo site is straightforward — drop a favicon.ico into static/. But making it appear circular in the browser tab is trickier than it sounds. ImageMagick’s alpha channel handling for ICO files is unreliable. The corners either don’t go transparent or the 1-bit alpha makes edges look jagged. The browser ends up showing a square icon regardless.

2022

Find Files And Delete Recursively

·89 words·1 min
Problem # Sometimes when using monorepos to host multiple services in a single repository, there may be a requirement to delete a file or list of files from each microservice. For example, I needed to delete application-dev.yml files for all the services after getting rid of dev environment in favor of acceptance. Solution # Use following find command to find application-dev.yml files recursively and delete them.

Spring Boot Request Header too large

·145 words·1 min
How to solve IllegalArgumentException: Request header is too large in spring boot # When migrating a spring boot application to cloud, multiple layers got added to serve traffic. On prem: nginx -> spring boot app (tomcat) Azure: nginx -> azure application gateway -> nginx ingress controller -> spring boot app(tomcat) In Azure, we noticed that some of http requests threw 400 http status code in our logs.

Nginx Ingress Controller forward headers

·100 words·1 min
Error # While moving to kubernetes, and migrating spring boot apps, we encountered a strange behavior that few of the webpages served by freemarker templates in spring boot were adding port :8080 instead of just using the hostname with SSL port :443 Fix # After some investigation and trying to find some workaround, we found out that X-Forwarded-* headers needs to be forwarded by nginx ingress controller when it’s behind an azure app gateway(L7 load balancer).

Fix Only_full_group_by_sql_error

Recently, I encountered sql state 42000 error in a spring boot application while moving from MySQL version 5.6 to 8.0. After inspecting stack trace and some googling, I got to know that few default configurations have changed in MySQL 8.0 (as expected 😃 ). This caused our poorly written queries to fail during migration. Background # Lets look at sample query using spring-data jpa to gather some analytics by aggregating data about a customer ordering products

Nginx Ingress Sample Configurations for Helm values

·248 words·2 mins
Ingress configurations in helm values files. The following setup assumes that you have a helm chart which provides the configuration to deploy a service and an ingress for it Now, lets look at few of the sample helm values file configurations for ingress configurations with ingress-nginx. Enable Cors # ingress: enabled: true annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/enable-cors: "true" nginx.ingress.kubernetes.io/cors-allow-methods: "DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT" nginx.ingress.kubernetes.io/cors-allow-headers: "*" nginx.ingress.kubernetes.io/cors-allow-origin: "*" nginx.ingress.kubernetes.io/cors-max-age: "100" nginx.ingress.kubernetes.io/cors-allow-credentials: "true" hosts: - host: ravikrs.com paths: - path: /test/path1 pathType: Prefix - path: /path2 pathType: Prefix External Authentication # External Authentication configuration based from doc

Google Search Tips and Tricks

·133 words·1 min
1. Exact phrase search # Use double quotes "" to search for exact phrase match. e.g.: “JedisDataException: ERR unknown command CONFIG” 2. Exclude terms # use hyphen (-) to exclude search terms which should not contibute to the search result. e.g.: coke -cola to exclude cola from search results.

JedisDataException ERR unknown command CONFIG

·93 words·1 min
Error # While trying to setup Azure Cache for Redis as spring session store, I encountered following exception: .JedisDataException: ERR unknown command CONFIG, with args beginning with: get, notify-keyspace-events": 1, Fix # Found the solution in spring-session-gh-issue Kotlin @Configuration class HttpSessionConfig() { companion object { // another solution could be to enable notify-keyspace-events for redis @Bean fun configureRedisAction(): ConfigureRedisAction { return ConfigureRedisAction.NO_OP } } } Java @Configuration class HttpSessionConfig() { // another solution could be to enable notify-keyspace-events for redis @Bean public static ConfigureRedisAction configureRedisAction() { return ConfigureRedisAction.NO_OP; } } Links # spring-session-gh-issue

Exec Format Error

·219 words·2 mins
Having encountered exec format error stacktrace for two times already, I definitely want to log it 😤 First encounter # I got this error when I got a new Mac M1 from my employer. I was using colima as docker desktop replacement for Mac. While working on a feature for a service, I built container image using colima; pushed the image to container registry and tried deploying to dev environment. And saw the exec format error in logs.