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 »

Posts by Iizuki‭

42 posts
75%
+4 −0
Q&A How to invert command exit code?

An exclamation mark followed by space in the beginning of a pipeline will negate the final exit code of the pipeline. Here's an example in Bash. Echoing $? will print out the exit code of the prev...

posted 6mo ago by Iizuki‭  ·  edited 2mo ago by Iizuki‭

Answer
71%
+3 −0
Q&A How to show motherboard model?

dmidecode can do this. Here's an example output from my system: # dmidecode --type 2 Getting SMBIOS data from sysfs. SMBIOS 3.1.1 present. Handle 0x0002, DMI type 2, 15 bytes Base Board Info...

posted 13d ago by Iizuki‭

Answer
71%
+3 −0
Q&A How to invert command exit code?

How to apply a logical not to a shell command, e.g. in a Bash script? So if the command exited with 0 (success) I would like it to be changed to a non-zero value, and if it exited with a non-zero ...

1 answer  ·  posted 6mo ago by Iizuki‭  ·  last activity 5d ago by Quasímodo‭

71%
+3 −0
Q&A How to find your public IP address from command-line?

ip a command will conveniently show the addresses assigned to your network interfaces, but oftentimes this is not what the internet sees your machine as. So how to find your public IP address from...

3 answers  ·  posted 5mo ago by Iizuki‭  ·  last activity 2mo ago by Michael‭

71%
+3 −0
Q&A How to count the lines of a file?

How to get the number of lines in a file? I.e. for a file like this: Line one Line 2 Final line I would like to do something like this: $ count-lines /path/to/the/file/above 3

2 answers  ·  posted 3mo ago by Iizuki‭  ·  last activity 29d ago by Michael‭

Question shell file
71%
+3 −0
Q&A How to convert json to yaml?

How to convert a json file to yaml? Technically json is already valid yaml, but I'm talking about the characteristic easy-to-read yaml formatting with indentation and minimal quotes.

1 answer  ·  posted 30d ago by Iizuki‭  ·  last activity 11d ago by Iizuki‭

Question json yaml
71%
+3 −0
Q&A Prettify XML in a shell

xmllint from xmllib2 can do this: $ output-dirty-xml | xmllint --format - The dash in the end tells xmllint to read from stdin instead of a file. Source: manpage

posted 2mo ago by Iizuki‭

Answer
66%
+2 −0
Q&A Show a timestamp on the right side of prompt when executing a command in ZSH

How to configure ZSH shell to print a timestamp on the right hand side of the prompt line when executing a command? I don't want to display the time prior to executing a command. Here's about how ...

1 answer  ·  posted 4mo ago by Iizuki‭  ·  last activity 4mo ago by Iizuki‭

Question zsh
66%
+2 −0
Q&A Show a timestamp on the right side of prompt when executing a command in ZSH

The preexec function is called right before executing commands, so it's the place to do this sorta things. This solution is adapted from Dan Berindei's original answer (CC BY-SA 3.0) to a related ...

posted 4mo ago by Iizuki‭

Answer
66%
+2 −0
Q&A How to show motherboard model?

Surely there exists a command to print out the system's mother board model? Opening up the chassis is not an option.

2 answers  ·  posted 13d ago by Iizuki‭  ·  last activity 6d ago by Matthias Braun‭

66%
+2 −0
Q&A Find out which process is using a port

Sometimes your programs fail because the network port they are trying to use is already in use by some other process. How to find out what this other process is?

1 answer  ·  posted 3mo ago by Iizuki‭  ·  last activity 3mo ago by Canina‭

Question port process
66%
+2 −0
Q&A What are the %U and %u parameters in desktop files?

Desktop files always have either %u or %U as an argument for the program being launched. E.g. here's a line from my firefox.desktop: Exec=/usr/lib/firefox/firefox %u What does it mean?

1 answer  ·  posted 2mo ago by Iizuki‭  ·  last activity 2mo ago by Iizuki‭

Question desktop xdg
66%
+2 −0
Q&A What are the %U and %u parameters in desktop files?

They are defined in the Desktop Entry Specification. In fact there are also %f and %F options. They tell the desktop manager how the program handles multiple files. Like if I select a bunch of fil...

posted 2mo ago by Iizuki‭

Answer
66%
+2 −0
Q&A How to convert json to yaml?

With yq: $ yq --output-format yaml . file.json > file.yaml . is a filter which is applied to the data, but since . just stands for the document root, this means that the data is passed throu...

posted 30d ago by Iizuki‭  ·  edited 11d ago by Iizuki‭

Answer
60%
+1 −0
Q&A Get notifications to dunst when systemd units fail

I have no experience with dunst, but generally you want a global service-level dropin file in /etc/systemd/system/service.d/ with OnFailure= setting in it. This way it gets added to all services ru...

posted 1mo ago by Iizuki‭

Answer
60%
+1 −0
Q&A Calculate the SHA1 checksum of a file

There's a sha1sum tool in GNU coreutils: $ touch file $ sha1sum file da39a3ee5e6b4b0d3255bfef95601890afd80709 file Note the trailing spaces and the filename in the output. It needs to be acc...

posted 3d ago by Iizuki‭

Answer
60%
+1 −0
Q&A Systemd unit needs to start at boot but wait for network

Yup that's the recommended way to do it. Wants adds the network-online.target as a soft dependency.[1] Systemd will try to start it if it isn't up already. Networking should work after this target...

posted 22d ago by Iizuki‭  ·  edited 19d ago by Iizuki‭

Answer
60%
+1 −0
Q&A How to create ed25519 subkey in GPG?

At the moment GPG only offers the following options when generating a new subkey the with the addkey command: gpg> addkey Please select what kind of key you want: (3) DSA (sign only) (...

1 answer  ·  posted 9mo ago by Iizuki‭  ·  last activity 9mo ago by Iizuki‭

Question security GPG
60%
+1 −0
Q&A How to export public GPG key?

This is how to save it to a file: $ gpg --export --armor key-id > my-key.pub --armor stands for the format with printable characters.

posted 1mo ago by Iizuki‭

Answer
60%
+1 −0
Q&A ==> WARNING: Possibly missing firmware for module: 'foo'

Here's the relevant ArchWiki page. The gist of it is that most of those warnings are probably for some fairly obscure hardware, and can be just ignored (provided that your system indeed works fine...

posted 1mo ago by Iizuki‭  ·  edited 1mo ago by Iizuki‭

Answer
60%
+1 −0
Q&A Prettify XML in a shell

How to pretty print XML in a shell? I have command-line tool which outputs XML in a single line, totally unreadable. I would like something to pipe this into, to turn it into human readable XML wi...

1 answer  ·  posted 2mo ago by Iizuki‭  ·  edited 2mo ago by Iizuki‭

Question shell xml
60%
+1 −0
Q&A ldapsearch: how to ignore certificate?

This can be done by setting the LDAPTLS_REQCERT environment variable to never. For example like this when issuing the command: LDAPTLS_REQCERT=never ldapsearch -H ldaps://example.com:636 ...

posted 3mo ago by Iizuki‭

Answer
60%
+1 −0
Q&A How to count the lines of a file?

One way is to use grep: $ grep --count ^ /path/to/the/file The ^ character matches a start of a new line, so it basically counts the number of starting lines.

posted 3mo ago by Iizuki‭

Answer
60%
+1 −0
Q&A How to open a port in firewalld?

How to open a port when using firewalld as the system firewall?

1 answer  ·  posted 7mo ago by Iizuki‭  ·  last activity 7mo ago by Iizuki‭

Question firewall firewalld
60%
+1 −0
Q&A How to create ed25519 subkey in GPG?

By using the non-interactive --quick-add-key method. This adds separate signing and encryption subkeys with expiration date one year from now: $ gpg --quick-add-key YOUR-PRIMARY-KEY-ID ed25519 sig...

posted 9mo ago by Iizuki‭

Answer