Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Activity for alx‭

Type On... Excerpt Status Date
Answer A: Why/how can distro support lifetimes exceed the lifetime of their dependencies (such as Python)?
When an upstream project stops supporting a version (e.g., Python stops supporting 3.8), the maintainers of the distribution do the job of supporting those components, applying security patches as necessary. You can expect that their knowledge of the project isn't as comprehensive as that of the p...
(more)
about 1 month ago
Question Can a malicious party add false recipients (who are listed but can't really decrypt) to an encrypted GPG message?
In gpg(1), one normally adds recipients of an encrypted message with `--recipient`. Those recipients will be able to decrypt the message, and their key ID will appear unencrypted, so anyone will know that they are able to decrypt it. gpg(1) also allows adding hidden recipients, with `--hidden-rec...
(more)
about 1 month ago
Question How to use the gitignore file without git(1).
How can a file list be manually filtered with a gitignore file. I want to do the equivalent of `git ls-files`, but it should work even if I remove `.git`, so I can't use git(1). Currently, I'm doing ```sh find . -not -type d \ | grep -v ^.git$ \ | grep -v other-files-specified-in-the-giti...
(more)
3 months ago
Answer A: Run pipeline in the background from git hook
Use nohup(1), and redirect stdout and stderr to /dev/null The following works as expected, not having to wait until the PDF is generated. ```sh #!/bin/sh test "$1" = "refs/heads/main" || exit 0; cd /srv/src/alx/linux/man-pages/man-pages/; unset $(git rev-parse --local-env-vars); git ...
(more)
5 months ago
Answer A: How to extract string from file, run filter, and replace in file with new value?
(Assuming your file names are portable, according to POSIX (). If not, please read this for writing a more robust script: .) ``` find . -type f \ | grep '/chapter-[^/].xhtml$' \ | while read f; do ( head -n11 <"$f"; sed -n '12p' <"$f" | titlecase; ...
(more)
5 months ago
Question Run pipeline in the background from git hook
I'm trying to run a pipeline to update a PDF after every push to the 'main' branch. I want it to be atomic, so it doesn't touch the existing PDF until it has finished, so I need to use sponge(1) (from moreutils). I've tried the following script: ```sh #!/bin/sh test "$1" = "refs/heads/main...
(more)
5 months ago
Answer A: How to RTFM well to get a CLI command
The pager less(1) less(1) is the usual pager nowadays; you would do well learning to use it. It's also used for paging the manual pages, in most systems. The most common operation is searching, which is done by pressing `/`. Press `h` within the pager, or run `less --help` to read its help f...
(more)
6 months ago
Answer A: Looking for a way to sync dotfile content between different machines without introducing security issues
It depends on how much sensitive they are. I have three classes. 1) Very sensitive directories Partitions For my `/.ssh/`, `/.password-store/`, `/.gnupg/`, and `/.abook/`, I have a drive with 4 partitions, one for each directory, each of them encrypted with LUKS2. The relevant fs...
(more)
6 months ago
Question How to change resolution of virtual terminal?
How can I rescale the Linux virtual terminals (ctrl + alt + {f1, f2, f3, f4, f5, f6}), so that a high-resolution display doesn't make the letters too small? I'd like to use 1080 or even 720 resolution in virtual terminals (and only there; I want native resolution in ctrl + alt + f7). If that ...
(more)
6 months ago
Answer A: How can I restrict filename characters?
You could try and convince Linux kernel maintainers, but they are reticent to that. I wonder what they'll do after POSIX.1-202x (Issue 8) possibly will forbid those. Maybe you could patch your kernel. It would be an interesting thing to do, even if just for fun. I've never done such a thing, so...
(more)
6 months ago
Answer A: Rename multiple files which have a variable suffix
```sh find . -type f -print0 \ | grep -z -- '-min.jpg-[[:alnum:]]$' \ | while IFS= read -r -d '' f; do find "$f" -print0 \ | sed -z 's/-min.jpg-[[:alnum:]]$/-min.jpg/' \ | xargs -0 mv "$f"; done; ``` Or, if you prefer a one-liner: ```sh find . -type f -print0 | grep -z -- '...
(more)
7 months ago
Answer A: How to run a command on a list of files?
In some cases, when you want to apply a pipeline or a complex command to each file, I find it useful to use `while read`: ```sh find . -type d \ | while read d; do find $d -type f -maxdepth 1 \ | head -n3; done; ``` Hardened version: ```sh find . -type d -print0 \ | while IFS= read -...
(more)
7 months ago
Answer A: How to identify and separate standalone applications from libraries in Linux package lists?
This answer is not directly usable under Arch, since I don't know the tools there. I show you a way to do it on Debian, which may inspire you to find a similar way in Arch. With apt-file(1), you can list the files that a package provides. From that list, you can see if the package provides files...
(more)
7 months ago
Answer A: How to list the first x files in each directory
Here's my approach: ```sh find l1 -type d \ | while read d; do find $d -maxdepth 1 -type f \ | head -n3; done; ``` If your middle directories also contain files, it will also show them (of course, only the first 3). This is what it shows for me in a tree similar to yours, where I add...
(more)
7 months ago
Answer A: How to overwrite each line of STDOUT with the next one?
Instead of having new stdout lines overwrite the previous one, it seems better to specify that old stdout lines should be overwritten by anything that comes after them. This has the benefit that stdout cannot overwrite stderr (or anything else that goes in the tty). ```sh #!/bin/sh setterm ...
(more)
7 months ago
Answer A: Ergonomic way to search man pages
Unix filters are quite handy. First of all, you can get an index of any manual page with a simple grep(1): ```sh $ man pacman | grep '^[^ ]' PACMAN(8) Pacman Manual PACMAN(8) NAME SYNOPSIS DESCRIPTION OPERATIONS OPTIONS TRANSACTION OP...
(more)
7 months ago
Question How to overwrite each line of STDOUT with the next one?
I wrote a filter program to overwrite each line with the next one. ```sh $ cat /usr/local/bin/ovr #!/bin/sh sed '2,$s/^/\x1B[1A\x1B[K/'; ``` Here's the behavior: ```sh $ echo | ovr $ echo 'foo' | ovr foo $ echo -e 'foo\nbar' | ovr bar $ echo -e 'foo\nbar\nbaz' | ovr baz $ ech...
(more)
7 months ago
Answer A: How to get a mailto: URI out of abook(1)
There's no such feature. But it's easy to write. Apply this patch: ```diff From 8ea7d1cf4933ca24006308ac61aa50fb8ab33b02 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sat, 30 Sep 2023 17:44:03 +0200 Subject: [PATCH] query: outformat: Add "mailto" format Signed-off-by: Alejandro ...
(more)
7 months ago
Question How to get a mailto: URI out of abook(1)
I store my address book with abook(1). Let's say I want to introduce some contact in some field that accepts the usual `name ` format. How can I ask abook(1) to produce that format? The addressbook entry is the following: ``` [0] name=Alejandro Colomar email=alx@kernel.org,alx.manp...
(more)
8 months ago
Question How to see all header fields of an email in mutt?
Neomutt (and probably Mutt too, but I didn't try) seems to be hiding header fields from email, such as the Message-ID field, and fields that are added by SMTP servers when they receive the message. How can one ask it to show the entire mail source, as if one was reading the file itself? In othe...
(more)
8 months ago
Question Who creates subdirs under `/run`?
A system daemon needs to create several files under `/run/program-name/` (and possibly other subdirs of that). They are the PID file, and at least one Unix socket file (but maybe more). The FHS specifies that those files go there, under a `/run` subdir: . (In some Unix systems, it would still be `...
(more)
over 1 year ago