New answers tagged

1 vote

How to set audio device profile and route with PipeWire directly?

The question was "what [is] the native way of setting audio device profiles with PipeWire[?]" pw-cli looked too involved for my tastes (IMHO, listening to audio isn't supposed to be a brain-...
Seamus's user avatar
  • 2,959
2 votes

"The rest of the line" How setup ssh client console to show all (/px aux) java process line to know the name of the java file?

If you want to see more of the command line, with many ps implementations including that from procps¹ on Linux, you can just add the -w option (or w with the BSD-style API you're using), twice to get ...
Stéphane Chazelas's user avatar
0 votes

How to execute a command on all files whose names match a pattern and whose contents match a pattern?

Fun case of chained xargs: find /path/to/dir -name '*.[hc]pp' -print0 | xargs -0 grep -lZ 'FOO' | xargs -0 ... Depending on your command you may need to pass -n 1 to the second invocation of xargs to ...
Joshua's user avatar
  • 1,893
0 votes

ACPI BIOS Error During Boot: Could Not Resolve Symbols

Question 1: What is the cause of this ACPI BIOS error during boot? As the error message says, this is a bug in your firmware. This isn't a new problem, somewhen in the 5.x kernel release cycle these ...
Marcus Müller's user avatar
2 votes

"The rest of the line" How setup ssh client console to show all (/px aux) java process line to know the name of the java file?

All you need is pgrep: pgrep -fa 'file\.jar' -f: forces pgrep to match the extended regular expression against the full invocation command-line¹ which will include the filename. -a: forces pgrep to ...
kos's user avatar
  • 2,977
4 votes

Will writing to /dev/pts allow me to source ~/.bashrc?

source ~/.bashrc makes the current shell source ~/.bashrc. Redirecting output to tee (that in your case sends it to several /dev/pts/… files) is, well, redirecting output from commands in .bashrc, not ...
Kamil Maciorowski's user avatar
1 vote

How to run python script on login

I was able to fix this issue by configuring the following: Open a terminal on the user you'd like to configure this for and create a ~/.config/autostart/kiosk.desktop in a text editor (nano ~/.config/...
Firav's user avatar
  • 31
0 votes

"The rest of the line" How setup ssh client console to show all (/px aux) java process line to know the name of the java file?

not a good solution but solve part of the problem edit config of ssh client and change font size to 1 insane solution you cant read anything but selection the most long lines and copying on a notepad ...
Felipe Braga Comonier's user avatar
0 votes

the Internet does not start via squid

I helped the following decision. I have managed to install squid by command sudo apt install squid-openssl before I have updated the repository. It was installed the package of squid 5.7 without ...
Николай Мельников's user avatar
0 votes

How can I use a mobile broadband stick with a VoIP server to route calls to multiple devices over Wi-Fi and VPN?

So the immediate reaction I have to this is: that's a bit backwards. Use a VoIP provider that offers you the same flatrate, immediately solving your problem. Assuming you literally can't do that, or ...
Marcus Müller's user avatar
1 vote

SATA options & conflicts for dual booting windows and Linux

You need to start Windows in Safe Mode, then change the disk controller from RAID to AHCI mode, then put Windows back into normal boot mode. I described how to do this here: https://www.theregister....
Liam Proven's user avatar
5 votes
Accepted

Does writing data on one LV keep deleted files on another LV from the same group intact?

Short answer: yes, your deleted data is as safe as it can be under the circumstances. When you configure normal logical volumes (as opposed to "thin" ones), particular stretch(es) of disk ...
telcoM's user avatar
  • 97k
4 votes

Does writing data on one LV keep deleted files on another LV from the same group intact?

With normal Logical Volumes, each LV is separate same way partitions are separate. LVM allocates extents from its Physical Volumes to each LV. Outside of snapshots, the same extent can not be given ...
frostschutz's user avatar
  • 49.2k
5 votes

Does writing data on one LV keep deleted files on another LV from the same group intact?

Logical volumes are all separate, writing to one won’t affect another. LVs do have “geometry”, and you can see it by running sudo dmsetup table This will show how each LV (represented by constituent ...
Stephen Kitt's user avatar
1 vote

How to execute a command on all files whose names match a pattern and whose contents match a pattern?

find /path/to/dir -name '*.[hc]pp' -exec grep -l 'FOO' {} + \ | while IFS= read -r f; do cmd "$f"; done
cjs's user avatar
  • 680
0 votes

OpenVPN client - DNS will get set only on the 1st launch

You can add a hook to have OpenVPN configure the DNS though systemd-resolved. From https://github.com/jonathanio/update-systemd-resolved, grab the update-systemd-resolved script and mark it as ...
Jeff Isaacs's user avatar
4 votes

How to execute a command on all files whose names match a pattern and whose contents match a pattern?

First turn on the globstar option in Bash: shopt -s globstar Now you can simply do: for x in /path/to/dir/**/*.[hc]pp; do if grep -q 'FOO' "$x"; then ... fi fi The ** pattern ...
Kaz's user avatar
  • 8,476
10 votes

How to execute a command on all files whose names match a pattern and whose contents match a pattern?

With GNU implementations of those utilities (and a shell with support for ksh-style¹ process substitution), you could just do: xargs -r0a <(grep -rlZ --include='*.[hc]pp' FOO) cmd -- Above, with -...
Stéphane Chazelas's user avatar
18 votes
Accepted

How to execute a command on all files whose names match a pattern and whose contents match a pattern?

-exec … \; is also a test, it succeeds iff the command inside returns exit status 0. -exec … + can process many pathnames with one command and it always succeeds, so it's not a useful test. grep -q ...
Kamil Maciorowski's user avatar
1 vote

Reboot and select proper boot device SSD error

I followed the Debian instructions for reinstalling grub-efi, which can be summarized as follows: Boot a live usb (or rescue mode on an install USB) on the BIOS and board you wish for your SSD to ...
Cheetaiean's user avatar
1 vote

Is there a tool that preserves CSS formatting during HTML to PDF conversion?

There are multiple options, including paged.js, WeasyPrint, and wkhtmltopdf (which is outdated, but easy to install on most distros. You might also want to checkout speedata, and there are many closed-...
tarleb's user avatar
  • 2,112
3 votes
Accepted

chown cannot dereference, Permission denied

This answer supposes that this is in place: # sysctl fs.protected_symlinks fs.protected_symlinks = 1 The root user (which the following security feature was especially intended to affect) as any ...
A.B's user avatar
  • 36.6k
1 vote

Understanding memory limits in a systemd service: Are they per-process or combined?

Linux supports limits using two mechanisms ulimit which is (mostly) per process cgroups which limits totals for the group of processes added to the cgroup Most of the limits systemd sets, including ...
user10489's user avatar
  • 6,785
0 votes

Debian Linux live system toram: Failed to open /dev/shm device

This is caused by a bug in live-boot. The bug is already fixed upstream, but it will take some time until a release is made. In the meantime, you can just ignore the error log (it's harmless). Or you ...
Jan Schär's user avatar
0 votes

Could not create MokListRT: volume full etc when trying to boot almost any distro/liveUSB

The errors indicate the UEFI NVRAM that is used to store UEFI boot variables and other firmware settings seems to be full. Run sudo efibootmgr -v: if it displays a large number of obsolete boot ...
telcoM's user avatar
  • 97k
0 votes

How to replace one char with another in all filenames of the current directories?

Use detox command. In your case use simply: detox -v .
betontalpfa's user avatar
16 votes

Differences Between `/dev/null` and Devices Under `null_blk` Driver

/dev/null is a "character device", on which all reads return empty and all writes complete fully with no additional side-effects. These are the semantics since V5 UNIX in 1974, and are ...
telcoM's user avatar
  • 97k
20 votes
Accepted

Differences Between `/dev/null` and Devices Under `null_blk` Driver

/dev/null is handled by a device driver, but it’s a very simple one. The major difference between /dev/null and null_blk is that the former is a character device, the latter a block device. The former ...
Stephen Kitt's user avatar
0 votes

How can I look up a username by id in linux?

Just to add another method for use on systems without a suitably recent id utility: perl -le 'print scalar getpwuid $ARGV[0]' "$uid" Unlike grepping the passwd file, this works fine on ...
Matthijs's user avatar
  • 101
3 votes

what is the meaning when a makefile rule has prerequisites but without the recipe?

The all target simply depends on the tar, rmt, and tar.info targets, but doesn't do anything except making sure those three are built. .PHONY is an extension that means the phony targets all and ...
ilkkachu's user avatar
  • 139k
1 vote
Accepted

Tracing iptables Rules

So, what am I missing, here? The -v option for verbose: -v, --verbose Verbose output. This option makes the list command show the interface name, the rule options (if any), and the TOS masks. The ...
A.B's user avatar
  • 36.6k
0 votes

Could not create MokListRT: volume full etc when trying to boot almost any distro/liveUSB

as explained in askubuntu, disabling secureboot should fix that if for some reason you still need it, you will need to install sbctl go install github.com/foxboron/sbctl/cmd/sbctl@latest $(go env ...
killertofus's user avatar
3 votes
Accepted

How to clean up a Linux system to free up disk space?

sudo journalctl --vacuum-size=300M reduces the logs to 300 MB sudo logrotate /etc/logrotate.conf compresses or (?) deletes system logs sudo apt-get autoremove removes software that are only ...
mYnDstrEAm's user avatar
  • 4,248
1 vote

How to permanently disable autostarting of applications on Linux/Debian?

If an autostart file exists in /etc/xdg/autostart, then copying it to ~/.config/autostart and adding Hidden=True will work even after the package is updated. If the option exists to disable/mask the ...
ajgringo619's user avatar
  • 3,296
3 votes
Accepted

Editors crashing with certain characters, programs crashing, how to diagnoze?

The messages in the crash report indicate that the sdb disk had a read error and returned bad data. It says auto reallocate failed, so it might be that any spare capacity to replace detected bad ...
telcoM's user avatar
  • 97k
0 votes

Which process scheduler is my linux system using?

If it helps and I understood the questions correctly, the ones I have been using for sometime already in Ubuntu are these ones: CPU SCHEDULER Before Kernel 6.6 it was the CFS (Completely Fair ...
Luis Alvarado's user avatar
6 votes
Accepted

Why does env -S with quoted strings in the shebang line work fine in Ubuntu but not in macOS?

Shebang lines are parsed slightly differently on different Unix kernels. On Linux and on modern BSD, the command is followed by a single argument (or none), which can contain spaces. On macOS, the ...
Gilles 'SO- stop being evil''s user avatar
0 votes

Mirroring disk between computers

Your requirement indicates you really just need regular backups, not something complex, live, simultaneously distributed. So, your cron-job + rsync approach sounds right. I'd throw in that you ...
Marcus Müller's user avatar
0 votes

Mirroring disk between computers

Use dRAID with zfs. dRAID is a variant of raidz that provides integrated distributed hot spares which allows for faster resilvering while retaining the benefits of raidz. A dRAID vdev is constructed ...
J_H's user avatar
  • 866
1 vote
Accepted

When I turn on the computer ( or restart ) the screen turns on and off three times before booting grub. How to stop this behaviour?

I didn't find an answer, so at last, I gone to the bios settings. choose Legacy boot, and Try UEFI first, and that worked fine. but still it won't work when I choose UEFI instead of legacy boot. I ...
white-hat-er's user avatar
0 votes

Do not halt the boot if an fstab mounting fails

nofail mounts wont prevent the system from booting on failure. nobootwait was an upstart specific option to prevent upstart from waiting for the device. Note that since systemd (the replacement for ...
the_redburn's user avatar
1 vote

When I turn on the computer ( or restart ) the screen turns on and off three times before booting grub. How to stop this behaviour?

Booting looks fine to me from a technical standpoint. I think this is happening: The resolution of the display gets changed for a split second to another resolution. As this is sooo early in the boot ...
Manux's user avatar
  • 57
0 votes

How to avoid "Permission denied" error messages when searching recursively for a string with find and grep?

To only search directories that you have access to and to only examine files that you're able to read, using GNU find (which is what is used in the question), you can test with -executable and -...
Kusalananda's user avatar
  • 334k
1 vote
Accepted

Can a FIDO2 Security Token be removed after unlocking a LUKS volume at boot?

Accessing an external FIDO2 token on every disk operation would make an encrypted disk device very slow, to the point of being practically unusable. With LUKS, any password, FIDO2 token or other means ...
telcoM's user avatar
  • 97k
0 votes
Accepted

postgresql service down, "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory

fixed it with #FATAL: "/var/lib/postgres/data" is not a valid data directory rm /var/lib/postgres/data sv start postgresql
bazizi khaled's user avatar
0 votes
Accepted

tar says Cannot open: No space left on device but df -h and df -i both show the available space is very large

According to this blog entry, the author estimates that the maximum normal ext4 directory size is about 10 million files unless the large_dir filesystem option is enabled: Suppose, not entirely ...
ErikF's user avatar
  • 4,057
1 vote

How to delete one line and the line above in Linux?

You could use pcregrep, or rather pcre2grep these days' -Multiline mode: pcre2grep -vMi '^\h*alter table[^;]*\sdrop\s[^;]*;' file.sql To also remove the preceding comments: pcre2grep -vMi '(^--.*\n)*^...
Stéphane Chazelas's user avatar
2 votes

How to delete one line and the line above in Linux?

I'll maybe extend this to address the question as it has been layed out, but to address the actual issue at hand: table_options in ALTER TABLE statements are completely optional in MySQL: ALTER TABLE ...
kos's user avatar
  • 2,977
0 votes
Accepted

How to configure openntpd to only rarely connect to NTP servers and sync the clock (or only when a large clock drift was detected)?

The solution was to upgrade to Debian12, remove openntpd, and install timesyncd as described here. The default options can be shown with timedatectl show-timesync as frostschutz' helpful answer shows ...
mYnDstrEAm's user avatar
  • 4,248
2 votes

How to delete one line and the line above in Linux?

Using any awk and tac: $ tac file | awk '$1=="DROP"{c=2} !(c&&c--)' | tac ALTER TABLE TESTE3 ADD COLUMN nome2 VARCHAR(2) DEFAULT NULL; -- -- Create table `TESTE10` -- CREATE TABLE ...
Ed Morton's user avatar
  • 31.7k

Top 50 recent answers are included