<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>thermcampos blog</title><link href="http://thermcampos.blog/" rel="alternate"/><link href="http://thermcampos.blog/atom/" rel="self"/><id>/atom/</id><updated>2026-10-01T18:15:11Z</updated><author><name>R. Campos</name></author><subtitle>Welcome to my blog, personal corner and stuff</subtitle><entry><title>javalin the lightweight java framework</title><link href="http://thermcampos.blog/post/javalin-java-framework/" rel="alternate"/><published>2026-10-01T18:15:11Z</published><updated>2026-10-01T18:15:11Z</updated><author><name>R. Campos</name><email>ricardompcampos@gmail.com</email></author><id>/post/javalin-java-framework/</id><summary type="html">&lt;!-- tags: java --&gt;
&lt;!-- date: 2026-10-01 18:15:11 --&gt;
&lt;p&gt;I'd like to introduce you all to &lt;a class="reference external" href="https://javalin.io/"&gt;Javalin&lt;/a&gt;. Java is known for being heavy and
bloated, verbose, often flagged as bad choice for cold-start functions, or
simple MVPs or POCs. Often because it's slow, or memory-heavy consumer, which
I could agree with, on some situations.&lt;/p&gt;
&lt;p&gt;This is specially interestring if you're coming from languages such as Go or
Typescript and is already familiar with express.js or chi from Golang. The
learning curve for a full Java backend app will be pretty smoth.&lt;/p&gt;
</summary><content type="html">&lt;!-- tags: java --&gt;
&lt;!-- date: 2026-10-01 18:15:11 --&gt;
&lt;p&gt;I'd like to introduce you all to &lt;a class="reference external" href="https://javalin.io/"&gt;Javalin&lt;/a&gt;. Java is known for being heavy and
bloated, verbose, often flagged as bad choice for cold-start functions, or
simple MVPs or POCs. Often because it's slow, or memory-heavy consumer, which
I could agree with, on some situations.&lt;/p&gt;
&lt;p&gt;This is specially interestring if you're coming from languages such as Go or
Typescript and is already familiar with express.js or chi from Golang. The
learning curve for a full Java backend app will be pretty smoth.&lt;/p&gt;
&lt;!-- read_more --&gt;
&lt;p&gt;Let's cut to the chase, no rambling, no time spent. Javalin is simple,
lightweight, interoperable, flexible, supports OpenAPI and runs on
top of Jetty JVM web-server, that includes SSL and HTTP3.&lt;/p&gt;
&lt;p&gt;Here's what a Hello World would look like, if you're curious.&lt;/p&gt;

&lt;pre class="brush: java"&gt;
import io.javalin.Javalin;

void main() {
  var app = Javalin.create(config -&gt; {
    config.routes.get("/", ctx -&gt; ctx.result("Hello World"));
  }).start(7070);
}
&lt;/pre&gt;

&lt;p&gt;And that's it! No &lt;em&gt;annotations&lt;/em&gt; needed, controllers, or any of the boilerplate
that Springs like. As simple as that.&lt;/p&gt;
&lt;p&gt;If you're a &lt;strong&gt;maven&lt;/strong&gt; person, you can get started in the &lt;a class="reference external" href="https://javalin.io/tutorials/maven-setup"&gt;maven-setup page&lt;/a&gt;, but
ify you're a &lt;strong&gt;graddle&lt;/strong&gt; person, use the &lt;a class="reference external" href="https://javalin.io/tutorials/gradle-setup"&gt;graddle-setup page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://javalin.io/tutorials/"&gt;On their page&lt;/a&gt; there's plenty of useful tutorials and code snippets, check it
out. And now if you want to go straight to the code, find their GitHub repo at:
&lt;a class="reference external" href="https://github.com/javalin/javalin"&gt;https://github.com/javalin/javalin&lt;/a&gt;&lt;/p&gt;
&lt;div class="section" id="native-build"&gt;
&lt;h3&gt;Native build&lt;/h3&gt;
&lt;p&gt;Javalin also supports GraalVM. GraalVM builds are OS-native binaries, compiled
into full executable apps that can run without the JVM. This is super attractive
for Serverless and functions that needs cold-start within seconds.&lt;/p&gt;
&lt;p&gt;Here's an example from their main page: &lt;a class="reference external" href="https://javalin.io/2018/09/27/javalin-graalvm-example.html"&gt;https://javalin.io/2018/09/27/javalin-graalvm-example.html&lt;/a&gt;
and if you want something more complete, including tests, Flyway migrations, and more,
you can take a look at this personal project: &lt;a class="reference external" href="https://github.com/thermcampos/lin-order-java"&gt;https://github.com/thermcampos/lin-order-java&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;That's all for today. If you have any questions, I'll be happy to answer. Reach out by using
the comment system below or any of the link in the about page.&lt;/p&gt;
&lt;p&gt;Thanks for reading.&lt;/p&gt;
&lt;/div&gt;
</content></entry><entry><title>minimal initramfs script</title><link href="http://thermcampos.blog/post/minimal-initramfs-script/" rel="alternate"/><published>2026-09-10T12:59:27Z</published><updated>2026-09-10T12:59:27Z</updated><author><name>R. Campos</name><email>ricardompcampos@gmail.com</email></author><id>/post/minimal-initramfs-script/</id><summary type="html">&lt;!-- tags: linux,kernel --&gt;
&lt;p&gt;After several years having Debian as my main Linux &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Linux_distribution"&gt;distro&lt;/a&gt;, I've decided to go
back to &lt;a class="reference external" href="https://www.gentoo.org/"&gt;Gentoo&lt;/a&gt;, the distro who caught my attention since day one. However, my
root partition is encrypted. While Debian has an out-of-the-box solution that
makes everyone's life easier and almost transparent, Gentoo goes the opposite
way. &lt;em&gt;You&lt;/em&gt; have to connect the dots and make it work &lt;em&gt;yourself&lt;/em&gt;. I had to stop,
plan for a moment, and get ready.&lt;/p&gt;
&lt;p&gt;In this short post, I'll be sharing the steps I took, the shell scripts,
and how I wired up a minimal init script, that I called &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Initial_ramdisk"&gt;initramfs&lt;/a&gt;, although
it's not quite that, this is much smaller and single purposed, decrypt my
root partition.&lt;/p&gt;
</summary><content type="html">&lt;!-- tags: linux,kernel --&gt;
&lt;p&gt;After several years having Debian as my main Linux &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Linux_distribution"&gt;distro&lt;/a&gt;, I've decided to go
back to &lt;a class="reference external" href="https://www.gentoo.org/"&gt;Gentoo&lt;/a&gt;, the distro who caught my attention since day one. However, my
root partition is encrypted. While Debian has an out-of-the-box solution that
makes everyone's life easier and almost transparent, Gentoo goes the opposite
way. &lt;em&gt;You&lt;/em&gt; have to connect the dots and make it work &lt;em&gt;yourself&lt;/em&gt;. I had to stop,
plan for a moment, and get ready.&lt;/p&gt;
&lt;p&gt;In this short post, I'll be sharing the steps I took, the shell scripts,
and how I wired up a minimal init script, that I called &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Initial_ramdisk"&gt;initramfs&lt;/a&gt;, although
it's not quite that, this is much smaller and single purposed, decrypt my
root partition.&lt;/p&gt;
&lt;!-- read_more --&gt;
&lt;p&gt;Long story short, I needed to find a way to decrypt, mount and boot my new OS
having the root partition encrypted. Using Gentoo's live-cd I was able to
try the script partially, and confirm the decryption works. All I needed was
having a busybox environment with all crypt libs on it. Using Gentoo itself
for that, I compiled some packages with &lt;strong&gt;static linked&lt;/strong&gt; dependencies.&lt;/p&gt;
&lt;p&gt;Then build the initial script that's going to do all the heavy-lifting.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;, here are the scripts:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Create the initramfs directory, embed busybox and the crypt libs and tools on it&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="brush: bash"&gt;
#!/bin/sh
set -e
STAGE="${1:-/usr/src/initramfs}"

mkdir -p "$STAGE"/{bin,sbin,lib,dev,proc,sys,mnt/root,run}

cp /sbin/busybox "$STAGE/bin/"
"$STAGE/bin/busybox" --install -s "$STAGE/bin"

cp /sbin/cryptsetup "$STAGE/sbin/"
cp /sbin/lvm "$STAGE/sbin/"

for bin in /sbin/cryptsetup /sbin/lvm; do
    ldd "$bin" | awk '{print $3}' | grep -v '^$'
done | sort -u | while read -r lib; do
    mkdir -p "$STAGE$(dirname "$lib")"
    cp -L "$lib" "$STAGE$lib"
done

cp init "$STAGE/init"
chmod +x "$STAGE/init"

echo "Staged tree ready at $STAGE — cd there and run the cpio|gzip packaging step."
&lt;/pre&gt;

&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;create the &lt;em&gt;init&lt;/em&gt; script (it needs to be called only init) at /usr/src/initramfs&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="brush: bash"&gt;
#!/bin/sh

rescue_shell() {
    echo "Something went wrong v3. Dropping to a shell."
    exec /bin/sh
}

mount -t proc none /proc
mount -t sysfs none /sys
mount -t devtmpfs none /dev
mkdir -p /run/cryptsetup
export DM_DISABLE_UDEV=1

ROOT=$(sed -n 's/.*\broot=\([^ ]*\).*/\1/p' /proc/cmdline)

cryptsetup luksOpen /dev/nvme0n1p3 gentoo_root || rescue_shell
lvm vgchange -ay || rescue_shell

mount -o ro "$ROOT" /mnt/root || rescue_shell

exec switch_root /mnt/root /sbin/init
&lt;/pre&gt;

&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Finally generate the image that goes to /boot and grub&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="brush: bash"&gt;
#!/bin/bash

KERNEL="7.2.4-gentoo"

cd /usr/src/initramfs

find . | cpio -o -H newc | gzip &gt; /boot/initramfs-$KERNEL.img

grub-mkconfig -o /boot/grub/grub.cfg
&lt;/pre&gt;

&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Done. With luck, you should have a minimal setup ready to decrypt and boot
your OS. Feel free to get in touch and ask for help, if needed. I have these
scripts versioned on my personal repo, find then here: &lt;a class="reference external" href="https://github.com/thermcampos/gentoo-config-files/tree/main/kernel"&gt;https://github.com/thermcampos/gentoo-config-files/tree/main/kernel&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That's all. Thanks for reading.&lt;/p&gt;
</content></entry><entry><title>monthly updates</title><link href="http://thermcampos.blog/post/sep-2026-updates/" rel="alternate"/><published>2026-09-08T17:50:18Z</published><updated>2026-09-08T17:50:18Z</updated><author><name>R. Campos</name><email>ricardompcampos@gmail.com</email></author><id>/post/sep-2026-updates/</id><summary type="html">&lt;!-- tags: updates,recommendations --&gt;
&lt;p&gt;September has just started and is already flying away, going by light-speed
fast! Christmas is almost knocking on the door. But I'm here to talk about
updates and what's going on recently. Let's dive in!&lt;/p&gt;
</summary><content type="html">&lt;!-- tags: updates,recommendations --&gt;
&lt;p&gt;September has just started and is already flying away, going by light-speed
fast! Christmas is almost knocking on the door. But I'm here to talk about
updates and what's going on recently. Let's dive in!&lt;/p&gt;
&lt;!-- read_more --&gt;
&lt;div class="section" id="hybrid-work"&gt;
&lt;h3&gt;hybrid work&lt;/h3&gt;
&lt;p&gt;I decided (not entirely by choice) to go regularly to a coworking space near my
apartment. By regularly, I mean at least three times a week. The reasons are
noisy constructions at my building, constructions inside our apartment, and
giving my wife some space. (our apartment is very small, and she's in a
graduate program, needs silence to study).&lt;/p&gt;
&lt;p&gt;I gotta admit, I thought I'd hate, but actually I can see its value now.
Getting out of the house is doing me so much good. I like the walking commute.
The space is on the fourth floor with a nice view, and there's free coffee
included!&lt;/p&gt;
&lt;p&gt;This is unexpected from me because I've been working from home since 2019, 7
years now, and until recently I was strongly refusing to go back to any office.
But here I am, and I'm pretty happy. Anyways, let's see what the recommendations
section brought this time.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="recommendations"&gt;
&lt;h3&gt;recommendations&lt;/h3&gt;
&lt;p&gt;Along with updates, I'd like to share findings that caught my attention. They
might be useful, handy, entertaining. you judge.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;I'd like to kick off with &lt;a class="reference external" href="https://cassidoo.co/"&gt;Cassidy Williams&lt;/a&gt;. She's a Senior
Director of Developer Advocacy at GitHub and keeps a newsletter that's so
well-curated, it'd be a sin not to share it. You can have a &lt;a class="reference external" href="https://buttondown.com/cassidoo/archive"&gt;glance at it here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you are in the AI world, &lt;a class="reference external" href="https://www.devthusiast.com/"&gt;Devthusiast&lt;/a&gt; might interest you. This newsletter
covers what's happening and the bleeding-edge tech updates.&lt;/li&gt;
&lt;li&gt;Now if you're into AI and also into software engineering, take a look at
&lt;a class="reference external" href="https://github.com/mattpocock/skills"&gt;Matt Pocock's skillset&lt;/a&gt; to go the opposite way of &lt;em&gt;vibe-coders&lt;/em&gt;. Matt shared a &lt;a class="reference external" href="https://www.youtube.com/watch?v=M6mYodf0dJM"&gt;YouTube Video&lt;/a&gt; with
first steps and how to get started.&lt;/li&gt;
&lt;li&gt;On the frontend and UI/UX side, there's a great article that went around the internet
in the last few weeks about what would be the best dark mode toggle. Very
interesting discussion. &lt;a class="reference external" href="https://lea.verou.me/blog/2026/dark-mode-toggles-2/"&gt;Read it here&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That's all for today! Thanks for reading. If you like this content, you might consider
subscribing via RSS to this category: &lt;a class="reference external" href="/atom/updates/"&gt;use this URL&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
</content></entry><entry><title>hello world</title><link href="http://thermcampos.blog/post/print-hello-world/" rel="alternate"/><published>2026-08-24T19:59:46Z</published><updated>2026-08-24T19:59:46Z</updated><author><name>R. Campos</name><email>ricardompcampos@gmail.com</email></author><id>/post/print-hello-world/</id><summary type="html">&lt;!-- tags: updates --&gt;
&lt;p&gt;Welcome to the very first post. Long time ago (2011-2013) I use to write to a
personal blog like this, then life got busy, and all faded away. I must say I
tried writing here and there some of my technical discoveries and helping
content, but never actually found a nice place where personal thoughts fit
nicely along with tech findings.&lt;/p&gt;
</summary><content type="html">&lt;!-- tags: updates --&gt;
&lt;p&gt;Welcome to the very first post. Long time ago (2011-2013) I use to write to a
personal blog like this, then life got busy, and all faded away. I must say I
tried writing here and there some of my technical discoveries and helping
content, but never actually found a nice place where personal thoughts fit
nicely along with tech findings.&lt;/p&gt;
&lt;!-- read_more --&gt;
&lt;p&gt;In the past few days I decided to go back to Gentoo, after more or less 7
years using Debian Sid (the only truly rolling release Debian flavor), and
that brought a lot of memories. And blogging was one of them. So I decided
to re-write and bring back to life the old Blohg engine, a lightweight python
Flask app that uses git as back-end and Jinja2 to render templates.&lt;/p&gt;
&lt;p&gt;I also decided to get back to IRC, where I spent a lot of time in the past
chatting with friends about Linux. But the old server is gone, Freenode.
Now the common choice seems to be Libera. If you're in there too, ping me
anytime, just search for my handler &lt;strong&gt;thermcampos&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="section" id="there-s-more"&gt;
&lt;h3&gt;there's more&lt;/h3&gt;
&lt;p&gt;Another reason that helped me decide having a personal blog again was a post
that I can't find right now (sorry) saying that many people don't write
because they think the content will be the same as other people, but there's
a gotcha, even though is the same content as the other people, it is your
content with your words. Then bum! That was enough. And here I am. Here we
are.&lt;/p&gt;
&lt;p&gt;Comments will come soon. In the meanwhile, feel free to ping me and chat
using any of the options in the /contact page.&lt;/p&gt;
&lt;p&gt;Bye for now.&lt;/p&gt;
&lt;p&gt;o/&lt;/p&gt;
&lt;!-- author: R. Campos &lt;ricardompcampos@gmail.com&gt; --&gt;
&lt;/div&gt;
</content></entry></feed>