-
How to migrate an AWS EC2 instance from IPv4 to IPv6
With AWS’s decision to charge for public IPv4 addresses starting February 1, 2024, many users are looking for ways to avoid the new cost. This article guides you through the process of assigning an IPv6 address to your Amazon EC2 instance and removing the IPv4 address to prevent incurring charges. Check IPv6 Support Before making any changes t... Read More
-
Why is my JVM's max heap size less than -Xmx?
TL;DR Because Max heap size = -Xmx - max possible Survivor Space size (with Parallel Garbage Collector, one of the two Survivor Spaces always needs to be empty, so objects can be copied into it during GC). The same question is also answered more concisely in this Stack Overflow post. How we got here Some time ago at work, I was looking into the... Read More
-
Solving probability problem with code
The Problem Last weekend, as I was casually browsing the CS:GO subreddit for any news related to the game, I found myself in a staring contest with a math problem: Question: A player is holding a Desert Eagle and facing an enemy. Each shot he fires has 50% chance of hitting the enemy. If the shot is accurate, there’s also a 20% chance of hea... Read More
-
Effectively read logs using vanilla vim
TL;DR Glance over the gifs below for tips. Preface As with the motivation for my previous post, I often need to read logs in remote machines or containers. Rather than trying to copy the files to my local computer, it’s easier to open and browse them directly in the remote shell using vim. This article showcases some vanilla vim features (i.e.... Read More
-
5 lines I put in a blank .vimrc
TL;DR To make a default Vim installation more useful, type the following 5 lines into its .vimrc file: set hls set ic set is set nu set noswf Or if you prefer, copy and paste the spelled out and annotated version: set hlsearch " highlight all search results set ignorecase " do case insensitive search set incsearch " show incremental s... Read More