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

Fun stats