RSSAmplifier

Blog

lavafroth

Recent content on lavafroth

lavafroth.is-a.devRSS feed ↗72 posts

Latest posts

Becoming All the Instruments

I’ve been working on a tool using very simple math to convert humming or human whistles into musical MIDI notes. Here’s how the idea morphed into its current form. First, I tried using Fourier transform over chunks of the audio, which is known as the STFT. I wanted to get close to straight lines for each humming pattern or whistle. To isolate these lines, we could chunk the audio by…

A Visual Tour of a Convolution

Please enable JavaScript to enjoy this demo. This interactive tour is open-source and can be run locally.

Butterflies

When she wears the top with the butterfly pattern, the butterflies spring to life.

Portrait study

I was playing with the pen pressure settings in Krita and tested it out with a portrait study of my significant other.

Easy SSH Tunnel

Sometimes I forget the correct syntax to tunnel a port through SSH but I don’t want to read through a bunch of AD infested websites. This simple tool outputs the command to run on the local machine. You can edit the local port, remote host and port, and traffic direction. Local port Traffic direction Remote port Connect to ⧉ Copy

Step to the 💗 beat

My first procedurally generated animation using shaders. The shader can be visualized with glslViewer . uniform vec2 u_mouse ; uniform vec2 u_resolution ; uniform float u_time ; void main ( void ) { vec2 st = gl_FragCoord . xy / u_resolution . xy ; float aspect = u_resolution . x / u_resolution . y ; st . x *= aspect ; // positioning shenanigans st . x = st . x * 2.0 - 1.8 ; st . y = st . y * 2.0…

Working With LUKS File Stashes

LUKS is an incredible solution for encrypting entire partitions in Linux. Often times, however, we can’t afford to create new partitions inside a disk without having to completely format the drive anew. This post will guide you through the process of creating and working with LUKS container files that are encrypted at rest and can be decrypted on demand with knowledge of the passphrase.…

Algebraic Python Enums

University has compelled me to use Python despite my preference for Rust, primarily due to the machine learning and data science hype. One Rust feature that I dearly miss is enumerable data types that can encapsulate various other data types. Although Python has the answer to creating structs as dataclasses , including support for structural match expressions in recent versions, most tutorials…

NixOS Notes to Self

A dedicated post collecting solutions to minor NixOS headaches. nixos-rebuild shows no network activity On rare occasions, a system rebuild will get stuck while downloading a package from a source. No network activity, no timeout, no writes to the nix store. root@rahu /h/u/dotfiles (main)# nixos-rebuild boot --flake . building the system configuration... [0/9 built, 1/0/1 copied (0.0/681.0 MiB),…

Privacy Policy

This site does not use cookies or <link> any third party resources to track you. The site theme changes based on your theme preference propagated by your browser. Posts here can be viewed without javascript excepting live demos. The only feature relying on javascript is the search.

Guide: Changing Recents Provider on /e/OS

Overview Over the past month I have been daily driving my new phone, the Nothing CMF 1 flashed with /e/OS after I unlocked its bootloader. It&rsquo;s a very pleasant experience except for the default Bliss launcher (home app). Reasons I do not prefer it: iOS like feel Icons can&rsquo;t be rearranged Pull down from top opens search instead of notification shade Consumes a lot of RAM I started using…

Sam

Easy grep to detect stripped Go binaries

A couple of days ago when I was reading the guide to the Go garbage collector , I came across the following excerpt: When all else fails, the Go GC provides a few different specific traces that provide much deeper insights into GC behavior. These traces are always printed directly to STDERR, one line per GC cycle, and are configured through the GODEBUG environment variable that all Go programs…

Need a hand?

The tides Over the past few months, a sizable fraction of my developer peers have taken to AI tools. Beckoned from under a rock by the light of day, I was taken aback by this rising wave of vibe coding . They claim AI tools to be phenomenal for frontend technologies like React and NextJS. The selling point? Context aware autocompletes and agent mode. Context aware autocompletes happen when the…

In search of the smallest DNA complement function

For the past few weeks, I have been trying to come up with a fast and purely agebraic function to convert DNA bases to their respective complements. Problem statement Our goal is rather straightforward. We aim to create a mapping of the characters a , t , g , c and n to their respective complements. We choose to keep our solution one step behind the classical reverse complement which reverses the…

Building an in-browser Manim clone

Note: The following interactive animation requires JavaScript to render. Please enable it if it isn&rsquo;t already. A live, in-browser demo of PROJECT_MANA . Feel free to look around: rotate, zoom or pan the 3D view. Frames for the outline animation will be recomputed on the fly! The hardcoded duration for the animation is 5 seconds in this example.

PicoCTF SansAlpha Writeup

Hey everyone, since 2024 hasn&rsquo;t seen a lot of posts on this blog, I plan to start this year off by going back to the roots. I&rsquo;ll be focusing on posting more CTF writeups again! Today&rsquo;s challenge is SansAlpha from PicoCTF. The challenge description states The Multiverse is within your grasp! Unfortunately, the server that contains the secrets of the multiverse is in a universe…

A Tale of a Frugal Home Server

Having run an on-premise server for the past two years, I think my setup has finally matured enough to be worth talking about. At any point, you can check out the source code for the server&rsquo;s infrastructure here for a concrete example. For each service I talk about, I will also link the respective definitions in my config. My minimalist mindset has unsurprisingly aided the architecture of my…

NixOS Secureboot Shenanigans

Key takeaways This issue only pertains to secureboot on NixOS using lanzaboote. Most Linux users have secureboot disabled. If you are paranoid like me and have enabled it, continue reading. Make sure to track the latest version of lanzaboote . ( example ) Set the PKI bundle location to the newer sbctl default. ( example ) Deprecated overrideScope' For the past few months, I started noticing this…

Wrapping up GSoC 2024

Overview Hello and welcome to the final GSoC post for 2024! My task was to formalize the SWHKD parser using context-free EBNF notation. This post is to serve as a birdseye view of what I have developed over this summer. Report Architecting the parser I started out with the scaffolding of the parser in an extended Backus-Naur form garmmar template in a separate repository called SWEET using a Rust…

Painlessly setting up ML tooling on NixOS

Note: Use the following method only if you wish to have the latest version of CUDA that is not yet available in the nix-community cache, otherwise follow this . TL;DR: Save this flake , run nix develop and setup PyTorch as described CUDA is a proprietary vendor lock-in for machine learning folks. Training ML models is incredibly fast with CUDA as compared to CPUs due to the parallel processing. So…

sculpt.blend

This is my first time trying out sculpting in blender, so forgive me for the quality of the sculpt. I&rsquo;m still pretty much in the learning stage. Big thank you to Nichole Sebastian for the reference photo. Also apologies if the empty eye sockets gave you a jumpscare.

How I Use SWHKD in My Workflow

SWHKD is the project that I have been working on for the past few months as a part of Google Summer of Code for this year. Now that we are done with the development process, I want to talk about why I wanted to improve the project. Although the easy answer is to get paid or to get a more production facing OSS development experience, for me, the most important driving force is using it in my own…

Polishing and Bugfix Week

Hello and welcome to the last instalment in the series where we build a parser for a domain specific langauge in Rust. Please go through the previous articles since this article assumes you are aware of such contextual details. Let&rsquo;s start with the bugfixes. Eagerly removing unbinds While going through the tests, I figured that the prior parser eagerly parses unbinds and removes said…

Humans Suck at Command Sanitization

Hello and welcome to the eighth instalment in the series where we build a parser for a domain specific language in Rust. I’d highly recommend going through the previous articles to make sense of what we’ll talk about today. Previously, we had built the scaffolding for modes to bind shortcuts to. Today, we&rsquo;ll create the mechanism to invoke commands in the contexts of the modes that can be…

Preventing Infinite Recursions From Eating Your Lunch

Hello and welcome to the eighth instalment in the series where we build a parser for a domain specific language in Rust. I&rsquo;d highly recommend going through the previous articles to make sense of what we’ll talk about today. After a bit of back and forth with my mentor, we landed on moving the logic that imports other config files into the parser crate itself. Config files can reference other…

Test Driven Development - The Pinnacle of Engineering

Hello and welcome to the seventh instalment in the series where we build a parser for a domain specific language in Rust. I would highly recommend you to go through the previous articles to make sense of what we’ll talk about today. Tying loose ends Up until the last post, we had covered quite some ground, from building elementary expressions to the penultimate levels of abstraction for…

Drowning

A cyborg head sinking in a pool of water. What more did you expect? Here&rsquo;s a timelapse .

This Error

My first hand drawn YouTube thumbnail, I&rsquo;m might continue using lawyer ferris as my mascot both due to ferris being in the public domain as well as the sheer memeworthiness of the debacle.

Modes, Unbinds and Other Ensembled Parser Patterns

Hello and welcome to the sixth instalment in this series where we build a parser for a domain specific language from scratch. I would highly recommend you to go through the previous articles to make sense of what we&rsquo;ll talk about today. So far, we have built ranges, shorthands and bindings, starting all the way down from primitives such as keys and modifiers. Continuing with the theme, we…

I Solemnly Swear to Never Buy a Gaming Laptop Again

Around half a decade ago, I bought an Asus gaming laptop, one I&rsquo;m currently using to write this article. Although it came preinstalled with Windows, I never let it even boot and instead opted for linux. Bill Gates can cry a river. Despite switching distros multiple times, one sporadical issue my setup suffered from was the wireless card dying after a few minutes of booting the box. The only…

Modeling More Realistic Keybinds With Modifiers

Real world keybindings for shortcuts often involve more than just a simple keypress, especially outside the context of a single application. The general distinction for these two types involves modifier keys. When I talk about a shortcut bound to super v , chances are you automatically think of global bindings at the operating system or desktop environment level. Today we&rsquo;ll go through the…

Edge cases? You Shall Not Pass!

This post is a part of a series that explains the architecture of the config parser I am building for swhkd as a part of Google Summer of Code. I highly recommend reading through the previous posts as I&rsquo;ll be referring to them from time to time. In the last post I talked about key attributes that can be used as prefix to denote the timing of an event, on key press ( send / ~ ) or release (…

Timing is Key: A Tale of Keystrokes and Timings

Whether you&rsquo;re playing a video game or competing in a constrained attack-defense CTF, your keystroke timings matter. We at waycrate value your precision, to the extent that you can configure your keybindings to perform actions either on a key&rsquo;s press or a release. Hi, my name&rsquo;s Himadri and this post is a part of a series explaining how we (basically just me) are rewriting the…

Keep the Keys Clackin'

This is the second post in a series of posts I&rsquo;m writing for Google Summer of Code. Each post covers a separate topic. While the previous posts might have given you an overview of ideas, this post will delve into more technical details. I highly recommend reading the previous posts because I will refer to them from time to time. Let&rsquo;s begin with why we chose EBNF grammar in pest.rs…

2 Afternoons, 2 Languages, 2 TUIs

Yesterday I created a tool in Golang to help me render my animations a little faster. Although the alterior reason was to check my Golang proficiency, today I rewrote it in Rust and I was blown away by the differences in the final products. When I&rsquo;m rendering animations for a YouTube video, the general development iteration comprises me creating or modifying a file, switching to a different…

A SWEET Little Parser

A few days ago, I had announced my project for this year&rsquo;s Google Summer of Code. Today I&rsquo;ll be explanding upon that. I believe that to construct a good grammar, I should be able to understand and explain it well. So here goes. General Idea SWHKD&rsquo;s grammar parser, although similar to tools before it like sxhkd, has a more coherent syntax. For starters, every binding declaration…

Wayland Tools Rock!

Hey folks. Quite a few months have passed since I last posted here. As you might have known from my earlier posts, I&rsquo;ve been daily driving Wayland instead of Xorg on my NixOS setup for quite some time now. One of the tools I stumbled upon while writing my voice automation abomination was SWHKD (Simple Wayland HotKey Daemon). It&rsquo;s a spiritual successor to sxhkd from the Xorg world and…

Using an Android Phone as a webcam in NixOS

I recently had to attend an online meeting for a software development event. While my PC did have a decent microphone, the built-in camera has been damaged to the extent that the best it can capture is this: No, it&rsquo;s not a close-up of the moon, it&rsquo;s the refraction caused by the scuffs to the lens plus other sciency stuff I&rsquo;m not qualified enough to explain to you.

Throwing knives

An unfinished animation with a focus on anatomy. Thank you Polina Tankilevitch for the reference video .

Kringlecon 2023 Writeup

Happy new year everyone! As every year, I&rsquo;ll begin this one with sharing my writeup for the 2023 Holiday Hack Challenge for Kringlecon. I must warn you, I was unable to finish all the challenges due to other life events. With that out of the way, enjoy the writeup! Christmas Island: Orientation Cranberry Pi This is a sanity check question to kick the tires. The answer to it simply is answer…

Abstracting Structured Patterns in Concurrent Programming

I hope this article provides a solid blueprint for building a concurrency management API. If you have questions or feel that I have missed something, feel free to talk about it in this repository&rsquo;s issue tracker or the discussion board . In recent months, I have come across multiple articles talking about the need of structured concurrency in modern programming languages as a built-in.…

Headache

This challenge involves reverse engineering a polymorphic binary, one that modifies its own instructions during runtime. Essentially, the binary checks if the current character equals a known value and xor decrypts the next section where the code jumps to. If the characters don&rsquo;t match, the logic short-circuits and the program exits. This process of checking the character and decrypting the…

Compact XOR

Description I found some hex in a file called fleg, but I’m not sure how it’s encoded. I’m pretty sure it’s some kind of xor… Exploration We begin by creating a new rust project. cargo new amateurs cd amateurs cargo add hex cargo add itertools Let&rsquo;s decode the hexadecimal contents of the file using the following Rust code: fn main () -> Result < (), Box < dyn std :: error :: Error >> { let…

Volcano

This reversing challenge is very mathematical, focusing mainly on modulo congruences. Like all challenges, there is some scary looking obfuscation for the fun which I&rsquo;ll try my best to explain. The challenge description says that it was inspired by recent &ldquo;traumatic&rdquo; events but I&rsquo;m oblivious to what that reference meant. Decompilation We start off with downloading the…

Waiting an Eternity

This was a fairly straightforward and fun challenge that required a bit of common sense to solve. We are given the URL https://waiting-an-eternity.amt.rs to begin with. Let&rsquo;s use curl with its verbose flag to fetch this URL. curl -v 'https://waiting-an-eternity.amt.rs' We get a response that tells us to wait an enternity. > GET / HTTP/2 > Host: waiting-an-eternity.amt.rs > User-Agent:…

I Switched to NixOS

Hi. It&rsquo;s been quite a while since I had last posted. I had been spending my time on some programming projects that withheld me from even participating in CTFs. Tired of this workflow that I somehow spiraled into, I&rsquo;m now seeking to learn new things in an attempt to break out of this workflow. The End of an Overarching Journey As any of my long time audience might be familiar with, I…

Twosum

This is a rather simple binary exploitation challenge. We are given the following source code for the program running on the remote server: #include <stdio.h> #include <stdlib.h> static int addIntOvf ( int result , int a , int b ) { result = a + b ; if ( a > 0 && b > 0 && result < 0 ) return - 1 ; if ( a < 0 && b < 0 && result > 0 ) return - 1 ; return 0 ; } int main () { int num1 , num2 , sum ;…

Java Code Analysis!?!

To get started we are given the username &ldquo;user&rdquo; and password &ldquo;user&rdquo; to log into the BookShelf Pico web application. We are also given the source code of the application. Taking a look at the src/main/java/io/github/nandandesai/pico/security subdirectory of the project, we see that it uses JWT. Interestingly, the file SecretGenerator.java in the aforementioned directory…

Java Script Kiddie 2

The challenge This is a web challenge involving javascript, meaning most of the solution is going to be client side. We are asked to visit the challenge page . From here, we can view the source code of the page. < html > < head > < script src = 'jquery-3.3.1.min.js' ></ script > < script > var bytes = []; $ . get ( 'bytes' , function ( resp ) { bytes = Array . from ( resp . split ( ' ' ), x =>…