Posts for 2024 February
MdLogGen
Post by Nico Brailovsky @ 2024-02-25 | Permalink | Leave a comment
If you're reading this, you somehow found me at nicolasbrailo.github.io. Maybe you came here from one of my many previous blogs, and you're marveling at the beautiful new design (?). As I alluded to in the "moved again" note, this site is built from a source of md files, using a custom md-to-html enginge. If you're sane, you're probably why I would create an md-to-html engine, instead of using one of the many available options.
MdlogGen: yet another MD site generator
MdlogGen is a simple md-to-static-html, however it supports a few features I wasn't able to find elsewhere: comments, and site-search. MdlogGen depends on Github for these two features (or, rather, depends on the viewer to have a Github account to be able to use these two features).
MdlogGen also supports the exact feature set I need, no more and no less; while using an off-the-shelf generator may have been a better longer term investment, 90% for the raison d'etre of this site is "for fun", and spending a weekend writing hacky code is more fun than spending a weekend trying to figure out how to configure Github deploy rules, and learning to use a third party content generator. I get to write enough code for a living during the week - weekends are for fun code! An alternate reason is that I already had to spend a chunk of time cleaning XML exports from my previous sites to build this one - so MdlogGen is sort of a natural evolution of those scripts. Kind of.
Check out MdlogGen's reamde: while many other md-to-html generators exist, I think this may be one of the simplest feature-complete generators out there.
Bash tip: expand args
Post by Nico Brailovsky @ 2024-02-25 | Permalink | Leave a comment
If you're writing a script and it looks like this
your_bin --arg1 \
--arg2=123 \
--arg3=345 \
--arg4...
It can get pretty ugly to maintain. Instead, try this:
many_args=(
--arg1
--arg2=123
--arg3=345
--arg4...
)
your_bin "${many_args[@]}"
Fix "slow" Grub
Post by Nico Brailovsky @ 2024-02-23 | Permalink | Leave a comment
Grub tends to be setup-and-forget, so this is a tip that should be useless. Except when things break.
I noticed while fixing a computer that Grub was "slow" - each keystroke would take about half a second to show up on the screen, give or take a hundred ms, and it wouldn't even queue my keystrokes (leading to skipped keys, and even more frustrating sessions of backspace-backspace-backspace, fix-fix-fix, repeat). This seems to be related to Grub running in a very high resolution, which should be entirely unnecessary - I don't care about 4K boot menus, nor about 4K boot splash screens that will be displayed for a second or two.
To fix slow-Grub, it's enough to tell it to stick to a more terminal-friendly resolution. Debian-based example:
Add this to /etc/default/grub
GRUB_GFXMODE=1024x768
GRUB_CMDLINE_LINUX_DEFAULT="nosplash verbose debug nomodeset"
Then run update-grub
. Next boot up Grub input should behave in a sane way again.
Extra tip: Increase terminal font size without murking in Grub
If you got past Grub, you're probably booting into 4K mode terminals, and texts that are but a few millimiters high. You can increase your terminal font size, before ever going to a graphical interface:
setfont /usr/share/consolefonts/Uni3-Terminus32x16.psf.gz
Extra extra tip: Kernel arcana
If you're reading this, you're probably looking for debug verbose nomodeset earlyprintk=vga loglevel=7 ignore_loglevel
How to: UEFI shell
Post by Nico Brailovsky @ 2024-02-20 | Permalink | Leave a comment
There are countless "how to use an UEFI shell" notes out there, but this is the cheatsheet I tend to use:
# Set video to 80cols 50 rows, so it's less tiny in a 4k screen
mode 80 50
# Show pci device tree. Eg to find the VGA controller
devtree
# Show all things that have a FS may be bootable
map
# Refresh list of devices, if a new one is connected
map -r
# Show maybe bootable things that look like a usb
map -t cdrom
# Inspect a fs attached to a mapping (eg when looking at fs0, from the output of §map§)
# Case sensitive, uses fwd slashes and not back slashes
ls fs0:
ls fs0:EFI\BOOT\
# Moving around: first select mapped device, eg
fs1:
# Then cd and ls works
cd efi
ls
Eg to boot a Debian live USB on my setup
shell> mode 80 50
shell> map -t cdrom
shell> FS0:
shell> FS0:
FS0:> cd efi\boot
FS0:\efi\boot> ./grubx64.efi
Move again
Post by Nico Brailovsky @ 2024-02-18 | Permalink | Leave a comment
I'm now at nicolasbrailo.github.io. If I count platform, domain or tech-stack changes as a migration, I've now lost count of how many this site has had. It's the third one in the last few years. I moved away from WP because I wasn't happy with the sponsored content added to my site. I also wasn't happy with Blogger, I never quite like the interface, the way to write posts, or the customization options.
This site now came full circle: it started as a self-hosted php bundle, and it's now a kind-of-self-hosted static html site, generated from .md files in Github. I figured I'm the person who reads this site the most, so I should like it. I'm a nerd, so I like writing code; hence the custom md-to-html converter, about which I should blog some time soon. This is also only meant as a fun project (and a great self-reminder mechanism, persistent through the decades) so why not reinvent the wheel, and create a custom md-to-html renderer for it?
ToDo
- RSS doesn't work yet
- There are broken things from back the 2010's - I need to review old posts
- Some content isn't migrated yet
Fun stats
- There are about 450 posts, in about 15 years. This means I'm quite lazy.
- Most of the external links are actually broken. If you browse the site, you'll notice the further back in time you go, the more dead links you get. This site has survived a non trivial chunk of the existing Internet.
- This blog started some time in 2008, and since then has had at least 5 domains (but possibly more)
- nicolasb[com.ar]
- monosinfinitos[com.ar]
- monoinfinito.wordpress.com
- monkeywritescode.blogspot.com
- Now: nicolasbrailo.github.io
- Finally deleted all content from Wordpress - just today!
- I moved away from Wordpress in 2021. Somehow, the site still claims to have 20 visitors a day, even though there are no posts (other than a text saying "moved to...")
- I still haven't deleted all the content from Blogger - but it's in my ToDo list
wc $(find md_blog -type f)
says this blog has 116068 words in 16497 lines. This is comparable to 400 pages book, though not necessarily a good one. Google says 'The Return of the King' is about 135K words, and 'The Hobbit' is about 100K. 'Sense and Sensibility' comes closest at 119K words.