Saturday, April 10, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


bash: looping through characters not working

Posted: 10 Apr 2021 09:42 AM PDT

hey guy I have this code that checks that the string contains only space characters and hash characters ("#"), if so it echos 'yes' if not echos 'no'

string="###############          #             #          # #############          #             #          # ######### # #          #         # # #          # ### ##### # #          #   #     # # #          # # ###########          # #                      ###############"                       confirm_variable="Yes"  for (( i=0; i<${#string}; i++ )); do      str="${string:$i:1}"      if [ "$str" == "#" ] || [ "$str" == " " ] || [ "$str" == "\n" ] ;           then              continue          else              confirm_variable="No"              break      fi    done  echo $confirm_variable  

not sure why this isnt working as if i make the string equal somthing like:

string = "## #### # # #"

it seems to work fine

thanks in advance

lsusb: can't get debug descriptor: Resource temporarily unavailable

Posted: 10 Apr 2021 09:42 AM PDT

I'm unable to get Report Descriptors for my usb device using lsusb -v. I'm running it as root but I'm still only getting:

         Report Descriptors:              ** UNAVAILABLE **  

My USB devices seem to work but every most usb entries give out errors like:

can't get device qualifier: Resource temporarily unavailable  can't get debug descriptor: Resource temporarily unavailable  

outputs of lsusb -vd <vid>:<pid>:

root@mx:/home/bobajeff# lsusb -vd 046d:c069    Bus 002 Device 003: ID 046d:c069 Logitech, Inc. M-U0007 [Corded Mouse M500]  Device Descriptor:    bLength                18    bDescriptorType         1    bcdUSB               2.00    bDeviceClass            0     bDeviceSubClass         0     bDeviceProtocol         0     bMaxPacketSize0         8    idVendor           0x046d Logitech, Inc.    idProduct          0xc069 M-U0007 [Corded Mouse M500]    bcdDevice           56.01    iManufacturer           1 Logitech    iProduct                2 USB Laser Mouse    iSerial                 0     bNumConfigurations      1    Configuration Descriptor:      bLength                 9      bDescriptorType         2      wTotalLength       0x0022      bNumInterfaces          1      bConfigurationValue     1      iConfiguration          4 U56.01_B0009      bmAttributes         0xa0        (Bus Powered)        Remote Wakeup      MaxPower               98mA      Interface Descriptor:        bLength                 9        bDescriptorType         4        bInterfaceNumber        0        bAlternateSetting       0        bNumEndpoints           1        bInterfaceClass         3 Human Interface Device        bInterfaceSubClass      1 Boot Interface Subclass        bInterfaceProtocol      2 Mouse        iInterface              0           HID Device Descriptor:            bLength                 9            bDescriptorType        33            bcdHID               1.10            bCountryCode            0 Not supported            bNumDescriptors         1            bDescriptorType        34 Report            wDescriptorLength      71           Report Descriptors:              ** UNAVAILABLE **        Endpoint Descriptor:          bLength                 7          bDescriptorType         5          bEndpointAddress     0x81  EP 1 IN          bmAttributes            3            Transfer Type            Interrupt            Synch Type               None            Usage Type               Data          wMaxPacketSize     0x0006  1x 6 bytes          bInterval              10  can't get device qualifier: Resource temporarily unavailable  can't get debug descriptor: Resource temporarily unavailable  Device Status:     0x0000    (Bus Powered)  root@mx:/home/bobajeff# lsusb -vd 056a:00b1    Bus 002 Device 006: ID 056a:00b1 Wacom Co., Ltd PTZ-630 [Intuos3 (6x8)]  Device Descriptor:    bLength                18    bDescriptorType         1    bcdUSB               1.10    bDeviceClass            0     bDeviceSubClass         0     bDeviceProtocol         0     bMaxPacketSize0         8    idVendor           0x056a Wacom Co., Ltd    idProduct          0x00b1 PTZ-630 [Intuos3 (6x8)]    bcdDevice            1.02    iManufacturer           1 Tablet    iProduct                2 PTZ-630    iSerial                 0     bNumConfigurations      1    Configuration Descriptor:      bLength                 9      bDescriptorType         2      wTotalLength       0x0022      bNumInterfaces          1      bConfigurationValue     1      iConfiguration          0       bmAttributes         0x80        (Bus Powered)      MaxPower              300mA      Interface Descriptor:        bLength                 9        bDescriptorType         4        bInterfaceNumber        0        bAlternateSetting       0        bNumEndpoints           1        bInterfaceClass         3 Human Interface Device        bInterfaceSubClass      1 Boot Interface Subclass        bInterfaceProtocol      2 Mouse        iInterface              0           HID Device Descriptor:            bLength                 9            bDescriptorType        33            bcdHID               1.00            bCountryCode            0 Not supported            bNumDescriptors         1            bDescriptorType        34 Report            wDescriptorLength     170           Report Descriptors:              ** UNAVAILABLE **        Endpoint Descriptor:          bLength                 7          bDescriptorType         5          bEndpointAddress     0x81  EP 1 IN          bmAttributes            3            Transfer Type            Interrupt            Synch Type               None            Usage Type               Data          wMaxPacketSize     0x000a  1x 10 bytes          bInterval               4  can't get debug descriptor: Resource temporarily unavailable  Device Status:     0x0000    (Bus Powered)    root@mx:/home/bobajeff# lsusb -vd 1d6b:0003    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub  Device Descriptor:    bLength                18    bDescriptorType         1    bcdUSB               3.00    bDeviceClass            9 Hub    bDeviceSubClass         0     bDeviceProtocol         3     bMaxPacketSize0         9    idVendor           0x1d6b Linux Foundation    idProduct          0x0003 3.0 root hub    bcdDevice            5.08    iManufacturer           3 Linux 5.8.0-3-amd64 xhci-hcd    iProduct                2 xHCI Host Controller    iSerial                 1 0000:00:14.0    bNumConfigurations      1    Configuration Descriptor:      bLength                 9      bDescriptorType         2      wTotalLength       0x001f      bNumInterfaces          1      bConfigurationValue     1      iConfiguration          0       bmAttributes         0xe0        Self Powered        Remote Wakeup      MaxPower                0mA      Interface Descriptor:        bLength                 9        bDescriptorType         4        bInterfaceNumber        0        bAlternateSetting       0        bNumEndpoints           1        bInterfaceClass         9 Hub        bInterfaceSubClass      0         bInterfaceProtocol      0 Full speed (or root) hub        iInterface              0         Endpoint Descriptor:          bLength                 7          bDescriptorType         5          bEndpointAddress     0x81  EP 1 IN          bmAttributes            3            Transfer Type            Interrupt            Synch Type               None            Usage Type               Data          wMaxPacketSize     0x0004  1x 4 bytes          bInterval              12          bMaxBurst               0  Hub Descriptor:    bLength              12    bDescriptorType      42    nNbrPorts             6    wHubCharacteristic 0x000a      No power switching (usb 1.0)      Per-port overcurrent protection    bPwrOn2PwrGood       10 * 2 milli seconds    bHubContrCurrent      0 milli Ampere    bHubDecLat          0.0 micro seconds    wHubDelay             0 nano seconds    DeviceRemovable    0x00   Hub Port Status:     Port 1: 0000.02a0 5Gbps power Rx.Detect     Port 2: 0000.02a0 5Gbps power Rx.Detect     Port 3: 0000.02a0 5Gbps power Rx.Detect     Port 4: 0000.02a0 5Gbps power Rx.Detect     Port 5: 0000.02a0 5Gbps power Rx.Detect     Port 6: 0000.02a0 5Gbps power Rx.Detect  Binary Object Store Descriptor:    bLength                 5    bDescriptorType        15    wTotalLength       0x000f    bNumDeviceCaps          1    SuperSpeed USB Device Capability:      bLength                10      bDescriptorType        16      bDevCapabilityType      3      bmAttributes         0x02        Latency Tolerance Messages (LTM) Supported      wSpeedsSupported   0x0008        Device can operate at SuperSpeed (5Gbps)      bFunctionalitySupport   3        Lowest fully-functional device speed is SuperSpeed (5Gbps)      bU1DevExitLat          10 micro seconds      bU2DevExitLat         512 micro seconds  can't get debug descriptor: Resource temporarily unavailable  Device Status:     0x0001    Self Powered      

Why is my system unable to get device qualifier, debug descriptor or Report Descriptors from my usb devices? Can this be fixed?

Zsh: Is it possible to disable history expansion inside double quotes?

Posted: 10 Apr 2021 08:27 AM PDT

Is it possible to disable history expansion inside double quotes?

I do not want history expansion to be completely disabled, as I still use it, but I see no reason to expand the history inside a string ...

An example of my desired behavior:

$ echo "Hello!"  Hello!  $ !!  Hello!  

Convert a string variable to a number/float

Posted: 10 Apr 2021 08:20 AM PDT

here comes my problem. I would like to use the mean and standard deviation of a raster file to perform some computations. The statitics come in a xml file. I imported the mean using:

mean=$(grep MEAN 2021_rasterfile.tif.aux.xml | cut -c 34-49)  

to find the correct line and the correct position. Further I got

echo $mean  0.51233039627487  

Unfortunately, this is a string, not a float. I cannot do any calculations with the "number". I hope for your help. Thanks a lot Felix

Toggling touchpad with `xinput --disable <device>` kills user session

Posted: 10 Apr 2021 08:18 AM PDT

[Host running Arch linux 5.11.12-arch1-1 with gdm on Xorg.]

For years I've disabled/enabled my touchpad on the fly, directly from keyboard as long as I had an active terminal session (launched with tmux in my case). I did this by pressing a key combination which I bind to the execution of a small script found pretty much everywhere on the net by now. This has ceased to function with my latest package update from 2 days ago. It included a Linux kernel upgrade from 5.11.10 to 5.11.12.

Now whenever the key combo is pressed, the user session quits along with everything USER was doing in it, and USER is left staring at a fresh user login screen. I could not find a similar issue searching the net AND the SE knowledge base for similar report, but no luck.

  • using ~/.xbindkeysrc I bind the key combo CTRL+Mod4 + p + Release to the execution of the script :

    "(/opt/scripts/toggle_touchpad.sh &)"  Control+Mod4 + p + Release  

Combo CTRL+Mod4 corresponds to keys Control and the "Win" key that allows focusing in and out of the Gnome desktop. I have not found any reference to that key combo being newly reserved or assigned to something else by gdm.

  • the script is a slightly modified public recipe:

    $ cat /opt/scripts/toggle_touchpad.sh  #!/usr/bin/env bash  declare -i xID  declare -i STATE  # detect touchpad's xID and state  xID=$(sed -ne '/06CB:7A13 Touchpad/s/.*\ *id=\([0-9]*\)\ *.*$/\1/p' < <(/usr/bin/xinput --list))  STATE=$(awk '/Device Enabled/ {print $4}' < <(/usr/bin/xinput --list-props "$xID"))    if [ "$STATE" -eq 1 ]; then      #/usr/bin/xinput --disable "$xID"      /usr/bin/xinput --set-prop "$xID" "Device Enabled" 0  else      /usr/bin/xinput --enable "$xID"  fi  

xID has value 14 for my laptop's touchpad, and I checked that the user session is killed when I disable the touchpad from terminal:

  $ /usr/bin/xinput --disable 14   # syntax as shown in man page  

or

  $ /usr/bin/xinput disable 14     # maybe deprecated syntax, not in man page  

or

  $ /usr/bin/xinput --set-prop 14 "Device Enabled" 0  

Same behavior when I enable the touchpad from either the CLI or using the key binding. So the xinput cmd line could be the culprit rather than the key combo binding.

I am stranded. Any pointers anyone ?

Manjaro 21.0.1 download links are broken!

Posted: 10 Apr 2021 08:53 AM PDT

I'm trying to download Manjaro on my system but all of the links on the website are broken. is it the same for you?

EDIT: I upgraded the Manjaro Gnome version as always. I was on a stable branch and after the update, the Gnome version updated to 40 and the Gnome shell stayed at 38. and after that, the whole Gnome crashed. now I want to install Manjaro KDE and all of the links are broken

How to download folders using wildcards with SCP?

Posted: 10 Apr 2021 07:10 AM PDT

Basically, I try to download only folders in a folder that start with a specific letter, like a: sshconf:/var/www/mywebsite/data/a* ~/mywebsite/data/. The wildcard works and it lists all directories starting with a, however, it will report:

: /var/www/mywebsite/data/afoo: not a regular file  : /var/www/mywebsite/data/abar: not a regular file  ...  

How can I download all the folders starting with a using SCP? I hope it is possible to do this in one command.

How to install R 4.0.* on Raspbian GNU/Linux 10 (buster)?

Posted: 10 Apr 2021 06:56 AM PDT

I believe I have followed the instructions on the relevant CRAN site to update R to the newest version (currently R 4.0.5) but with no luck.

I'm running

$ cat /etc/os-release  PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"  

with R version

$ R --version  R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"  

What I did is, first add repository to /etc/apt/sources.list

http://cloud.r-project.org/bin/linux/debian buster-cran40/   

which currently looks like this:

deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi  # Uncomment line below then 'apt-get update' to enable 'apt-get source'  #deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi  deb http://cloud.r-project.org/bin/linux/debian buster-cran40/  

Second, to fetch and import the current signing key:

$ sudo apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'  

Third,

$ sudo apt update  $ sudo apt upgrade  

Now I attempted to install, but that fails.

$ sudo apt-get install r-base r-base-dev  Reading package lists... Done  Building dependency tree  Reading state information... Done  Some packages could not be installed. This may mean that you have  requested an impossible situation or if you are using the unstable  distribution that some required packages have not yet been created  or been moved out of Incoming.  The following information may help to resolve the situation:    The following packages have unmet dependencies:   r-base : Depends: r-base-core (>= 4.0.5-1~bustercran.0) but 3.5.2-1 is to be installed            Depends: r-recommended (= 4.0.5-1~bustercran.0) but it is not going to be installed            Recommends: r-base-html but it is not going to be installed   r-base-dev : Depends: r-base-core (>= 4.0.5-1~bustercran.0) but 3.5.2-1 is to be installed  E: Unable to correct problems, you have held broken packages.  

To solve the issue I tried several things like fixing dependencies issue,

$ sudo apt-get autoremove  

re-installing r-base-core,

$ sudo apt update   $ sudo apt remove r-base-core  $ sudo apt install r-base-core  

and using the command at the CRAN site mentioned above.

$ sudo apt install -t buster-cran40 r-base  

But I still have R version 3.5.2, i.e. I always get R 3.5.2 instead of R 4.0.5.

How do I get R 4.0.5 onto my Raspberry pi?

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

Posted: 10 Apr 2021 07:29 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?

How to automatically launch LibreWolf browser in full screen?

Posted: 10 Apr 2021 07:56 AM PDT

When I launch the LibreWolf browser it opens in a small window:

enter image description here

Then I manually expand the window to full screen:

enter image description here

It is inconvenient for me to open the window in full screen manually after every time I start the LibreWolf.

I think I need to change some setting somewhere in the about:config section, but I don't know which setting.

Update: I use Xorg + Arch + LibreWolf 87 (based on Firefox 87).

Issue installing input-fonts with nixOS, how to use 'nix-store --add-fixed'?

Posted: 10 Apr 2021 07:38 AM PDT

NixOS version: 20.09.3765.d6f63659a70 (Nightingale)

I am trying to install Input Fonts on NixOS (which I'm pretty new to).

I seem to be unable to install input-fonts on NixOS even though I have the following lines in my /etc/nixos/configuration.nix

fonts.fonts = with pkgs; [    input-fonts  ];    nixpkgs.config.allowUnfree = true;  nixpkgs.config.input-fonts.acceptLicense = true;  

When trying to nixos-rebuild switch, I get the following error:

***  Unfortunately, we cannot download file Input-Font.zip automatically.  Please go to https://input.fontbureau.com/download/ to download it yourself, and add it to the Nix store  using either    nix-store --add-fixed sha256 Input-Font.zip  or    nix-prefetch-url --type sha256 file:///path/to/Input-Font.zip    ***  

Looks like the issue is that there is no static download URL accessible from the Fontbureau page.

So I have downloaded the zip manually and run nix-store --add-fixed sha256 Input-Font.zip, but frankly I don't really know what to do with the output and the docs for --add-fixed don't really shed any light on it for me.

I get an output like this: /nix/store/7vqs2n6hrnwgd9hf6rxyhg5hx5qnrd2s-Input-Font.zip

Is anyone more familiar with installing packages in this way able to shed light on what to do with this?


Alternatively I could install the fonts from the files I've downloaded manually, but I am also unclear on how to do that, NixOS docs state:

Adding personal fonts to ~/.fonts doesn't work    The ~/.fonts directory is being deprecated upstream[1]. It already doesn't work in NixOS.    The new preferred location is in $XDG_DATA_HOME/fonts, which for most users will resolve to ~/.local/share/fonts  

I have tried adding the font files in ~/.local/share/fonts too, but they still don't get recognized when I try to use them in any config.


Any help on either method for getting these fonts working would be appreciated!

Software recommendation: Preview file list

Posted: 10 Apr 2021 10:07 AM PDT

I would need an app showing previews (thumbnails) of a given list of files: is there any? I know I could simulate it by (soft-)linking the files in a temporary folder, but when the list is huge it's time-consuming.

Just to better explain: when you do a search in your file manager, you get a list of files from different folders BUT in a unified view, and you can preview them (see their thumbnails). Now: I want the exact same view BUT providing the list of the files, without doing a search. Is there an app to do that?

Space content arguments piped into bash via xargs

Posted: 10 Apr 2021 09:53 AM PDT

This list will be arguments piped into bash via xargs:

$ ls  foo  'foo bar'  

but fail to do it in such:

$ n=7; ls| xargs bash -c "for i ;{ echo -e $n \$i ;}" 0  7 foo   7 foo  7 bar  

instead of

7 foo  7 'foo bar'  

How to do it the correct way ? Thanks

Motion on Pi - Not Writing Files

Posted: 10 Apr 2021 10:01 AM PDT

I am struggling to get Motion working properly. It is not currently writing files when it detects motion.

I got my first Pi today. I have set it up, the camera works. I can take pictures and take video. These are being written fine. I have set up Motion and this appears to be working. I can stream the video via the IP address/web browser to a different machine. When creating movement in front of the camera this is detected - the log file motion.log updates and detects motion. However, stills are not being written. The target_dir folder is empty and a search of the file system doesn't find any new image files.

How do I get the stills to be written when motion is detected?

motion.conf is below. Any suggestions welcome. Thanks


# Daemon    # Start in daemon (background) mode and release terminal (default: off)  daemon off    # File to store the process ID, also called pid file. (default: not defined)  process_id_file /var/run/motion/motion.pid    # Basic Setup Mode    # Start in Setup-Mode, daemon disabled. (default: off)  setup_mode off      # Use a file to save logs messages, if not defined stderr and syslog is used. (default: not defined)  logfile /var/log/motion/motion.log    # Level of log messages [1..9] (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL). (default: 6 / NTC)  log_level 6    # Filter to log messages by type (COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL). (default: ALL)  log_type all    ###########################################################  # Capture device options  ############################################################    # Videodevice to be used for capturing  (default /dev/video0)  # for FreeBSD default is /dev/bktr0  videodevice /dev/video0    # v4l2_palette allows one to choose preferable palette to be use by motion  # See motion_guide.html for the valid options and values.  (default: 17)  v4l2_palette 17    # Tuner device to be used for capturing using tuner as source (default /dev/tuner0)  # This is ONLY used for FreeBSD. Leave it commented out for Linux  ; tunerdevice /dev/tuner0    # The video input to be used (default: -1)  # Should normally be set to 0 or 1 for video/TV cards, and -1 for USB cameras  # Set to 0 for uvideo(4) on OpenBSD  input -1    # The video norm to use (only for video capture and TV tuner cards)  # Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)  norm 0    # The frequency to set the tuner to (kHz) (only for TV tuner cards) (default: 0)  frequency 0    # Override the power line frequency for the webcam. (normally not necessary)  # Values:  # -1 : Do not modify device setting  # 0  : Power line frequency Disabled  # 1  : 50hz  # 2  : 60hz  # 3  : Auto  power_line_frequency -1    # Rotate image this number of degrees. The rotation affects all saved images as  # well as movies. Valid values: 0 (default = no rotation), 90, 180 and 270.  rotate 0    # Flip image over a given axis (vertical or horizontal), vertical means from left to right  # horizontal means top to bottom. Valid values: none, v and h.  flip_axis none    # Image width (pixels). Valid range: Camera dependent, default: 320  width 640    # Image height (pixels). Valid range: Camera dependent, default: 240  height 480    # Maximum number of frames to be captured per second.  # Valid range: 2-100. Default: 100 (almost no limit).  framerate 2    # Minimum time in seconds between capturing picture frames from the camera.  # Default: 0 = disabled - the capture rate is given by the camera framerate.  # This option is used when you want to capture images at a rate lower than 2 per second.  minimum_frame_time 0    # Full Network Camera URL.  Valid Services: http:// ftp:// mjpg:// rtsp:// mjpeg:// file:// rtmp://  ; netcam_url value    # Username and password for network camera if required. Syntax is user:password  ; netcam_userpass value    # The setting for keep-alive of network socket, should improve performance on compatible net cameras.  # off:   The historical implementation using HTTP/1.0, closing the socket after each http request.  # force: Use HTTP/1.0 requests with keep alive header to reuse the same connection.  # on:    Use HTTP/1.1 requests that support keep alive as default.  # Default: off  netcam_keepalive off    # URL to use for a netcam proxy server, if required, e.g. "http://myproxy".  # If a port number other than 80 is needed, use "http://myproxy:1234".  # Default: not defined  ; netcam_proxy value    # Set less strict jpeg checks for network cameras with a poor/buggy firmware.  # Default: off  netcam_tolerant_check off    # RTSP connection uses TCP to communicate to the camera. Can prevent image corruption.  # Default: on  rtsp_uses_tcp on    # Name of camera to use if you are using a camera accessed through OpenMax/MMAL  # Default: Not defined  ; mmalcam_name vc.ril.camera    # Camera control parameters (see raspivid/raspistill tool documentation)  # Default: Not defined  ; mmalcam_control_params -hf    # Let motion regulate the brightness of a video device (default: off).  # The auto_brightness feature uses the brightness option as its target value.  # If brightness is zero auto_brightness will adjust to average brightness value 128.  # Only recommended for cameras without auto brightness  auto_brightness off    # Set the initial brightness of a video device.  # If auto_brightness is enabled, this value defines the average brightness level  # which Motion will try and adjust to.  # Valid range 0-255, default 0 = disabled  brightness 0    # Set the contrast of a video device.  # Valid range 0-255, default 0 = disabled  contrast 0    # Set the saturation of a video device.  # Valid range 0-255, default 0 = disabled  saturation 0    # Set the hue of a video device (NTSC feature).  # Valid range 0-255, default 0 = disabled  hue 0      # Round Robin (multiple inputs on same video device name)    # Number of frames to capture in each roundrobin step (default: 1)  roundrobin_frames 1    # Number of frames to skip before each roundrobin step (default: 1)  roundrobin_skip 1    # Try to filter out noise generated by roundrobin (default: off)  switchfilter off      ############################################################  # Motion Detection Settings:  ############################################################    # Threshold for number of changed pixels in an image that  # triggers motion detection (default: 1500)  threshold 1500    # Automatically tune the threshold down if possible (default: off)  threshold_tune off    # Noise threshold for the motion detection (default: 32)  noise_level 32    # Automatically tune the noise threshold (default: on)  noise_tune on    # Despeckle motion image using (e)rode or (d)ilate or (l)abel (Default: not defined)  # Recommended value is EedDl. Any combination (and number of) of E, e, d, and D is valid.  # (l)abeling must only be used once and the 'l' must be the last letter.  # Comment out to disable  despeckle_filter EedDl    # Detect motion in predefined areas (1 - 9). Areas are numbered like that:  1 2 3  # A script (on_area_detected) is started immediately when motion is         4 5 6  # detected in one of the given areas, but only once during an event.        7 8 9  # One or more areas can be specified with this option. Take care: This option  # does NOT restrict detection to these areas! (Default: not defined)  ; area_detect value    # PGM file to use as a sensitivity mask.  # Full path name to. (Default: not defined)  ; mask_file value    # PGM file to completely mask out a area of image.  # Full path name to. (Default: not defined)  # mask_privacy value    # Dynamically create a mask file during operation (default: 0)  # Adjust speed of mask changes from 0 (off) to 10 (fast)  smart_mask_speed 0    # Ignore sudden massive light intensity changes given as a percentage of the picture  # area that changed intensity. Valid range: 0 - 100 , default: 0 = disabled  lightswitch 0    # Picture frames must contain motion at least the specified number of frames  # in a row before they are detected as true motion. At the default of 1, all  # motion is detected. Valid range: 1 to thousands, recommended 1-5  minimum_motion_frames 1    # Specifies the number of pre-captured (buffered) pictures from before motion  # was detected that will be output at motion detection.  # Recommended range: 0 to 5 (default: 0)  # Do not use large values! Large values will cause Motion to skip video frames and  # cause unsmooth movies. To smooth movies use larger values of post_capture instead.  pre_capture 0    # Number of frames to capture after motion is no longer detected (default: 0)  post_capture 0    # Event Gap is the seconds of no motion detection that triggers the end of an event.  # An event is defined as a series of motion images taken within a short timeframe.  # Recommended value is 60 seconds (Default). The value -1 is allowed and disables  # events causing all Motion to be written to one single movie file and no pre_capture.  # If set to 0, motion is running in gapless mode. Movies don't have gaps anymore. An  # event ends right after no more motion is detected and post_capture is over.  event_gap 60    # Maximum length in seconds of a movie  # When value is exceeded a new movie file is created. (Default: 0 = infinite)  max_movie_time 0    # Always save images even if there was no motion (default: off)  emulate_motion off      ############################################################  # Image File Output    # Output 'normal' pictures when motion is detected (default: off)  # Valid values: on, off, first, best, center  # When set to 'first', only the first picture of an event is saved.  # Picture with most motion of an event is saved when set to 'best'.  # Picture with motion nearest center of picture is saved when set to 'center'.  # Can be used as preview shot for the corresponding movie.  output_pictures centre    # Output pictures with only the pixels moving object (ghost images) (default: off)  output_debug_pictures off    # The quality (in percent) to be used by the jpeg and webp compression (default: 75)  quality 75    # Type of output images  # Valid values: jpeg, ppm or webp (default: jpeg)  picture_type jpeg    ############################################################    # Use ffmpeg to encode videos of motion (default: off)  ffmpeg_output_movies off    # Use ffmpeg to make videos showing the moving pixels (ghost images) (default: off)  ffmpeg_output_debug_movies off    # Bitrate to be used by the ffmpeg encoder (default: 400000)  # This option is ignored if ffmpeg_variable_bitrate is not 0 (disabled)  ffmpeg_bps 400000    # Enables and defines variable bitrate for the ffmpeg encoder.  # ffmpeg_bps is ignored if variable bitrate is enabled.  # Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps,  # or the range 1 - 100 where 1 means worst quality and 100 is best.  ffmpeg_variable_bitrate 0    # Container/Codec output videos  # Valid values: mpeg4, msmpeg4, swf,flv, ffv1, mov, mp4, mkv, hevc  ffmpeg_video_codec mkv    # When creating videos, should frames be duplicated in order  # to keep up with the requested frames per second  # (default: true)  ffmpeg_duplicate_frames true    # Interval in seconds between timelapse captures.  Default: 0 = off  timelapse_interval 0    # Timelapse file rollover mode. See motion_guide.html for options and uses.  timelapse_mode daily    # Frame rate for timelapse playback  timelapse_fps 30    # Container/Codec for timelapse video. Valid values: mpg or mpeg4  timelapse_codec mpg    # External pipe to video encoder  # Replacement for FFMPEG builtin encoder for ffmpeg_output_movies only.  # The options movie_filename and timelapse_filename are also used  # by the ffmpeg feature  #############################################################    # Bool to enable or disable extpipe (default: off)  use_extpipe off    # External program (full path and opts) to pipe raw video to  # Generally, use '-' for STDIN...  ;extpipe mencoder -demuxer rawvideo -rawvideo w=%w:h=%h:i420 -ovc x264 -x264encopts bframes=4:frameref=1:subq=1:scenecut=-1:nob_adapt:threads=1:keyint=1000:8x8dct:vbv_bufsize=4000:crf=24:partitions=i8x8,i4x4:vbv_maxrate=800:no-chroma-me -vf denoise3d=16:12:48:4,pp=lb -of   avi -o %f.avi - -fps %fps  ;extpipe x264 - --input-res %wx%h --fps %fps --bitrate 2000 --preset ultrafast --quiet -o %f.mp4  ;extpipe mencoder -demuxer rawvideo -rawvideo w=%w:h=%h:fps=%fps -ovc x264 -x264encopts preset=ultrafast -of lavf -o %f.mp4 - -fps %fps  ;extpipe ffmpeg -y -f rawvideo -pix_fmt yuv420p -video_size %wx%h -framerate %fps -i pipe:0 -vcodec libx264 -preset ultrafast -f mp4 %f.mp4      # Snapshots (Traditional Periodic Webcam File Output)    # Make automated snapshot every N seconds (default: 0 = disabled)  snapshot_interval 0      ############################################################  # Text Display  # %Y = year, %m = month, %d = date,  # %H = hour, %M = minute, %S = second, %T = HH:MM:SS,  # %v = event, %q = frame number, %t = camera id number,  # %D = changed pixels, %N = noise level, \n = new line,  # %i and %J = width and height of motion area,  # %K and %L = X and Y coordinates of motion center  # %C = value defined by text_event - do not use with text_event!  # You can put quotation marks around the text to allow  # leading spaces    # Locate and draw a box around the moving object.  # Valid values: on, off, preview (default: off)  # Set to 'preview' will only draw a box in preview_shot pictures.  locate_motion_mode preview    # Set the look and style of the locate box if enabled.  # Valid values: box, redbox, cross, redcross (default: box)  # Set to 'box' will draw the traditional box.  # Set to 'redbox' will draw a red box.  # Set to 'cross' will draw a little cross to mark center.  # Set to 'redcross' will draw a little red cross to mark center.  locate_motion_style redbox    # Draws the timestamp using same options as C function strftime(3)  # Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock  # Text is placed in lower right corner  text_right %Y-%m-%d\n%T-%q    # Draw a user defined text on the images using same options as C function strftime(3)  # Default: Not defined = no text  # Text is placed in lower left corner  ; text_left CAMERA %t    # Draw the number of changed pixed on the images (default: off)  # Will normally be set to off except when you setup and adjust the motion settings  # Text is placed in upper right corner  text_changes on    # This option defines the value of the special event conversion specifier %C  # You can use any conversion specifier in this option except %C. Date and time  # values are from the timestamp of the first image in the current event.  # Default: %Y%m%d%H%M%S  # The idea is that %C can be used filenames and text_left/right for creating  # a unique identifier for each event.  text_event %Y%m%d%H%M%S    # Draw characters at twice normal size on images. (default: off)  text_double off      # Text to include in a JPEG EXIF comment  # May be any text, including conversion specifiers.  # The EXIF timestamp is included independent of this text.  ;exif_text %i%J/%K%L    ############################################################  # Target Directories and filenames For Images And Films  # For the options snapshot_, picture_, movie_ and timelapse_filename  # you can use conversion specifiers  # %Y = year, %m = month, %d = date,  # %H = hour, %M = minute, %S = second,  # %v = event, %q = frame number, %t = camera id number,  # %D = changed pixels, %N = noise level,  # %i and %J = width and height of motion area,  # %K and %L = X and Y coordinates of motion center  # %C = value defined by text_event  # Quotation marks round string are allowed.    # Target base directory for pictures and films  # Recommended to use absolute path. (Default: current working directory)  target_dir home/pi/Documents/motion    # File path for snapshots (jpeg, ppm or webp) relative to target_dir  # Default: %v-%Y%m%d%H%M%S-snapshot  # Default value is equivalent to legacy oldlayout option  # For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-snapshot  # File extension .jpg, .ppm or .webp is automatically added so do not include this.  # Note: A symbolic link called lastsnap.jpg created in the target_dir will always  # point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'  snapshot_filename %v-%Y%m%d%H%M%S-snapshot    # File path for motion triggered images (jpeg, ppm or .webp) relative to target_dir  # Default: %v-%Y%m%d%H%M%S-%q  # Default value is equivalent to legacy oldlayout option  # For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-%q  # File extension .jpg, .ppm or .webp is automatically added so do not include this  # Set to 'preview' together with best-preview feature enables special naming  # convention for preview shots. See motion guide for details  picture_filename %v-%Y%m%d%H%M%S-%q    # File path for motion triggered ffmpeg films (movies) relative to target_dir  # Default: %v-%Y%m%d%H%M%S  # File extensions(.mpg .avi) are automatically added so do not include them  movie_filename %v-%Y%m%d%H%M%S    # File path for timelapse movies relative to target_dir  # Default: %Y%m%d-timelapse  # File extensions(.mpg .avi) are automatically added so do not include them  timelapse_filename %Y%m%d-timelapse    # Global Network Options    ipv6_enabled off    # Live Stream Server    # The mini-http server listens to this port for requests (default: 0 = disabled)  stream_port 8081    # 50% scaled down substream (default: 0 = disabled)  # substream_port 8082    # Quality of the jpeg (in percent) images produced (default: 50)  stream_quality 80    # Output frames at 1 fps when no motion is detected and increase to the  # rate given by stream_maxrate when motion is detected (default: off)  stream_motion off    # Maximum framerate for stream streams (default: 1)  stream_maxrate 1    # Restrict stream connections to localhost only (default: on)  stream_localhost off    # Limits the number of images per connection (default: 0 = unlimited)  # Number can be defined by multiplying actual stream rate by desired number of seconds  # Actual stream rate is the smallest of the numbers framerate and stream_maxrate  stream_limit 0    # Set the authentication method (default: 0)  # 0 = disabled  # 1 = Basic authentication  # 2 = MD5 digest (the safer authentication)  stream_auth_method 0    # Authentication for the stream. Syntax username:password  # Default: not defined (Disabled)  ; stream_authentication username:password    # Percentage to scale the stream image for preview  # This is scaled on the browser side, motion will keep sending full frames  # Default: 25  ; stream_preview_scale 25    # Have stream preview image start on a new line  # Default: no  ; stream_preview_newline no    ############################################################  # HTTP Based Control  ############################################################    # TCP/IP port for the http server to listen on (default: 0 = disabled)  webcontrol_port 8080    # Restrict control connections to localhost only (default: on)  webcontrol_localhost on    # Output for http server, select off to choose raw text plain (default: on)  webcontrol_html_output on    # Authentication for the http based control. Syntax username:password  # Default: not defined (Disabled)  ; webcontrol_authentication username:password    # Parameters to include on webcontrol.  0=none, 1=limited, 2=advanced, 3=restricted  # Default: 0 (none)  webcontrol_parms 0      ############################################################  # Tracking (Pan/Tilt)  #############################################################    # Type of tracker (0=none (default), 1=stepper, 2=iomojo, 3=pwc, 4=generic, 5=uvcvideo, 6=servo)  # The generic type enables the definition of motion center and motion size to  # be used with the conversion specifiers for options like on_motion_detected  track_type 0    # Enable auto tracking (default: off)  track_auto off    # Serial port of motor (default: none)  ;track_port /dev/ttyS0    # Motor number for x-axis (default: 0)  ;track_motorx 0    # Set motorx reverse (default: 0)  ;track_motorx_reverse 0    # Motor number for y-axis (default: 0)  ;track_motory 1    # Set motory reverse (default: 0)  ;track_motory_reverse 0    # Maximum value on x-axis (default: 0)  ;track_maxx 200    # Minimum value on x-axis (default: 0)  ;track_minx 50    # Maximum value on y-axis (default: 0)  ;track_maxy 200    # Minimum value on y-axis (default: 0)  ;track_miny 50    # Center value on x-axis (default: 0)  ;track_homex 128    # Center value on y-axis (default: 0)  ;track_homey 128    # ID of an iomojo camera if used (default: 0)  track_iomojo_id 0    # Angle in degrees the camera moves per step on the X-axis  # with auto-track (default: 10)  # Currently only used with pwc type cameras  track_step_angle_x 10    # Angle in degrees the camera moves per step on the Y-axis  # with auto-track (default: 10)  # Currently only used with pwc type cameras  track_step_angle_y 10    # Delay to wait for after tracking movement as number  # of picture frames (default: 10)  track_move_wait 10    # Speed to set the motor to (stepper motor option) (default: 255)  track_speed 255    # Number of steps to make (stepper motor option) (default: 40)  track_stepsize 40      ############################################################  # External Commands, Warnings and Logging:  # You can use conversion specifiers for the on_xxxx commands  # %Y = year, %m = month, %d = date,  # %H = hour, %M = minute, %S = second,  # %v = event, %q = frame number, %t = camera id number,  # %D = changed pixels, %N = noise level,  # %i and %J = width and height of motion area,  # %K and %L = X and Y coordinates of motion center  # %C = value defined by text_event  # %f = filename with full path  # %n = number indicating filetype  # Both %f and %n are only defined for on_picture_save,  # on_movie_start and on_movie_end  # Quotation marks round string are allowed.  ############################################################    # Do not sound beeps when detecting motion (default: on)  # Note: Motion never beeps when running in daemon mode.  quiet on    # Command to be executed when an event starts. (default: none)  # An event starts at first motion detected after a period of no motion defined by event_gap  ; on_event_start value    # Command to be executed when an event ends after a period of no motion  # (default: none). The period of no motion is defined by option event_gap.  ; on_event_end value    # Command to be executed when a picture (.ppm|.jpg) is saved (default: none)  # To give the filename as an argument to a command append it with %f  ; on_picture_save value    # Command to be executed when a motion frame is detected (default: none)  ; on_motion_detected value    # Command to be executed when motion in a predefined area is detected  # Check option 'area_detect'.   (default: none)  ; on_area_detected value    # Command to be executed when a movie file (.mpg|.avi) is created. (default: none)  # To give the filename as an argument to a command append it with %f  ; on_movie_start value    # Command to be executed when a movie file (.mpg|.avi) is closed. (default: none)  # To give the filename as an argument to a command append it with %f  ; on_movie_end value    # Command to be executed when a camera can't be opened or if it is lost  # NOTE: There is situations when motion don't detect a lost camera!  # It depends on the driver, some drivers dosn't detect a lost camera at all  # Some hangs the motion thread. Some even hangs the PC! (default: none)  ; on_camera_lost value    # Command to be executed when a camera that was lost has been found (default: none)  # NOTE: If motion doesn't properly detect a lost camera, it also won't know it found one.  ; on_camera_found value    #####################################################################  # Options require database options to be active also.  #####################################################################    # Log to the database when creating motion triggered picture file  (default: on)  ; sql_log_picture on    # Log to the database when creating a snapshot image file (default: on)  ; sql_log_snapshot on    # Log to the database when creating motion triggered movie file (default: off)  ; sql_log_movie off    # Log to the database when creating timelapse movies file (default: off)  ; sql_log_timelapse off    # SQL query string that is sent to the database  # Use same conversion specifiers has for text features  # Additional special conversion specifiers are  # %n = the number representing the file_type  # %f = filename with full path  # Default value:  # Create tables :  ##  # Mysql  # CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp(14), event_time_stamp timestamp(14));  #  # Postgresql  # CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp without time zone, event_time_stamp timestamp without time zone);  #  # insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')  ; sql_query insert into security(camera, filename, frame, file_type, time_stamp, event_time_stamp) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')      ############################################################  # Database Options  ############################################################    # database type : mysql, postgresql, sqlite3 (default : not defined)  ; database_type value    # database to log to (default: not defined)  # for sqlite3, the full path and name for the database.  ; database_dbname value    # The host on which the database is located (default: localhost)  ; database_host value    # User account name for database (default: not defined)  ; database_user value    # User password for database (default: not defined)  ; database_password value    # Port on which the database is located  #  mysql 3306 , postgresql 5432 (default: not defined)  ; database_port value    # Database wait time in milliseconds for locked database to  # be unlocked before returning database locked error (default 0)  ; database_busy_timeout 0        # Video Loopback Device (vloopback project)    # Output images to a video4linux loopback device  # Specify the device associated with the loopback device  # For example /dev/video1 (default: not defined)  ; video_pipe value    # Output motion images to a video4linux loopback device  # Specify the device associated with the loopback device  # For example /dev/video1 (default: not defined)  ; motion_video_pipe value       # camera config files.  ; camera /etc/motion/camera1.conf  ; camera /etc/motion/camera2.conf  ; camera /etc/motion/camera3.conf  ; camera /etc/motion/camera4.conf      # Camera config directory  # Any files ending in '.conf' in this directory will be read  # as a camera config file.    ; camera_dir /etc/motion/conf.d  

Perl command Performance issue

Posted: 10 Apr 2021 07:24 AM PDT

I've used the following command to remove special characters in number columns (.CSV file) and it is working fine as excepted but the issue here is performance. My CSV file number column data contains as below. To remove 1000 separator comma in data I've used the following Perl command.

payment          "4,326.34"          590.20            "12,499.40"   

Note: My file delimiter was "," comma.

input file :                     Organization,Amount,Revenue,Balance,Desc      Congos,"4,233.78","3,233.78","1,233.78",Payment      Toyoto,590.2,390.2,190.2,Payment      lenives,"5,234.89","2,234.89","1,234.89",Payment                              Excepted OutPut:                          Organization,Amount,Revenue,Balance,Desc      Congos,4233.78,3233.78,1233.78,Payment      Toyoto,590.2,390.2,190.2,Payment      lenives,5234.89,2234.89,1234.89,Payment  

Command : cat | perl -p -e 's/,(?=[\d,.]\d")//g and s/"(\d[\d,.])"/\1/g' 'test.csv' >> newfile.csv

File data count: 11 millions data

Issue: It was taking almost 10 minutes to remove 1000 separate "comma" in data.

Any better solution to improve performance?

Compare two DNA sequences

Posted: 10 Apr 2021 08:51 AM PDT

I have two DNA sequence ATGCATGC and TACGTTGC

I want to write a program which gives "+" if upon comparing A align with T and G with C otherwise print "-"

Like

ATGCATGC  TACGTTGC  +++++---  

Can anyone help me out?

Output which I expect is given above.

What I tried is as following:

#!/bin/bash      declare -a seq1=()  declare -a seq2=()      read -p 'Enter the ncleotide seq (charactor by charactor followe\d by space0) ' -a seq1    read -n1 seq1    read -p 'Enter the ncleotide seq (charactor by charactor followe\d by space0) ' -a seq2    read -n1 seq2    for a in ${seq1[*]} ; do  for b in ${seq2[*]} ; do  if [ $a == A ] || [ $b == T ] ; then  echo -n "+"  elif [ $a == A ] || [ $b == C ] ; then  echo -n " -"  elif [ $a == A ] || [ $b == G ] ; then  echo -n "-"  elif [ $a == T ] || [ $b == A ] ; then  echo -n "+"  elif [ $a == T ] || [ $b == C ] ; then  echo -n "-"  elif [ $a == T ] || [ $b == G ] ; then  echo -n "-"  elif [ $a == C ] || [ $b == G ] ; then  echo -n "+"  elif [ $a == C ] || [ $b == A ] ; then  echo -n "-"  elif [ $a == C ] || [ $b == T ] ; then  echo -n "-"  elif [ $a == G ] || [ $b == C ] ; then  echo -n "+"  elif [ $a == G ] || [ $b == A ] ; then  echo -n "-"  elif [ $a == G ] || [ $b == T ] ; then  echo -n "-"  else    echo $a $b  fi  done  done  

Debian preseed does not create encrypted disk with LUKS LVM properly

Posted: 10 Apr 2021 09:06 AM PDT

I'm trying to create a LUKS LVM disk partition autmatically using preseed on Debian 10 (Buster). I have only a single disk /dev/sda with the size of 80GB and it has system memory of 4GB

Here is my full preseed configuration:

#### Preseed preconfiguration file (for Debian buster)  ### Partman early command  ### Kernal parameter  d-i debian-installer/add-kernel-opts string net.ifnames=0 biosdevname=0 console=ttyS0,19200n8  ### Localization  d-i debian-installer/locale string en_US.UTF-8  d-i debian-installer/language string en  d-i debian-installer/country string MY    ### Keyboard selection  d-i keyboard-configuration/xkb-keymap select us    ###  Network configuration  d-i netcfg/choose_interface select eth0  d-i netcfg/use_dhcp string false  d-i netcfg/disable_autoconfig boolean true  d-i netcfg/dhcp_failed note  d-i netcfg/dhcp_options select Configure network manually  # IPv4 Static network configuration  d-i netcfg/get_ipaddress string 172.14.5.185  d-i netcfg/get_netmask string 255.255.255.0  d-i netcfg/get_gateway string 172.14.5.1  d-i netcfg/get_nameservers string 139.12.11.5  d-i netcfg/confirm_static boolean true    # Set a hostname  d-i netcfg/get_hostname string sun  d-i netcfg/get_domain string domain.com  # Force a hostname  d-i netcfg/hostname string sun.domain.com  # Disable that annoying WEP key dialog  d-i netcfg/wireless_wep string    ### Mirror settings  d-i mirror/country string manual  d-i mirror/http/hostname string deb.debian.org  d-i mirror/http/directory string /debian  d-i mirror/http/proxy string    ### Account setup  # Skip creation of a normal user account  d-i passwd/make-user boolean false  # Set root password  # or encrypted using a crypt(3)  hash.  d-i passwd/root-password-crypted password $6$R3C6TyiPkyqUwaw7$4rgc4Uluov6wm5ZXmEdssw3pZs5E5dsnOuVPa/VAHAJTsQCsxSeKjIj7hp3xJzZ9t5wQpx6UuYcXZxYpjbkn/    ### Clock and time zone setup  # Set hardware clock to UTC  d-i clock-setup/utc boolean true  # Set timezone  d-i time/zone string Asia/Kuala_Lumpur  # Use NTP clock during installation  d-i clock-setup/ntp boolean true    ### Partitioning  # LVM LUKS method  d-i partman-auto/method string crypto  d-i partman-lvm/device_remove_lvm boolean true  d-i partman-md/device_remove_md boolean true  d-i partman-lvm/confirm boolean true  d-i partman-auto-lvm/guided_size string max  d-i partman-auto-lvm/new_vg_name string box1  d-i partman-auto/disk string /dev/sda  d-i partman-auto/choose_recipe select boot-crypto  d-i partman-auto/expert_recipe string \  boot-crypto :: \    1024 1024 1024 ext4 \            $primary{ } $bootable{ } \            method{ format } format{ } \            use_filesystem{ } filesystem{ ext4 } \            mountpoint{ /boot } \    . \    15360 15360 15360  ext4 \            $lvmok{ } lv_name{ root } \            in_vg { box1 } \            method{ format } format{ } \            use_filesystem{ } filesystem{ ext4 } \            mountpoint{ / } \    . \    2048 2048 2048 ext4 \            $lvmok{ } lv_name{ tmp } \            in_vg { box1 } \            method{ format } format{ } \            use_filesystem{ } filesystem{ ext4 } \            mountpoint{ /tmp } \            options/nosuid{ nosuid } \            options/noexec{ noexec } \    . \    4096 4096 4096 linux-swap \            $lvmok{ } lv_name{ swap } \            in_vg { box1 } \            method{ swap } format{ } \    . \    80896 80896 1000000 ext4 \            $lvmok{ } lv_name{ home } \            in_vg { box1 } \            method{ format } format{ } \            use_filesystem{ } filesystem{ ext4 } \            mountpoint{ /home } \            options/nosuid{ nosuid } \  d-i partman-basicfilesystems/no_mount_point boolean false  d-i partman-partitioning/confirm_write_new_label boolean true  d-i partman/choose_partition select finish  d-i partman/confirm boolean true  d-i partman/confirm_nooverwrite boolean true    ### Apt setup  d-i apt-setup/cdrom/set-first boolean false  d-i apt-setup/cdrom/set-next boolean false  d-i apt-setup/cdrom/set-failed boolean false  d-i apt-setup/services-select multiselect security, updates  d-i apt-setup/security_host string security.debian.org  ### Package selection  tasksel tasksel/first multiselect standard  # Individual additional packages to install  d-i pkgsel/include string openssh-server  popularity-contest popularity-contest/participate boolean false  

The other preseed config ran successfully. The disk is created with LUKS LVM but the problem is that there is a missing partition like /home (which is not created from the beginning) but I did defined it in the preseed file above. In addition, the swap disk space should be 4GB but it filled up the rest of the space. Here is the screenshot how this preseed config created the disk structure:

NAME            MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT  sda               8:0    0   79G  0 disk  |-sda1            8:1    0  976M  0 part  /boot  |-sda2            8:2    0    1K  0 part  `-sda5            8:5    0   78G  0 part    `-sda5_crypt  254:0    0   78G  0 crypt      |-box1-root 254:1    0 14.3G  0 lvm   /      |-box1-tmp  254:2    0  1.9G  0 lvm   /tmp      `-box1-swap 254:3    0 61.8G  0 lvm   [SWAP]  

What could be the reason for this? Any mistakes in my preseed file for partitioning?

My partition scheme is this:

TOTAL SPACE is 80 GB    partition: /boot 1GB | FILE SYSTEM: ext4 | bootable flag: on | no need to encrypt      # This is LVM container encryption called box1:    partition: /root (/) 15 GB | FILE SYSTEM: ext4    partition: /tmp 2GB | FILE SYSTEM: ext4 | mount with: nosuid, noexec    partition: swap 4GB    partition: /home 60GB (or the rest space left) | FILE SYSTEM: ext4| mount with: nosuid  

Gnome segfaults when monitor sleeps (desktop, PopOS)

Posted: 10 Apr 2021 09:57 AM PDT

Desktop computer running PopOS (incl Nvidia driver), NVIDIA graphics, Intel i7. After some indeterminate amount of time my monitor goes to sleep, according to it's power saving settings (Can't be disabled). When I wake my machine up I see that a random selection of the windows I had opened have disappeared.

Looking at syslog I can see tons of logs from the NVIDIA drivers that the monitor has disconnected, and in the middle of those a log from gnome-shell saying it hit a segfault. Then X11 segfaults and starts sending SIGKILL to numerous processes. At least, that's my interpretation of them. Logs are as follows, I've removed some errata as indicated by ellipsis (...):

Apr  9 13:31:42 logan-popos gnome-shell[2218]: Sync_devices: Failed to match stream id: 27, description: 'HDMI / DisplayPort', origin: 'GM200 High Definition Audio Digital Stereo (HDMI)'  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-2: disconnected  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-2: Internal DisplayPort  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-2: 960.0 MHz maximum pixel clock  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0):  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): CRT-0: disconnected  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock  ...(Lots more NVIDIA logs)...  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (II) NVIDIA(0): Setting mode "NULL"  Apr  9 13:31:43 logan-popos kernel: [ 8801.794613] gnome-shell[2218]: segfault at 18 ip 00007f89e8e29fe6 sp 00007ffd5ecf1bf0 error 4 in libmutter-7.so.0.0.0[7f89e8d88000+124000]  Apr  9 13:31:43 logan-popos kernel: [ 8801.794621] Code: 1f 44 00 00 85 db 0f 84 c8 00 00 00 a8 02 0f 84 c0 00 00 00 48 8b 45 30 48 8d 54 24 20 48 89 ef 4c 8d 7c 24 30 4c 8d 74 24 40 <8b> 70 18 e8 32 9c ff ff 4c 89 fe 48 89 ef e8 f7 90 ff ff 4c 89 f6  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): CRT-0: disconnected  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock  ...(Lots more NVIDIA logs)...  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Main process exited, code=dumped, status=11/SEGV  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Failed to kill control group /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@x11.service, ignoring: Operation not permitted  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 2245 (ibus-dconf) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 2248 (ibus-x11) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 3298 (WebExtensions) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 4347 (zsh) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 4578 (zsh) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 4607 (zsh) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 4608 (gitstatusd-linu) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 5203 (Web Content) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 5600 (Web Content) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 5860 (Web Content) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 6554 (Web Content) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 9135 (openconnect) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 9970 (cli) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 10639 (git) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 10640 (git-remote-http) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 10688 (git) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 3433 (Web Content) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 4346 (alacritty) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 4277 (Web Content) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 3375 (Privileged Cont) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 3154 (firefox) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 5530 (Web Content) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 7475 (RDD Process) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 10649 (git) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Failed to kill control group /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@x11.service, ignoring: Operation not permitted  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Failed to kill control group /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@x11.service, ignoring: Operation not permitted  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 2245 (ibus-dconf) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 3298 (WebExtensions) with signal SIGKILL.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Killing process 4347 (zsh) with signal SIGKILL.  ...(Lots more SIGKILL logs)...  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Unit process 5600 (Web Content) remains running after unit stopped.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Scheduled restart job, restart counter is at 1.  Apr  9 13:31:43 logan-popos systemd[1642]: Stopped GNOME Shell on X11.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Found left-over process 3298 (WebExtensions) in control group while starting unit. Ignoring.  Apr  9 13:31:43 logan-popos systemd[1642]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.  Apr  9 13:31:43 logan-popos systemd[1642]: org.gnome.Shell@x11.service: Found left-over process 4578 (zsh) in control group while starting unit. Ignoring.  Apr  9 13:31:43 logan-popos systemd[1642]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.  ...(Lots more "this usually indicated, ignoring..." logs)...  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): CRT-0: disconnected  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0):  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-0: disconnected  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-0: Internal TMDS  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-0: 330.0 MHz maximum pixel clock  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0):  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-1: disconnected  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-1: Internal TMDS  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0):  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-2: disconnected  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-2: Internal DisplayPort  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DFP-2: 960.0 MHz maximum pixel clock  ...(Lots more NVIDIA logs)...  Apr  9 13:31:43 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0):  Apr  9 13:31:43 logan-popos gsd-media-keys[2361]: Failed to grab accelerators: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface "org.gnome.Shell" on object at path /org/gnome/Shell  Apr  9 13:31:43 logan-popos gnome-shell[11258]: Skipping parental controls support as it's disabled  Apr  9 13:31:43 logan-popos gnome-shell[11258]: Unset XDG_SESSION_ID, getCurrentSessionProxy() called outside a user session. Asking logind directly.  Apr  9 13:31:43 logan-popos gnome-shell[11258]: Will monitor session 1  Apr  9 13:31:43 logan-popos dbus-daemon[1673]: [session uid=1000 pid=1673] Activating service name='org.freedesktop.portal.IBus' requested by ':1.467' (uid=1000 pid=11274 comm="ibus-daemon --panel disable --xim " label="unconfined")  Apr  9 13:31:43 logan-popos dbus-daemon[1673]: [session uid=1000 pid=1673] Successfully activated service 'org.freedesktop.portal.IBus'  Apr  9 13:31:43 logan-popos dbus-daemon[1363]: [system] Activating via systemd: service name='org.freedesktop.GeoClue2' unit='geoclue.service' requested by ':1.125' (uid=1000 pid=11258 comm="/usr/bin/gnome-shell " label="unconfined")  Apr  9 13:31:43 logan-popos systemd[1]: Starting Location Lookup Service...  Apr  9 13:31:43 logan-popos gnome-shell[11258]: Telepathy is not available, chat integration will be disabled.  Apr  9 13:31:43 logan-popos dbus-daemon[1363]: [system] Successfully activated service 'org.freedesktop.GeoClue2'  Apr  9 13:31:43 logan-popos systemd[1]: Started Location Lookup Service.  Apr  9 13:31:43 logan-popos dbus-daemon[1363]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.125' (uid=1000 pid=11258 comm="/usr/bin/gnome-shell " label="unconfined")  Apr  9 13:31:43 logan-popos systemd[1]: Starting PackageKit Daemon...  Apr  9 13:31:43 logan-popos PackageKit: daemon start  Apr  9 13:31:43 logan-popos dbus-daemon[1363]: [system] Successfully activated service 'org.freedesktop.PackageKit'  Apr  9 13:31:43 logan-popos systemd[1]: Started PackageKit Daemon.  Apr  9 13:31:44 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DELL P2415Q (DFP-2): connected  Apr  9 13:31:44 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DELL P2415Q (DFP-2): Internal DisplayPort  Apr  9 13:31:44 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0): DELL P2415Q (DFP-2): 960.0 MHz maximum pixel clock  Apr  9 13:31:44 logan-popos /usr/libexec/gdm-x-session[1679]: (--) NVIDIA(GPU-0):  Apr  9 13:31:44 logan-popos gnome-shell[11258]: meta_display_get_monitor_geometry: assertion 'monitor >= 0 && monitor < n_logical_monitors' failed  Apr  9 13:31:44 logan-popos gnome-shell[11258]: checking for plugins in /home/mattsi/.local/share/pop-shell/launcher/  Apr  9 13:31:44 logan-popos gnome-shell[11258]: checking for plugins in /usr/lib/pop-shell/launcher/  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin at /usr/lib/pop-shell/launcher//calc/meta.json  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin: Calculator  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin at /usr/lib/pop-shell/launcher//files/meta.json  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin: File Search  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin at /usr/lib/pop-shell/launcher//pulse/meta.json  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin: PulseAudio Volume Control  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin at /usr/lib/pop-shell/launcher//recent/meta.json  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin: Recent Documents  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin at /usr/lib/pop-shell/launcher//terminal/meta.json  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin: Terminal Commands  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin at /usr/lib/pop-shell/launcher//web/meta.json  Apr  9 13:31:44 logan-popos gnome-shell[11258]: found plugin: Web Search  Apr  9 13:31:44 logan-popos system76-power[1383]: [INFO] DBUS Received GetSwitchable() method  Apr  9 13:31:44 logan-popos system76-power[1383]: [INFO] DBUS Received GetProfile() method  

On a desktop so battery/power settings shouldn't be a concern, but I did check and found that suspend is & has always been switched off in power settings. Based on that and the logs I'm convinced that the problem is triggered by the monitor suspending, not the PC.

I would guess the issue is coming from the NVIDIA drivers, reacting in some way that Gnome can't handle. Any ideas? What can I do to further debug this and fix it?

Edit It happened again today. This time the logs don't show much other than there was a segfault in gnome-shell. It comes from the same place- "error 4" in "libmutter". But it isn't followed by the same X11 errors as last time. Once again it coincides with a load of NIVIDA logs. Similar NVIDIA logs are being sent out at various times and aren't associated with a Gnome segfault, but I think this is related because it happens at exactly the same second despite there being a long gap of no logs before then.

Apr 10 17:22:47 logan-popos rtkit-daemon[1535]: Supervising 9 threads of 7 processes of 1 users.  Apr 10 17:22:47 logan-popos rtkit-daemon[1535]: Successfully made thread 73612 of process 2700 owned by '1000' RT at priority 5.  Apr 10 17:22:47 logan-popos rtkit-daemon[1535]: Supervising 10 threads of 7 processes of 1 users.  Apr 10 17:22:47 logan-popos dbus-daemon[1232]: [system] Activating via systemd: service name='net.reactivated.Fprint' unit='fprintd.service' requested by ':1.47' (uid=1000 pid=2108 comm="/usr/bin/gnome-shell " label="unconfined")  Apr 10 17:22:47 logan-popos systemd[1]: Starting Fingerprint Authentication Daemon...  Apr 10 17:22:47 logan-popos dbus-daemon[1232]: [system] Successfully activated service 'net.reactivated.Fprint'  Apr 10 17:22:47 logan-popos systemd[1]: Started Fingerprint Authentication Daemon.  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-2: disconnected  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-2: Internal DisplayPort  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-2: 960.0 MHz maximum pixel clock  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0):  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): CRT-0: disconnected  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0):  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-0: disconnected  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-0: Internal TMDS  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-0: 330.0 MHz maximum pixel clock  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0):  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-1: disconnected  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-1: Internal TMDS  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0):  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-2: disconnected  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-2: Internal DisplayPort  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-2: 960.0 MHz maximum pixel clock  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0):  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-3: disconnected  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-3: Internal TMDS  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-3: 165.0 MHz maximum pixel clock  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0):  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-4: disconnected  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-4: Internal DisplayPort  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-4: 960.0 MHz maximum pixel clock  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0):  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-5: disconnected  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-5: Internal TMDS  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-5: 165.0 MHz maximum pixel clock  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0):  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-6: disconnected  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-6: Internal DisplayPort  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-6: 960.0 MHz maximum pixel clock  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0):  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-7: disconnected  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-7: Internal TMDS  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): DFP-7: 165.0 MHz maximum pixel clock  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0):  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (II) NVIDIA(0): Setting mode "NULL"  Apr 10 17:22:48 logan-popos kernel: [24722.343573] gnome-shell[2108]: segfault at 18 ip 00007f33555e4fe6 sp 00007ffef2caf310 error 4 in libmutter-7.so.0.0.0[7f3355543000+124000]  Apr 10 17:22:48 logan-popos kernel: [24722.343581] Code: 1f 44 00 00 85 db 0f 84 c8 00 00 00 a8 02 0f 84 c0 00 00 00 48 8b 45 30 48 8d 54 24 20 48 89 ef 4c 8d 7c 24 30 4c 8d 74 24 40 <8b> 70 18 e8 32 9c ff ff 4c 89 fe 48 89 ef e8 f7 90 ff ff 4c 89 f6  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): CRT-0: disconnected  Apr 10 17:22:48 logan-popos /usr/libexec/gdm-x-session[1549]: (--) NVIDIA(GPU-0): CRT-0: 400.0 MHz maximum pixel clock  

The most relevant part being:

Apr 10 17:22:48 logan-popos kernel: [24722.343573] gnome-shell[2108]: segfault at 18 ip 00007f33555e4fe6 sp 00007ffef2caf310 error 4 in libmutter-7.so.0.0.0[7f3355543000+124000]  Apr 10 17:22:48 logan-popos kernel: [24722.343581] Code: 1f 44 00 00 85 db 0f 84 c8 00 00 00 a8 02 0f 84 c0 00 00 00 48 8b 45 30 48 8d 54 24 20 48 89 ef 4c 8d 7c 24 30 4c 8d 74 24 40 <8b> 70 18 e8 32 9c ff ff 4c 89 fe 48 89 ef e8 f7 90 ff ff 4c 89 f6  

vsftp work only without TLS

Posted: 10 Apr 2021 07:04 AM PDT

Hi I installed vsftpd on ubuntu 20.04, at the beginning I tested my FTP server without having secured and it worked fine !!

But when I use the TLS certification the server does not work anymore I do not know what it is where it is what's the problem please help me! This is the configuration of my certification in vsftpd.conf

rsa_cert_file=/etc/ssl/private/vsftpd.pem  rsa_private_key_file=/etc/ssl/private/vsftpd.pem  ssl_enable=YES  user_sub_token=$USER  local_root=/home/$USER/ftp  allow_writeable_chroot=YES  pasv_min_port=10000  pasv_max_port=11000  userlist_enable=YES  userlist_file=/etc/vsftpd.user_list  userlist_deny=NO  allow_anon_ssl=NO  force_local_data_ssl=YES  force_local_logins_ssl=YES  ssl_tlsv1=YES  ssl_sslv2=NO  ssl_sslv3=NO  require_ssl_reuse=NO  ssl_ciphers=HIGH  

my error output of fillezilla is :

Error: The data connection cannot be established: ECONNREFUSED - Connection refused by the server  

in log file i get :

Fri Apr  9 21:30:18 2021 [pid 5390] DEBUG: Client "::ffff:196.178.36.3", "SSL version: TLSv1.3, SSL cipher: TLS_AES_256_GCM_SHA384, not reused, no cert"  

OUtupt systemctl status vsftpd :

vsftpd.service - vsftpd FTP server       Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)       Active: active (running) since Sat 2021-04-10 08:14:06 UTC; 3h 40min ago      Process: 5466 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited, status=0/SUCCESS)     Main PID: 5467 (vsftpd)        Tasks: 10 (limit: 2282)       Memory: 4.1M       CGroup: /system.slice/containerd.service/system.slice/vsftpd.service               |-5467 /usr/sbin/vsftpd /etc/vsftpd.conf               |-5483 /usr/sbin/vsftpd /etc/vsftpd.conf               |-5484 /usr/sbin/vsftpd /etc/vsftpd.conf               |-5485 /usr/sbin/vsftpd /etc/vsftpd.conf               |-5486 /usr/sbin/vsftpd /etc/vsftpd.conf               |-5487 /usr/sbin/vsftpd /etc/vsftpd.conf               |-5488 /usr/sbin/vsftpd /etc/vsftpd.conf               |-5490 /usr/sbin/vsftpd /etc/vsftpd.conf               |-5491 /usr/sbin/vsftpd /etc/vsftpd.conf               `-5492 /usr/sbin/vsftpd /etc/vsftpd.conf    Apr 10 08:14:06 VPS systemd[1]: Starting vsftpd FTP server...  Apr 10 08:14:06 VPS systemd[1]: Started vsftpd FTP server.  

Calculating specific average

Posted: 10 Apr 2021 08:35 AM PDT

I have a log with a long variable string and I am trying to get min, max and average from a number.

String examples

date time from Time: 100 ms to status code:   date time Time: 1050 ms status code IP  date time IP Time: 2 ms status code destination  

"Time: * ms" is constant in every line but the field location is changing. I would need that ms number max, min and average.

Failed to load module "module-alsa-card" for PulseAudio

Posted: 10 Apr 2021 09:38 AM PDT

I am trying to get my microphone working for voice recognition. When I run pulseaudio, I get the following error:

enter image description here

I am running a Lenovo Thinkstation P620 and I'm running Arch Linux.

Here is the output of arecord -l. Card number 3 (the rear 3.5mm line input plate with the microphone input and speaker output jacks) is what I'm trying to get to work.

enter image description here

I did try my microphone in Ubuntu and it just worked. I also don't get the "module-alsa-card" error. Do I need to configure a kernel parameter?

TLPDB error during Vanilla Install of TeXLive 2020

Posted: 10 Apr 2021 09:12 AM PDT

I'm trying to install TeXLive 2020 onto iSh (which uses Alpine Linux) and have extracted all files in the install-tl-unx.tar.gz tarball from the TUG webpage. However, when I execute ./install-tl from the extracted directory I get the following error:

Loading http://www.ctan.org/tex-archive/systems/texlive/tlnet/tlpkg/texlive.tlpdb    ./install-tl: TLPDB::from_file could not initialize from:                http://www.ctan.org/tex-archive/systems/texlive/tlnet/tlpkg/texlive.tlpdb  ./install-tl: Maybe the repository setting should be changed.  ./install-tl: More info: https://tug.org/texlive/acquire.html  

This happens whether or not I select a specific repository via the --select-repository option and happens both as root and normal user. How can I solve this problem?

Identify PCI device providing network interface

Posted: 10 Apr 2021 07:15 AM PDT

I can get vendor and device IDs for the device providing a network interface using /sys/class/net/:

$ cat /sys/class/net/p4p2/device/vendor /sys/class/net/p4p2/device/device  0x15b3  0x1013  

Then I can get lspci to show me info about that device:

$ lspci -d 0x15b3:0x1013  82:00.0 Infiniband controller: Mellanox Technologies MT27700 Family [ConnectX-4]  82:00.1 Ethernet controller: Mellanox Technologies MT27700 Family [ConnectX-4]  

So it's dual-port. In this case I happen to know that device p4p2 is the ethernet side, but is there info in /sys/class/net/<dev> which links it to the 82:00.1 entry? Or some other way which doesn't require sudo?

ls -l with regular grep expression

Posted: 10 Apr 2021 06:58 AM PDT

we have the following 1000 files

ls -ltr | grep list_of_cars | sort    -rw-r--r-- 1 root root   259 Dec 24 16:29 list_of_cars-0.json  -rw-r--r-- 1 root root   259 Dec 24 16:29 list_of_cars-1.json  -rw-r--r-- 1 root root   259 Dec 24 16:29 list_of_cars-2.json  .  .  .    -rw-r--r-- 1 root root   260 Dec 24 16:29 list_of_cars-996.json  -rw-r--r-- 1 root root   260 Dec 24 16:29 list_of_cars-997.json  -rw-r--r-- 1 root root   260 Dec 24 16:29 list_of_cars-998.json  -rw-r--r-- 1 root root   260 Dec 24 16:29 list_of_cars-999.json  

but when I try to capture all files with list_of_cars-[0-999].json by the following regular syntax , we get only 10 files instead of 1000 , why?

ls -ltr | sort | awk '{print $NF}' | grep "^list_of_cars-[0-999].json"  list_of_cars-0.json  list_of_cars-1.json  list_of_cars-2.json  list_of_cars-3.json  list_of_cars-4.json  list_of_cars-5.json  list_of_cars-6.json  list_of_cars-7.json  list_of_cars-8.json  list_of_cars-9.json  

where I am wrong?

How to resize a partition to its maximum capacity after partitioning it to half of its capacity?

Posted: 10 Apr 2021 07:00 AM PDT

After cloning a 1TB hdd "TO" a 2TB hdd, in which the 2TB hdd is now only 1TB... The following format will not allow me to resize it properly, to its max capacity. Seems as though it won't get resized to a bigger size than it is now.

FORMAT USED:

parted  resizepart  partition #  size 2000000MB (OR) 2GB  

"sectors exceed msdos parition max..." It says that it 'exceeds' the max by almost 1GB.

UPDATE: after repartitioning it at a slightly larger size than it was, I can no longer mount it.

HyperX Alloy Elite RGB customize led patterns

Posted: 10 Apr 2021 08:23 AM PDT

Today I bought an HyperX Alloy Elite RGB keyboard. I see that they have a led pattern customization software called NGenuity (https://www.hyperxgaming.com/us/ngenuity). But that's windows only. I tried to run it in wine but it didn't find the keyboard. Is there a way to configure it in Linux or make wine find the keyboard so I can use the windows led customization program ?

Thanks

TL;DR:

I posted a new solution I found some time ago as an answer. Check it.

A warning note

I couldn't get NGenuity to work on linux. It installed and run on Wine, but didn't recognize the keyboard. So I tried first in a virtualized ReactOS, with equal results. Then I continued to a virtualized Windows 7 running on Ubuntu, that I have in my office's computer. When I tried this option, NGenuity runned and asked me if I wanted to update keyboard's firmware. I made the choice to update and the whole keyboard went dead. The update's progress bar just didn't pass the initial state and I thought I had ruined the keyboard. Unpluged, replugged, restarted. Dead. Called the support only to listen they would replace it. Fortunately I had windows natively installed in other machine and this time the update completed sucessfully and the keyboard went alive again. But please:

JUST DON'T RUN NGENUITY FIRMWARE UPDATES IN NON-STANDARD WINDOWS INSTALLATIONS

Although if anyone had success in running this software or customizing the keyboard on linux I'd like to hear from you.

EDIT

More than a year later I finally got the courage to try this again. Now I have used it a bit :D

But anyway @d4rkm3z solution didn't work. My Mint installation ain't got any ttyUSB0 in /dev. Also I think it's more complicated than that. First Elite RGB has 2 USB cables. Then AFAIU it's using the hidraw port. I don't know much of these things. It's the same thing ? I read it's a raw USB port so it should be the same. I think it is because of dmesg output. I tried to link com1 to all ln hiraw0 to hidraw5 devices, but Ngenuity could not find the device with any of them. I also found some files in /dev/input/by-id that have the HyperX_Alloy_RGB name on it. Tried to link all of them to com1 with same result. What I could understand by dmesg output is that is linked to more than one USB.

Here's some data:

whatever:~$ sudo ls /dev -p  autofs           cuse         hidraw3     i2c-4      loop1         mei0            ppp     sdb   tty    tty17  tty26  tty35  tty44  tty53  tty62      ttyS12  ttyS21  ttyS30   uinput      vcs2   vcsa4  vcsu6  block/           disk/        hidraw4     i2c-5      loop2         mem               psaux   sdb1    tty0   tty18  tty27  tty36  tty45  tty54  tty63      ttyS13  ttyS22  ttyS31   urandom     vcs3   vcsa5  vcsu7  bsg/             dri/         hidraw5     i2c-6      loop3      memory_bandwidth       ptmx    sg0   tty1   tty19  tty28  tty37  tty46  tty55  tty7       ttyS14  ttyS23  ttyS4    usb/    vcs4   vcsa6  vfio/  btrfs-control    drm_dp_aux0  hpet        initctl    loop4         mqueue/             pts/    sg1   tty10  tty2   tty29  tty38  tty47  tty56  tty8       ttyS15  ttyS24  ttyS5    userio      vcs5   vcsa7  vga_arbiter  bus/             ecryptfs     hugepages/  input/     loop5         net/                random  shm/  tty11  tty20  tty3   tty39  tty48  tty57  tty9       ttyS16  ttyS25  ttyS6    vboxdrv     vcs6   vcsu   vhci  char/            fb0          hwrng       kmsg       loop6         network_latency     rfkill  snapshot  tty12  tty21  tty30  tty4   tty49  tty58  ttyprintk  ttyS17  ttyS26  ttyS7    vboxdrvu    vcs7   vcsu1  vhost-net  console          fd           i2c-0       kvm        loop7         network_throughput  rtc     snd/  tty13  tty22  tty31  tty40  tty5   tty59  ttyS0      ttyS18  ttyS27  ttyS8    vboxnetctl  vcsa   vcsu2  vhost-vsock  core             full         i2c-1       lightnvm/  loop-control  null                rtc0    stderr    tty14  tty23  tty32  tty41  tty50  tty6   ttyS1      ttyS19  ttyS28  ttyS9    vboxusb/    vcsa1  vcsu3  video0  cpu/             fuse         i2c-2       log        mapper/       nvram               sda     stdin     tty15  tty24  tty33  tty42  tty51  tty60  ttyS10     ttyS2   ttyS29  udmabuf  vcs     vcsa2  vcsu4  zero  cpu_dma_latency  hidraw2      i2c-3       loop0      mcelog        port                sda1    stdout    tty16  tty25  tty34  tty43  tty52  tty61  ttyS11     ttyS20  ttyS3   uhid     vcs1    vcsa3  vcsu5  zfs  whatever:~$ sudo ls /dev/usb -p  hiddev1  hiddev2  whatever:~$ sudo ls /dev/input/ -p  by-id/  by-path/  event0  event1  event10  event11  event12  event13  event14  event15  event16  event17  event18  event19  event2  event20  event3  event4  event5  event9  mice  mouse0  mouse1  mouse2  whatever:~$ sudo ls /dev/input/by-path/ -p  pci-0000:00:1d.0-usb-0:1.2.4:1.0-event-mouse  pci-0000:0b:00.0-usb-0:2:1.0-event-kbd  pci-0000:0b:00.0-usb-0:2:1.2-event      pci-0000:0b:00.0-usb-0:2:1.2-event-mouse  platform-i8042-serio-0-event-kbd    platform-i8042-serio-1-mouse  pci-0000:00:1d.0-usb-0:1.2.4:1.0-mouse        pci-0000:0b:00.0-usb-0:2:1.1-event-kbd  pci-0000:0b:00.0-usb-0:2:1.2-event-kbd  pci-0000:0b:00.0-usb-0:2:1.2-mouse    platform-i8042-serio-1-event-mouse  platform-PNP0C14:00-event  whatever:~$ sudo ls /dev/input/by-id -p  usb-ELECOM_TrackBall_Mouse_HUGE_TrackBall-event-mouse         usb-HyperX_Alloy_Elite_RGB_HyperX_Alloy_Elite_RGB-event-kbd   usb-HyperX_Alloy_Elite_RGB_HyperX_Alloy_Elite_RGB-if02-event-mouse  usb-ELECOM_TrackBall_Mouse_HUGE_TrackBall-mouse           usb-HyperX_Alloy_Elite_RGB_HyperX_Alloy_Elite_RGB-if01-event-kbd  usb-HyperX_Alloy_Elite_RGB_HyperX_Alloy_Elite_RGB-if02-mouse  usb-HyperX_Alloy_Elite_RGB_HyperX_Alloy_Elite_RGB-event-if02  usb-HyperX_Alloy_Elite_RGB_HyperX_Alloy_Elite_RGB-if02-event-kbd  

lsusb output:

Bus 002 Device 004: ID 138a:0011 Validity Sensors, Inc. VFS5011 Fingerprint Reader  Bus 002 Device 031: ID 056e:010d Elecom Co., Ltd   Bus 002 Device 029: ID 163c:0407    Bus 002 Device 028: ID 1a40:0101 Terminus Technology Inc. Hub  Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub  Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub  Bus 003 Device 004: ID 0951:16be Kingston Technology   <<<<<< should be this one  Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  Bus 001 Device 004: ID 0cf3:3005 Atheros Communications, Inc. AR3011 Bluetooth  Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  

dmesg | grep HyperX:

[  840.621032] usb 3-2: Product: HyperX Alloy Elite RGB  [  840.621034] usb 3-2: Manufacturer: HyperX Alloy Elite RGB  [  840.636345] input: HyperX Alloy Elite RGB HyperX Alloy Elite RGB as /devices/pci0000:00/0000:00:1c.4/0000:0b:00.0/usb3/3-2/3-2:1.0/0003:0951:16BE.000F/input/input40  [  840.696729] hid-generic 0003:0951:16BE.000F: input,hidraw3: USB HID v1.11 Keyboard [HyperX Alloy Elite RGB HyperX Alloy Elite RGB] on usb-0000:0b:00.0-2/input0  [  840.702294] input: HyperX Alloy Elite RGB HyperX Alloy Elite RGB as /devices/pci0000:00/0000:00:1c.4/0000:0b:00.0/usb3/3-2/3-2:1.1/0003:0951:16BE.0010/input/input41  [  840.760639] hid-generic 0003:0951:16BE.0010: input,hidraw4: USB HID v1.11 Keyboard [HyperX Alloy Elite RGB HyperX Alloy Elite RGB] on usb-0000:0b:00.0-2/input1  [  840.768647] input: HyperX Alloy Elite RGB HyperX Alloy Elite RGB Mouse as /devices/pci0000:00/0000:00:1c.4/0000:0b:00.0/usb3/3-2/3-2:1.2/0003:0951:16BE.0011/input/input42  [  840.828447] input: HyperX Alloy Elite RGB HyperX Alloy Elite RGB System Control as /devices/pci0000:00/0000:00:1c.4/0000:0b:00.0/usb3/3-2/3-2:1.2/0003:0951:16BE.0011/input/input43  [  840.828573] input: HyperX Alloy Elite RGB HyperX Alloy Elite RGB Consumer Control as /devices/pci0000:00/0000:00:1c.4/0000:0b:00.0/usb3/3-2/3-2:1.2/0003:0951:16BE.0011/input/input44  [  840.828675] input: HyperX Alloy Elite RGB HyperX Alloy Elite RGB Keyboard as /devices/pci0000:00/0000:00:1c.4/0000:0b:00.0/usb3/3-2/3-2:1.2/0003:0951:16BE.0011/input/input46  [  840.828834] hid-generic 0003:0951:16BE.0011: input,hiddev2,hidraw5: USB HID v1.11 Mouse [HyperX Alloy Elite RGB HyperX Alloy Elite RGB] on usb-0000:0b:00.0-2/input2  

how to compare text file datas with excel sheet values

Posted: 10 Apr 2021 10:03 AM PDT

For Example :

in my username.txt file

ravi  peri  perl  phython  

in my .xls file i have two columns named as user name and email

username                      email  ravi                          ravi@gmail.com  peri                          peri@gmail.com  

I want to produce the output in list order like excel view or normal list view .Please help me to solve this issue .

No access for user to shared libraries

Posted: 10 Apr 2021 09:00 AM PDT

I use Debian and I have a problem with executing arm-none-eabi-gdb as a user. I get the following message: arm-none-eabi-gdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory. The only way to run it is to type sudo arm-none-eabi-gdb . I have checked library libncurses.so.5 and found that there was no execute permission for users so I changed it with chmod. Now all users can execute it but I still get the error when calling arm-none-eabi-gdb without sudo.

Can anyone explain me what is the mechanism that is blocking me ?

Java programs not running in terminal

Posted: 10 Apr 2021 08:02 AM PDT

I have java 8 installed on fedora 20. Any java program runs perfectly fine via eclipse but when I run the same program on terminal it reports an error saying 'could not load main class' . what could be the problem?

I wrote a simple helloworld program named hello.java and executed on eclipse. Then I opened terminal and moved to the folder containing the hello.class in eclipse workspace and typed ' java hello '. But it said 'error:could not load main class'.

Also as I said I have installed and I use oracle java 8.

i3wm : start applications on specific workspaces when i3 starts

Posted: 10 Apr 2021 08:39 AM PDT

How can I start applications on specific workspaces in i3 when it starts?

Why is this not working in my config file? :

workspace 1; exec firefox; workspace 2; exec chromium; workspace 1  

No comments:

Post a Comment