Define default applications on the command-line

The xdg-mime command, which is part of the xdg-utils package, can be used to define default application associations via the XDG MIME Applications specification. https://wiki.archlinux.org/title/Default_applications https://wiki.archlinux.org/title/XDG_MIME_Applications Query the MIME type of a file: xdg-mime query filetype <path-to-file> Display the default application for PDFs: xdg-mime query default application/pdf Find the desktop entry name of Firefox: ls -l /usr/share/applications | grep -i firefox Set Firefox as the default application for html files: xdg-mime default firefox....

January 1, 2024 · Fernando Costa Bertoldi

PDF utilities based on libpoppler

Poppler is a PDF rendering library based on the xpdf-3.0 code base. The package poppler-utils contains pdf utilities based on Poppler. pdfunite: concatenate documents pdfunite file1.pdf file2.pdf out.pdf pdfseparate: page extraction tool extract from sample.pdf pages 3 to 5, generating sample-page-3.pdf, sample-page-4.pdf, sample-page-5.pdf pdfseparate -f 3 -l 5 sample.pdf sample-page-%d.pdf pdftotext: text extraction pdftoppm: convert to image formats pdftoppm -png file.pdf > file.png pdfinfo: document information pdfsig: verify digital signatures

November 9, 2023 · Fernando Costa Bertoldi

Check Secure Boot in Linux

TIL: use the mokutil command to check if Secure Boot is enabled. secureBoot:~$ mokutil --sb-state SecureBoot disabled “The mokutil command is used to manage Machine Owner Keys (MOK). These keys are used by the shim layer to validate grub2 and kernel images and can also be used to verify that Secure Boot is enabled.” https://www.kvaser.com/developer-blog/secure-boot-linux-systems/

October 28, 2022 · Fernando Costa Bertoldi

APT: apt purge <package>

TIL: purge is identical to remove, but it also deletes configuration files

Fernando Costa Bertoldi

Automatically start an application during desktop startup in Linux

To auto-start a executable during desktop startup, add a .desktop file to $HOME/.config/autostart. Based on the FreeDesktop spec. # ~/.config/autostart/rescuetime.desktop [Desktop Entry] Version=1.0 Name=RescueTime Exec=rescuetime Terminal=false Type=Application

Fernando Costa Bertoldi

checkinstall: create a Linux package file (.deb, .rpm) from a Makefile

checkinstall tracks installation of local software, and produces a binary manageable with your package management software. Instead of sudo make install, you will use sudo checkinstall to install. This will automatically create a package files, which you can use to uninstall the files: sudo dpkg -r <packagename> https://help.ubuntu.com/community/CheckInstall

Fernando Costa Bertoldi

Core dumps in Linux

https://www.baeldung.com/linux/managing-core-dumps https://wiki.archlinux.org/title/Core_dump Core dumps in systems with systemd are managed by the service systemd-coredump. This is a service that acquires the core dump, then processes it to extract metadata out of it. It then stores this information under /var/lib/systemd/coredump/. We can check if the system is configured by checking the kernel attribute kernel.core_pattern $ sysctl -n kernel.core_pattern |/lib/systemd/systemd-coredump %P %u %g %s %t 9223372036854775808 %h To remove dump file size limits in the current shells, run ulimit -c unlimited...

Fernando Costa Bertoldi

File Hierarchy Standard (FHS) locally as a man page

man hier, pretty much it

Fernando Costa Bertoldi

Installing .desktop files in Linux

sudo desktop-file-install <program.desktop> sudo update-desktop-database Use desktop-file-edit FILE to edit the files.

Fernando Costa Bertoldi