Wednesday, November 3, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Chrome crashing with open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)

Posted: 03 Nov 2021 09:43 AM PDT

When i open chrome with python module named subprocess it crashes and gives me these

[1103/163807.480539:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)      [1103/163807.480673:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)  

here is my arguments

google-chrome --disable-gpu --start-maximized --new-window -incognito http://localhost:9932/

Determining whether first character mathes (#;!) or the first two matching // or @c

Posted: 03 Nov 2021 09:50 AM PDT

How can I determine whether the first character in a line is #, ;, or !, or if the first two characters are // or @c?

I have to do this in a bash script.

How do you rename multiple files by removing 4 characters in the middle that are different in each file name but in the same location?

Posted: 03 Nov 2021 09:24 AM PDT

I would like to rename my files using BASH by removing 4 characters in the middle.

old file names:

dwe_hiul123456.pdf  dwe_lkyd345876.pdf  dwe_ythn157843.pdf  

I want to remove the 4 letters in the middle so the new file names would be:

dwe_123456.pdf  dwe_345876.pdf  dwe_157843.pdf  

openssl certificate error for WinRM connection

Posted: 03 Nov 2021 09:02 AM PDT

I have on Windows server certificate which is valid and active and WinRM listener is active as well on port 5986 (telnet works) for WinRM connection that needs to be established from the Linux server.

I didn't copy that certificate anywhere on the linux server as I do not know where that should be or how it should be configured.

If I try to establish WinRM connection I am getting this error on the Linux server.

openssl s_client -connect 10.7.147.210:5986           No client certificate CA names sent    Peer signing digest: SHA256    Peer signature type: RSA    Server Temp Key: ECDH, P-384, 384 bits    ---    SSL handshake has read 1367 bytes and written 447 bytes    Verification error: unable to verify the first certificate  

Can you please help me what I need to do and configure on Linux server for certificate generated on Windows server for WinRM connection? I am not the expert for this topic so I would appreciate all useful instructions. Thank you

What is the admin:// prefix and how to make it work?

Posted: 03 Nov 2021 09:23 AM PDT

Looking for an alternative to gksudo in Debian, I stumbled upon this article, which suggests to use the admin:// prefix in order to access files as root. E.g. instead of

gksu gedit /etc/default/apport  

one is supposed to run

gedit admin:///etc/default/apport  

I don't use gedit, but running leafpad admin:///etc/fstab on my Debian Buster simply opens an empty file. What am I missing?

mtp:// is working on that machine, so I suppose GVFS support is present.

How to set LUKS loading screen Debian

Posted: 03 Nov 2021 08:56 AM PDT

On linux mint and fedora, when you first boot a LUKS encrypted system, instead of a command line passphrase entering section, it has kind of a GUI that looks better than the default command line on Debian. I noticed that on Debian you can press escape and it will change to a similar type of menu. Is there any way to set this "GUI" type LUKS decryption screen as the default? Also what would be the proper terminology for this screen?

Copy folder with scp that contains links

Posted: 03 Nov 2021 08:45 AM PDT

How can i copy a folder with scp that contains links? When i use the -r flag, all the data where the links point to are copied. How can i copy the link?

Are Other Drives Safe if I Install Pop_OS?

Posted: 03 Nov 2021 07:53 AM PDT

I'm currently using Windows 10. I'd like to switch to Pop_OS. I have a main drive, a drive for games, a random drive, and an external drive. Would these drives be safe if I installed Pop_OS on my PC? As in, would they have to be reformatted to use? Because I obviously don't want to have to format those drives.

Issue with sources, 404 on upgrade

Posted: 03 Nov 2021 07:29 AM PDT

on Debian Bullseye (11) I recently have run into some dead endpoints when I run apt dist-upgrade after an update, see my sources list below. I have tried to resolve with --fix-missing and I have run apt clean... Any ideas?

I have looked at the site, http://deb.debian.org/debian/pool/main/, and I can confirm the directories are missing.

Errors

Failed to fetch http://deb.debian.org/debian/pool/main/g/glibc/locales_2.31-13_all.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/g/glibc/libc6-i386_2.31-13_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/g/glibc/libc-dev-bin_2.31-13_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/g/glibc/libc6-dev_2.31-13_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/g/glibc/libc6_2.31-13_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/p/perl/perl-modules-5.32_5.32.1-4_all.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/p/perl/libperl5.32_5.32.1-4_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/p/perl/perl_5.32.1-4_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/p/perl/perl-base_5.32.1-4_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/m/mutter/mutter_3.38.4-1_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/m/mutter/libmutter-7-0_3.38.4-1_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/n/nautilus/nautilus_3.38.2-1_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/n/nautilus/nautilus-data_3.38.2-1_all.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/e/exiv2/libexiv2-27_0.27.3-3_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/g/grilo/libgrilo-0.3-0_0.3.13-1_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/n/nodejs/nodejs_12.21.0%7edfsg-5_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/n/nodejs/libnode72_12.21.0%7edfsg-5_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/g/ghostscript/ghostscript_9.53.3%7edfsg-7_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/g/ghostscript/libgs9-common_9.53.3%7edfsg-7_all.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/f/flatpak/flatpak_1.10.2-3_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/g/gnome-shell/gnome-shell-extension-prefs_3.38.4-1_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/s/speech-dispatcher/speech-dispatcher-espeak-ng_0.10.2-2_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/s/speech-dispatcher/speech-dispatcher_0.10.2-2_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Failed to fetch http://deb.debian.org/debian/pool/main/s/speech-dispatcher/speech-dispatcher-audio-plugins_0.10.2-2_amd64.deb  404  Not Found [IP: 2a04:4e42:10::644 80]  E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?  

Sources

deb http://deb.debian.org/debian/ stable main contrib non-free  deb-src http://deb.debian.org/debian/ stable main contrib non-free    deb http://deb.debian.org/debian/ stable-updates main contrib non-free  deb-src http://deb.debian.org/debian/ stable-updates main contrib non-free    deb http://ftp.debian.org/debian buster-backports main contrib non-free  deb-src http://ftp.debian.org/debian buster-backports main contrib non-free  deb http://deb.debian.org/debian/ buster main contrib non-free  deb http://deb.debian.org/debian/ buster-updates main contrib non-free  

Configure a desktop shortcut during live media ubuntu 20.04 customization

Posted: 03 Nov 2021 08:27 AM PDT

Context

Currently I'm creating a customized Ubuntu 20.04 LTS to be booted from live media (USB).

I'm trying to create a desktop shortcuts i.e. for the shutdown command. I prepared a .desktop file shutdown.desktop which includes the following:

#!/usr/bin/env xdg-open    [Desktop Entry]  Type=Application  Name=Shutdown  Comment=shutdown  Icon=/opt/icons/shutdown.svg  Exec=sudo shutdown -h now  Terminal=false  Categories=Development;  Name[fr_CA]=something_related_to_project  

and updated the access rights as well

chmod 777 -R home/<user>/Desktop/shutdown.desktop  

I also ran

gio set shutdown.desktop metadata::trusted true  

When I test the generated live media, the file is available on the desktop but it's not executable.

Attempts

When I display the context menu "allow launching" is not available. From some forums, I copied the file to /usr/share/applications then from there I copied it back to desktop by replacing the existing file. At this point the "allow launching" is displayed but the file is still not executable.

When I click on "allow launching" and I double click the file, the command is executed.

Question

How can I configure, during the creation of the live media, my file that execute the shutdown command?

Note:

  • The procedure used to work with Ubuntu 18.04 LTS
  • The commands are also executed in a chroot context.

ASCII to ANSI convertion does not work

Posted: 03 Nov 2021 07:51 AM PDT

Trying to convert an ASCII file to ANSI on Linux:

$ file -bi relocate.xml   text/xml; charset=us-ascii  $ iconv -f us-ascii -t ms-ansi < relocate.xml | file -bi -  text/xml; charset=us-ascii  $ cat relocate.xml | recode us-ascii..ms-ansi | file -bi -  Request: ANSI_X3.4-1968..:libiconv:..CP1252  Shrunk to: ANSI_X3.4-1968..CP1252  text/xml; charset=us-ascii  

I also tried other tools to infer the encoding and they all return the same result :

$ enca -L none relocate.xml ; echo "###" ; uchardet relocate.xml ; echo "###" ; encguess relocate.xml   7bit ASCII characters    CRLF line terminators  ###  ASCII  ###  relocate.xml    US-ASCII  

As you can see, there is no error message from iconv nor from recode tools, but the final encoding is still us-ascii.

How can I convert it to ANSI ?

Duplicate Timeshift backups name

Posted: 03 Nov 2021 08:00 AM PDT

So I have 3 different linux distros using the same partition to store backups using timeshift.

  1. Arch linux
  2. Arch linux
  3. Ubuntu 20.04

I installed one of the arch linux a few days ago, and now after doing all the base setup to get me started, I finally setup the timeshift in the end. But the problem is that both the arch linux installations have the same name when opening the timeshift app. See the image.enter image description here

See, both the arch installations have the same entry under System.
So, I just want a way to differentiate between the two installations of arch linux. So, what options have I got.

All are rsync backups, if that makes any difference.

What expressions would match the pattern (^[0-9]..[a-zA-Z ]+$) in grep command? Linux bash

Posted: 03 Nov 2021 07:59 AM PDT

Im trying to understand what expressions exactly the regular expression (^[0-9]..[a-zA-Z ]+$) detects in grep command (linux terminal)

I know that if I'd write the following command:

grep ^[0-9]..[a-zA-Z] filename.txt  

I will detect any line that contains expressions such as 92afg But Im not sure what the +$ means and what kind of expressions will I be able to detect with the command

grep ^[0-9]..[a-zA-Z]+$ filename.txt  

I tried to open a new text file and just type expressions that I thought would be detected, but none of them matched, so I'd appreciate explanation for this.

Keyboard input N-Key Rollover

Posted: 03 Nov 2021 08:16 AM PDT

Question

Is there any way to programmatically negotiate and enable NKRO (N-Key Rollover) for plugged keyboards when that feature is available? Also, how to properly distinguish between "standard mode" handler and NKRO?

Rationale

I do have three different keyboards that behave slightly differently from each other and even between platforms. All of them support NKRO in their own way. My main problem is that one of these doesn't have any key combination to enforce/switch NKRO mode, it only can be done by the driver/OS.

Tests

I played with my keyboards on Windows 10 and Linux 5.10.17+ (Pi Zero) platforms. My devices are Razer Ornata Chroma, HyperX HX-KB1BR1-NA and Havit HV-KB390L. I think I can put some behavior descriptions of that devices here.

By standard mode I'm referring to a low-speed 8-byte sized USB packet, which is commonly used. By game-mode I'm referring to a keyboard-specific feature if available.

Windows  - Razer: NKRO enabled by default regardless of game-mode state, game-mode only disables Win key,           game-mode state stored only by platform driver           (Razer Central installed)  - Havit: NKRO enabled by default, game-mode does nothing (probably configured via software)           (no additional software installed)  - HyperX: stores NKRO state internally in keyboard and enforces it, game-mode disables Win key only            (no additional software installed)  
Linux  - Razer: standard mode by default, game-mode enforces NKRO and disables Win key  - Havit: standard mode by default, game-mode does nothing, There is no key sequence to enforce NKRO  - HyperX: behaves the same as on Windows, internal state changes works between platforms  

So with that, HyperX implementation of standard mode/NKRO switching is the most favored by me, Razer at least provides a key combination to enforce NKRO (needed to do on every connection/bootup though), Havit unfortunately doesn't give an option to enable NKRO through any key combination.

So, is it possible to do it from the OS side?

Differentiate standard and NKRO handlers

During my tests, I found out that these two different modes relate to two different eventX handlers. We can inspect /proc/bus/input/devices file and find some more context.

I: Bus=0003 Vendor=0951 Product=16b7 Version=0111  N: Name="Kingston HyperX Alloy FPS Mechanical Gaming Keyboard"  P: Phys=usb-20980000.usb-1.1/input0  S: Sysfs=/devices/platform/soc/20980000.usb/usb1/1-1/1-1.1/1-1.1:1.0/0003:0951:16B7.0001/input/input0  U: Uniq=  H: Handlers=sysrq kbd leds event0  B: PROP=0  B: EV=120013  B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe  B: MSC=10  B: LED=1f    I: Bus=0003 Vendor=0951 Product=16b7 Version=0111  N: Name="Kingston HyperX Alloy FPS Mechanical Gaming Keyboard Mouse"  P: Phys=usb-20980000.usb-1.1/input1  S: Sysfs=/devices/platform/soc/20980000.usb/usb1/1-1/1-1.1/1-1.1:1.1/0003:0951:16B7.0002/input/input1  U: Uniq=  H: Handlers=mouse0 event1  B: PROP=0  B: EV=17  B: KEY=1f0000 0 0 0 0 0 0 0 0  B: REL=1943  B: MSC=10    I: Bus=0003 Vendor=0951 Product=16b7 Version=0111  N: Name="Kingston HyperX Alloy FPS Mechanical Gaming Keyboard System Control"  P: Phys=usb-20980000.usb-1.1/input1  S: Sysfs=/devices/platform/soc/20980000.usb/usb1/1-1/1-1.1/1-1.1:1.1/0003:0951:16B7.0002/input/input2  U: Uniq=  H: Handlers=kbd event2  B: PROP=0  B: EV=13  B: KEY=c000 100000 0 0 0  B: MSC=10    I: Bus=0003 Vendor=0951 Product=16b7 Version=0111  N: Name="Kingston HyperX Alloy FPS Mechanical Gaming Keyboard Consumer Control"  P: Phys=usb-20980000.usb-1.1/input1  S: Sysfs=/devices/platform/soc/20980000.usb/usb1/1-1/1-1.1/1-1.1:1.1/0003:0951:16B7.0002/input/input3  U: Uniq=  H: Handlers=kbd event3  B: PROP=0  B: EV=1f  B: KEY=3f 301ff 0 0 0 0 483ffff 17aff32d bfd44446 0 0 1 130ff3 8b17c000 677bfa d9415fed 19ed680 4400 0 10000002  B: REL=1040  B: ABS=1 0  B: MSC=10    I: Bus=0003 Vendor=0951 Product=16b7 Version=0111  N: Name="Kingston HyperX Alloy FPS Mechanical Gaming Keyboard"  P: Phys=usb-20980000.usb-1.1/input1  S: Sysfs=/devices/platform/soc/20980000.usb/usb1/1-1/1-1.1/1-1.1:1.1/0003:0951:16B7.0002/input/input5  U: Uniq=  H: Handlers=sysrq kbd event4  B: PROP=0  B: EV=100013  B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe  B: MSC=10  

That file format is explained well here

In the HyperX case, there are five different handlers available (can be more/less in others):

  1. handler for keyboard events, standard mode
  2. mouse handler (e.g. remote USB keyboard witch touchpad). I'm assuming it is always there by design
  3. just by referring to its name "System Control", it provides events for power, sleep, etc.
  4. referring to "Consumer Control", it provides events for multimedia and related special keys
  5. handler for NKRO events

I can find the "standard mode" keyboard handler easily by looking for EV=120013 (I'm not sure if it is a proper way either). In that particular case I could look for other entries with an identical bitmap of supported keys, but unfortunately in Havit case that bitmap is pretty different. Another pattern that I see and might be useful is to look for sysrq in handlers, However, I don't know what it means.

And that's it.

How can I properly find both standard mode and NKRO handlers for given keyboard?

Find with `-exec` but with a delay

Posted: 03 Nov 2021 09:16 AM PDT

I have this code to optimize image size of all my images inside /dir directory:

find /dir/ -iregex ".*\.\(jpg\|jpeg\)" -exec jpegoptim --strip-all {} \;  

When I run this code, it consumes a lot of my server CPU. So I am wondering: is it possible to me add a delay between each exec? For example, I want 100 miliseconds of delay between each time exec is called to every image, this way the CPU does not get very busy.

What would you suggest? My server is running Centos 8.

Downloading packages: warning yum

Posted: 03 Nov 2021 08:57 AM PDT

after yum update

Downloading packages:  warning: /var/cache/yum/x86_64/7/centreon-stable-noarch/packages/centreon-plugins-sudoers-1.0.0-6.el7.centos.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 3fc49c1b: NOKEY  Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CES      The GPG keys listed for the "Centreon open source software repository." repository are already installed but they are not correct for this package.  Check that the correct key URLs are configured for this repository.       Failing package is: centreon-plugins-sudoers-1.0.0-6.el7.centos.noarch   GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CES  

bash: Read from stdin until a string delimiter

Posted: 03 Nov 2021 08:27 AM PDT

Let's say I have two files containing arbitrary bytes: ./delimiter and ./data.

I want to read from ./data up to and excluding the first occurrence of the byte sequence in ./delimiter.

How would I do this using Bash?

Example:

  • Content of ./delimiter
    world  
  • Content of ./data
    helloworld  
  • Expected result:
    hello  

Similar/Equivalent Question:

Note: read -d delim does not solve my problem, because it only support a single-character delimiter, not a string. Also, it stores the result in a variable, and variables don't support NUL bytes. I want the output on stdout.

bash script commands seperated by space [duplicate]

Posted: 03 Nov 2021 08:30 AM PDT

Saying that I have a bash script /home/me/test/sh:

#!/bin/bash    # cmd                              # here is the output of the cmd  pwd echo 'aaa'                     # /home/me  val=pwd echo 'aaa'                 # aaa  val=pwd echo 'aaa'$val             # aaa    val=pwd echo 'aaa' && echo $val    # aaa <and an empty line>  

I can't quite understand how these bash codes seperated by a space works.

BTW, I pose this question because I just installed ROS and a bash script named setup.sh was generated, and I'm reading this script. There is a line as below:

CATKIN_SHELL=bash /opt/ros/kinetic/_setup_util.py >> file.log  

Youtube sound cutting out when using bluetooth headphones on Fedora

Posted: 03 Nov 2021 09:05 AM PDT

So when watching a YouTube video on my Fedora machine, the sound will cut out, and then a few second later a white loading circle will appear on the video. I suspect a related problem might be that when I try to listen to spotify, a similar problem arises where it says "The Current Song Cannot be Played" for every single song. These problems seemed to have cropped up since I moved the machine to a new office, so could a change in network cause them somehow? I also have noticed significantly increased lag.

Relevant details: Browser: Chrome Headphones: Bluetooth (any) OS: Fedora 27

Thanks!

UPDATE: I was able to fix my problem by reducing the number of bluetooth devices (wireless usb mouse, needed to use a wired keyboard, as for some reason even the wireless usb keyboard was causing issues.) and moving my tower so that it had a direct line to my headphones without going through my desk.

How do I pass a variable from a shell script to my .muttrc?

Posted: 03 Nov 2021 07:59 AM PDT

I'd like mutt (mutt-kz, actually -- I'd love to migrate to neomutt but that's a bigger project) to get my SMTP password from pass so I don't have to keep it stored in cleartext in my config file, but I'm not sure how to properly pass the password into my .muttrc.

This is what I have in .muttrc:

source ~/.mutt/pass.sh|  set smtp_pass = $my_pass  

And then .mutt/pass.sh contains:

#! /bin/bash  my_pass=$(pass Example/user)  

If I add echo ${my_pass} to pass.sh and run it from the command line, it does echo my password.

When I launch mutt-kz I'm prompted to unlock my pass gpg key, so something is working, but when I try to send mail from Mutt it asks for my SMTP password and fails if I don't provide it the message isn't sent: ("SASL authentication failed")

So ... how do I correctly pass the variable from my shell script to my .muttrc?

I need to find all users home directories listed using grep from /etc/passwd

Posted: 03 Nov 2021 09:25 AM PDT

I have a question similar to another one on this site where the individual had to find a list of all users using grep or awk from /etc/passwd. That worked for me but I've tried translating it to find and list the home directories of them also. I already know you can't do it in one line so I know I would use a pipeline. I've done my research online but I can't figure it out the problem is. If I use grep and do something like the following:

   grep -oE '^[/*/]$' /etc/passwd   

...i t would probably give me an error or it will also show me the /bin/bash files which is not what I want. I just need the user names and their home directories listed using grep! I'm also not sure if the * will show other forward-slashes as characters, as some home directories have more than just two /'s (forward-slashes).

Arch linux ( kvm/qemu virtualization ) failed to open libiscsi.so.4

Posted: 03 Nov 2021 08:04 AM PDT

I have fallowed the steps from Arch Linux #KVM and #qemu

1) sudo pacman -S then installed libs

libvirt  libiscsi   libaio  qemu  qemu-arch-extra   qemu-block-iscsi   qemu-block-rbd   qemu-block-gluster   

2) $ lscpu check if VT-x is enabled

3) added the .conf file in the /etc/modprobe.d/ for the fallowing modules:

network device (virtio-net)  block device (virtio-blk)  controller device (virtio-scsi)  serial device (virtio-serial)  balloon device (virtio-balloon)  

4) I have included and run the mkinitcpio.conf the modconf hook to load the modules in initramfs.

5) run $ lsinitcpio

I think is an issues here because in the output i don't see any virtualization module loaded:

usr/lib/modules  usr/lib/modules/4.5.4-1-ARCH  usr/lib/modules/4.5.4-1-ARCH/modules.devname  usr/lib/modules/4.5.4-1-ARCH/modules.builtin.bin  usr/lib/modules/4.5.4-1-ARCH/modules.symbols.bin  usr/lib/modules/4.5.4-1-ARCH/modules.alias.bin  usr/lib/modules/4.5.4-1-ARCH/modules.dep.bin  usr/lib/modules/4.5.4-1-ARCH/kernel  usr/lib/modules/4.5.4-1-ARCH/kernel/sdhci.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/ext4.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/usb-common.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/ehci-pci.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/sd_mod.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/rtsx_pci_sdmmc.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/serio.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/cdrom.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/hid.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/ehci-hcd.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/sdhci-acpi.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/atkbd.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/xhci-pci.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/usbhid.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/xhci-hcd.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/sr_mod.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/crc16.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/rtsx_pci.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/libps2.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/libahci.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/led-class.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/scsi_mod.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/mmc_core.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/mmc_block.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/i8042.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/usbcore.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/ahci.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/libata.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/mbcache.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/usb-storage.ko  usr/lib/modules/4.5.4-1-ARCH/kernel/jbd2.ko  

6) When I run :

$ modinfo virtio-scsi I get the fallowing answer :

filename:       /lib/modules/4.5.4-1-ARCH/kernel/drivers/scsi/virtio_scsi.ko.gz  license:        GPL  description:    Virtio SCSI HBA driver  alias:          virtio:d00000008v*  depends:        virtio,scsi_mod,virtio_ring  intree:         Y  vermagic:       4.5.4-1-ARCH SMP preempt mod_unload modversions   

$ systool -v -m virtio-scsi and here for same module I get an error msg:

Error opening module `virtio-scsi`  

7) And when I try to create a qemu image $ qemu-img create -f raw arch-qemu 8G i get the fallowing error:

$ Failed to open module:libiscsi.so.4: cannot open shared object file: No such file or directory

Any help is appreciated !

Change the password for many accounts at once in Gnome Keyring

Posted: 03 Nov 2021 08:02 AM PDT

I use Gnome Keyring as the password storage backend for various applications. Many of the entries are for different ways to log into the same account, accessed through different means. I've changed my password on this account, now I want to update all the entries in my keyring.

I usually use Seahorse to edit the keyring, but it only lets me edit individual entries with a slightly awkward sequence of key presses or mouse clicks. With many passwords to change, that's tedious.

How can I update my password for many entries in Gnome Keyring efficiently, i.e. without having to type it again and again?

VNC/SSH: How to execute a command after logging in?

Posted: 03 Nov 2021 07:01 AM PDT

I'm looking for a way to create a VNC console user that executes the command screen or bash immediately after logging in so they get their own restricted shell for executing commands etc. Screen/bash will be pre-configured to handle all security issues. The VNC console also has to terminate once the user types the exit/logout command as I don't want them to access the rest of the system.

I have already looked through the documentation of TigerVNC and TightVNC but couldn't find anything useful.

If this is not possible with VNC, a SSH console can work as well.

The server's OS is CentOS.

IMAP Dovecot cannot connect

Posted: 03 Nov 2021 09:04 AM PDT

I am trying to set up my own mail server (for 'fun'). I followed this tutorial to the bone. But I get this error message:

imap-login: Disconnected (auth failed, 2 attempts in 9 secs): user=<dayuloli@mydomain.com>, method=PLAIN, rip=203.210.7.43, lip=1.2.3.4, TLS: Disconnected, session=<VDW4ua8NzADL0gcr>  

I am using the SSL certificate and key I have for my nginx web server, on the same machine.

I disabled plaintext authentication by adding these two lines (as per tutorial) to /etc/dovecot/conf.d/10-auth.conf:

disable_plaintext_auth = yes  auth_mechanisms = plain login  

But the method in the log entry still says PLAIN, and TLS is Disconnected. Could that be an issue?

There're too many configurations to post them all here. if you think you need more information, please tell me which parts and I will update my question.

How to make tar save the archive on a remote machine using sftp or ftp?

Posted: 03 Nov 2021 07:34 AM PDT

I would like to backup some of my very important data on a remote machine.
Currently I'm just saving it to my local machine by using this command: tar -cvjf ~/backups/Backup.tar.bz2 ~/importantfiles/*

I would prefer not using another command to transger it to the remote machine, meaning I would like to just have this command being upgraded so it can transfer the data to the remote machine.

This is designed to be in a script later that is suposed to run on its own, meaning any type of required user input would completly mess it up!

Something like

tar -cvjf sftp://user:pwassword@host/Backup.tar.bz2 ~/importantfiles/*  tar -cvjf  ftp://user:pwassword@host/Backup.tar.bz2 ~/importantfiles/*  

would be perfect! (No pipes (etc.), just one command!)

A standard tool to convert a byte-count into human KiB MiB etc; like du, ls1

Posted: 03 Nov 2021 08:54 AM PDT

Is there a standard tool which converts an integer count of Bytes into a human-readable count of the largest possible unit-size, while keeping the numeric value between 1.00 and 1023.99 ?

I have my own bash/awk script, but I am looking for a standard tool, which is found on many/most distros... something more generally available, and ideally has simple command line args, and/or can accept piped input.

Here are some examples of the type of output I am looking for.

    1    Byt      173.00 KiB       46.57 MiB        1.84 GiB       29.23 GiB      265.72 GiB        1.63 TiB    

Here is the bytes-human script (used for the above output)

awk -v pfix="$1" -v sfix="$2" 'BEGIN {         split( "Byt KiB MiB GiB TiB PiB", unit )        uix = uct = length( unit )        for( i=1; i<=uct; i++ ) val[i] = (2**(10*(i-1)))-1     }{ if( int($1) == 0 ) uix = 1; else while( $1 < val[uix]+1 ) uix--        num = $1 / (val[uix]+1)        if( uix==1 ) n = "%5d   "; else n = "%8.2f"        printf( "%s"n" %s%s\n", pfix, num, unit[uix], sfix )      }'  

Update  Here is a modified version of Gilles' script, as described in a comment to his answer ..(modified to suit my preferred look).

awk 'function human(x) {           s=" B   KiB MiB GiB TiB EiB PiB YiB ZiB"           while (x>=1024 && length(s)>1)                  {x/=1024; s=substr(s,5)}           s=substr(s,1,4)           xf=(s==" B  ")?"%5d   ":"%8.2f"           return sprintf( xf"%s\n", x, s)        }        {gsub(/^[0-9]+/, human($1)); print}'  

No comments:

Post a Comment