Fixing slow Bcrypt and BasicAuthenticationFilter.doFilter

I recently investigated and fixed a performance issue with user authentication in our Spring Boot based API service. Our users started complaining about random 504s from our service. Looking at our thread pool config, worker threads, database connection pool size etc., everything looked normal. Looking at NewRelic for slow transactions, it gave a clue: It… Continue reading Fixing slow Bcrypt and BasicAuthenticationFilter.doFilter

Vagrant Remote Debugging – Xdebug 3 & IntelliJ or PHPStorm

Debugging is one of the most efficient ways to investigate an unexpected behaviour. This post details how to setup a debugger for a PHP application running in a vagrant machine via your IDE such as IntelliJ or PHPStorm. We’ll be using Xdebug version 3 in this post. Xdebug version 3 is significantly different from the… Continue reading Vagrant Remote Debugging – Xdebug 3 & IntelliJ or PHPStorm

Jenkinsfile – Cheat sheet, Examples & References

All of these examples were tested with the ‘Multibranch Pipeline’ type jobs. This may not work with other types of jobs in Jenkins. Validate Jenkinsfile for syntax Navigate to the directory which has the Jenkinsfile file. You’ll need the Jenkins host URL, username/password of your Jenkins host. Conditional credential variable based on the branch name… Continue reading Jenkinsfile – Cheat sheet, Examples & References

Published
Categorized as CI/CD Tagged

Hide Links object with SpringDoc & Swagger 3

We started generating Swagger 3 documentation (OpenAPI 3.0) for our API service using SpringDoc. We are also using Spring Hateoas to include links within the response for easy navigation. The generated schema includes the 3 examples of “_links” object for each model classes that extends RepresentationModel in your response. Here is a shortened example of… Continue reading Hide Links object with SpringDoc & Swagger 3

Published
Categorized as Spring Boot

iTerm2 – Clear scrollback automatically on a schedule

iTerm2 is my default terminal and have been using it for close to 8 years now. It is highly customizable and has API support for hackability. I was using it today to run a webpack watch command on my 2nd monitor. For every change, webpack recompiles the modified files and adds it to the output.… Continue reading iTerm2 – Clear scrollback automatically on a schedule

Using tableLayout CSS property with TypeScript

Using table-layout property with React and TypeScript was giving a type error like below: ERROR in /var/jenkins/workspace/dev/resources/packages/sites/table.tsx [tsl] ERROR in /var/jenkins/workspace/dev/resources/packages/sites/table.tsx(79,25) TS2322: Type ‘{ padding: number; width: string; margin: string; tableLayout: string; }’ is not assignable to type ‘CSSProperties’. Types of property ‘tableLayout’ are incompatible. Type ‘string’ is not assignable to type ‘TableLayout’. This was… Continue reading Using tableLayout CSS property with TypeScript

CSS Flip Animation for Font Awesome Icons

This flip animation will be a perfect use-case for enable/disable UI actions. We’ll be using rotateY transform function to achieve this flip animation. Here is a simple HTML page with a few font awesome icons in both enabled and disabled states (we’ll be adding CSS for these states later) and jquery included for click actions.… Continue reading CSS Flip Animation for Font Awesome Icons

Shrinking indices in Elasticsearch

The Problem Today, we started receiving the following error from our production Elasticsearch cluster when a new index was about to be created: The error description was obvious that we would breach the shard limit of 1,000 when creating a new index. Confirming the number from the error message using _cat/shards endpoint, we see that… Continue reading Shrinking indices in Elasticsearch

Static Websites with AWS CloudFront and S3

Why CloudFront & S3 is better for hosting static sites? AWS CloudFront is a CDN that can be used to serve static HTML sites backed by S3 storage. S3 storage is very cheap. Combined with CloudFront, you can make your sites serve in low latency speeds. Deploy to S3 and start CloudFront cache invalidation Why… Continue reading Static Websites with AWS CloudFront and S3