RSSAmplifier

Blog

Blog on Bruno Arine

Recent content in Blog on Bruno Arine

brunoarine.comRSS feed ↗103 posts

Latest posts

I-V curve of a few small solar panels

Shortly after diving heads down into the MeshCore craze, I naturally started amassing solar panels for my MeshCore-related projects. 
 Upon working with these panels in practice, I realized that most of them are sold with notoriously deceptive technical specs. (A 10x10 cm panel delivering 5W? Seriously?) And when the ads try to be honest with regard to power output, you never know if they are…

org-crypt GPG error

I’m running Doom Emacs v3.0.0-pre, and was trying to use org-crypt to encrypt org headings tagged with :crypt: . I couldn’t make it work, even by manually invoking org-encrypt-entries . The error message didn’t help: 
 GPG error: 'Encrypt failed', 'Exit'
 Turns out epg-pinentry-mode should be loopback , but for some reason defaulted to nil in my setup. 
 Here’s…

Compiling C Programs on FreeBSD

Today I tried to install Simon Willison’s llm tool on FreeBSD. I use uv as my Python package manager, and no matter what I did, I was hitting the same error: 
 $ uv tool install llm --with pysqlite3

...

 In file included from src/blob.c:1:
 src/blob.h:4:10: fatal error: 'sqlite3.h' file not found
 4 | #include 'sqlite3.h'
 | ^~~~~~~~~~~
 1 error…

Seamless connectivity with AdGuard Home using nginx and Tailscale on FreeBSD


 This post is an account on how I configured my FreeBSD home server in a way that I could seamlessly route my DNS requests through my self-hosted AdGuard Home instance, both at home and outside using Tailscale and nginx. 
 Details 
 At the time of this post: 
 
 My home server is running FreeBSD 14.3 with a static IP in my home subnet, 192.168.3.101 . 
 For managing jails,…

Cinnamon screensaver locking users out

There&rsquo;s a crazy bug in Cinnamon (more specifically, Cinnamon&rsquo;s screensaver) that had been pestering me since I switched to this DE . It&rsquo;s an issue that has been ongoing for many years without an official solution. When the computer is idle for some time and the screensaver kicks in, you can&rsquo;t regain access unless you switched to another TTY (via Ctrl + Alt + F<n> ) and…

How to edit a file as root the right way

Suppose you need to edit a file that requires root privileges, like /etc/fstab . One way to do this is simply invoking your editor of choice with sudo : &#xA; sudo vim /etc/fstab&#xA; Running a command with sudo is equivalent to logging in as root and then running the desired command. That means the loaded configuration will be root &rsquo;s, not the user&rsquo;s. &#xA; A better way to do that is…

20250610170000

Cinnamon is, in my opinion, one of the most polished desktop environments out there. I came to this conclusion after a lot of frustration at other DEs and how they managed HiDPI displays. While Gnome, KDE, xfce, and i3 would go crazy with my plugging and unplugging the 4K monitor, Cinnamon handled these events just fine, always guessing the correct screen and text scale and without graphical…

Outlining Emacs init files

Today I learned that commented out Elisp code with ;;; in Emacs are interpreted as headings when you&rsquo;re in outline-minor-mode . That means that you can create hierarchical headings (e.g. one level is ;;; , two levels is ;;;; ), and you can fold each heading with outline-cycle . &#xA; Since when I migrated my workflow to Doom Emacs, my custom configuration file grew out of control. One way to…

Grepping inside Vim

Today I learned a very cool trick. I can grep a pattern inside a given directory by running :grep pattern /path/to/dir . Vim will execute a grep command externally and put the results into a quickfix list. &#xA; The quickfix list is basically a dynamic buffer where Vim stores lists of values. In this case, all results returned by the external grep command end up in there, and you can navigate the…

Timer-triggered orchestration instances purge on Azure

In one of my recent projects, I used Azure Durable Functions extensively to orchestrate multi-stage, asynchronous machine learning inference requests. It worked like a charm in spite of Azure&rsquo;s misleading and/or outdated documentation on the Python SDK of their own product. &#xA; But then at a certain point of the project, I had to implement a timer-triggered orchestration history purge to…

Using Pydantic objects with Azure Durable Function triggers

Azure&rsquo;s Durable Functions are asynchronous, scalable cousins of standard Azure Functions. They&rsquo;re basically composed of a main orchestrator function (though you can also work with multiple sub-orchestrators), and a series of activity triggers , which are subfunctions to be launched asynchronously by the orchestrator. &#xA; Both activity triggers and orchestrator functions run in…

Azure ML (misleading) charts

tl;dr don&rsquo;t trust Azure ML charts. &#xA; In a recent project, we relied heavily on Azure ML workspaces. All of our models had been deployed as Azure-managed online endpoints. Letting Azure manage the endpoints was the wise thing to do, given that we had limited personnel to keep a sane Kubernetes ecosystem. &#xA; Nonetheless, we found the endpoint latency a bit too high. The first question…

ONNX Models Segmentation Fault

I’m using YOLOX for inference, and I’m getting unexplainable ONNX runtime errors 15% of the time. &#xA; 2025-01-30 14:30:46,845 E [78] azmlinfsrv - Encountered Exception: Traceback (most recent call last):&#xA; File '/opt/miniconda/envs/amlenv/lib/python3.9/site-packages/azureml_inference_server_http/server/user_script.py', line 132, in invoke_run&#xA; run_output =…

Azure ML Components and a mysterious segmentation fault error

Here&rsquo;s yet another evidence of poor error handling and user-friendly error messages from Azure.&#xA;The other day I tried to execute a custom Azure ML pipeline component, which failed with the following error: &#xA; Execution failed. User process 'python' terminated by signal with name SIGSEGV. There is a segmentation fault possibly caused by an out of memory error. Please check log file…

Fixing bad resolution modes of a generic display on Linux

I had to use an adapter so I could plug an old monitor with VGA ports only into a somewhat old graphic card with HDMI outputs.&#xA;The adapter worked great, but because of it, my Linux machine could no longer identify the display nor its optimal resolution and frequency.&#xA;I was stuck in a 1024x768 resolution. &#xA; To fix that, first I had to go to the LG website and look up my monitor model…

How to list all installed PGP certificates in your system

You can list all the keys in currently installed in your system by running: &#xA; gpg --list-secret-keys&#xA; where --list-secret-keys lists specified secret keys, and if no keys are specified, then it will return all known secret keys. &#xA;

Launching a generic UDP listener using netcat

Today I learned a cool trick to test if a certain port in your router is open or not. &#xA; I&rsquo;m trying to get Wireguard correctly configured, and for that, I needed to open UDP port 51820 on my router.&#xA;But for the life of me I can&rsquo;t figure out whether the problem is my Wireguard setup or the router. &#xA; The first thing I want to do before looking into the Wireguard setup is to…

Setting up a Wireguard connection from a .conf file in Gnome

At the time of this writing, Gnome&rsquo;s NetworkManager already supports Wireguard connections. But first, you have to install wireguard-tools as instructed by the Arch Linux Wiki . &#xA; Strangely, the GUI doesn&rsquo;t have a means to import Wireguard&rsquo;s .conf files, but you can import them in the terminal: &#xA; nmcli connection import type wireguard file path/to/your/wg.conf&#xA;

Solve &#39;Attempt To Read Or Write Outside Of Disk&#39; Error

Locate the partition in which linux is present with the help of following technique: &#xA; grub rescue > ls&#xA; ( hd0 ) ( hd0, msdos9 ) &#xA; grub rescue > ls ( hd0,msdos9 ) /&#xA; grub rescue > ls ( hd0,msdos8 ) /&#xA; grub rescue > ls ( hd0,msdos5 ) / # suppose this is root and bootloader of linux &#xA; grub rescue > ls ( hd0,msdos5 ) /&#xA; grub rescue > set root =( hd0,msdos5 ) &#xA; grub…

How to change your SIM PIN code on Android

One of the most common tactics by phone burglars is to remove the SIM card from your phone and put it into another device, so they can recover the passwords from your account and, if you use SMS as a means of twp-factor authentication (not recommended), they can also retrieve the OTP codes. Therefore, changing your SIM PIN code is key to avoid SIM swaps if your phone is stolen. &#xA; On Android:…

How to Jump To a Heading on Emacs Org-mode

Today I learned (remembered, actually) that it&rsquo;s possible to jump directly to an Org heading by navigating a list of headings.&#xA;The command responsible for this is org-goto . &#xA; Nonetheless, org-goto &rsquo;s default behavior (incremental search) is a bit weird in my opinion.&#xA;But there are ways to configure it, and switch to searching through the buffer&rsquo;s outline via…

How to modify Scikit-Learn&#39;s ConfusionMatrix low-level attributes

Today I learned how to modify low-level components of a ConfusionMatrixDisplay object, i.e. fiddling directly with fig and ax .&#xA;I needed to do this after trying to plot a gigantic matrix of nearly 100 labels.&#xA;I searched the documentation for ways to change the figsize value, but found out that the ConfusionMatrixDisplay implementation does not allow custom plot parameters to be passed.…

The real impact of a high VSWR in radio transmission

When it comes to the voltage standing wave ratio (VSWR), we&rsquo;re often told that we should struggle to keep our antennas tuned and with a VSWR below 2:1.&#xA;This advice is specially useful if you don&rsquo;t want to fry your rig with powerful reflected signals due to an impedance mismatch.&#xA;But if your VSWR is within the safe limit, by no means you should worry about how much these…

Multiple displays on i3

First, install xrandr . If you haven&rsquo;t done so (and are using Arch Linux or a derived distro): &#xA; sudo pacman -S xrandr&#xA; xrandr&#xA; The output will indicate which monitors are available. To activate the second screen, type the following command: &#xA; xrandr --output $SECONDARY_DISPLAY --auto --right-of $PRIMARY_DISPLAY &#xA; A new workspace will be automatically instantiated in the…

How to Copy A Private GPG Key To Another Machine

Rather than copying the ~/.gnupg folder, you can create an export of your secret keys and then import on the new install, e.g. &#xA; &#xA;$ gpg --export-secret-keys --output mykeys&#xA; Then on the new system: &#xA; &#xA;$ gpg --import mykeys&#xA; (note: you will need to know the password associated with the keys to import them) &#xA; By exporting and importing, you allow gpg to handle any…

Docker error while deploying an Azure ML endpoint locally

I&rsquo;ve recently had to debug an attempt of deploying an Azure ML online endpoint.&#xA;Unsurprisingly, Azure tends to spit out quite uninformative error messages when something breaks, so my best bet at tackling it was deploying my machine learning model locally, as suggested by Azure itself . &#xA; Following Azure&rsquo;s instructions, here&rsquo;s how to deploy an endpoint locally using Azure…

Estado das repetidoras FM analógicas em São Paulo

Observação: status a partir de GG66fm utilizando uma antena em jota a 8 m de altura com transceptor de 50 W. &#xA; &#xA;&#x9; &#xA;&#x9;&#x9;&#x9; &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; Frequência &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; Localidade &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; Shift (MHz) &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; Subtom (Hz) &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; Atracável? &#xA;&#x9;&#x9;&#x9;&#x9;&#x9;…

How to free up space from pacman&#39;s unused files

Today I had no space remaining in the disk while I was upgrading my EndeavourOS system, so I had to look up for ways to free some space. &#xA; The first idea was to do away with the cached pacman packages. It stores all packages you&rsquo;ve downloaded recently, so it seems to be a good idea to run this command every now and then: &#xA; sudo pacman -Sc&#xA; The command above cleans up cached…

How to set-up aspell on a per-project basis

If you wish to set-up aspell on a per-project basis, several variables have to be configured accordingly. &#xA; The following procedure considers that your spellchecking engine of choice is aspell , and you&rsquo;re using spell-fu to show the typos in your buffer. &#xA; The first step is to make sure you have aspell correctly installed in your system. Type aspell -a -m to check if it was installed…

Ox-hugo auto-export mode with Doom Emacs

I&rsquo;ve been trying to enable ox-hugo &rsquo;s auto-export mode for hours.&#xA;The official documentation instructs to add the following line on your .dir-locals.el file, if the file is already in the same directory as your Org files: &#xA; (( org-mode . (( eval . ( org-hugo-auto-export-mode ))))) &#xA; If you already have something in your .dir-locals.el and want to ensure you&rsquo;re adding…

How to edit a multiline command in the shell

Just press CTRL + x + e in either bash or zsh .&#xA;The shell will open the default editor.&#xA;Once you finish typing the command, save the file and exit. &#xA;

How to bypass MacOS app verification

If you can&rsquo;t open applications downloaded from the Internet, and the concerning option in Privacy and Security is grayed out, here&rsquo;s a quick way to bypass Apple&rsquo;s verification.&#xA;Type in your terminal: &#xA; sudo spctl --master-disable&#xA;

Sargable queries in SQL

&ldquo;Sargable&rdquo; is short for &ldquo;Search ARGument ABLE.&rdquo; In SQL, a sargable query is one that can efficiently use indexes to search for rows in a database table. Making queries sargable often involves ensuring that operations on columns (especially in WHERE clauses) allow for efficient use of indexes rather than requiring a full table scan. Non-sargable operations can prevent the…

The perfect Makefile template

Recently, I stumbled upon this Makefile template, and I can&rsquo;t recall where I got this from.&#xA;Funny thing is that my Makefile recipes nowadays resamble a lot with this. &#xA; .SILENT : &#xA; &#xA; .PHONY : help &#xA; ## This help screen&#xA; help : &#xA; &#x9; printf 'Available targets\n\n' &#xA; &#x9;awk '/^[a-zA-Z\-\_0-9]+:/ { \&#xA; &#x9;&#x9;helpMessage = match(lastLine, /^## (.*)/);…

How to render emojis as traditional unicode symbols

Today I learned it&rsquo;s possible to render emojis differently. Take the Heavy Black Heart unicode character ( U+2764 ). If you append U+FE0F , it will look like the heart emoji ❤️ (which some browsers do by default nowadays). &#xA; But if you want to force the rendering of the unicode symbol instead, add U+FE0E to it, and it will be rendered like ❤︎. &#xA;

How to record and play a macro on Doom Emacs

Today I learned how to record a macro on Doom Emacs and play it as many times as you want. &#xA; First, press q <letter> (or M-x evil-record-macro RET <letter> ). This will start recording the macro at register <letter> . &#xA; Then, do everything you want to do, and when done, press q to quit recording mode. &#xA; To replay the macro you&rsquo;ve just stored in the <letter> register, press @…

Membership checking on Python is O(n) for lists and tuples and O(1) for dicts and sets

Today I learned that the time complexity of a membership checking operation is different for each Python type. &#xA; &#xA;&#x9; &#xA;&#x9;&#x9;&#x9; &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; Type &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; Complexity &#xA;&#x9;&#x9;&#x9; &#xA;&#x9; &#xA;&#x9; &#xA;&#x9;&#x9;&#x9; &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; list &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; `O(n)` &#xA;&#x9;&#x9;&#x9;…

How to emulate Doom Emacs &#43; Swiper search on VSCode

The instructions below consider that you are using the Neovim Extension for VSCode .&#xA;Different extensions may require some adjustments. &#xA; &#xA; Install the Swiper addon for VSCode &#xA; Add the following to your keybindings JSON file: &#xA; &#xA; &#xA; { &#xA; 'command' : 'swiper.swiper' , &#xA; 'key' : 'space s b' , &#xA; 'when' : 'editorTextFocus && neovim.mode != insert' , &#xA; } &#xA;

How to switch between terminal and editor on VSCode Emacs-style

My Emacs muscle memory is too stubborn, so that I always find myself pressing C-x o to switch between terminal and editor window.&#xA;The pain ended today.&#xA;To switch focus on VSCode with C-X o , add the following to your JSON config: &#xA; { &#xA; 'key' : 'ctrl+x o' , &#xA; 'command' : 'workbench.action.terminal.focus' &#xA; } , &#xA; { &#xA; 'key' : 'ctrl+x o' , &#xA; 'command' :…

How to update Arch Linux&#39;s packages database without upgrading anything

Oftentimes our local repository goes out of sync, and you can&rsquo;t install anything unless you update pacman &rsquo;s database. &#xA; One way to do this without upgrading any package is typing pacman -Sy or pacman -Syy . &#xA; &#xA; -S tells pacman you want to synchronize packages. In other words, it&rsquo;s used for installing packages. &#xA; -y will refresh (sync) all of your package lists,…

How to fix Emacs org-super-agenda keymap with evil-mode on

org-super-agenda default&rsquo;s config is incompatible with Doom Emacs keybindings.&#xA;When we move the cursor to a date-containing line in the timegrid, trying to move past it will inevitably open the interactive calendar. &#xA; To avoid this behavior, add the following to your Emacs config file: &#xA; ( use-package! org-super-agenda &#xA; :after org-agenda &#xA; :init &#xA; (…

How to use breakpoint() on IPython

Since Python 3.7, the breakpoint() call has become a handy replacement for import pdb; pdb.set_trace() .&#xA;When you run a program normally, it will automatically stop at that line and launch the debugging console with the standard Python interpreter. &#xA; But it&rsquo;s also possible to use breakpoint() to work with IPython, which has colors and tab completion and all sort of goodies. &#xA; To…

How to get help about an object in the Python interpreter

Today I learned how to get the signature, docstring, and everything you need to know about how to use an object. Just append a ? . Example: &#xA; Signature: processor.tokenizer(text: 'str') -> 'list[str]'&#xA;Docstring:&#xA;Run the tokenization and post-processing.&#xA;This method should be called by the similarity algorithms.&#xA;File: ~/projects/findlike/findlike/preprocessing.py&#xA;Type:…

How smoke detectors actually work

I&rsquo;ve always had the wrong idea of how smoke detectors worked. &#xA; Smoke detectors have two electrically charged plates and a radioactive source.&#xA;The radioactive source ionizes the air, making current flow. &#xA; When smoke penetrates the device, the attenuation disrupts the current flow, firing the alarm. &#xA; &#xA; &#xA;&#xA; But one detail was missing: how exactly the smoke disrupts…

Comparing TF-IDF, GloVe, and SBERT

I&rsquo;m exploring better algorithms for findlike .&#xA;At the moment, only lexical search algorithms have been implemented, but I know for a fact that semantic similarity trumps lexical search by a landslide. &#xA; So I ran a quick test to see how large the difference is between a context-aware model (SBERT) and a free-context model (GloVe) and statistical algorithms (TF-IDF, BM25). &#xA; &#xA;…

4 years of digital gardening, why I sorta killed it, and lessons learned

I killed my digital garden, and it&rsquo;s the best thing that happened to my sanity. &#xA; Well, technically it&rsquo;s not dead.&#xA;It has just been absorbed by my actual blog, and the blog incorporated the looks of my former digital garden. &#xA; &#xA;&#x9;&#x9;&#x9; Figure 1: What have I done? And why this blogging gardener Kirby has mumps? (Midjourney prompt: farmer kirby writing in a…

findlike: a CLI tool for finding similar documents

I&rsquo;ve just released findlike , a CLI tool that helps you find lexically similar documents in relation to a reference file or an ad-hoc query. &#xA; ELI5 &#xA; Imagine you have a document, and you want to find other documents on your computer that talk about similar things. You can use findlike to do that. It looks at the words and phrases used in your reference document or a specific question…

pytest and the tmp_path fixture

Today I learned that you don&rsquo;t need to import temp file or directory generators, nor create them yourself, when you&rsquo;re testing a code with pytest . &#xA; All you have to do is use the tmp_path fixture, and pytest will take care of everything. Example: &#xA; def test_create_file ( tmp_path ): &#xA; d = tmp_path / 'sub' &#xA; d . mkdir () &#xA; p = d / 'hello.txt' &#xA; p . write_text (…

About short-circuiting in Python

Today I learned that it&rsquo;s possible to short-circuit boolean operations in Python. &#xA; Example: &#xA; &#xA;&#x9; &#xA;&#x9;&#x9;&#x9; &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; Operation &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; Result &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; Notes &#xA;&#x9;&#x9;&#x9; &#xA;&#x9; &#xA;&#x9; &#xA;&#x9;&#x9;&#x9; &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; X or Y &#xA;&#x9;&#x9;&#x9;&#x9;&#x9; If X is…

How do Bloom filters work?

In a conversation with Hugh, today I learned about the Bloom filter&mdash;a statistical algorithm that tells whether a sample likely belongs to a group, or does not belong to it at all. &#xA; The algorithm is employed in several big projects, most noticeably Redis and the word vectors model floret . &#xA; How do Bloom filters work? &#xA; Imagine you have a huge table, and you&rsquo;d like to check…