Sunday, July 10, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


GNOME Wayland gestures not working

Posted: 10 Jul 2022 06:54 AM PDT

I use Opensuse Tumbleweed with Gnome. Normally with Gnome, you can always swipe from the top left corner of your screen to the middle to open activities. I mean with a Touchscreen.

PROBLEM:

The problem is, this gesture doesn't work with Wayland. When I use Xorg, this gesture works perfectly (but mousepad gestures won't work). I really want to use Wayland. But this simple gesture doesn't work.

QUESTION:

Is there any way to make the top left corner swiping gesture work in Gnome Wayland?

Why doesn't sudo always spawn a shell sub-process?

Posted: 10 Jul 2022 06:59 AM PDT

I am trying to understand why some shells seem to receive a special treatment when called with sudo. For instance, there seem to be two possible behaviours:

The "implicit" group (pstree is a direct child of sudo, no shell in between):

$ sudo pstree -s $$  systemd───login───bash───sudo───pstree  $ sudo bash -c 'pstree -s $$'  systemd───login───bash───sudo───pstree  $ sudo zsh -c 'pstree -s $$'  systemd───login───bash───sudo───pstree  $ sudo dash -c 'pstree -s $$'  systemd───login───bash───sudo───pstree  

The "explicit" group (the shell is a direct child of sudo):

$ sudo ksh -c 'pstree -s $$'  systemd───login───bash───sudo───ksh───pstree  $ sudo tcsh -c 'pstree -s $$'  systemd───login───bash───sudo───tcsh───pstree  $ sudo fish -c 'pstree -s $fish_pid'  systemd───login───bash───sudo───fish───pstree  

There is obviously seem to be some kind of integration happening between sudo and some shells, but I could find no documentation on it. I also grepped the source code of both sudo and bash but could find no clue there either.

This other question seems related: Why (...) doesn't spawn a new child process when run in background?

My versions of sudo and bash are:

$ sudo --version  Sudo version 1.8.29  ...  $ bash --version  GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)  ...  

Postfix : setting relayhost to Office 365

Posted: 10 Jul 2022 05:23 AM PDT

I am trying to relay emails to Office 365 and have configured postfix as follows:

meta_directory = /etc/postfix  shlib_directory = /usr/lib64/postfix  myhostname = mail.disorderly-order.com  mydomain = disorderly-order.com  myorigin = $mydomain  mynetworks = 127.0.0.0/8, 10.10.0.0/16  smtp_generic_maps = hash:/etc/postfix/generic  relayhost = disorderlyorder-com02e.mail.protection.outlook.com  

I have followed instructions on this website to setup the connector: http://kb.eclipseinc.com/kb/postfix-relay-office365/. I have set relayhost as disorderlyorder-com02e.mail.protection.outlook.com which is the value for the MX record.

When I send mail, nothing goes through. Below is my journalctl logs. I can see it sending email to root@disorderly-order.com but I haven't sent any email to this address. I have only sent emails to slee@disorderly-order.com.

Jul 10 22:04:40 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 27A0D10136330: from=<root@disorderly-order.com>, size=488, nrcpt=1 (queue active)  Jul 10 22:04:40 vxmail.livedemo.vdevops.info postfix/smtp[740108]: 27A0D10136330: to=<slee@disorderly-order.com>, relay=disorderlyorder-com02e.mail.protection.outlook.com[104.47.71.202]:>  Jul 10 22:04:40 vxmail.livedemo.vdevops.info postfix/cleanup[740106]: F0E0510136331: message-id=<20220710120440.F0E0510136331@mail.disorderly-order.com>  Jul 10 22:04:40 vxmail.livedemo.vdevops.info postfix/bounce[740109]: 27A0D10136330: sender non-delivery notification: F0E0510136331  Jul 10 22:04:40 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: F0E0510136331: from=<>, size=3299, nrcpt=1 (queue active)  Jul 10 22:04:40 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 27A0D10136330: removed  Jul 10 22:04:41 vxmail.livedemo.vdevops.info postfix/smtp[740108]: F0E0510136331: to=<root@disorderly-order.com>, relay=disorderlyorder-com02e.mail.protection.outlook.com[104.47.71.138]:>  Jul 10 22:04:41 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: F0E0510136331: removed  Jul 10 22:05:26 vxmail.livedemo.vdevops.info postfix/pickup[740098]: 62B9C10136330: uid=0 from=<root>  Jul 10 22:05:26 vxmail.livedemo.vdevops.info postfix/cleanup[740106]: 62B9C10136330: message-id=<20220710120526.62B9C10136330@mail.disorderly-order.com>  Jul 10 22:05:26 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 62B9C10136330: from=<root@disorderly-order.com>, size=910, nrcpt=1 (queue active)  Jul 10 22:05:26 vxmail.livedemo.vdevops.info postfix/smtp[740108]: 62B9C10136330: to=<root@disorderly-order.com>, orig_to=<root>, relay=disorderlyorder-com02e.mail.protection.outlook.com>  Jul 10 22:05:27 vxmail.livedemo.vdevops.info postfix/cleanup[740106]: 0DCAC10136331: message-id=<20220710120527.0DCAC10136331@mail.disorderly-order.com>  Jul 10 22:05:27 vxmail.livedemo.vdevops.info postfix/bounce[740109]: 62B9C10136330: sender non-delivery notification: 0DCAC10136331  Jul 10 22:05:27 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 0DCAC10136331: from=<>, size=3626, nrcpt=1 (queue active)  Jul 10 22:05:27 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 62B9C10136330: removed  Jul 10 22:05:27 vxmail.livedemo.vdevops.info postfix/smtp[740108]: 0DCAC10136331: to=<root@disorderly-order.com>, relay=disorderlyorder-com02e.mail.protection.outlook.com[104.47.71.202]:>  Jul 10 22:05:27 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 0DCAC10136331: removed  Jul 10 22:06:26 vxmail.livedemo.vdevops.info postfix/pickup[740098]: 77AA310136330: uid=0 from=<root>  Jul 10 22:06:26 vxmail.livedemo.vdevops.info postfix/cleanup[740106]: 77AA310136330: message-id=<20220710120626.77AA310136330@mail.disorderly-order.com>  Jul 10 22:06:26 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 77AA310136330: from=<root@disorderly-order.com>, size=910, nrcpt=1 (queue active)  Jul 10 22:06:27 vxmail.livedemo.vdevops.info postfix/smtp[740108]: 77AA310136330: to=<root@disorderly-order.com>, orig_to=<root>, relay=disorderlyorder-com02e.mail.protection.outlook.com>  Jul 10 22:06:27 vxmail.livedemo.vdevops.info postfix/cleanup[740106]: 233FA10136331: message-id=<20220710120627.233FA10136331@mail.disorderly-order.com>  Jul 10 22:06:27 vxmail.livedemo.vdevops.info postfix/bounce[740109]: 77AA310136330: sender non-delivery notification: 233FA10136331  Jul 10 22:06:27 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 233FA10136331: from=<>, size=3626, nrcpt=1 (queue active)  Jul 10 22:06:27 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 77AA310136330: removed  Jul 10 22:06:27 vxmail.livedemo.vdevops.info postfix/smtp[740108]: 233FA10136331: to=<root@disorderly-order.com>, relay=disorderlyorder-com02e.mail.protection.outlook.com[104.47.71.202]:>  Jul 10 22:06:27 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 233FA10136331: removed  Jul 10 22:07:26 vxmail.livedemo.vdevops.info postfix/pickup[740098]: 853A310136330: uid=0 from=<root>  Jul 10 22:07:26 vxmail.livedemo.vdevops.info postfix/cleanup[740106]: 853A310136330: message-id=<20220710120726.853A310136330@mail.disorderly-order.com>  Jul 10 22:07:26 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 853A310136330: from=<root@disorderly-order.com>, size=910, nrcpt=1 (queue active)  Jul 10 22:07:27 vxmail.livedemo.vdevops.info postfix/smtp[740108]: 853A310136330: to=<root@disorderly-order.com>, orig_to=<root>, relay=disorderlyorder-com02e.mail.protection.outlook.com>  Jul 10 22:07:27 vxmail.livedemo.vdevops.info postfix/cleanup[740106]: 2F6B810136331: message-id=<20220710120727.2F6B810136331@mail.disorderly-order.com>  Jul 10 22:07:27 vxmail.livedemo.vdevops.info postfix/bounce[740109]: 853A310136330: sender non-delivery notification: 2F6B810136331  Jul 10 22:07:27 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 2F6B810136331: from=<>, size=3626, nrcpt=1 (queue active)  Jul 10 22:07:27 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 853A310136330: removed  Jul 10 22:07:27 vxmail.livedemo.vdevops.info postfix/smtp[740108]: 2F6B810136331: to=<root@disorderly-order.com>, relay=disorderlyorder-com02e.mail.protection.outlook.com[104.47.71.202]:>  Jul 10 22:07:27 vxmail.livedemo.vdevops.info postfix/qmgr[740099]: 2F6B810136331: removed    

I have also tried creating a mapping for the root user to a valid email address. It is not working as I can still see the sender as root@disorderly-order.com in journalctl. Here is what I did.

Added the following line to /etc/postfix/main.cf:

smtp_generic_maps = hash:/etc/postfix/generic  

Addeed the required email address alias to /etc/postfix/generic:

root slee@disorderly-order.com  

Created the hash file and reload postfix:

postmap /etc/postfix/generic  service postfix reload  

Insert environment variable in system files - Lubuntu 22

Posted: 10 Jul 2022 04:47 AM PDT

Is it possible to insert environment variables in a YAML file in /etc/netplan/ to change IP, gateway or DNS dynamically? Can I do the same for HOSTNAME in /etc/host and the various .sh scripts in /etc/init.d?

I want to set a Lubuntu 22 client with a "standard template" and I need to change all configuration files dynamically accordingly to certain environment variables.

For example: changing env vars IP, HOSTNAME, DNS, WEB-URL, SLEEP-TIME and a final reboot, automatically set-up my client with the new env values distributed in various sh, YAML and host files in the file system without needing to rewrite all conf files manually. Is it possible to use the $IP, $HOSTNAME declaration, for example, in system conf files like YAML or fstab?

NTFS mount under Linux: Slow transfer speeds

Posted: 10 Jul 2022 06:31 AM PDT

I am migrating my home server from Windows to Ubuntu server 22.04. Some of the data I am migrating is on an NTFS drive and I want to transfer this data to a new (second) drive which is using XFS. However I am encountering very low transfer speeds ranging from 40 MB/s to 1 MB/s. Hdparm gives read speeds of around 230 MB/s unbuffered for the drives in question.

The drives are connected via motherboard SATA but I get similar results via an HBA (LSI 9211-8i IT mode) well. The drives are Seagate iron wolf 10Tb and 8Tb spinning disks. The motherboard is a gigabyte X399 aorus xtreme running an AMD threadripper 1920x. The files are mixed: video files (average 4GB) photos (8-20MB) and lots of smaller files >10 Mb.

While the drives were both connected in the Ubuntu server (via sata) I was getting transfer speeds of 1-3 MB/s using cp and around 7-8 MB/s using rsync. Not sure if it makes any difference but I formatted the XFS drives with the reverse mapping b-tree option (-m rmapbt=1).

The fstab entry for the xfs drive has the following options: auto,rw,sync,noexec,nodev,nosuid,nofail,x-gvfs-show,x-gvfs-name=sdisk2

When the ntfs drive was mounted in the Linux server it had the following fstab mount options: auto ro 0 0

From my basic google-fu I have managed to test:

  1. checking write-cache - confirmed enabled on the drives in question.
  2. potential bottleneck with NTFS drivers under Linux - see below.
  3. moving sata ports - this made no difference.

To test point 2 I connected the NTFS drive to a wired network windows box and then made the XFS drive available via samba - this increased the transfer speed to around 30-40MB/s - using explorer. So maybe part of the issue was the Linux NTFS driver. This is the best result thus far, but I assume this is well below what should be expected, at least based on my previous windows-only transfer experience.

I not sure what else to check. I am relatively new to Linux (learning a lot over the past two weeks) and would be grateful for any assistance.

Thanks,

FM

How do I prevent systemd-suspend.service and systemd.target from running after waking up from suspend?

Posted: 10 Jul 2022 03:30 AM PDT

The problem

Sometimes when I suspend my machine and wake up from the suspend, systemd-suspend.service and systemd.target still runs.

This causes chaos on my system, some apps won't open, I can't go into the tty, I can't logout the session, I can't even reboot through the terminal. It basically breaks everything on my system

My attempted solutions

The only way I've handled this is to force reboot the system by holding the power button on my laptop, and frankly I'm tired of doing that.

I've tried cancelling systemd-suspend.service and systemd.target by using systemctl cancel {PID} but it still breaks my system

What I want

I want for systemd-suspend.service and systemd.target to NOT run after I wake up from a suspend

Some info about my machine

Distro: EndeavourOS
GPU: Nvidia GeForce GTX 1650 Mobile / Max-Q
WM: OpenBox
Display Manager: LightDM
Kernel Version: 5.18.10-arch1-1
Laptop Model: MSI GF63 Thin 11SC

Slackware(64) 14.2 + Xephyr using chroot, umount partitions

Posted: 10 Jul 2022 03:28 AM PDT

This Exact Same Question i first time i do was ib -> https://www.linuxquestions.org/questions/showthread.php?p=6366697#post6366697

i need improve my script :

For close the Xephyr window automatically after click xfce4-session and for use the safest way to umount partiions after finish inside of chroot env.

---- You can ignore this part ---- : i have write a own script (on spanish, because i am from venezuela) for mount chroot and start in gracphical env inside a Xephyr Window from Virtual HardDrive, the idea of this script is make the folow things :

01 - Run like root 02 - Mount the Hard Drive (in this case is image qcow2 format) 03 - Mount the partition 04 - Start chroot 05 - Start Xephyr 06 - Run some commands inside chroot 07 - Xephyr window start xfce4-session 08 - Wait until Xephyr finish 09 - When Xephyr finish, start the umount of partitions 10 - Finish the script with "exit 0"

---- The follow part is the important ---- :

Ok here the code i had right now :

#!/usr/bin/env bash    echo '  Autor ----------------> Inukaze ( Venezuela )  Sitio ----------------> https://goo.gl/ij6WqW  Correo-E -------------> bloginukaze@gmail.com  Licencia -------------> GPL 2  '    #Establecer mediante la variable "$OBJETIVO"   #La particion con una distribucion a la cual se accedera mediante chroot  export OBJETIVO="/media/ddvirt"  mkdir -p "$OBJETIVO"    #Prevenir que se autoejecuten las funciones que se definiran despues  unset montar  unset desmontar  unset MensajeBase  unset xephyr    #Establecer y definir funciones :  function MensajeBase()  {  echo -e "\nLa forma correcta de utilizar este guion es :\n$0 «montar» , «xephyr» ó «desmontar», Por ejemplo : \n"  echo -e "$0 montar"  echo -e "$0 xephyr (Modo Ventana)"  echo -e "$0 desmontar\n"  }    function montar(){  #Desmontar en caso de que estuviera montado previamente :  umount /dev/nbd0p1              2>/dev/null ; \  qemu-nbd --disconnect /dev/nbd0 1>/dev/null ; \  #Preparar para montar el disco duro virtual  modprobe nbd max_part=8  qemu-nbd --connect=/dev/nbd0 /home/inukaze/.aqemu/Slack64-15.0.qcow2 2>/dev/null  mount /dev/nbd0p1 "$OBJETIVO" 2>/dev/null    #Preparar acceso para programas de entorno grafico :  export DISPLAY=:0.0 2>/dev/null  xhost + local 2>/dev/null    #Montar todo de una vez para una distro de 64 Bits (En este caso Slackware64 15.0) :   mount --rbind /proc                         "$OBJETIVO/proc"                    ; \  mount --make-rslave                     "$OBJETIVO/proc"                    ; \  mount --rbind /sys                          "$OBJETIVO/sys"                     ; \  mount --make-rslave                     "$OBJETIVO/sys"                     ; \  mount --rbind /dev                          "$OBJETIVO/dev"                 ; \  mount --make-rslave                     "$OBJETIVO/dev"                 ; \  mount --rbind /run                          "$OBJETIVO/run"                 ; \  mount --make-rslave                     "$OBJETIVO/run"                 ; \  mount --rbind /tmp                          "$OBJETIVO/tmp"                 ; \  mount --make-rslave                     "$OBJETIVO/tmp"                 ; \  mount --bind /etc/fstab                 "$OBJETIVO/etc/fstab"               ; \  mount --bind /etc/hostname          "$OBJETIVO/etc/hostname"        ; \  mount --bind /etc/hosts                 "$OBJETIVO/etc/hosts"           ; \  mount --bind /etc/resolv.conf           "$OBJETIVO/etc/resolv.conf" ; \    cat << EOF | chroot "$OBJETIVO"  export DISPLAY=:1.0 2>/dev/null  EOF    chroot                                  "$OBJETIVO" /bin/bash -l                    ; \  umount                              "$OBJETIVO"                                     ; \  mount -a 2>/dev/null  }    function xephyr(){  umount "$OBJETIVO/etc/resolv.conf" 2>/dev/null  umount "$OBJETIVO/etc/hosts" 2>/dev/null  umount "$OBJETIVO/etc/hostname" 2>/dev/null  umount "$OBJETIVO/etc/fstab" 2>/dev/null  umount "$OBJETIVO/lib/modules" 2>/dev/null  umount "$OBJETIVO/var/lib/dbus" 2>/dev/null  umount "$OBJETIVO/var/run/dbus" 2>/dev/null  umount "$OBJETIVO/tmp"   2>/dev/null  umount "$OBJETIVO/run" 2>/dev/null  umount "$OBJETIVO/dev/pts" 2>/dev/null  umount -l "$OBJETIVO/dev" 2>/dev/null  umount -l "$OBJETIVO/sys" 2>/dev/null  umount "$OBJETIVO/proc" 2>/dev/null  umount -l /dev/ndb0p1 2>/dev/null  sleep 7  qemu-nbd --disconnect /dev/nbd0 1>/dev/null  modprobe nbd max_part=8  qemu-nbd --connect=/dev/nbd0 /home/inukaze/.aqemu/Slack64-15.0.qcow2  sleep 3  mount /dev/nbd0p1 "$OBJETIVO"    #Copiar archivo de autorizacion X.Org :  rm -f "$OBJETIVO/home/inukaze/.Xauthority"  rm -f "$OBJETIVO/root/.Xauthority"  cp -f "/home/inukaze/.Xauthority" "$OBJETIVO/root/.Xauthority"  cp -f "/home/inukaze/.Xauthority" "$OBJETIVO/home/inukaze/.Xauthority"    chown inukaze:users "$OBJETIVO/home/inukaze/.Xauthority"    echo ""    if [ ! -f "$OBJETIVO/etc/X11/Xwrapper.config" ] ; then  # Prevenir el error « /usr/libexec/Xorg.wrap: Only console users are allowed to run the X server »  echo '# Xwrapper.config (Debian X Window System server wrapper configuration file)  #  # This file was generated by the post-installation script of the x11-common  # package using values from the debconf database.  #  # See the Xwrapper.config(5) manual page for more information.  #  # This file is automatically updated on upgrades of the x11-common package  # *only* if it has not been modified since the last upgrade of that package.  #  # If you have edited this file but would like it to be automatically updated  # again, run the following command as root:  #   dpkg-reconfigure x11-common  #allowed_users=console  allowed_users=anybody' | tee "$OBJETIVO/etc/X11/Xwrapper.config"  fi    echo ""    #Preparar acceso para programas de entorno grafico :  $(export DISPLAY=:0.0)  $(xhost + local 2>/dev/null)    #Montar todo de una vez para una distro de 64 Bits (En este caso Slackware64 15.0) :   mount --rbind /proc                     "$OBJETIVO/proc"                                                    ; \  mount --make-rslave                 "$OBJETIVO/proc"                                                    ; \  mount --rbind /sys                      "$OBJETIVO/sys"                                                     ; \  mount --make-rslave                 "$OBJETIVO/sys"                                                     ; \  mount --rbind /dev                      "$OBJETIVO/dev"                                                 ; \  mount --make-rslave                 "$OBJETIVO/dev"                                                 ; \  mount --rbind /dev/pts              "$OBJETIVO/dev/pts"                                             ; \  mount --make-rslave                 "$OBJETIVO/dev/pts"                                             ; \  mount --rbind /run                      "$OBJETIVO/run"                                                 ; \  mount --make-rslave                 "$OBJETIVO/run"                                                 ; \  mount --rbind /tmp                      "$OBJETIVO/tmp"                                                 ; \  mount --make-rslave                 "$OBJETIVO/tmp"                                                 ; \  mount --rbind /var/run/dbus     "$OBJETIVO/var/run/dbus"                                        ; \  mount --make-rslave                 "$OBJETIVO/var/run/dbus"                                        ; \  mount --rbind /var/lib/dbus         "$OBJETIVO/var/lib/dbus"                                        ; \  mount --make-rslave                 "$OBJETIVO/var/lib/dbus"                                        ; \  mount --rbind /lib/modules          "$OBJETIVO/lib/modules"                                         ; \  mount --make-rslave                 "$OBJETIVO/lib/modules"                                         ; \  mount --bind /etc/fstab             "$OBJETIVO/etc/fstab"                                               ; \  mount --bind /etc/hostname      "$OBJETIVO/etc/hostname"                                        ; \  mount --bind /etc/hosts             "$OBJETIVO/etc/hosts"                                           ; \  mount --bind /etc/resolv.conf       "$OBJETIVO/etc/resolv.conf"                                 ; \    $(Xephyr -screen 1070x887 -ac -br -reset -terminate :1.0 \  +extension Composite \  +extension DAMAGE \  +extension DOUBLE-BUFFER \  +extension DPMS \  +extension GLX \  +extension MIT-SCREEN-SAVER \  +extension MIT-SHM \  +extension RANDR \  +extension RENDER \  +extension X-Resource \  +extension XFIXES \  +extension XTEST \  +extension XVideo \  +iglx \  2>/dev/null &)    export xerphid=$(pidof "Xephyr")    cat << EOF | chroot "$OBJETIVO"  $(export DISPLAY=:1.0 2>/dev/null)   EOF    chroot                                  "$OBJETIVO" /bin/bash -l        <<"EOT"  #Primero Detectar Particiones, Crear Directorios dentro de /media y finalmente montarlas  #Nombre De Particion :  #   NPD1="1SlackIni"    # Esta es la particion /boot de la particion que estoy usando en chroot      NPD2="72GB"      NPD3="Compartido"      NPD4="2SlackIni"      NPD5="Slack64"  #Esta es la particion Anfrition, ya que intercambiare datos, la necesito montar.    #Parte de la Particion  #   PPD1=$(blkid -l -t LABEL="$NPD1" | awk '{print $01}' | sed 's/:.*//g')      PPD2=$(blkid -l -t LABEL="$NPD2" | awk '{print $01}' | sed 's/:.*//g')      PPD3=$(blkid -l -t LABEL="$NPD3" | awk '{print $01}' | sed 's/:.*//g')      PPD4=$(blkid -l -t LABEL="$NPD4" | awk '{print $01}' | sed 's/:.*//g')      PPD5=$(blkid -l -t LABEL="$NPD5" | awk '{print $01}' | sed 's/:.*//g')  $(mkdir -p /media/"$NPD2" ; mount "$PPD2" /media/"$NPD2" )  $(mkdir -p /media/"$NPD3" ; mount "$PPD3" /media/"$NPD3" )  $(mkdir -p /media/"$NPD4" ; mount "$PPD4" /media/"$NPD4" )  $(mkdir -p /media/"$NPD5" ; mount "$PPD5" /media/"$NPD5" )  #$(USER="inukaze" ; gpasswd -a $USER video)  $(rm -rf /tmp/.X1-lock)  $(chown root:root /tmp/.ICE-unix)  $(su - inukaze)    $(export DISPLAY=:1)  $(DISPLAY=:1 "/usr/bin/xfce4-session" -- :1 2>/dev/null &)  EOT    #Esperar que Xephyr sea cerrado para desmontar particiones :  tail --pid="$xerphid" -f /dev/null  sleep 120  umount "$OBJETIVO/etc/resolv.conf"    umount "$OBJETIVO/etc/hosts"          umount "$OBJETIVO/etc/hostname"  umount "$OBJETIVO/etc/fstab"          umount "$OBJETIVO/lib/modules"        umount "$OBJETIVO/var/lib/dbus"       umount "$OBJETIVO/var/run/dbus"  umount "$OBJETIVO/tmp"                umount -l "$OBJETIVO/run"  umount "$OBJETIVO/dev/pts"            umount -l "$OBJETIVO/dev"  umount -l "$OBJETIVO/sys"  umount "$OBJETIVO/proc"  umount -l /dev/ndb0p1  qemu-nbd --disconnect /dev/nbd0     1>/dev/null  sleep 7  mount -a                            2>/dev/null    }      function desmontar(){    # Desmontar  umount "$OBJETIVO/etc/resolv.conf"    umount "$OBJETIVO/etc/hosts"  umount "$OBJETIVO/etc/hostname"  umount "$OBJETIVO/etc/fstab"  umount "$OBJETIVO/lib/modules"  umount "$OBJETIVO/var/lib/dbus"  umount "$OBJETIVO/var/run/dbus"  umount "$OBJETIVO/tmp"  #umount -l "$OBJETIVO/run"          2>/dev/null  umount "$OBJETIVO/run"  umount "$OBJETIVO/dev/pts"  #umount -l "$OBJETIVO/dev"          2>/dev/null  umount "$OBJETIVO/dev"  #umount -l "$OBJETIVO/sys"          2>/dev/null  umount "$OBJETIVO/sys"  umount "$OBJETIVO/proc"  #umount -l /dev/ndb0p1                  2>/dev/null  umount -l /dev/ndb0p1                   2>/dev/null  qemu-nbd --disconnect /dev/nbd0     1>/dev/null  sleep 7  mount -a                                            2>/dev/null    }      #Este guión necesita ser ejecutado como SuperUsuario  #o en su defecto con permisos administrativos suficientes  #Para montar / desmontar particiones.    if [ "$(whoami)" != root ]; then        echo      echo      echo 'Por favor ejecuta este guion como SuperUsuario (root)'      echo      echo 'Utilize este guión bajo su Propio Riesgro'      echo 'El Autor , o sea yo , no me hago responsable'      echo 'de las consecuencias imprevistas que puedan'      echo 'acontecer en tu sistema operativo'      echo  else    # Proceder en caso de tener los permisos suficientes para montar/desmontar particiones :    #Si el usuario no pasa ningun parametro iniciar directamente en "Xephyr"  #En la interfaz de linea de comandos (ILC / CLI ) indicar como se puede usar este guion                if [ -z "$1" ]; then                      echo                      MensajeBase                      echo                      xephyr              fi    #Guion : Aqui se ha definido como se utilizara este guion correctamente para montar o desmontar la particion Objetivo  #Entrada : Cualquier palabra pasada por el parametro $1 sera convertida en minusculas    Entrada=$(echo "$1" | tr -s  '[:upper:]'  '[:lower:]')                if [ "$Entrada" == "montar" ]; then                      montar              fi                if [ "$Entrada" == "xephyr" ]; then                      xephyr              fi                if [ "$Entrada" == "desmontar" ]; then                      desmontar              fi    #Finalizar la condicion global de requerir usar el SuperUsuario o en su defectos persmisos administrativos  #Para poder (des)montar particiones :  fi  

The problem is when i indicate on the Xephyr window, and i wait around 5 mins for all process finish for close the Xephyr window manully because never gone, i can't umount the partions, because are still busy by "jbd2/nbd0p1-8", and neither i can force the kernel module "nbd" unload because is on use.

get rid of rebooting messages and watchdog

Posted: 10 Jul 2022 04:07 AM PDT

Broadcast message from username@Desktop (Sun 1919-08-10 11:45:14 CST):    The system is going to reboot NOW!    [756.345947] watchdog: watchdog0: watchdog did not stop!  [756.472889] watchdog: watchdog0: watchdog did not stop!  

Every time I reboot and found a message like this.

Is there any way to get rid of these messages?

I used to have a /etc/modprobe.d/watchdog.conf and blacklisted:

blacklist iTCO_wdtblacklist   blacklist iTCO_vendor_support  

but now it does not work

[firestar@ThinkPad ~]$ inxi -b  System:    Host: ThinkPad Kernel: 5.18.10-1-MANJARO arch: x86_64 bits: 64      Desktop: KDE Plasma v: 5.24.5 Distro: Manjaro Linux  Machine:    Type: Laptop System: LENOVO product: 20WKA000CD v: ThinkPad X13 Gen 2i      serial: <superuser required>    Mobo: LENOVO model: 20WKA000CD v: SDK0L77769 WIN      serial: <superuser required> UEFI: LENOVO v: N35ET47W (1.47 )      date: 05/13/2022  Battery:    ID-1: BAT0 charge: 54.7 Wh (100.0%) condition: 54.7/54.7 Wh (100.0%)  CPU:    Info: quad core 11th Gen Intel Core i7-1165G7 [MT MCP] speed (MHz):      avg: 897 min/max: 400/4700  Graphics:    Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] driver: i915 v: kernel    Device-2: IMC Networks Integrated RGB Camera type: USB driver: uvcvideo    Display: x11 server: X.Org v: 21.1.3 driver: X: loaded: modesetting      gpu: i915 resolution: 2560x1600~60Hz    OpenGL: renderer: Mesa Intel Xe Graphics (TGL GT2) v: 4.6 Mesa 22.1.3  Network:    Device-1: Intel Ethernet I219-V driver: e1000e    Device-2: Intel Wi-Fi 6 AX210/AX211/AX411 160MHz driver: iwlwifi  Drives:    Local Storage: total: 953.87 GiB used: 29.01 GiB (3.0%)  Info:    Processes: 221 Uptime: 10m Memory: 15.35 GiB used: 2.68 GiB (17.5%)    Shell: Bash inxi: 3.3.19  

how to share wifi to other devices in linux mint from ethernet using wifi adapter

Posted: 10 Jul 2022 02:18 AM PDT

after long searching for a way to share network to other devices i still not find a clear and working steps. I'm connected in my Linux mint using cable, and i want to share network from it using usb WiFi adapter, so i can connect with my phone but no way !! .

enter image description here

  • i created a WiFi hotspot as most of tutorials mentioned but i can't find in my phone i want to make a public hotspot which i can simply connect to it from any other device.

enter image description here

What is difference between sleep and NOP in depth?

Posted: 10 Jul 2022 06:52 AM PDT

I am trying to learn operating system concepts. Here is two simple python code:

while True:      pass  

and this one:

from time import sleep  while True:      sleep(0.00000001)  

Question: Why when running first code CPU usage is 100% but when running the second one it is about 1% to 2% ? I know it may sounds stupid but why we can not implement something like sleep in user space mode without using sleep system call ?

NOTE: I have tried to understand sleep system call from linux kernel but TBH I didn't understand what happens there. I also search about NOP assembly code and turns out that it is not really doing nothing but doing something useless (like xchg eax, eax) and maybe this is that cause of 100% CPU usage. but I am not sure.

What exactly assembly code for sleep system call that we can't do it in user space mode? Is it something like HLT

I also tried to use HLT assembly in code like this:

section     .text  global      _start   _start:       hlt  halter:      jmp     _start  section     .data  msg     db  'Hello world',0xa    len     equ $ - msg     

but after running this code I see kernel general protection fault like this:

[15499.991751] traps: hello[22512] general protection fault ip:401000 sp:7ffda4e83980 error:0 in hello[401000+1000]  

I don't know maybe this is related to protection ring or my code is wrong? The other question here is that OS is using HLT or other protected assembly commands under beneath sleep system call or not?

What's the correct way to setup Certbot for an nginx server with several ports/services under one single domain?

Posted: 10 Jul 2022 01:56 AM PDT

Originally, I had NGINX configured for two services (Radicale and LMS) on two different ports. I did this in /etc/nginx/nginx.conf. Access to MYDOMAIN:8000 and :8009 and 3001 from the internet are redirected to Radicale and LMS respectively.

I set up certificates on the server to enable this and then ran sudo certbot --nginx -d MYDOMAIN to generate letsencrypt certs. Afterwards I disabled my own certs (I just had to set them up to make the config file error-free).

user www-data;  worker_processes auto;  pid /run/nginx.pid;  include /etc/nginx/modules-enabled/*.conf;    events {      worker_connections 768;  }    http {      sendfile on;        tcp_nopush on;      types_hash_max_size 2048;      keepalive_timeout 65;        include /etc/nginx/mime.types;      default_type application/octet-stream;        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE      ssl_prefer_server_ciphers on;        # reduce logging      access_log off;    #   access_log /var/log/nginx/access.log;      error_log /var/log/nginx/error.log;        gzip on;    #   include /etc/nginx/conf.d/*.conf;  #   include /etc/nginx/sites-enabled/*;        auth_basic "NGINX";      auth_basic_user_file /etc/nginx/.htpasswd;    #   old, before Certbot  #   ssl_certificate ssl/server.crt;  #   ssl_certificate_key ssl/server.key;            server {        server_name MYDOMAIN;        listen 8000 ssl;        location / {          proxy_pass http://localhost:8000;          proxy_set_header X-Script-Name /;          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;          proxy_set_header X-Remote-User $remote_user;          proxy_set_header Host $http_host;          proxy_pass_header Authorization;          auth_basic "Nginx-Radicale - Password required";        }            # generated with: sudo certbot --nginx -d MYDOMAIN      ssl_certificate /etc/letsencrypt/live/MYDOMAIN/fullchain.pem; # managed by Certbot      ssl_certificate_key /etc/letsencrypt/live/MYDOMAIN/privkey.pem; # managed by Certbot  }      server {        server_name MYDOMAIN;        listen 8009;        return 301 https://MYDOMAIN:3001;      }      server {        server_name MYDOMAIN;        listen 3001;        location / {          proxy_pass http://localhost:3000/;          auth_basic "NGINX";        }      }  }  

Now I changed my setup and wanted to split the server part of the config into nginx/conf.d subdirectory to have a clean setup. I wanted to let the original nginx.conf as it comes and just adjust my own two files:

pi@RPi64:/etc/nginx $ cat conf.d/radicale.conf   server {    server_name MYDOMAIN;    listen 8000;   # ssl;    location / {      proxy_pass http://localhost:5232;      proxy_set_header X-Script-Name /;      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;      proxy_set_header X-Remote-User $remote_user;      proxy_set_header Host $http_host;      proxy_pass_header Authorization;      auth_basic "Nginx-Radicale - Password required";    }  }  

and second file:

pi@RPi64:/etc/nginx $ cat conf.d/LMS.conf  server {      server_name MYDOMAIN;      listen 8009;      return 301 https://MYDOMAIN:3001;        listen 443 ssl; # managed by Certbot      ssl_certificate /etc/letsencrypt/live/MYDMOAIN/fullchain.pem; # managed by Certbot      ssl_certificate_key /etc/letsencrypt/live/MYDOMAIN/privkey.pem; # managed by Certbot      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot    }    server {      server_name MYDOMAIN;      listen 3001;      location / {          proxy_pass http://localhost:3000/;          auth_basic "NGINX";      }  }  

As you can see I commented out the ssl part in the first file. If I let it in sudo nginx -t was giving the error of missing certificates. I wanted to avoid having to setup my own certs.

Also, you can see that running certbot added five lines into my second file:

    listen 443 ssl; # managed by Certbot      ssl_certificate /etc/letsencrypt/live/MYDMOAIN/fullchain.pem; # managed by Certbot      ssl_certificate_key /etc/letsencrypt/live/MYDOMAIN/privkey.pem; # managed by Certbot      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot  

I think certbot found the https in this file and then decided to add the certs there.

However, I wanted to add certificates for the whole server - meaning both sites/files.

Especially since the process of renewing the certs has to be done regularly, I wanted to make sure there is not manual copying involved.

How can I tell Certbot to insert certs for both files? Do I have to add my own certs first for certbot to recognise the requiry?

Or would it make sense to add the certs to the main nginx.conf file? Am I doing something wrong?

mdadm rebuild RAID 6

Posted: 10 Jul 2022 06:31 AM PDT

So I have a RAID 6 created with mdadm.

I attempted to add 2 disks to the array but it looks like it hit a bad disk and screwed up the array.

I think mdadm is trying to assemble it but there appears to be something stopping it. And it looks like it still thinks I want to resize the array.

/dev/md126:             Version : 1.2          Raid Level : raid0       Total Devices : 10         Persistence : Superblock is persistent                 State : inactive     Working Devices : 10         Delta Devices : 2, (-2->0)           New Level : raid6          New Layout : left-symmetric       New Chunksize : 512K                  Name : dragon:0                UUID : 70d8f410:462c6714:50231e20:b08aca81              Events : 505703        Number   Major   Minor   RaidDevice           -       8       64        -        /dev/sde         -       8       32        -        /dev/sdc         -       8      176        -        /dev/sdl         -       8      144        -        /dev/sdj         -       8      112        -        /dev/sdh         -       8       80        -        /dev/sdf         -       8       48        -        /dev/sdd         -       8      160        -        /dev/sdk         -       8      128        -        /dev/sdi         -       8       96        -        /dev/sdg  

If I attempt to assemble/force it - it only says there are 6 disks and won't start the array.

# mdadm --verbose --assemble --force /dev/md126 /dev/sdi /dev/sdj /dev/sdk /dev/sdl /dev/sde /dev/sdh /dev/sdg /dev/sdf /dev/sdd /dev/sdc  mdadm: looking for devices for /dev/md126  mdadm: /dev/sdi is identified as a member of /dev/md126, slot 0.  mdadm: /dev/sdj is identified as a member of /dev/md126, slot 1.  mdadm: /dev/sdk is identified as a member of /dev/md126, slot 2.  mdadm: /dev/sdl is identified as a member of /dev/md126, slot 3.  mdadm: /dev/sde is identified as a member of /dev/md126, slot 4.  mdadm: /dev/sdh is identified as a member of /dev/md126, slot 5.  mdadm: /dev/sdg is identified as a member of /dev/md126, slot 6.  mdadm: /dev/sdf is identified as a member of /dev/md126, slot 7.  mdadm: /dev/sdd is identified as a member of /dev/md126, slot 8.  mdadm: /dev/sdc is identified as a member of /dev/md126, slot 9.  mdadm: added /dev/sdi to /dev/md126 as 0 (possibly out of date)  mdadm: added /dev/sdj to /dev/md126 as 1 (possibly out of date)  mdadm: added /dev/sdk to /dev/md126 as 2 (possibly out of date)  mdadm: added /dev/sdl to /dev/md126 as 3 (possibly out of date)  mdadm: added /dev/sdh to /dev/md126 as 5  mdadm: added /dev/sdg to /dev/md126 as 6  mdadm: added /dev/sdf to /dev/md126 as 7  mdadm: added /dev/sdd to /dev/md126 as 8  mdadm: added /dev/sdc to /dev/md126 as 9  mdadm: added /dev/sde to /dev/md126 as 4  mdadm: /dev/md126 assembled from 6 drives - not enough to start the array.  

I suspect it has something to do with the "possibly out of date" message. Is there a way to tell mdadm to just whatever the latest (or even choose one) whatever it's trying to use. I understand that may cause some data loss - but that is fine.

Responding to @frostschutz - I've tried that and I'm guessing mdadm won't assemble the array is because I have 4 "out of date" drives and doesn't know what it should do. If it was just the 2 I could probably try to start the array without those. I'm wondering if there is a flag to be like "just assume it's clean and sync up all the dates". I've tried to --create with the correct order and mdadm tells me basically that it wants to wipe and create a new array. All the articles suggest that if it did work --create would not prompt and re-build the array.

I don't see results of a self test of an SSD in smartctl

Posted: 10 Jul 2022 02:59 AM PDT

I want to test my SSD. It seems that I can start a self test with smartctl, but when I try to display test's results, I don't see anything.

My SDD's model is PNY CS3030 250GB SSD:

$ lsblk -d -o name,model /dev/nvme0n1  NAME    MODEL  nvme0n1 PNY CS3030 250GB SSD  

I make sure that SMART is enabled on it:

$ sudo smartctl -s on /dev/nvme0n1  smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-121-generic] (local build)  Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org    NVMe device successfully opened    Use 'smartctl -a' (or '-x') to print SMART (and more) information  

Then I start the test:

$ sudo smartctl -t short /dev/nvme0n1  smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-121-generic] (local build)  Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org    NVMe device successfully opened    Use 'smartctl -a' (or '-x') to print SMART (and more) information  

Then I try to see the results of the test - but smartctl does not display any:

$ sudo smartctl -l selftest /dev/nvme0n1  smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-121-generic] (local build)  Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org    NVMe device successfully opened    Use 'smartctl -a' (or '-x') to print SMART (and more) information  

And that's all. No information about any test running, having failed, nothing. I tried to repeat this command after an hour (maybe I should wait until the test is done), but still no result.

What's going on here?

How do I use sort on multiple columns with different data types

Posted: 10 Jul 2022 07:29 AM PDT

Here's my tab-delimited file t.tsv:

$ cat t.tsv  2022/05/05  -258.03  2022/05/07  -18.10  2022/05/09  -10.74  2022/05/09  -132.60  2022/05/12  -18.56  2022/05/12  -20.20  2022/05/17  -11.00  2022/05/17  -112.91  2022/05/17  -51.43  2022/05/17  -64.78  2022/05/18  -13.96  2022/05/18  -13.96  2022/05/18  -7.51  2022/05/19  -17.08  2022/05/20  -33.08  

I am using MacOS 12.4 sort (from man page: The sort utility is compliant with the IEEE Std 1003.1-2008 ("POSIX.1") specification) to sort first by col 1 in alpha seq ascending, then by col2 in numeric ascending.

$ cat t.tsv|sort --field-separator='\t' --key=1,1 --key=2,2n  2022/05/05  -258.03  2022/05/07  -18.10  2022/05/09  -10.74  2022/05/09  -132.60  2022/05/12  -18.56  2022/05/12  -20.20  2022/05/17  -11.00  2022/05/17  -112.91  2022/05/17  -51.43  2022/05/17  -64.78  2022/05/18  -13.96  2022/05/18  -13.96  2022/05/18  -7.51  2022/05/19  -17.08  2022/05/20  -33.08  

I'm baffled as to why the second column is isn't being sorted in ascending numeric sequence when the first column is the same. Numerous SE answers to this same question all say that (a) you specify single columns as --key=1,1, and (b) you may apply options such as -n to individual key definitions like --key=2,2n.

Always pipe a command with another command

Posted: 10 Jul 2022 02:40 AM PDT

How can I do the following?

If a command looks like

git show .....   

Then run

git show ..... | bat -l rs  

I mean, add | bat -l rs to the end of command before running.

Where are the characters going?

Posted: 10 Jul 2022 05:03 AM PDT

In a shell where \u is valid (bash +4.3, ksh93 or zsh) we can print Unicode characters:

$ printf 'a b c \ua0 \ua1 \ua2 \ua3 \n'  a b c   ¡ ¢ £  

Which are some characters from the Latin-1_Supplement range.

However as soon as an Unicode 9fcharacter is added, printing stops until a Unicode 9c gets printed.

Both \u9f and \u9c (APC and ST) are C1 control character.

$ printf 'a b c \u9f d e f \u9c \ua0 \ua1 \ua2 \ua3 \n'  a b c    ¡ ¢ £   

The characters d e f disappear.

It is sure that printf is generating all the characters, and that redirecting the output to some other software (not the terminal) will show the characters generated:

$ printf 'a b c \u9f d e f \u9c \ua0 \ua1 \ua2 \ua3 \n' | od -A n -tx1   61 20 62 20 63 20 c2 9f 20 64 20 65 20 66 20 c2   9c 20 c2 a0 20 c2 a1 20 c2 a2 20 c2 a3 20 0a  

That goes as far as demonstrating that the characters are being generated. Then, why are they not being printed (shown with some visible glyph) ?.

The questions I have are:

  1. Is APC actually connected to ST. Where is it defined ?
  2. Are the characters between those two characters sent to some application ?
  3. If so, to which application ?
  4. Who is responsible for such redirection? The shell, the terminal or something else ?

EDIT

Neither the xterm nor konsole terminals remove the d e f characters.

That confirms that it is an internal issue of the terminal application, not the shell. Have not found where that is defined yet.

Convert unified diff hunk into text old or new

Posted: 10 Jul 2022 04:47 AM PDT

I'd love to be able to extract raw text from diffs. F.ex. the hunk:

--- a   2022-07-08 01:15:08.091318061 +0300  +++ b   2022-07-08 01:15:18.175389833 +0300  @@ -1,5 +1,5 @@   Common text    -Old text  +Changed text     Common text  

must be converted to text A:

Common text    Old text    Common text  

and B:

Common text    Changed text    Common text  

Quite strange I could not find this in standard tools, so I've always used some sed commands. Maybe I missed something and there is some standard way of doing this? Anyway, quite curious to know your shortest command-line implementation.

How to delete lines whose first field contains special characters only?

Posted: 10 Jul 2022 07:12 AM PDT

How to delete lines which contains a / or ' or - or . only in their first |-separated field?

  • code tried:
    sed 's/^\.\d; /^\-/d; /^\//d' file > file_out  
  • example input :
    /|98374|  /trust|q83129|  //|392720|  //cust|23892|  .|9374|  .abcd|28374|  '|238674|  'hcsu|3810|  -|327492|  -abcde|9837|  
  • expected output:
    .abcd|28374|  /trust|q83129|  //cust|23892|  'hcsu|3810|  -abcde|9837|  

kubeadm init missing optional cgroups

Posted: 10 Jul 2022 02:47 AM PDT

It seems that since I've updated to the newest kernel (Ubuntu server 22), I get this message during kubeadm init

How to get rid of the following error? :

user@kubemaster:~$ sudo kubeadm init  [init] Using Kubernetes version: v1.24.2  [preflight] Running pre-flight checks          [WARNING SystemVerification]: missing optional cgroups: blkio  

xorg-x11-drv-intel SYSTEM FAILURE, Intel Iris Xe, I7 1165 G7

Posted: 10 Jul 2022 05:48 AM PDT

i've installed fedora 35 on my new laptop(asus x513 i7 1165g7) and, since i changed from w11 to f35, this system failure always appear when starting my system, the backtrace says:

WARNING: CPU: 2 PID: 387 at drivers/gpu/drm/i915/display/intel_tc.c:878 intel_tc_port_init+0x229/0x230 [i915]  Modules linked in: i915(+) i2c_algo_bit ttm drm_kms_helper nvme nvme_core cec hid_multitouch crct10dif_pclmul drm crc32_pclmul crc32c_intel ghash_clmulni_intel serio_raw i2c_hid_acpi vmd wmi i2c_hid video pinctrl_tigerlake ipmi_devintf ipmi_msghandler fuse  CPU: 2 PID: 387 Comm: systemd-udevd Not tainted 5.16.20-200.fc35.x86_64 #1  Hardware name: ASUSTeK COMPUTER INC. VivoBook_ASUSLaptop X513EAN_X513EAN/X513EAN, BIOS X513EAN.201 05/31/2021  RIP: 0010:intel_tc_port_init+0x229/0x230 [i915]  Code: 4c 8b 67 50 4d 85 e4 75 03 4c 8b 27 e8 70 6e 43 f7 48 c7 c1 40 78 4f c0 4c 89 e2 48 c7 c7 75 6a 51 c0 48 89 c6 e8 97 6c 82 f7 <0f> 0b e9 59 ff ff ff 0f 1f 44 00 00 41 54 55 53 89 f3 48 83 ec 08  RSP: 0018:ffffb69e80577ae0 EFLAGS: 00010282  RAX: 0000000000000031 RBX: ffff9d77c7874000 RCX: 0000000000000000  RDX: 0000000000000001 RSI: ffffffffb8635b25 RDI: 00000000ffffffff  RBP: 0000000000000002 R08: 0000000000000000 R09: ffffb69e80577920  R10: ffffb69e80577918 R11: ffffffffb8f462e8 R12: ffff9d77c1737510  R13: ffff9d77c7874f90 R14: 00000000ffffffff R15: 00000000ffffffff  FS:  00007fa100b42b40(0000) GS:ffff9d7937680000(0000) knlGS:0000000000000000  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033  CR2: 000055cef5b0ebc8 CR3: 0000000102bce003 CR4: 0000000000770ee0  PKRU: 55555554  Call Trace:  

The reason:

WARNING: CPU: 2 PID: 387 at drivers/gpu/drm/i915/display/intel_tc.c:878 intel_tc_port_init+0x229/0x230 [i915]  

cmdline:

BOOT_IMAGE=(hd0,gpt2)/vmlinuz-5.16.20-200.fc35.x86_64 root=UUID=ef22d715-7597-4a9a-b9a0-71a8f4ffc672 ro rootflags=subvol=root rhgb quiet  

package: kernel-core-5.16.20-200.fc35

i'm actually new to linux, so, i would be very happy if someone could help me! i've googled this topic many times, and didn't find any answer, only for nvdia gpus, not this one.

Prevent rm -r of btrfs snapshots

Posted: 10 Jul 2022 04:22 AM PDT

I would like to use btrfs snapshots as a safety measure in case of accidental sudo rm -rf /* or similar but unfortunately you can delete readonly snapshots with rm -r.

Can I disable this "feature" somehow?

letsencrypt shellinabox

Posted: 10 Jul 2022 04:21 AM PDT

I see this problem all over the internet searches, and can't seem to find the resolution.

I want to use shellinabox on whatever.net:54321

I have letsencrypt certificates

I've tried to copy /etc/letsencrypt/live/whatever.net/fullchain.pem to /var/libshellinabox/certificate.pem then chown shellinabox:shellinabox certificate.pem, but after trying to connect from a browser, SIAB creates a self-signed certificate-whatever.net.pem

I've also tried editing /etc/default/shellinabox certdir line to point to /etc/letsencrypt/live/whatever.net, but then shellinabox compains about not having correct file permissions. (Understandably so)

I've also tried copying /etc/letsencrypt/live/whatever.net/fullchain.pem to certificate.pem, and chown certificate.pem to shellinabox, but that doesn't seem to do the trick either.

Seems like it should be easy enough, but no matter what I've tried, letsencrypt still wants to make it's own self-signed certificates, which causes browsers to complain.

So, the big question, what's the magic tapdance to make siab use letsencyrypt certificates and stop making self-signed certificates?

fstab issue mount system call failed not a directory

Posted: 10 Jul 2022 06:08 AM PDT

I added two extra entries in my fstab file in an attempt to move tmp directories off SSD to HDD:

/dev/sdb1 /tmp none bind 0 0  /dev/sdb1 /var/tmp none bind 0 0  

However this stops my PC from booting up and there's an error: "mount: /var/tmp: mount(2) system call failed: Not a directory"

What am I doing wrong? How can I move those temp dirs from my SSD to HDD?

NVME SSD performance slow on Linux

Posted: 10 Jul 2022 06:08 AM PDT

Why is my sequential read speed so (comparatively) slow?

While CrystalDiskMark on Win10 reports around 5GB/s (for reading as well as writing), I just do not get close to that performance on Linux. (A copy&paste of several hundreds of GBs on Windows from/to the same drive averaged around 2,5GB/s, so I do not think CDM is far off from real values here.)

A simple dd if=/dev/nvme0n1 of=/dev/null bs=1M count=10k reports a mere 1.5GB/s.

On another NVME (both being Corsair Force MP600 1TB) dd reports 1.4 GB/s.

I would expect that such a sequential access is the best-case for reading from any storage device, so I really have no clue on what is going on here.

(I saw some similar questions on StackExchange, but they all went into different directions than this 'simple one'.)

Note aside: CrystalDiskMark uses 'real files' if I'm not mistaken - so it has even additional file system overhead, whereas my dd call should be the best one could possibly get - or not?

System info:

  • both NVMEs are connected with 4 PCIe 4.0 lanes
  • temperature of both NVMEs < 60°C
  • the faster one is also mounted as root, the slower one was unmounted
  • Zen2 Threadripper (so more than enough PCIe 4.0 lanes..)
  • Kernel 5.6.4
  • BIOS up2date
  • NVME firmware up2date

Any ideas or pointers into the right direction would be greatly appreciated!

How can I install Debian with full-disk encryption and a custom sized swapfile?

Posted: 10 Jul 2022 07:16 AM PDT

I'm trying to use a Debian network cd to install it, via the advanced graphical installer. I want to use the full-disk encryption option, but I'm trying to install it on an older machine. I think it has about 1GB of RAM. I installed Pop!_OS on it, and it ran fast enough, as I could specify a decent swapfile size, but try as I might, I couldn't get it to find a graphics driver that would give me anything but a 640 screen resolution. (Debian found a great video driver, FWIW).

When I use the guided setup for an encrypted whole disk on an LVM volume, it gives me a tiny 1.1 GB encrypted swap partition. It installs fine, and seems to run, but when I start to use the Software Center, pretty soon it just starts to grind and grind on the swapfile.

If I try to shrink one of the big LVM partitions, I can't in gparted, since it tells me it is in use. I've tried command-line approaches, but they fail; and are extremely frustrating. If I boot on a Debian Live DVD, first must do sudo apt-get update, which takes a while, and then sudo apt-get crypt-setup and lvm2 in order to mount them. Nothing in the Debian docs told me how, but this Ubuntu page describes one method: Resize encrypted partitions

If I pause anytime for very long during this process, the monitor goes dark, and when I press a key, the screen presents me with my nice desktop, only to grind on the live DVD for about 5 minutes, and finally show me a nice, colorful wallpaper, and grind for about 20 minutes or more, before showing me a prompt that it has been locked, and it asks me for a password; which I never knew, but found out that it is "live".

If I tried actually carrying out the commands, I think it was on the e2fsck command, or the resize2fs didn't work. I forget the exact error.

I tried making the partition smaller, using only 130GB of a 160GB HD, and then expanding it with the instructions from How to enlarge encrypted swap partition? (sic), but it failed on the mkswap command, since the volume was in use. I tried using the live DVD, but gave up in frustration after it locked the screen again.

I went back to fight with the graphic installer, but once I told it to use guided full-disk encryption, it insisted on giving me a 1.1 GB swap partition. When I tried to reduce the size of the main LVM partition, it gave me the clever "No modifications can be made to this device ...", "In use by LVM Volume Group XXX". If I try to double-click on the 158 GB ext4 partition, there's nothing there that lets me reduce its size, to make room for a reasonably-sized swap-file. If I try to do a manual partition setup, and try to create partitions like it has with the guided LVM encrypted setup, I can't get them the same way.

I think a 30 or 40 GB swapfile for Linux is a lot more realistic - especially since e.g. Linux Performance: Why You Should Almost Always Add Swap Space | Hacker News details how awfully Linux behaves when it is out of swapfile space: it's almost always a hard reboot. Open too many tabs in your browser, or run an application that uses too much data, and there you are.

I'm sure it must be possible. I'd hate to think that an encrypted volume on Debian is simply impractical unless one has huge amounts of RAM. I'm sure it could be done from the command line, but I think it would be a longer timewaster than I have been on now (around two weeks on this so far), to set it up.

I'm sure it's not impossible, but is there a way to set up an encrypted volume on Debian through the graphical installer, with maybe a few commands I can execute afterwards, or from the Debian Live DVD (which as above, lacks so much as a partition manager!!!)? Perhaps a Kali Linux live disk wouldn't give me so much heartache if I tried to use it after-the-fact. Maybe somebody can give me command-line instructions that will do this in Debian. The swapfile should be encrypted, too, of course. Otherwise, it would defeat the point of encryption.

EDIT:

I tried to manually create the partitions. I created a root partition, and made it bootable, although I'm not sure what size it should be. I suppose I could learn its size from a guided partition.

I created a encrypted partition with all the remaining space on the disk. I then created a volume group within it. However, I wasn't able to create a partition within it, much less specify that that's where the bulk of the OS should be installed; nor create a swap partition within the volume group. It says the volume is part of a volume group already. Without a volume group, I was likewise not able to create partitions within the encrypted partition.

EDIT 2:

The solution was to use manual partition configuration in the graphic installer. I had to create the boot partition outside the encrypted volume, create an encrypted volume with the rest of the disk, make an LVM group in the encrypted volume thus created, and then create the root and other volumes within the volume group.

I made a 30GB swap partition since Linux has no well-maintained truly dynamic swapfile manager (although I may try my luck with swapspace); and Linux is useless once the swap partition is used up - worse than Windows when there is no more space on the disk for the swapfile. Without a huge swap partition, just open a lot of tabs, a really large spreadsheet and a really large log file, and you may be forced to do a hard reboot as the HD grinds and grinds and grinds.

I'm sporting a whopping 1GB RAM on a Pentium Dual E2200 on my server computer! It'll make a nice small server in addition to my main desktop one.

I chose not to install any desktop, but just the tools and servers; and then upon reboot, I did

apt-get update  apt-get install plasma-desktop  apt-get install sddm  

because I don't want the default bloatware. I made sure I can log in as su, since I can do su and log in on the console to install stuff system-wide (i.e., for all users; otherwise, I might be locked out of su access). The biggest problems is that Discover(=Software Center) runs too slow to be usable, and it only has picked up my MBs SPDIF audio output, not my regular audio ones yet. At least it doesn't grind the swap partition a huge amount when attempting to use Discover. However, I can install what I need via apt-get, and Konqueror and other stuff runs fine. Of course, as with many challenging problems, in retrospect, doing this doesn't seem as difficult as when I tried to do it myself without a guide. I guess that'll bring at least this extended round of distro hopping to an end :P.

VPN SSL Network Extender in Firefox

Posted: 10 Jul 2022 05:59 AM PDT

I need to connect from a Debian Stretch amd64 VM to a CheckPoint corporate VPN.

I am using it from the customer point of view, and do not know much technical details about the server side. I am using it with the CheckPoint Mobile client in Windows, and I know it accepts Web VPN connections with Firefox+Java aka SSL Network Extender.

I have tried opening it up in Firefox in Linux, but did not work. I also investigated text mode alternatives, namely the snx command line client, however CheckPoint literature clearly states direct logins from snx in the command line, are no longer supported.

I made several tests, inclusive installing the snx linux client, snxconnect and the openconnect/vpnc VPN client without much success. I also somewhat suspect the CheckPoint side besides the already convoluted process, is double-checking for the user agent, at least in my case.

What to do?

call bash script in script not found, directory is in $PATH

Posted: 10 Jul 2022 07:02 AM PDT

I have added a directory to my PATH variable to access all my bash scripts. I add the PATH globally on the system under /etc/profile.d/custom.sh as follow:

export PATH=$PATH:/usr/local/bin/helper  

This works, but when I call them in another script they are not found. Only if I use the full path to there location or I add a source /etc/profile.d/custom.sh at the top of an script they run.

All Scripts have a #!/usr/bin/env bash at the top.

Is there another way, or have I missed something?

I/O errors and undeletable directories

Posted: 10 Jul 2022 04:07 AM PDT

For some unknown reason, there are 2 directories I can't delete.

First directory called sw.old is empty and can be deleted only by rm, as rmdir won't recognize it. However, even after rm, it still shows up:

[02:11:36] user@user:/media/user/exthdd/docs$ ls -il  total 1072064  1456 drwx------ 1 user user          0 Aug 12 10:04 1old.or.probably.unfinished  5717 drwx------ 1 user user       8192 Jan 27 22:58 videos  6528 -rw------- 1 user user 1097779088 Nov  5 16:15 release_Remix_OS_for_PC_Android_M_64bit_B2016112101.zip  8008 drwx------ 1 user user       4096 Jan 28 00:55 txt    64 drwx------ 1 user user          0 Dec 25 22:15 sw.old  [02:12:03] user@user:/media/user/exthdd/docs$ rmdir sw.old/  rmdir: failed to remove 'sw.old/': No such file or directory  [02:12:57] user@user:/media/user/exthdd/docs$ rm -rf sw.old/  [02:13:15] user@user:/media/user/exthdd/docs$ ls -il  total 1072064  1456 drwx------ 1 user user          0 Aug 12 10:04 1old.or.probably.unfinished  5717 drwx------ 1 user user       8192 Jan 27 22:58 videos  6528 -rw------- 1 user user 1097779088 Nov  5 16:15 release_Remix_OS_for_PC_Android_M_64bit_B2016112101.zip  8008 drwx------ 1 user user       4096 Jan 28 00:55 txt    64 drwx------ 1 user user          0 Dec 25 22:15 sw.old  

Second one called misc has a corrupted file inside it:

[02:24:32] user@user:/media/user/exthdd/docs/txt$ ls -il  total 0  22607 drwx------ 1 user user 0 Dec 31 16:09 misc  [02:24:36] user@user:/media/user/exthdd/docs/txt$ ls -il misc/  ls: cannot access misc/patterns.mp4: Input/output error  total 0  ? -????????? ? ? ? ?            ? patterns.mp4  [02:24:54] user@user:/media/user/exthdd/docs/txt$ rm -rf misc/  rm: cannot remove 'misc/patterns.mp4': Input/output error  

How can I remove those directories (and corrupted file inside one of them) without formatting?

Lenovo Y720 Keyboard backlight & Extreme cooling on Arch Linux

Posted: 10 Jul 2022 02:09 AM PDT

I installed ArchLinux on my Lenovo Legion Y720 laptop and I can't turn on Keyboard lights and Extreme Cooling as I could in Windows 10 using Lenovo NerveSense app. How can I access these on Linux? Is it even possible? I've searched everywhere and I couldn't find anything. Should I try coding a driver? Any literature on that?

Thank you!

Output of ls /sys/class/leds/*/brightness:

/sys/class/leds/input0::capslock/brightness  /sys/class/leds/input0::numlock/brightness  /sys/class/leds/input0::scrolllock/brightness  /sys/class/leds/input17::capslock/brightness  /sys/class/leds/input17::compose/brightness  /sys/class/leds/input17::kana/brightness  /sys/class/leds/input17::numlock/brightness  /sys/class/leds/input17::scrolllock/brightness  /sys/class/leds/input2::capslock/brightness  /sys/class/leds/input2::compose/brightness  /sys/class/leds/input2::kana/brightness  /sys/class/leds/input2::numlock/brightness  /sys/class/leds/input2::scrolllock/brightness  /sys/class/leds/input5::capslock/brightness  /sys/class/leds/input5::numlock/brightness  /sys/class/leds/input5::scrolllock/brightness  /sys/class/leds/phy0-led/brightness`  

Read out pulseaudio volume from commandline? (I want: "pactl GET-sink-volume")

Posted: 10 Jul 2022 07:32 AM PDT

I want to read out the volume level I can set with

pactl set-sink-volume $SINK $VOLUME  

Is there an easy way to do that? As easy as the hypothetical

pactl get-sink-volume $SINK  

?

(What I'm trying to do? I use pactl to set volume and it lets me set the volume higher than 100% which is a bad idea (sound quality goes down), so I'm thinking about writing a small script that will not go over 100%. Read it out. Over some threshold? Set to 100%. Below? add 1%. If there is another way to do that, great, tell me! The cleanest solution would probably to tell pulse to just stop at 100%. But the original question remains, there must be some way..)

I am on Debian if that makes any difference.

As of early 2021, it seems like work is underway to implement this feature in pactl. Thanks to Klaas van Schelven for pointing this out.

No comments:

Post a Comment