Tuesday, August 26, 2025

[fread]: An old-school text file viewer for the modern terminal (GNU/Linux)

Last month I came across an old gem: PC Game Programmer's Encyclopedia, a DOS-era program built with the Pascal TUI Vision library. It’s a collection of docs about assembly and game programming compiled by Mark Feldman.

These files were originally stored in old MS-DOS encodings. Luckily, thanks to the dos2ansi project I was able to convert them into a more UTF-8-friendly format, making them readable on modern systems.

That got me thinking: why not create a modern TUI version for GNU/Linux to display these texts?

The first step was building a text file viewer that supports modern Unicode encoding. That’s how fread was born.


You can see it in action in this demo video.

The project has a modular approach:

  • openfile.c handles opening and reading files.

  • viewer.c takes care of displaying the contents, with both horizontal and vertical scrolling, screen resizing, and even binary file detection.

I'm quite happy with how it turned out and it is a marked improvement on my previous attempt at coding a textfile reader fw, which only supported ASCII characters. I like how you can keep writing the same style of program and still learn something new each time. I have quite a collection of TUI programs now :D

The next step will be to create a mock-up of the original DOS program with the dro-down menus at the top linking to the documents.


Friday, August 15, 2025

Dictionary Apps: Terminal and Web-Based

I set about coding a TUI dictionary program for the Linux terminal in C to help me expand my vocabulary in English using the interface I had made for HIS (TUI history command). The dictionary is stored in a CSV file with 4 fields (ID, WORD, TRANSLATION, COMMENT). You can add words from the program, edit specific fields.  The feature I'm definitely most proud of is the built-in game to guess words from your dictionary.



You can try it out here: https://github.com/velorek1/dict

It's fun to play it on Termux on an Android phone. The downside is that the dictionary is stored locally and cannot be accessed from any other device. 

Another approach I explored was reusing the previous work I had done with Google App Scripts , Javascript, Google sheets and the recently discovered, amazing hosting service of Netlify. Thanks to Claude (AI) I was able to deploy a fully developed APP that mimicks and more than exceeds the  features of my terminal program. I will definitely be using Netlify in future web-based projects! :)


Full version here : https://regal-sawine-d63fb6.netlify.app/



Sunday, January 5, 2025

Art - Exploring objects in the computational universe

Fractals are characterized by self-similarity and recursive patterns at various scales. Sometimes this complex behavior can be achieved from simple rules which typically make use of loops, recursion, or even modular arithmetic in conjunction with bit-wise operations (XOR; AND, ETC).

I had found this example a while ago and I'm still amazed at how such a complex pattern like the Sierpinski fractal can emerge in only 14 bytes of assembler code!? Truly mind-boggling.

The second example uses modular arithmetic to create a maze-like fractal pattern.

REPOSITORY FOR ART 





Saturday, January 4, 2025

[keyc] : A proof-of-concept Linux Keylogger in C

[keyc] : KeyCapture

A simple keylogger for Linux using evdev. This program captures keyboard input. I

t requires root privileges to run. Keyboard device file defaults to event0. 


If different, check /proc/bus/input/devices and run with paramater specifying device file number (X) as in ./keyc X


Key chars are stored in .capt.dat


Compilation

Compile the program with GCC:

  • gcc keyc.c -o keyc