code.Antrikshy | Notes, tinkerings, experiments

Fix Firefox PiP On KDE Plasma 6+ Running Wayland


I am trying to switch from Windows to Fedora as my primary OS. It’s been about a decade since I last tried running a Linux OS as my daily, and I want things to just work.

After much thought, I picked the KDE Plasma edition, which runs on the newer Wayland protocol. Things have been good, except for Firefox’s picture-in-picture behavior. It not only behaves differently from Windows, but also actively gets in my way when I switch tabs.

There are some blog posts, forum discussions and Reddit comments that discuss workarounds, but many have gone out of date. So instead of prescribing settings, let me explain in more general steps how to get to Firefox-on-Windows-like behavior, which I consider almost perfect and unobtrusive.

Read more »

Streaming Direct PUT Firehose Records Into S3 With Newline Characters


Recently, I found myself working with AWS Kinesis Firehose and S3. All I wanted was to write custom JSON records programmatically into a Firehose stream, and have it output to an S3 location. However, by default, the records would get written without any newline separators. Searching for how to insert newline characters generally got me to complex solutions for complex data input sources.

Neither AWS documentation, nor existing Stack Overflow answers pointed me towards the incredibly simple actual syntax. I chased down complex solutions using Firehose features until I figured out you can just include the newline character directly after your message.

Read more »

My Mid 2023 Red + White Gaming PC Build


Four years and a GPU shortage later, I built my third gaming PC in July 2023. It was a tough one to plan because my last build was really hard to top.

It’s technically the fourth PC build I’ve been part of, after helping my brother build his first in late 2021.

Read more »

Painless Partitioned localStorage In A React App


The localStorage API is as straightforward as can be. Create, read, delete, clear-all methods, and that’s about it. The only notable limitation is that it only stores strings, but that can be mitigated using JSON stringification and parsing to expand support for objects and more.

I came up with this cute wrapper class for localStorage a few years ago, and it remains one of my favorite personal utility classes in JavaScript.

Read more »

Switch Displays In Windows With Python


You can execute displayswitch.exe to bring up the Win+P display switcher utility from the command line. This is not a new discovery by any stretch. Some web searching tells me this utility has existed since at least Windows 7. It wasn’t the easiest thing to find instructions when I wanted a solution. I figured I should write this down in the context of Python to help people searching with the keywords I was.

So if you’re setting up a script for your own personal automation, or writing a utility application in Python that switches or extends users’ displays, here are some code snippets to copy-paste.

Read more »