Marcus Folkesson

Embedded Linux Artist

TIL - suid_dumpable

TIL - suid_dumpable TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post Ever notice that you can't get a coredump from a process running with extra privileges like capabilites or setuid? This is related to a previous post [1] about some restrictions that is applied to such processes. I suggest to read that post first to get the context.

TIL - make pacman-pkg

TIL - make pacman-pkg TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post v6.11 of the upstream kernel makes it really easy to do kernel devlopment on Arch Linux with the new make pacman-pkg target [1]: commit c8578539debaedfbb4671e1954be8ebbd1307c6f Author: Thomas Weißschuh <linux@weissschuh.net> Date: Sat Jul 20 11:18:12 2024 +0200 kbuild: add script and target to generate pacman package pacman is the package manager used by Arch Linux and its derivates. cover

TIL - strace and capabilites

TIL - strace and capabilities TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post strace [1] is a terrific tool to trace system calls and signals for a specific command. The fact that programs using the setuid bit do not have the effective user ID priviliges when being traced was something I already knew, but that the same was true to capabilites [2] was new to me.

TIL - interactive shell script

TIL - interactive shell script TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post Tody I saw this line in a script: 1INTERACTIVE="" && [[ -t 0 ]] && INTERACTIVE="-it" that later on started a container: 1docker run --rm ${INTERACTIVE} -v "${PWD}":/home/br-user \ 2 --user "$(id -u)":"$(id -g)" \ 3 myproject/docker "${@}" It tests if STDIN is opened on a terminal and in that case set $INTERACTIVE to -ti to start the container with an interactive shell.

TIL - Git bundle

TIL - Git bundle TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post The git bundle [1] subcommand has been around for many years but is something I came across quite recently. The command allows you to create, unpack, and manipulate bundles files, which are used to share git repositories without an active server. cover

TIL - Magic SysRq with SystemD

TIL - Magic SysRq with SystemD TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post The Magic SysRq [1] is a ueful tool for debugging and recovering from a frozen system and is something I use frequently. SystemD sets the permissions bitmask to 0x10 by default [2] , it means that only a subset of the available features is allowed. cover

TIL - raw HTML in Hugo

TIL - raw HTML in Hugo TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post I'm using Hugo [1] for this website setup [2] and find it very satisfying. I can write all my content in reStructured Text [3] and create a website out from it. Today I needed to add a part of raw HTML into one of my pages and that was when I found Shortcodes [4] in which is very useful.

TIL - Parse command output from shell

TIL - Parse command output from shell TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post Parse text output in shell scripts is something that is needed every now and then. It used to be some clever pipeline with regular expressions, grep, cut or even awk. But now I've started to use read for such things, and it has helped me a lot.

TIL - Reuse your SSH connection

TIL - Reuse your SSH connection TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post OpenSSH has the feature to reuse an existing SSH connection for multiple subsequent connections to the same host. It will improve your workflow because it reduces the time it takes to establish a new connection and in cases where you have to type a password, the time saving is even more.

TIL - xxd color support

TIL - xxd color support TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post Today (2 January 2024), version 9.1 of the Vim editor has been released [1]! xxd [2] is a utility that is distributed with Vim and is my go-to-tool when it comes to view or manipulating binary files. cover