Tech

My Experience with LG Ultragear 32GS60QC (32 inch)

As a backend engineer who spends long hours juggling IDEs, terminals, browser tabs, and dashboards, the right monitor setup is more than just a luxury — it’s a necessity. After weeks of research, I picked up the LG UltraGear™ 32GS60QC, a curved 32-inch QHD monitor with solid specs at a reasonable price. Here’s my review…

Scala

TIL: Value Classes

Value classes are a super neat way to improve type safety in your code without paying the price of object creation at runtime. In many programming languages, especially on the JVM, it’s easy to pass around raw primitives or strings like IDs, tokens, etc. But doing that often leads to bugs like accidentally swapping a…

Tech

How to Check If a Private Key Matches a Certificate

When working with SSL, SAML, JWT, or other cryptographic systems, it’s essential to ensure that your private key and certificate actually belong to each other. A mismatch can lead to hours of frustrating errors like: Failed to decrypt Invalid signature No matching private key found I have encountered few of those errors and didn’t explored…

Scala

How to Serialize and Deserialize UUID in Json4s

When working with UUIDs in Scala using json4s, you might run into issues serializing and deserializing UUID objects by default. Json4s does not handle java.util.UUID out-of-the-box. Fortunately, there’s a simple and elegant solution using JavaTypesSerializers. To enable UUID support in json4s, you can add JavaTypesSerializers.all to your implicit formats: When working with Java types like…

Java

Setting Up Swagger with JWT Authentication in Spring Boot

When working on APIs, secure endpoints often need an easy way to authorize requests during development and testing. Swagger (via Springdoc OpenAPI) lets us integrate JWT-based authentication directly into the UI. Here’s a breakdown of the configuration that makes this happen: Let’s break this down: Components Section: This part defines a new security scheme called…

Java

Resolving “module java.base does not export sun.security.x509” Error

When working with Java applications, you may encounter the following error like I did: This issue arises because your code is attempting to use the internal sun.security.x509.X500Name class. Starting with Java 9, the Java Platform Module System (JPMS) restricts access to internal APIs such as sun.security.*, making them inaccessible unless explicitly allowed. Why This Happens…

Java

Enabling CORS in Spring

There are multiple ways to enable CORS in Spring Boot. Enable CORS Globally To apply CORS settings to all endpoints in your Spring application, you can use the WebMvcConfigurer interface. Enable CORS for Specific Endpoints You can use the @CrossOrigin annotation to enable CORS for specific controllers or methods. This approach is ideal if you…