Thursday, June 3, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


older Linux kernel does not boot with newer distro

Posted: 03 Jun 2021 10:39 AM PDT

I have to install a self compiled 4.17 kernel on a new Ubuntu 21.04 distro and run into the issue, that the system seems to be stuck after printing "Loading initial ramdisk...". Same problem occurs for the recovery boot option of that kernel. A new, self compiled 5.11 kernel can be installed and booted without any problems and a 4.17 kernel installed by deb file also boots without problems.

I can not receive any more information why the boot fails. journaldevctl does not collect any logs of the failed boot. Booting without "quiet" and with "loglevel=7" parameter does not print further information.

I also tried an older gcc version and used the config of the 4.17 kernel installed by deb file without any success. Is there anything I miss or is using an older kernel with a newer distro a problem in general?

Why "go version" command fail with an error? No such file or directory

Posted: 03 Jun 2021 10:54 AM PDT

Below is the environment in Mac:

~$  ~$  ~$ echo $0  -bash  ~$  ~$  ~$  ~$  ~$  ~$ cat /etc/paths.d/go  /usr/local/go/bin  ~$  ~$ cat /etc/paths  /usr/local/bin  /usr/bin  /bin  /usr/sbin  /sbin  /Users/MYUSER/go/bin  ~$  ~$  ~$ echo $PATH  /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/MYUSER/go/bin:/usr/local/go/bin  ~$  ~$ uname -a  Darwin XYXYXYXXYX 19.6.0 Darwin Kernel Version 19.6.0: Mon Apr 12 20:57:45 PDT 2021; root:xnu-6153.141.28.1~1/RELEASE_X86_64 x86_64  ~$  ~$ which go  /usr/local/go/bin/go  ~$  ~$  ~$  ~$ go version  -bash: /usr/local/bin/go: No such file or directory  ~$  ~$  ~$  ~$ /usr/local/go/bin/go version  go version go1.16.4 darwin/amd64  ~$  ~$  

How to make go version command work?

how to tell VIM to format brackets of functions, conditionals, and loops on new line?

Posted: 03 Jun 2021 11:02 AM PDT

Is there a way I can tell vim to format brackets on a new line?

For example:

public class Foo {      private Foo(int a) {          if (a > 30) {              // do stuff          }          for (int i = 0; i < a; i++) {              // more stuff          }      }  }  

Should become:

public class Foo  {      private Foo(int a)      {          if (a > 30)          {              // do stuff          }          for (int i = 0; i < a; i++)          {              // more stuff          }      }  }  

Why this? Because by pressing zc VIM fold code blocks nicely if they are format as the second example. In this case, VIM will fold only the content inside the brackets. If code is formated as in the first example, VIM will fold not only the content inside the brackets, but also fold if (...), for (....), function f(), class Foo(), and so on. So I'd like to know if there is a way to tell VIM to format file like in the second example.

Another alternative would be to tell VIM to not fold the content before the brackets.

Where is the MAC address for a bridge interface stored?

Posted: 03 Jun 2021 10:06 AM PDT

I recently cloned an SD card containing ubuntu for a Raspberry Pi to a HD. I then decided to use the SD card in a different Raspberry Pi and ran into a MAC address/IP Address conflict (both Pi's were getting their address via DHCP).

So I'm wondering where the MAC addresses are coming from. It turns out that additional bridges have indentical MAC addresses on both machines as well. Here's the interfaces on the Pi booting from the SD card.

root@Raspi-SD:~# ifconfig br0  br0: flags=4098<BROADCAST,MULTICAST>  mtu 1500          ether 56:38:8b:dc:54:1e  txqueuelen 1000  (Ethernet)          RX packets 0  bytes 0 (0.0 B)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 0  bytes 0 (0.0 B)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  root@Raspi-SD:~# ifconfig br1  br1: flags=4098<BROADCAST,MULTICAST>  mtu 1500          ether 9a:20:c4:42:34:a4  txqueuelen 1000  (Ethernet)          RX packets 0  bytes 0 (0.0 B)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 0  bytes 0 (0.0 B)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  root@Raspi-SD:~# ifconfig br2  br2: flags=4098<BROADCAST,MULTICAST>  mtu 1500          ether 62:ba:8a:ad:57:8f  txqueuelen 1000  (Ethernet)          RX packets 0  bytes 0 (0.0 B)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 0  bytes 0 (0.0 B)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  

And here are the same interfaces on the Pi booting from a hard drive:

root@Raspi-HD:~# ifconfig br0  br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500          inet A.B.C.D  netmask 255.255.255.0  broadcast A.B.C.255          inet6 fe80::5438:8bff:fedc:541e  prefixlen 64  scopeid 0x20<link>          ether 56:38:8b:dc:54:1e  txqueuelen 1000  (Ethernet)          RX packets 34097  bytes 2497567 (2.4 MB)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 1799  bytes 146667 (146.6 KB)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  root@Raspi-HD:~# ifconfig br1  br1: flags=4098<BROADCAST,MULTICAST>  mtu 1500          ether 9a:20:c4:42:34:a4  txqueuelen 1000  (Ethernet)          RX packets 0  bytes 0 (0.0 B)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 0  bytes 0 (0.0 B)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  root@Raspi-HD:~# ifconfig br2  br2: flags=4098<BROADCAST,MULTICAST>  mtu 1500          ether 62:ba:8a:ad:57:8f  txqueuelen 1000  (Ethernet)          RX packets 0  bytes 0 (0.0 B)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 0  bytes 0 (0.0 B)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0    

So where are these MAC addresses coming from and how can I change it so this doesn't happen again?

Thanks for reading!

Cannot install libpng12 on debian 10 (buster) which is required for making stata 14 works

Posted: 03 Jun 2021 10:27 AM PDT

I am a newbie but I have tried to use some distros like ubuntu, linuxmint even arch linux and its derivatives but I found my liking with debian. I just have one issue as to my computer needs using debian 10 and that is how to install libpng12 which is required for stata 14 to work. I have tried a lot of solutions proposed on many forums but up to now without luck in installing libpng12 on my debian buster installation. I only need a simple step by step 'procedure' on how to do this successfully so I can go ahead with data analysis for my research using stata 14.

Error: --boot uefi=RPI_EFI.fd : Did not find any UEFI binary path for arch 'aarch64' emulating raspi3 on jetson nano with virt-install

Posted: 03 Jun 2021 09:39 AM PDT

it's more of a challenge,to be able to emulate the raspberry pi 3 on my Jetson nano (aarch64) using virt-install. I'm learning how to do that by reading heavily here :

https://github.com/dhruvvyas90/qemu-rpi-kernel

I tried to do something like this :

virt-install \     --name pi \     --machine raspi3 \     --cpu arm1176 \     --memory 1024 \     --import \     --disk /root/Desktop/zi/Work/Android/Raspy/Debian/2019-09-26-raspbian-buster-lite.img,format=raw,bus=virtio \     --network user,model=virtio \     --video vga \     --graphics spice \     --rng device=/dev/urandom,model=virtio \     --boot 'uefi=RPI_EFI.fd,dtb=bcm2710-rpi-3-b-plus.dtb,kernel=kernel8.img,kernel_args=root=/dev/vda2 rootwait panic=1 dwc_otg.fiq_fsm_enable=0' \     --events on_reboot=destroy  

But I get this error :

ERROR Error: --boot uefi=RPI_EFI.fd,dtb=bcm2710-rpi-3-b-plus.dtb,kernel= kernel8.img,kernel_args=root=/dev/vda2 rootwait panic=1 dwc_otg.fiq_fsm_enable=0: Did not find any UEFI binary path for arch 'aarch64'

I've got the UEFI BIOS file from here :

https://github.com/andreiw/RaspberryPiPkg/blob/master/Binary/prebuilt/2019Jan16-GCC5/RELEASE/RPI_EFI.fd

I'm not sure if it isn't the right efi file to use in this specific configuration or if it is,but I'm passing the parameter badly. What do you suggest me to do ?

Gimp: Image Size Background

Posted: 03 Jun 2021 09:31 AM PDT

I have an image I that is my background on my laptop. But the image is too zoomed in. So half of the image is not showing on my laptop background. How do I fix this? Is this a scale thing? I tried re-sizing to 250*250 and applied the new image to the background but same thing. I am using Fedors 34 Lenovo laptop.

Xdotool script not working if called from i3

Posted: 03 Jun 2021 09:31 AM PDT

I have a script for scrolling looking like this

xdotool key --clearmodifiers Up Up Up Up  

It works perfectly fine if I am in a browser and execute it via dmenu using an i3 bindsym. However, it does nothing using the following bindsym directly:

bindysm $mod+x exec --no-startup-id scroll  

If I replace scroll by some other script, the script runs as expected. Do you have an idea what could cause this behaviour?

path of current working directory

Posted: 03 Jun 2021 10:27 AM PDT

pwd stands for "print working directory". This command outputs the full path of the directory you are currently in, called the working directory.

What is the path of the current working directory just after you logged in?

How to define a pulseaudio profile that ignores the "input" capabilities of a microphone

Posted: 03 Jun 2021 09:13 AM PDT

I want to add an udev rule that loads a pulseaudio configuration in which a device's direction is set only to output. I have the udev rule triggering, but pulseaudio fails to load the device (removing the rule causes the device to be found again).

I identified the device following the following procedure

$ lsusb | grep -i blue  Bus 001 Device 035: ID 046d:0ab7 Logitech, Inc. Blue Microphones  $ sudo lsusb -v -s 001:035 | grep -e 'idVendor' -e 'idProduct'    idVendor           0x046d Logitech, Inc.    idProduct          0x0ab7  

Using the information above I defined the following udev rule in /etc/udev/rules.d/96-pulseaudio-usb.rules:

ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0ab7", ENV{PULSE_PROFILE_SET}="blue-yeti.conf"  

Finally, I wrote the following configuration file in /usr/share/pulseaudio/alsa-mixer/profile-sets/blue-yeti.conf:

[General]  auto-profiles = yes    [Mapping analog-comm]  description = Communication  device-strings = hw:%f,0,0  channel-map = mono  paths-input = blue-yeti-input    [Profile output:analog-comm+output:analog-main+input:analog-comm]  output-mappings = analog-comm analog-main  input-mappings = analog-comm  priority = 5100  skip-probe = yes  

As I mentioned previously, this does not work, but I cannot find a way to get any logs from pulse audio so I'm in the dark regarding what the error is.

Does anybody have a more sensible configuration I could use to have pulseaudio ignore the input capabilities of the microphone? Thank you.

su not working inside arch-chroot with dash shell

Posted: 03 Jun 2021 09:58 AM PDT

When i try to do the following inside a dash script:

#!/bin/dash    arch-chroot /mnt /bin/dash <<- EOF      su myuser      whoami  EOF  

It simply logs the "root", but when i try to do it manually, it works fine:

$ arch-chroot /mnt  $ su myuser  $ whoami  > myuser   

Any clues of what might be happening? probably some undocumented pitfall of dash?

How do I resize image jpg/png files in AIX based systems through linux commands (Not UNIX)

Posted: 03 Jun 2021 09:37 AM PDT

How do I resize image jpg/png files in AIX based systems through linux commands (Not UNIX). I have already seen ImageMagick tool in many forums but it's only for unix based systems like ubuntu but it is not working for my system which is AIX based. This is for an Oracle Apps host Concurrent program where we need to reduce the image dimensions. All the image files are stored in a server directory and need to resize all of them to a specific dimensions. Any help would be highly appreciated. Thanks in advance.

Xrdp session has wrong display screen size and aspect ratio

Posted: 03 Jun 2021 08:50 AM PDT

I am using remote desktop on a windows machine to connect to a CentOS 7 machine running a Xrdp server. Recently I had a problem with an application, where the avaialable openGL version (2.1) was not enough and it suggested either updating it, or using VNC.

While trying to make a VNC connection to work I made several updates inlcuding a Kernel update. I could not get the turboVNC to work at the same time than Xrdp, and damaged the settings somehow.

Now, when I connect to the Xrdp session the Gnome shell window is very small and has a weird aspect ratio, making it unusable (see picture below, the black area is the the size of my screen). Even if logged out of the gnome session, where I am able to select other shell (KDE, for example) I still have the same window size. enter image description here

Since I could not find a similar problem, I am not sure what is causing the problem. How could I return the size of the window to its original shape and size?

bash + awk: processing of multiple csv filles in loop

Posted: 03 Jun 2021 08:50 AM PDT

As a part of my bash routine, I am using the following gawk code to

test_ranking44 () {      for csv in "${rescore}"/*str*.csv; do  gawk 'BEGIN { FS=", *"; OFS=", " }  NR > 1 {      cnts[1][$1]++      cnts[2][$2]++  }  END {      numRows = 5      numCols = 2        PROCINFO["sorted_in"] = "@val_num_desc"      for (colNr=1; colNr<=numCols; colNr++) {          rowNr = 0          for (key in cnts[colNr]) {              vals[++rowNr][colNr] = sprintf("%s (number of cases: %d)", key, cnts[colNr][key])          }      }            print FILENAME, NR      print "TOP PROT", "TOP LIG"      for (rowNr=1; rowNr<=numRows; rowNr++) {          for (colNr=1; colNr<=numCols; colNr++) {              printf "%s%s", vals[rowNr][colNr], (colNr<numCols ? OFS : ORS)          }      }  }' ${csv} >> "${rescore}"/test_ranking.log  done  }  

Briefly, it calculates the occurrence of the elements in a given column (ignoring the first line, which is a header part) of each CSV (contained str glob pattern in its name), via focusing on the indices in the first as well as the second columns. Eventually it prints top five indexes from the both columns to the test_ranking.log contained info for all processed CSVs at once. Is it possible to modify directly the GAWK code in order to consider only the first N (says first 100 lines) of each csv (now it treats all lines) ? Or alternatively should I pipe it to some other command like

head -n 100 csv  

Why is this package (pdfc-gui) updates my ca-certificates, on Ubuntu 16.04?

Posted: 03 Jun 2021 10:06 AM PDT

I am trying to figure out if an application I installed can be trusted, based on the following output. I hope this is the correct platform to get some advice on the matter!

I installed this package (pdfc-gui) from here with:

sudo dpkg -i pdfc-gui-21.4.225.deb

and in the installation I see that it adds/updates ssl certificates (see install output below).
Unfortunately I don't understand linux well enough to be sure if this is something I should worry about.

Can anyone explain this output to me?

Should I remove the package, and if so, how to be sure that all the changes it did would truely be reverted?

sudo dpkg -i pdfc-gui-21.4.225.deb  Selecting previously unselected package pdfc-gui.  (Reading database ... 734495 files and directories currently installed.)  Preparing to unpack pdfc-gui-21.4.225.deb ...  Unpacking pdfc-gui (21.4.225) ...  Setting up pdfc-gui (21.4.225) ...  Clearing symlinks in /etc/ssl/certs...  done.  Updating certificates in /etc/ssl/certs...  129 added, 0 removed; done.  Running hooks in /etc/ca-certificates/update.d...    Replacing debian:ACCVRAIZ1.pem  Replacing debian:Actalis_Authentication_Root_CA.pem  Replacing debian:AffirmTrust_Commercial.pem  Replacing debian:AffirmTrust_Networking.pem  Replacing debian:AffirmTrust_Premium.pem  Replacing debian:AffirmTrust_Premium_ECC.pem  Replacing debian:Atos_TrustedRoot_2011.pem  Replacing debian:Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem  Replacing debian:Baltimore_CyberTrust_Root.pem  Replacing debian:Buypass_Class_2_Root_CA.pem  Replacing debian:Buypass_Class_3_Root_CA.pem  Replacing debian:CA_Disig_Root_R2.pem  Replacing debian:CFCA_EV_ROOT.pem  Replacing debian:COMODO_Certification_Authority.pem  Replacing debian:COMODO_ECC_Certification_Authority.pem  Replacing debian:COMODO_RSA_Certification_Authority.pem  Replacing debian:Certigna.pem  Replacing debian:Certum_Trusted_Network_CA.pem  Replacing debian:Chambers_of_Commerce_Root_-_2008.pem  Replacing debian:Comodo_AAA_Services_root.pem  Replacing debian:Cybertrust_Global_Root.pem  Replacing debian:D-TRUST_Root_Class_3_CA_2_2009.pem  Replacing debian:D-TRUST_Root_Class_3_CA_2_EV_2009.pem  Replacing debian:DST_Root_CA_X3.pem  Replacing debian:DigiCert_Assured_ID_Root_CA.pem  Replacing debian:DigiCert_Assured_ID_Root_G2.pem  Replacing debian:DigiCert_Assured_ID_Root_G3.pem  Replacing debian:DigiCert_Global_Root_CA.pem  Replacing debian:DigiCert_Global_Root_G2.pem  Replacing debian:DigiCert_Global_Root_G3.pem  Replacing debian:DigiCert_High_Assurance_EV_Root_CA.pem  Replacing debian:DigiCert_Trusted_Root_G4.pem  Replacing debian:E-Tugra_Certification_Authority.pem  Replacing debian:EC-ACC.pem  Replacing debian:Entrust.net_Premium_2048_Secure_Server_CA.pem  Replacing debian:Entrust_Root_Certification_Authority.pem  Replacing debian:Entrust_Root_Certification_Authority_-_EC1.pem  Replacing debian:Entrust_Root_Certification_Authority_-_G2.pem  Replacing debian:GeoTrust_Primary_Certification_Authority_-_G2.pem  Replacing debian:GlobalSign_ECC_Root_CA_-_R4.pem  Replacing debian:GlobalSign_ECC_Root_CA_-_R5.pem  Replacing debian:GlobalSign_Root_CA.pem  Replacing debian:GlobalSign_Root_CA_-_R2.pem  Replacing debian:GlobalSign_Root_CA_-_R3.pem  Replacing debian:Global_Chambersign_Root_-_2008.pem  Replacing debian:Go_Daddy_Class_2_CA.pem  Replacing debian:Go_Daddy_Root_Certificate_Authority_-_G2.pem  Replacing debian:Hellenic_Academic_and_Research_Institutions_RootCA_2011.pem  Replacing debian:Hongkong_Post_Root_CA_1.pem  Replacing debian:IdenTrust_Commercial_Root_CA_1.pem  Replacing debian:IdenTrust_Public_Sector_Root_CA_1.pem  Replacing debian:Izenpe.com.pem  Replacing debian:Microsec_e-Szigno_Root_CA_2009.pem  Replacing debian:NetLock_Arany_=Class_Gold=_Főtanúsítvány.pem  Replacing debian:Network_Solutions_Certificate_Authority.pem  Replacing debian:OISTE_WISeKey_Global_Root_GB_CA.pem  Replacing debian:QuoVadis_Root_CA.pem  Replacing debian:QuoVadis_Root_CA_1_G3.pem  Replacing debian:QuoVadis_Root_CA_2.pem  Replacing debian:QuoVadis_Root_CA_2_G3.pem  Replacing debian:QuoVadis_Root_CA_3.pem  Replacing debian:QuoVadis_Root_CA_3_G3.pem  Replacing debian:SecureSign_RootCA11.pem  Replacing debian:SecureTrust_CA.pem  Replacing debian:Secure_Global_CA.pem  Replacing debian:Security_Communication_RootCA2.pem  Replacing debian:Security_Communication_Root_CA.pem  Replacing debian:Sonera_Class_2_Root_CA.pem  Replacing debian:Staat_der_Nederlanden_EV_Root_CA.pem  Replacing debian:Staat_der_Nederlanden_Root_CA_-_G3.pem  Replacing debian:Starfield_Class_2_CA.pem  Replacing debian:Starfield_Root_Certificate_Authority_-_G2.pem  Replacing debian:Starfield_Services_Root_Certificate_Authority_-_G2.pem  Replacing debian:SwissSign_Gold_CA_-_G2.pem  Replacing debian:SwissSign_Silver_CA_-_G2.pem  Replacing debian:T-TeleSec_GlobalRoot_Class_2.pem  Replacing debian:T-TeleSec_GlobalRoot_Class_3.pem  Replacing debian:TWCA_Global_Root_CA.pem  Replacing debian:TWCA_Root_Certification_Authority.pem  Replacing debian:TeliaSonera_Root_CA_v1.pem  Replacing debian:Trustis_FPS_Root_CA.pem  Replacing debian:USERTrust_ECC_Certification_Authority.pem  Replacing debian:USERTrust_RSA_Certification_Authority.pem  Replacing debian:VeriSign_Universal_Root_Certification_Authority.pem  Replacing debian:XRamp_Global_CA_Root.pem  Replacing debian:certSIGN_ROOT_CA.pem  Replacing debian:ePKI_Root_Certification_Authority.pem  Replacing debian:AC_RAIZ_FNMT-RCM.pem  Replacing debian:Amazon_Root_CA_1.pem  Replacing debian:Amazon_Root_CA_2.pem  Replacing debian:Amazon_Root_CA_3.pem  Replacing debian:Amazon_Root_CA_4.pem  Replacing debian:Certum_Trusted_Network_CA_2.pem  Replacing debian:Hellenic_Academic_and_Research_Institutions_ECC_RootCA_2015.pem  Replacing debian:Hellenic_Academic_and_Research_Institutions_RootCA_2015.pem  Replacing debian:ISRG_Root_X1.pem  Replacing debian:SZAFIR_ROOT_CA2.pem  Replacing debian:TUBITAK_Kamu_SM_SSL_Kok_Sertifikasi_-_Surum_1.pem  Replacing debian:GDCA_TrustAUTH_R5_ROOT.pem  Replacing debian:GlobalSign_Root_CA_-_R6.pem  Replacing debian:OISTE_WISeKey_Global_Root_GC_CA.pem  Replacing debian:SSL.com_EV_Root_Certification_Authority_ECC.pem  Replacing debian:SSL.com_EV_Root_Certification_Authority_RSA_R2.pem  Replacing debian:SSL.com_Root_Certification_Authority_ECC.pem  Replacing debian:SSL.com_Root_Certification_Authority_RSA.pem  Replacing debian:TrustCor_ECA-1.pem  Replacing debian:TrustCor_RootCert_CA-1.pem  Replacing debian:TrustCor_RootCert_CA-2.pem  Replacing debian:Certigna_Root_CA.pem  Replacing debian:certSIGN_Root_CA_G2.pem  Replacing debian:emSign_ECC_Root_CA_-_C3.pem  Replacing debian:emSign_ECC_Root_CA_-_G3.pem  Replacing debian:emSign_Root_CA_-_C1.pem  Replacing debian:emSign_Root_CA_-_G1.pem  Replacing debian:Entrust_Root_Certification_Authority_-_G4.pem  Replacing debian:e-Szigno_Root_CA_2017.pem  Replacing debian:GTS_Root_R1.pem  Replacing debian:GTS_Root_R2.pem  Replacing debian:GTS_Root_R3.pem  Replacing debian:GTS_Root_R4.pem  Replacing debian:Hongkong_Post_Root_CA_3.pem  Replacing debian:Microsoft_ECC_Root_Certificate_Authority_2017.pem  Replacing debian:Microsoft_RSA_Root_Certificate_Authority_2017.pem  Replacing debian:Trustwave_Global_Certification_Authority.pem  Replacing debian:Trustwave_Global_ECC_P256_Certification_Authority.pem  Replacing debian:Trustwave_Global_ECC_P384_Certification_Authority.pem  Replacing debian:UCA_Extended_Validation_Root.pem  Replacing debian:UCA_Global_G2_Root.pem  Replacing debian:NAVER_Global_Root_Certification_Authority.pem  done.  done.  Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ...  Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...  Rebuilding /usr/share/applications/bamf-2.index...  Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...  Processing triggers for mime-support (3.59ubuntu1) ...  Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ...  

Download Debian - Configure the Network Problem

Posted: 03 Jun 2021 09:08 AM PDT

I was downloading and installing debian to make it my main OS. And i'm stuck somewhere.

My first question :

Debian gets stuck on "Configure the Network" while installing. I am using laptop and ASUS USB-N14 Wireless-N300

first display:

Attemption to find an available wireless network failed.    "X" is a wireless network interface. Please enter the name (the ESSID) of the wireless network you would like "X" to use. To connect to any available network, leave thıs field blank.    Wireless ESSID for "X":  ....................  

Second display

Choose WEP/Open if the network is open or secured with WEP. Choose WPA/WPA2 if the network is protect with WPA/WPA2 PSK(Pre-Shared Key).    Wireless network type for "X":  ...............................  

Third display

Enter the passphrase for WPA/WPA2 PSK authentication. This should be the passphrase defined for the wireless network you are trying to use.    WPA/WPA2 passphrase for wireless device "X":  ...............................  

I enter the correct information and press continue, but after the third screen it sends me back to the first screen.

My Second Question:

When installing the Windows 10 operating system with usb, there were options such as format and delete.There were no such options when installing the debian. How can I install debian after completely cleaning the SSD?

List of Users - RHEL

Posted: 03 Jun 2021 09:15 AM PDT

I want to get list of users - both human and machine who have access to the unix server. OS is:

NAME="Red Hat Enterprise Linux Server"  VERSION="7.9 (Maipo)"  

I tried cat /etc/passwd and getent passwd - but both these lists are incomplete. A number of users that have a folder in /home are not present in output of either of the above two commands.

I ran id <username> for a username that had a folder but not present in the output of these commands and I got a valid output, proving that that user exists.

So, how do I get a list of "all" users of the server.
PS: I do have sudo access.

How can I move a file to another folder, but only if it hasn't been modified since 10 minutes?

Posted: 03 Jun 2021 08:38 AM PDT

Replace the "10 minutes" with whatever value. Basically I only want to move the file if it's not growing any more. How can I do this on the command-line or a bash script?

A solution that is easy to cron is preferred.


Details:

  • OS: CentOS
  • What I have tried so far: nothing because I don't know where to even start
  • What kind of files: any files in a directory

Postfix Relay access denied after upgrading from 2.11 to 3.4

Posted: 03 Jun 2021 09:00 AM PDT

The version 2.11.3 of the Postfix have worked flawlessly for the past couple of years. After I upgraded it to the version 3.4.14, the server is not able to send emails to external anymore.

In the mail.err file, I have found the following line:

postfix/smtpd[1043]: fatal: in parameter smtpd_relay_restrictions or smtpd_recipient_restrictions, specify at least one working instance of: reject_unauth_destination, defer_unauth_destination, reject, defer, defer_if_permit or check_relay_domains  

After that I have configured the both parameters in the master.cf to the

  -o smtpd_recipient_restrictions=reject_unauth_destination    -o smtpd_relay_restrictions=reject_unauth_destination  

In the Postfix version 2.11, that both parameters were commented out.

After that configuration the message in the mail.err was gone but I found another error in mail.log file

Jun  3 08:01:22 smtp-out postfix/smtpd[19915]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <info@info.com>: Relay access denied; from=<john.smith@test.com> to=<info@info.com> proto=ESMTP helo=<[127.0.0.1]>  

Since I am using the sender_dependent_relayhost_maps = hash:/etc/postfix/transport_sender what would be the correct configuration of those two parameters (in case if that is the problem)?

Here is my main.cf file:

inet_protocols = ipv4  smtpd_banner = Company ESMTP NO UCE/UBE  biff = no  append_dot_mydomain = no  myhostname = smtp-out.company.com  mydomain = company.com  alias_maps = hash:/etc/aliases  alias_database = hash:/etc/aliases  myorigin = /etc/mailname  mydestination = smtp-out.local, localhost.dmz.local.dmz.local, localhost, $mydomain, localhost.$mydomain    relayhost = [mail.external-relayserver.com]    relay_domains =  mynetworks = 192.168.10.0/24, 192.168.15.0/24, 127.0.0.0/8, [::1]/128  header_checks = regexp:/etc/postfix/regexp/header_checks  message_size_limit = 47185920  recipient_delimiter = +    transport_maps = hash:/etc/postfix/transport    undisclosed_recipients_header=  local_recipient_maps =  smtp_tls_security_level=may  smtp_tls_loglevel=1    # relay transport  sender_dependent_relayhost_maps = hash:/etc/postfix/transport_sender  smtp_sender_dependent_authentication = yes  smtp_sasl_auth_enable = yes  smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd  smtp_sasl_security_options = noanonymous    default_destination_concurrency_limit = 2  default_destination_rate_delay = 1s  

master.cf file:

smtp      inet  n       -       -       -       -       smtpd    -o smtpd_recipient_restrictions=reject_unauth_destination    -o smtpd_relay_restrictions=reject_unauth_destination    pickup    unix  n       -       -       60      1       pickup  cleanup   unix  n       -       -       -       0       cleanup  qmgr      unix  n       -       n       300     1       qmgr  tlsmgr    unix  -       -       -       1000?   1       tlsmgr  rewrite   unix  -       -       -       -       -       trivial-rewrite  bounce    unix  -       -       -       -       0       bounce  defer     unix  -       -       -       -       0       bounce  trace     unix  -       -       -       -       0       bounce  verify    unix  -       -       -       -       1       verify  flush     unix  n       -       -       1000?   0       flush  proxymap  unix  -       -       n       -       -       proxymap  proxywrite unix -       -       n       -       1       proxymap  smtp      unix  -       -       -       -       -       smtp  relay     unix  -       -       -       -       -       smtp  showq     unix  n       -       -       -       -       showq  error     unix  -       -       -       -       -       error  retry     unix  -       -       -       -       -       error  discard   unix  -       -       -       -       -       discard  local     unix  -       n       n       -       -       local  virtual   unix  -       n       n       -       -       virtual  lmtp      unix  -       -       -       -       -       lmtp  anvil     unix  -       -       -       -       1       anvil  scache    unix  -       -       -       -       1       scache    maildrop  unix  -       n       n       -       -       pipe    flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}    uucp      unix  -       n       n       -       -       pipe    flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)    ifmail    unix  -       n       n       -       -       pipe    flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)  bsmtp     unix  -       n       n       -       -       pipe    flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient  scalemail-backend unix  -   n   n   -   2   pipe    flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}  mailman   unix  -       n       n       -       -       pipe    flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py    ${nexthop} ${user}  

Why can't I run nmap with the -O option even when I use sudo

Posted: 03 Jun 2021 10:06 AM PDT

I'm trying to determine which ports are in use with my machine. I found, online an article that listed one method as follows:

$ sudo nmap -sT -O localhost  

I believedthis would give me a list of all ports listening for TCP packets. However, when I enter this command, I get the following result:

Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-02 21:07 EDT  socket troubles in HostOsScan: Permission denied (13)  

If I'm running as sudo, how can I lack permission to run something on my machine??

I tried running just:

$ sudo nmap -sT  localhost  

and got:

Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-02 21:28 EDT  Nmap scan report for localhost (127.0.0.1)  Host is up (0.000094s latency).  Not shown: 999 closed ports  PORT    STATE SERVICE  631/tcp open  ipp  

Just tried nmap without arguments and again was denied permission !?

$ sudo nmap localhost  Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-03 11:05 EDT  Couldn't open a raw socket. Error: Permission denied (13)  

Looking at nmap's --help option, I see that -O enables OS detection. Why should I not have permission to use this option - especially with sudo? (Note: I'm currently running Ubuntu 18.04 & 20.04)

(Note: Accepted answer solves my root problem - looking at ports, but answer in comments section explains why I was having trouble with nmap. Apparently, because I installed with snap, I needed to also execute:

 $ sudo snap connect nmap:network-control  

before nmap would work correctly

Replace strings in shell. Error: Bad substitution

Posted: 03 Jun 2021 09:57 AM PDT

I am trying to replace all white spaces with _. I used the following code:

FONT="DejaVu Sans Mono"  FONT_CODE=${FONT//[ ]/_}  echo $FONT_CODE   

I'm expecting DejaVu_Sans_Mono as the output But I got the following error :

x.sh: 2: Bad substitution  

I am not sure what I need to do to get work.

In shell parameter expansion, what’s the difference between ${variable:-} and ${variable-} (colon–hyphen–brace versus hyphen–brace) [duplicate]

Posted: 03 Jun 2021 11:00 AM PDT

In a shell script, I'm aware that ${var:-} will return var's value if it has one, and otherwise returns nothing.

But what about ${var-}? The chart in the POSIX documentation doesn't say (and there is no documentation matching the litmus string -} in man bash or Zsh's man zshall or man zshexpn).

While I understand the difference between ${var:-word} and ${var-word}, I do not understand what, exactly, this syntax means if word is omitted. What's the difference between ${var:-} and the ${var-} I see in a commit by Marco Ferrari to "Fix potentially unbound variables"?

How to add custom resolution in GNOME 40 on (Wayland)?

Posted: 03 Jun 2021 10:36 AM PDT

In display settings I am getting any other resolution but 1920 x 1080. I want to change it to 1920 x 1080 resolution mode. How can I add it and change the resolution? I am running Fedora 34 as a vm in VMware. Gnome 40 in Arch has the same issue..

Annotations not working in Okular (missing characters)

Posted: 03 Jun 2021 10:03 AM PDT

Yesterday, I upgraded to Fedora 34 from a F33 install.

Today, while using Okular (KDE's PDF reader), I noticed that special characters (áéíóúç etc...) doesn't appear in annotations made within the PDF. For example, in the image below, I should be getting 'xxx áéíóú xxx' rather than 'xxx xxx'.

enter image description here

What can be causing this problem? I don't recall it happening in F33.

speedtest-cli: ValueError: invalid literal for int() with base 10: ''

Posted: 03 Jun 2021 09:05 AM PDT

On 3 machines I get:

$ speedtest-cli   Retrieving speedtest.net configuration...  Traceback (most recent call last):    File "/usr/bin/speedtest-cli", line 11, in <module>      load_entry_point('speedtest-cli==2.1.2', 'console_scripts', 'speedtest-cli')()    File "/usr/lib/python3/dist-packages/speedtest.py", line 1986, in main      shell()    File "/usr/lib/python3/dist-packages/speedtest.py", line 1872, in shell      speedtest = Speedtest(    File "/usr/lib/python3/dist-packages/speedtest.py", line 1091, in __init__      self.get_config()    File "/usr/lib/python3/dist-packages/speedtest.py", line 1173, in get_config      ignore_servers = list(  ValueError: invalid literal for int() with base 10: ''  

I have tested one of these machines on two different internet connections with the same result.

Why is it not working?

XUbuntu LightDM login loop

Posted: 03 Jun 2021 11:04 AM PDT

I am currently using Ubuntu 18.04.3 LTS, and I randomly got a login loop upon restarting my PC. The content of my /var/log/lightdm/lightdm.log is the following:

Greeter connected version 1.27.0 api=1 resettable=false  Greeter start authentication for malek  Session pid=1767: Started with service 'lightdm', username 'malek'  Session pid=1767: Got 1 message(s) from PAM  Prompt greeter with 1 message(s)  Seat seat0 changes active session to  Seat seat0 changes active session to 4  

I did select the save session on restart option, which I only started doing two days ago, and I never had to encounter this problem before. My home directory and all of the files inside of it belong to malek

I am completely stumped, I don't want to re-install Linux (unless there's a way to do so without loosing your users)

Thank you for you help.

Alsa and PulseAudio (csound): Connection Refused

Posted: 03 Jun 2021 09:06 AM PDT

I've come across a problem that has me completely stumped. First; some system info

Linux quasar-nixos-tr 4.19.87 #1-NixOS SMP Sun Dec 1 08:17:47 UTC 2019 x86_64 GNU/Linux  

Now; I'm playing with a sound generating/music library called csound and I'm seeing a strange issue.

I'm using a layer over csound via Haskell; the library is called csound-expression and it merely generates a csound file based on some Haskell code, and then runs it via csound.

As per my understanding; csound then routes the audio to Alsa, which on my system, attempts to route it via PulseAudio's default device.

Now, something strange happens on my system.

  1. After a fresh boot, if I run the csound related code, I hear sound. But, once I've stopped that piece of code from running, no other application seems to be able to connect to PA anymore. Checking with systemctl --user status pulseaudio.service pulsaudio.socket reveals that the service is dead and it has exhausted the max. no. of tries to start up.
  2. After a fresh boot; if I run some other application, say pavucontrol; I can now connect to the PA service but my haskell csound code can no longer connect. It instead, exits with:

    λ> dac . osc $ 200   0dBFS level = 32768.0  --Csound version 6.13 (double samples) Jan  1 1970  [commit: none]  libsndfile-1.0.28  UnifiedCSD:  tmp.csd  STARTING FILE  Creating options  Creating orchestra  closing tag  Creating score  rtaudio: ALSA module enabled  rtmidi: ALSA Raw MIDI module enabled  Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.001s  sorting score ...      ... done  Elapsed time at end of score sort: real: 0.001s, CPU: 0.001s  displays suppressed  0dBFS level = 1.0  orch now loaded  audio buffered in 256 sample-frame blocks  ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused     *** Cannot open device 'default' for audio input: Connection refused  Failed to initialise real time audio input  inactive allocs returned to freespace  end of score.          overall amps:  0.00000         overall samples out of range:        0  1 errors in performance  Elapsed time at end of performance: real: 0.169s, CPU: 0.004s  

In case 1 (above); I see something interesting in the logs but I'm limited by my understanding of how PA works, how Alsa works and how both of these work together:

Dec 16 09:28:16 quasar-nixos-tr systemd[1708]: Starting Sound Service...  Dec 16 09:28:16 quasar-nixos-tr pulseaudio[2382]: E: [pulseaudio] socket-server.c: bind(): Address already in use  Dec 16 09:28:16 quasar-nixos-tr pulseaudio[2382]: E: [pulseaudio] module.c: Failed to load module "module-esound-protocol-unix" (argument: ""): initialization failed.  Dec 16 09:28:16 quasar-nixos-tr pulseaudio[2382]: E: [pulseaudio] main.c: D-Bus name org.PulseAudio1 already taken.  Dec 16 09:28:16 quasar-nixos-tr systemd[1708]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE  Dec 16 09:28:16 quasar-nixos-tr systemd[1708]: pulseaudio.service: Failed with result 'exit-code'.  Dec 16 09:28:16 quasar-nixos-tr systemd[1708]: Failed to start Sound Service.  Dec 16 09:28:16 quasar-nixos-tr systemd[1708]: pulseaudio.service: Service RestartSec=500ms expired, scheduling restart.  Dec 16 09:28:16 quasar-nixos-tr systemd[1708]: pulseaudio.service: Scheduled restart job, restart counter is at 4.  Dec 16 09:28:16 quasar-nixos-tr systemd[1708]: Stopped Sound Service.  Dec 16 09:28:16 quasar-nixos-tr systemd[1708]: Starting Sound Service...  Dec 16 09:28:17 quasar-nixos-tr pulseaudio[2390]: E: [pulseaudio] socket-server.c: bind(): Address already in use  Dec 16 09:28:17 quasar-nixos-tr pulseaudio[2390]: E: [pulseaudio] module.c: Failed to load module "module-esound-protocol-unix" (argument: ""): initialization failed.  Dec 16 09:28:17 quasar-nixos-tr pulseaudio[2390]: E: [pulseaudio] main.c: D-Bus name org.PulseAudio1 already taken.  Dec 16 09:28:17 quasar-nixos-tr systemd[1708]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE  Dec 16 09:28:17 quasar-nixos-tr systemd[1708]: pulseaudio.service: Failed with result 'exit-code'.  Dec 16 09:28:17 quasar-nixos-tr systemd[1708]: Failed to start Sound Service.  Dec 16 09:28:17 quasar-nixos-tr systemd[1708]: pulseaudio.service: Service RestartSec=500ms expired, scheduling restart.  Dec 16 09:28:17 quasar-nixos-tr systemd[1708]: pulseaudio.service: Scheduled restart job, restart counter is at 5.  Dec 16 09:28:17 quasar-nixos-tr systemd[1708]: Stopped Sound Service.  Dec 16 09:28:17 quasar-nixos-tr systemd[1708]: pulseaudio.service: Start request repeated too quickly.  Dec 16 09:28:17 quasar-nixos-tr systemd[1708]: pulseaudio.service: Failed with result 'exit-code'.  

The user here is in the audio and sound groups and I'm using NixOS; which likely has no bearing on this issue.

Can anyone help with what could be going on here?


Also note that; in case 2; alsamixer lists all devices correctly.

sed variable expansion issues

Posted: 03 Jun 2021 09:34 AM PDT

So I have made some progress on the bash script I'm writing but can't seem to figure out how to write the following so that it expands the variables. I tried the normal ${variable} and the \$(variable) as well as some other random helpless attempts.

I even tried using eval wrapping it in " " but it still didn't work (unless ran from command line but wouldn't work in the bash script).

sed -i 's/.*output_snat_lo.conf:/    - '\''\\-t nat -A POSTROUTING -s 10.0.0.1/32 -d $DNAT -j SNAT --to-source $SINT'\''\n&/' file.yaml  

Any suggestions? TIA.

Static IP and netplan stop working a couple days after fresh install Ubuntu Server 18.04 LTS

Posted: 03 Jun 2021 10:04 AM PDT

Having some major issues with networking on Ubuntu 18.04 LTS. Fresh install. I set a static IP during install which worked for a couple days and remained set after multiple reboots. Now the interface shows no IP. It seems when I set that IP it did generate a netplan that appears correct however netplan apply does nothing.

This happened to me previously as well on the previous install. I had been messing with some DNS stuff so I figured I'd just reimage the machine and not touch any of the network utilities this time and I still am having the issue.

The issue occurs about a day and a half after install seemingly randomly. Was not using the machine when the issue began and the only thing I have done so far on this install is set up a couple docker containers with samba and SFTP.

Contents of my 50-cloud-init.yaml

# This file is generated from information provided by  # the datasource.  Changes to it will not persist across an instance.  # To disable cloud-init's network configuration capabilities, write a file  # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:  # network: {config: disabled}  network:      version: 2      renderer: networkd      ethernets:          enp0s25:              dhcp4: no              addresses: [192.168.0.32/24]              gateway4: 192.168.0.1              nameservers:                  addresses: [1.1.1.1,8.8.8.8]  

Terminal output from netplan --debug apply

** (generate:2227): DEBUG: 23:11:19.520: Processing input file /etc/netplan/50-cloud-init.yaml..  ** (generate:2227): DEBUG: 23:11:19.520: starting new processing pass  ** (generate:2227): DEBUG: 23:11:19.520: enp0s25: setting default backend to 1  ** (generate:2227): DEBUG: 23:11:19.520: Generating output files..  ** (generate:2227): DEBUG: 23:11:19.520: NetworkManager: definition enp0s25 is not for us (backend 1)  DEBUG:netplan generated networkd configuration exists, restarting networkd  DEBUG:no netplan generated NM configuration exists  DEBUG:enp0s25 not found in {}  DEBUG:Merged config:  network:    bonds: {}    bridges: {}    ethernets:      enp0s25:        addresses:        - 192.168.0.32/24        dhcp4: false        gateway4: 192.168.0.1        nameservers:          addresses:          - 1.1.1.1          - 8.8.8.8    vlans: {}    wifis: {}    DEBUG:Skipping non-physical interface: lo  DEBUG:Skipping non-physical interface: docker0  DEBUG:Skipping non-physical interface: br-98e8ea9c70cb  DEBUG:{}  DEBUG:netplan triggering .link rules for lo  DEBUG:netplan triggering .link rules for enp0s25  DEBUG:netplan triggering .link rules for docker0  DEBUG:netplan triggering .link rules for br-98e8ea9c70cb    

My ifconfig

br-98e8ea9c70cb: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500          inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255          ether 02:42:51:a6:a3:66  txqueuelen 0  (Ethernet)          RX packets 0  bytes 0 (0.0 B)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 0  bytes 0 (0.0 B)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0    docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500          inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255          ether 02:42:d5:d6:46:8e  txqueuelen 0  (Ethernet)          RX packets 0  bytes 0 (0.0 B)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 0  bytes 0 (0.0 B)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0    enp0s25: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500          ether 00:24:7e:00:e0:30  txqueuelen 1000  (Ethernet)          RX packets 0  bytes 0 (0.0 B)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 0  bytes 0 (0.0 B)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          device interrupt 16  memory 0xfc500000-fc520000      lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536          inet 127.0.0.1  netmask 255.0.0.0          inet6 ::1  prefixlen 128  scopeid 0x10<host>          loop  txqueuelen 1000  (Local Loopback)          RX packets 7926  bytes 592108 (592.1 KB)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 7926  bytes 592108 (592.1 KB)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      

No comments:

Post a Comment