Monday, March 22, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


No GRUB entry after installation of manjaro-architect

Posted: 22 Mar 2021 10:06 AM PDT

I have used the XFCE live cd, to launch into manjaro-architect, not the standalone ISO.

I am planning to dual boot with windows, but now I have only one SSD plugged in, and aside the firmware having written the Windows Boot Loader in it, I belive there are no other conflicts.

Installed it on a 500GB SSD, I used LUKS1 on both the ESP and the rest was for /. BTRFS filesystem with multiple subolumes, including one for /boot/grub2/x86_64-efi as per OpenSuse documentation.

UEFI did not find the ESP, it only lists my Linux SSD and windows boot loader (the one written into the firmware) I reinstalled again still does not work.

I chrooted into the last one and created a grub entry:

efibootmgr -d /dev/sda1 -p 1 -c -L "GRUB2" -l /vmlinuz-5.11-x86_64 -u "cryptdevice=UUID=<nonluks-esp-partition-UUID-here>:<mapped-name-for-luks> root=UUID=<root-luks-UUID> rw initrd=/initramfs-5.11-x86_64.img"  

I have also tried with luks ESP uuid too. Additionally the mapped name was sda1_crypt.

Now that think about I did not udpate grub afterwards, but I think that will not make a difference.

Moving a mounted ext4 filesystem between physical disks

Posted: 22 Mar 2021 10:23 AM PDT

Is there a way to move an ext4 filesystem between physical disks transparently for the applications, i.e. while preserving file descriptors? There's no LVM nor hardware RAID, unfortunately.

I was thinking in the direction of creating an md mirror and breaking it after the sync, but it seems that it requires unmounting the disk or partition at least once. Converting to LVM on the fly would be ideal, but I haven't found any evidence that it can be done.

Arithmetic between 2 files generating a series of new files using awk

Posted: 22 Mar 2021 09:57 AM PDT

I have a tab separated model input file i would like to vary for ensemble analysis formatted such as this

cat input.txt  
#############################################     ###  Parameter file for the program ###   #############################################     ### GENERAL PARAMETERS  4   /* nbout # Number of outputs */   46  /* numesp # Number of species */  0.05    /* p # light incidence param (diff through turbid medium) */  0.1357158   0.2446549   0.3535940   0.4992873   0.6449806   0.6957850   0.7465893   0.8130218   0.8794543   0.9397271   1.0000000   0.9397271   0.8794543   0.8078294   0.7362045   0.6899817   0.6437589   0.5989616   0.5541642   0.4617186   0.3692730   0.3633708   0.3574686   0.2426215   /* normalized daily light course (from 7am to 7pm, with a half-hour time-step */  1   /* vox_la_max. The max voxel leaf area. */  0   /* l_growth_scheme. 0 = top down; 1 = random; 2 = homogeneous; 3 = bottom up */  0.1 /* knockout_max. Parameter controlling the extent to which lianas can knock out trees */  0.05    /* shed_prob. With this probability, the liana is completely shed from the voxel. */    ### Species description                                   ****    Nmass   LMA wsg dmax    hmax    ah  tmax    seedmass    Fregdistgr  Pmass   g1  s_liana  Alvaradoa_amorphoides   0.0214  74.775  0.584   0.5 24.44   0.892   1   0.0078  40  0.00145 3.77    0  Annona_reticulata   0.0350  74.529  0.503   0.5 24.44   0.892   1   0.2392  40  0.00142 3.77    0  Brosimum_alicastrum 0.0201  104.281 0.760   0.5 17.31   0.117   1   1.2486  40  0.00097 3.77    0    ### Climate (input environment)  25.47447    26.02723    26.87827    27.58436    26.95839    25.63987    25.61669    25.26543    24.99990    24.10808    24.71997    24.67287    /*Temperature in degree C*/  

I have another tab separated file of multipliers selected from a distribution formatted such as this

cat multipliers.txt  
2   3   4  3   2   2  4   3   3  

I am trying to multiply 3 specific input fields by multipliers to generate a series of new input files equal to the number of multipliers (in this case 3), while leaving the rest of the input file unchanged. In this scenario, I would like to multiply vox_la_max,knockout_max, and shed_prob by 2, 3, and 4 respectively for the first file, 3, 2, and 2 for the second file, and 4, 3, and 3 for the third. I would have 3 new files generated such as this

cat input1.txt  
#############################################     ###  Parameter file for the program ###   #############################################     ### GENERAL PARAMETERS  4   /* nbout # Number of outputs */   46  /* numesp # Number of species */  0.05    /* p # light incidence param (diff through turbid medium) */  0.1357158   0.2446549   0.3535940   0.4992873   0.6449806   0.6957850   0.7465893   0.8130218   0.8794543   0.9397271   1.0000000   0.9397271   0.8794543   0.8078294   0.7362045   0.6899817   0.6437589   0.5989616   0.5541642   0.4617186   0.3692730   0.3633708   0.3574686   0.2426215   /* normalized daily light course (from 7am to 7pm, with a half-hour time-step */  2   /* vox_la_max. The max voxel leaf area. */  0   /* l_growth_scheme. 0 = top down; 1 = random; 2 = homogeneous; 3 = bottom up */  0.3 /* knockout_max. Parameter controlling the extent to which lianas can knock out trees */  0.2 /* shed_prob. With this probability, the liana is completely shed from the voxel. */    ### Species description                                   ****    Nmass   LMA wsg dmax    hmax    ah  tmax    seedmass    Fregdistgr  Pmass   g1  s_liana  Alvaradoa_amorphoides   0.0214  74.775  0.584   0.5 24.44   0.892   1   0.0078  40  0.00145 3.77    0  Annona_reticulata   0.0350  74.529  0.503   0.5 24.44   0.892   1   0.2392  40  0.00142 3.77    0  Brosimum_alicastrum 0.0201  104.281 0.760   0.5 17.31   0.117   1   1.2486  40  0.00097 3.77    0    ### Climate (input environment)  25.47447    26.02723    26.87827    27.58436    26.95839    25.63987    25.61669    25.26543    24.99990    24.10808    24.71997    24.67287    /*Temperature in degree C*/  
cat input2.txt  
#############################################     ###  Parameter file for the program ###   #############################################     ### GENERAL PARAMETERS  4   /* nbout # Number of outputs */   46  /* numesp # Number of species */  0.05    /* p # light incidence param (diff through turbid medium) */  0.1357158   0.2446549   0.3535940   0.4992873   0.6449806   0.6957850   0.7465893   0.8130218   0.8794543   0.9397271   1.0000000   0.9397271   0.8794543   0.8078294   0.7362045   0.6899817   0.6437589   0.5989616   0.5541642   0.4617186   0.3692730   0.3633708   0.3574686   0.2426215   /* normalized daily light course (from 7am to 7pm, with a half-hour time-step */  3   /* vox_la_max. The max voxel leaf area. */  0   /* l_growth_scheme. 0 = top down; 1 = random; 2 = homogeneous; 3 = bottom up */  0.2 /* knockout_max. Parameter controlling the extent to which lianas can knock out trees */  0.1 /* shed_prob. With this probability, the liana is completely shed from the voxel. */    ### Species description                                   ****    Nmass   LMA wsg dmax    hmax    ah  tmax    seedmass    Fregdistgr  Pmass   g1  s_liana  Alvaradoa_amorphoides   0.0214  74.775  0.584   0.5 24.44   0.892   1   0.0078  40  0.00145 3.77    0  Annona_reticulata   0.0350  74.529  0.503   0.5 24.44   0.892   1   0.2392  40  0.00142 3.77    0  Brosimum_alicastrum 0.0201  104.281 0.760   0.5 17.31   0.117   1   1.2486  40  0.00097 3.77    0    ### Climate (input environment)  25.47447    26.02723    26.87827    27.58436    26.95839    25.63987    25.61669    25.26543    24.99990    24.10808    24.71997    24.67287    /*Temperature in degree C*/  
cat input3.txt  
#############################################     ###  Parameter file for the program ###   #############################################     ### GENERAL PARAMETERS  4   /* nbout # Number of outputs */   46  /* numesp # Number of species */  0.05    /* p # light incidence param (diff through turbid medium) */  0.1357158   0.2446549   0.3535940   0.4992873   0.6449806   0.6957850   0.7465893   0.8130218   0.8794543   0.9397271   1.0000000   0.9397271   0.8794543   0.8078294   0.7362045   0.6899817   0.6437589   0.5989616   0.5541642   0.4617186   0.3692730   0.3633708   0.3574686   0.2426215   /* normalized daily light course (from 7am to 7pm, with a half-hour time-step */  4   /* vox_la_max. The max voxel leaf area. */  0   /* l_growth_scheme. 0 = top down; 1 = random; 2 = homogeneous; 3 = bottom up */  0.3 /* knockout_max. Parameter controlling the extent to which lianas can knock out trees */  0.15    /* shed_prob. With this probability, the liana is completely shed from the voxel. */    ### Species description                                   ****    Nmass   LMA wsg dmax    hmax    ah  tmax    seedmass    Fregdistgr  Pmass   g1  s_liana  Alvaradoa_amorphoides   0.0214  74.775  0.584   0.5 24.44   0.892   1   0.0078  40  0.00145 3.77    0  Annona_reticulata   0.0350  74.529  0.503   0.5 24.44   0.892   1   0.2392  40  0.00142 3.77    0  Brosimum_alicastrum 0.0201  104.281 0.760   0.5 17.31   0.117   1   1.2486  40  0.00097 3.77    0    ### Climate (input environment)  25.47447    26.02723    26.87827    27.58436    26.95839    25.63987    25.61669    25.26543    24.99990    24.10808    24.71997    24.67287    /*Temperature in degree C*/  

I think I should be using awk, but have only been successful at varying one parameter with a one-column multipliers file at a time so far, and I need to be able to vary these 3 parameters simultaneously. What sort of script could I set up to run with awk -f to generate these outputs?

Screen blanks and doesn't come back on, multiple distros

Posted: 22 Mar 2021 09:48 AM PDT

I was using Ubuntu 20.04 up until yesterday, with i3. I had a problem where the screen would blank after some time (10 minutes?), and not un-blank in response to mouse/keyboard input. The host was not sleeping: I could still ssh into it.

Yesterday I switched to MX Linux with xfce. I disabled power management, screen blanking, and screensaver from the GUI settings tools. The problem persists with this new install as well: the screen blanks after several minutes, and the keyboard/mouse won't un-blank it. I can still ssh into it.

What might cause this, and how can I solve it?

How do I determine which commit a channel references with Nixos?

Posted: 22 Mar 2021 09:50 AM PDT

I'd like to figure out the commit and date that a channel references.

For example how can determine that for the nixos2009 channel below?

sudo nix-channel --list  nixos https://nixos.org/channels/nixos-20.09  nixos-2003 https://nixos.org/channels/nixos-20.03  nixos2003 https://nixos.org/channels/nixos-20.03  nixos2009 https://nixos.org/channels/nixos-20.09  unstable https://nixos.org/channels/nixpkgs-unstable  

I can see ls /nix/var/nix/profiles/per-user/root/channels-*/manifest.nix shows us the channel generations.. Which the latest channel generation has the following content:

cat /nix/var/nix/profiles/per-user/root/channels-61-link/manifest.nix | nixfmt  [    {      meta = { };      name = "nixos-20.09.2538.0cfd08f4881";      out = {        outPath =          "/nix/store/7s917s7ipvq3zmbx5g3kssldwc029r8r-nixos-20.09.2538.0cfd08f4881";      };      outPath =        "/nix/store/7s917s7ipvq3zmbx5g3kssldwc029r8r-nixos-20.09.2538.0cfd08f4881";      outputs = [ "out" ];      system = "x86_64-linux";      type = "derivation";    }    {      meta = { };      name = "nixos-2003-20.03.3324.929768261a3";      out = {        outPath =          "/nix/store/zajz4gpq506g68w47pnl11k8mhz06jz0-nixos-2003-20.03.3324.929768261a3";      };  

Potentially I can get it from the store path above like /nix/store/zajz4gpq506g68w47pnl11k8mhz06jz0-nixos-2003-20.03.3324.929768261a3 - but I'm not sure (and not sure what that "path" is called either).

Seems like an answer for this is documented here: https://discourse.nixos.org/t/how-to-see-what-commit-is-my-channel-on/4818/6?u=chrissound though that is not a programmatic way (which is what I'm looking for).

Linux user management

Posted: 22 Mar 2021 09:37 AM PDT

I am sorry if I am asking a very silly question but I am very new to security. Currently, I have a couple of requirements:

  1. Giving different level of access to a user on a Linux host like:

    • L1 - Read-only who can only view the logs and configuration file.
    • L2 - With a restricted command like he can not delete any files.
    • SME - Who can modify files
    • Super user - equal to root user
  2. If L1/L2 try to run an unauthorized command then one alert should be generated via email.

  3. If any configuration changes happen then one alert should be generated.

How I can achieve these scenarios?

Get UTC process start time in Linux

Posted: 22 Mar 2021 09:33 AM PDT

This ps command gives timezone-specific time:

$ date  Mon Mar 22 19:17:54 MSK 2021    $ ps -eo pid,cmd,lstart    PID CMD                                          STARTED      1 /init                       Mon Mar 22 19:13:33 2021      6 /init                       Mon Mar 22 19:13:33 2021      7 /init                       Mon Mar 22 19:13:33 2021      8 -bash                       Mon Mar 22 19:13:33 2021     33 ps -eo pid,cmd,lstart       Mon Mar 22 19:17:56 2021  o2genum@DESKTOP-TMJIEPG:~$  

What is the simplest way to get the process start time in UTC?

NFS Cannot allocate memory

Posted: 22 Mar 2021 09:20 AM PDT

The other night I was trying to restart NFS services but then I received the following error messages:

kernel: [81818.428785] nfsd: unable to allocate nfsd_file_hashtbl  rpc.nfsd[15567]: error starting threads: errno 12 (Cannot allocate memory)  systemd[1]: nfs-server.service: Main process exited, code=exited, status=1/FAILURE  

That is a weird error to get considering that the system had 12+GB of RAM left in buff/cache. As far as I understand buff/cache memory - that is memory that is used by the kernel to cache information but still available to applications to use if they need RAM.

I then ran the following command:

sync && echo 3 > /proc/sys/vm/drop_caches  

And the memory shifted from buff/cache to free and NFS started without any issues.

Everything that I'm reading suggests that is basically one of the worst things to do.

My question is that is this a bug in NFS or something else? It appears that this is a quite heated topic and I'm not arguing whether it is ok or not - all I can report is when I ran that NFS started without any issues and I am curious to know why.

I'm running Debian 10, with proxmox 6.3-6, NFS version 1:1.3.4-2.5+deb10u1

Delete till first occurrence of pipe "|" using sed

Posted: 22 Mar 2021 09:46 AM PDT

I want to remove all characters before the next pipe "|" symbol. I tried suggestions on previous questions however that did not work for me. As an example.

I want to delete the sequencenum=123 however the sequence number is dynamic and doesn't always equal 123, it could equal 934294. I could remove it by using "s/|sequence=123//g" or "s/|sequence=...//g" however I want to be able to delete all characters until the next pipe, "|".

Output:

2021-03-22T12:00:51.990368-04:00 8.8.8.8 time=1616428842|action=Detect|ifdir=inbound|origin=8.8.8.8|originsicname=CN\=Internet,O\=test|sequencenum=123|dst=1.1.1.1|proto=6|s_port=2231|service=80|src=9.9.9.9|src_machine_name=test@stackoverflow.com|src_user_name=user|user=testuser@stackoverflow.com|  

Desired Output:

2021-03-22T12:00:51.990368-04:00 8.8.8.8 time=1616428842|action=Detect|ifdir=inbound|origin=8.8.8.8|originsicname=CN\=Internet,O\=test|dst=1.1.1.1|proto=6|s_port=2231|service=80|src=9.9.9.9|src_machine_name=test@stackoverflow.com|src_user_name=user|user=testuser@stackoverflow.com|  

Interactive Fortran Program

Posted: 22 Mar 2021 09:12 AM PDT

I have an old fortran executable foo.exe that requires interactive input.

If I call foo.exe from Cywin I am prompted for the interactive input and the program works fine.

If I call foo.exe from WSL I am prompted for interactive input and the program works fine.


I would like to run a script or send input to foo.exe such that I don't need to go through the process of entering everything interactively.

In Cygwin I do the following:

foo.exe << EOI  1  1  Test  Out  EOI  

Everything works great!

I attempt to do the same thing in WSL and I get the following error message:

forrtl: An attempt was made to move the file pointer before the beginning of the file.  forrtl: severe (39): error during read, unit -4, file CONIN$  Image              PC        Routine            Line        Source  libifcorert.dll    1003A159  Unknown               Unknown  Unknown  


So I grabbed the original file foo.f and I attempted to recompile it using gfortran

gfortran foo.f -o new_foo.exe  

I then attempt to interactively call new_foo.exe from Cygwin and I get the following:

bash: ./newfoo.exe: cannot execute binary file: Exec format error  

So what used to work in Cygwin no longer does.

I then attempt to interactively call new_foo.exe from WSL and it works fine.

I can now run a script or send input to new_foo.exe using WSL and it works fine (couldn't do that before) but I have lost the ability to do it on Cygwin. One step forward, two steps back??


I then thought maybe I should recompiling it using 32-bit:

gfortran -m32 foo.f -o new_foo_32.exe  

This 32-bit compiled program doesn't work with Cygwin or WSL giving the following error on both:

bash: ./newfoo.exe: cannot execute binary file: Exec format error  

The ultimate goal is to have a single foo.exe program that runs interactively on both Cygwin & WSL (my original code does this) AND allows me to pipe/send input on both Cygwin & WSL (my original code only allows me to do this in Cygwin).

Any suggestions?

==============
Cygwin Version

CYGWIN_NT-10.0-WOW   <computer> 2.4.1(0.293/5/3)   2016-01-24 11:24 i686 Cygwin  

==============
WSL version

Linux <computer> 4.4.0-18362-Microsoft   #476-Microsoft Fri Nov 01 16:53:00 PST 2019   x86_64 x86_64 x86_64 GNU/Linux    Distributor ID: Ubuntu  Description:    Ubuntu 20.04.2 LTS  Release:        20.04  Codename:       focal  

(The lack of) ZED board sound card support in GNU/Linux

Posted: 22 Mar 2021 08:58 AM PDT

I am trying to convince a sound card to work on a custom HW similar to an Avnet ZED Board.

The original driver example was based on a heavily (a patch to vanilla is about 180k lines) modified 3.14.12 kernel and was called zed_adau1761. The "sound card" is not handled within one driver, it is divided into three logical parts:

  1. Codec driver adau1761-i2c.c,
  2. A driver taking care about streaming data axi-i2s.c,
  3. A driver setting up the two above to work together, zed_adau1761.c.

Unlike the first two drivers, the third one was probably never mainlined, and existed only in one branch of now probably defunct part of Analog Devices Github fork of a kernel.

The development board is still sold according an Avnet web page, so there might be some hackers using it.

My problem is that today tools are not able to work with such an old kernel as was the one about 7 years ago, and at the same time the old kernel is full of other problems, but the old driver is not included with the newer kernels and neither works with newer kernels.

Is the 3. driver mainlined under a different name? Or am I trying the wrong way to make the soundcard work?

Thank to anybody with a better insight into the problem!

small icons in "show application" menu

Posted: 22 Mar 2021 08:54 AM PDT

I have pop os 20.04 and I have installed some extensions by using the gnome-shell extension. my problem is when I installed the "dash to dock" extension and placed it on the bottom of the screen, icons in "show applications" are too small, do you have any idea or solution what to do if I just want the dock on the bottom?

Docker containers within FreeIPA realm and Kerberos secured NFS

Posted: 22 Mar 2021 08:53 AM PDT

In our environment we are using FreeIPA which has LDAP authentication. We have NFS shares that have Kerberos on them. Users that are authenticated can access the NFS shares. Host machines (physical/virtual) are enrolled into the FreeIPA realm and with sssd users can login/sudo on each of those machines and subsequently access the NFS shares.

However, docker containers aren't aware this and can't authenticate with the FreeIPA LDAP authentication. We can pass in the users uid/gid as a workaround but that user can't "sudo" or anything within the container.

Besides enrolling every single container into the realm, is there anyway to allow containers to function "normally" within the network? In larger (enterprise) type environments, how are permissions/authentication being managed in containers?

Deleted files with WinSCP command

Posted: 22 Mar 2021 08:53 AM PDT

I selected some files and wanted to move them to another folder. All I did was this, using WinSCP:

Right click, Move to...

enter image description here

and all files were deleted. So the last folder had additional *. * in it. I accidentally deleted the slash between them. Any suggestions? Any Recycle Bin or something for this?

Using shell arrays to read every N lines in parallel of a file

Posted: 22 Mar 2021 09:15 AM PDT

So, i already know how to successfully read every N lines in parallel, and run a command on each of those lines:

while read -r i && read -r a && read -r b && read -r c && read -r d && read -r e && read -r f && read -r g && read -r h && read -r j && read -r k && read -r l && read -r m && read -r n && read -r o && read -r p && read -r q && read -r r && read -r s && read -r t && read -r u && read -r v && read -r w && read -r x && read -r z && read -r aa && read -r bb && read -r cc && read -r dd && read -r ee && read -r ff && read -r gg && read -r hh && read -r ii && read -r jj; do                        dosomething "$i" &                      dosomething "$a" &                      dosomething "$b" &                      dosomething "$c" &                      dosomething "$d" &                      dosomething "$e" &                      dosomething "$f" &                      dosomething "$g" &                      dosomething "$h" &                      dosomething "$j" &                      dosomething "$k" &                      dosomething "$l" &                      dosomething "$m" &                      dosomething "$n" &                      dosomething "$o" &                      dosomething "$p" &                      dosomething "$q" &                      dosomething "$r" &                      dosomething "$s" &                      dosomething "$t" &                      dosomething "$u" &                      dosomething "$v" &                      dosomething "$w" &                      dosomething "$x" &                      dosomething "$z" &                      dosomething "$aa" &                      dosomething "$bb" &                      dosomething "$cc" &                      dosomething "$dd" &                      dosomething "$ee" &                      dosomething "$ff" &                      dosomething "$gg" &                      dosomething "$hh" &                      dosomething "$ii" &                      dosomething "$jj" &                      wait  done < somefile  

Where dosomething is just an example function/application that do something with the specific line (which is represented by the variable next to it).

Essentially this work fine. Just wanted to make this work/look better by using arrays instead, but not sure how to format this so it use arrays...

Where it would generate variable names (only alpha, no number as that might create problem with the usual numbered variable, such as $1 etc) for N amount of job.

To prevent confusion: each read in the script above does "one line" each, so each read = one line. Meaning each iteration there are reading one line X amount of read. The wait at the end of each iteration wait for all jobs to finish.

Example:

  • This answer does a similar thing that I'm doing, except it read from two file, two lines (one for each) at the same time. Mine does way more.

PS: I'm aware i could do something better using parallel, xargs or something else, but prefer to only use bash/POSIX if possible.

Any input appreciated.

Dpkg/atop daemon error

Posted: 22 Mar 2021 09:29 AM PDT

Whenever I try to install any package the following error occurs after a small bit of working normal:

penguin systemd[1]: atopacct.service: Failed with result 'protocol'.  penguin systemd[1]: Failed to start Atop process accounting daemon.  dpkg: error processing package atop (--configure):  installed atop package post-installation script subprocess returned error exit status 1  Errors were encountered while processing:  atop  E: Sub-process /usr/bin/dpkg returned an error code (1)  

When I try to install packages by opening deb files through chrome:

Error while installing package: installed atop package post-installation script subprocess returned error exit status 1  

The error used to include something about the "atop accounting daemon," but that bit left after I updated.

I have no idea how to troubleshoot/fix this, so any help would be great!

docker permission denied

Posted: 22 Mar 2021 09:00 AM PDT

docker pull sundowndev/phoneinfoga:latest  

That's what I tried in Terminal. I got error

WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement  Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/create?fromImage=sundowndev%2Fphoneinfoga&tag=latest: dial unix /var/run/docker.sock: connect: permission denied  

I am new to docker. So, I don't know what's happening After searching little I found this and this. But, I didn't understand anything.

I was trying this and this

In this link, I was unable to understand sudo usermod -aG docker ssirohi. I didn't understand that. that's why I tried sudo usermod -aG docker Istiakshovon I got the error usermod: group 'docker' does not exist . Should I install docker group? How to do that? I have docker... I tried it also.

How to use double quotes in bash around a directory with spaces

Posted: 22 Mar 2021 09:09 AM PDT

I am working on the raspberry pi (Raspberry Pi OS):

I run a Bash #!/bin/bash script where I need to save a file (a picture that is taken) under a directory which has spaces in its name.

In my case the directory is: /media/pi/test 1 2 3

And the command I run and does what I want:

raspistill -awb greyworld -vf -hf -o /media/pi/"test 1 2 3"/test.jpg  

Which takes a picture and saves it there, works fine.

My issue is, I want the "test 1 2 3" to be inside a variable, like this:

usbToSave="\"test 1 2 3\"" #usbToSave is now "test 1 2 3"  raspistill -awb greyworld -vf -hf -o /media/pi/$usbToSave/test.jpg  

But the above will throw me this error:

Invalid command line option (1)  

Which I do not understand why. I am sure something like this has already been answered somewhere in the forum, but I cannot find it. I guess I don't use the right keywords to search for it.

Note:

If, my directory has no spaces for example /media/pi/test the Bash script:

usbToSave="test"  raspistill -awb greyworld -vf -hf -o /media/pi/$usbToSave/test.jpg  

Works with no errors.

Why network isn't working after changes of proxychains4

Posted: 22 Mar 2021 09:24 AM PDT

sudo nano /etc/proxychains4.conf  

Dynamic chain is open. Then, I #/comment others(strict chain,random chain,round robin chain) Another changes I made socks4 125.26.99.2 44052. Then, I run proxychains on firefox

proxychains firefox google.com  

enter image description here

enter image description here

After few minutes : enter image description here

They are loading loading and loading................. I don't know why this is happening. Those websites aren't opening...

enter image description here enter image description here enter image description here enter image description here

My proxychains filename is proxychains4 that's why I thought it would work if I run the following command

proxychains4 firefox google.com  

Nonetheless, I am getting same error enter image description here

How to run a bash script using threads/parallel

Posted: 22 Mar 2021 10:07 AM PDT

I am running the following bash script as is. I.e. sequentially. Note that the prefetch and fastq-dump are calls for downloading files from a database, and _shrink is a C++ program that I have made to shrink the fetched files (due to limited storage).

Is it possible for me to use threads for this? It takes ages to download the files.

Important! The commands inside each block must run sequentially, but the blocks are allowed to run in parallel. Moreover, I would like to only run 10 blocks at a time.

#!/bin/bash  g++ -std=c++11 shrink_files.cpp -o _shrink    #block1      prefetch SRR837459  fastq-dump --fasta 0 SRR837459  rm ../../sra_sequences/sra/SRR837459.sra  ./_shrink SRR837459  rm SRR837459.fasta  echo "SRR837459" >> list_of_done.txt    #block1      prefetch SRR805782  fastq-dump --fasta 0 SRR805782  rm ../../sra_sequences/sra/SRR805782.sra  ./_shrink SRR805782  rm SRR805782.fasta  echo "SRR805782" >> list_of_done.txt    #... more blocks  

Trapping all crond errors in logs rather than email

Posted: 22 Mar 2021 09:59 AM PDT

I'm working on RHEL 7.9. In my crontab, I have the following variables and command :

MAILTO=""  SHELL="/usr/bion/ksh"    30 * * * * find /home/me/data/input -name "*.completed" -size +10M -print >> /home/me/jobs/completed.big 2>/home/me/jobs/completed.big.errors  

Since everyone has detected the extra o in the SHELL var, you (and I) can tell that all jobs were failing silently.
The /var/log/cron file was filled with all the expected command lines to run.
The journalctl -xe -t crond command only mentioned reloading my personal cron and skipping jobs :

Jan 30 01:21:05 servername crond[26104]: (root) INFO (Job execution of per-minute job scheduled for 01:20 delayed into subsequent minute 01:21. Skipping job run.)  [...]  Feb 05 16:02:01 servername crond[3997]: (me) RELOAD (/var/spool/cron/me)  

Seeing no logs from my jobs, I removed the MAILTO variable, and then the local mailbox of my account got messages like:

[... Stripping mail headers]    execl: couldn't exec `/usr/bion/ksh'  execl: No such file or directory  

Since this error arrives before the command actually launches, I didn't get it in my job logs.

Is there any way to have these errors or at least trap that CRON failed to launch the command in a log ?We have enough mails here, and logs are already monitored.

I have read the Where are cron errors logged? question, but I would like to have a definitive answer on "Can crond errors be found elsewhere than the mails?". This might be a hidden configuration for crond, or anything else, I don't know.

At last, I might even consider tricking the mailbox to redirect into a log, and clean it afterwards.

How to run HyperX NGenuity in Wine

Posted: 22 Mar 2021 10:31 AM PDT

Today I got my HyperX Alloy FPS RGB and I wanted to customize the RGB lighting with the software. But it is only available for Windows and I could not find anything on how to run it in Wine. The only thing I found was here, on StackExchange, but there was no answer to the question there. Can someone please help? Just nowing what DLLs it needs would be great.

How to rollback a channel to a previous Nixos generation?

Posted: 22 Mar 2021 09:17 AM PDT

$ sudo nix-env --list-generations --profile /nix/var/nix/profiles/system  ...   600   2020-01-25 21:01:11      601   2020-02-03 13:44:19      602   2020-02-09 14:06:20      603   2020-02-09 14:11:11      604   2020-02-11 00:02:43      605   2020-02-13 12:26:22      606   2020-02-16 16:40:02   (current)  

How could I get the commit / channel generation (is this a thing?) for a Nixos generation - and potentially rollback the channel to it?

Or in other words, how can I rollback my 'channel state' to what it was at generation 605?


Why I want to know is because I did a sudo nix-channel --update, and sudo nixos-rebuild switch few days ago - however whatever package updates took place - resulted in an unstable system.

So to mitigate this, I booted and continue to use an old generation (605).

I now want to update a specific package in my Nixos system configuration, and base the changes on 605 as opposed to the latest 606.


I did find https://stackoverflow.com/questions/39090387/how-to-undo-nix-channel-update (nix-channel --rollback..) however I may have updated the channels a few times - so the 'last' channel state might not be what I need.

I did notice you can specify a channel generation number as a parameter to this command - but I'm not sure what is the relationship between that and the nixos generation? It does not seem to be the same thing as I tried for 605 with the following results:

sudo nix-channel --rollback 605  error: generation 605 does not exist  error: program '/nix/store/cs47wjxwiqgyl1nkjnksyf3s2rb93piq-nix-2.3.2/bin/nix-env' failed with exit code 1  

File /etc/resolv.conf deleted on every reboot, why or what?

Posted: 22 Mar 2021 09:52 AM PDT

I am having an issue where DHCP (I though as I read in other similar topics) is clearing the /etc/resolv.conf file on each boot. I am not sure about how to deal with this since the post I have found (1, 2 and some others) are for Debian based distros or other but not Fedora.

This is the output of ifcfg-enp0s31f6 so for sure is DHCP:

cat /etc/sysconfig/network-scripts/ifcfg-enp0s31f6   HWADDR=C8:5B:76:1A:8E:55  TYPE=Ethernet  DEFROUTE=yes  IPV4_FAILURE_FATAL=no  IPV6INIT=no  IPV6_AUTOCONF=no  IPV6_DEFROUTE=no  IPV6_FAILURE_FATAL=no  IPV6_ADDR_GEN_MODE=stable-privacy  NAME=enp0s31f6  UUID=0af812a3-ac8e-32a0-887d-10884872d6c7  ONBOOT=yes  IPV6_PEERDNS=no  IPV6_PEERROUTES=no  BOOTPROTO=dhcp  PEERDNS=yes  PEERROUTES=yes  

In the other side I don't know if Network Manager is doing something else around this.

Update: Content of NetworkManager.conf (I have removed the comments since are useless)

$ cat /etc/NetworkManager/NetworkManager.conf   [main]  #plugins=ifcfg-rh,ibft  dns=none    [logging]  #domains=ALL  

Can I get some help with this? It's annonying be setting up the file once and once on every reboot.

UPDATE 2

After a month I'm still having the same issue where file gets deleted by "something".

Here is the steps I did follow in order to make a fresh test:

  • Reboot the PC
  • After PC gets restarted open a terminal and try to ping Google servers of course without success:

    $ ping google.com  ping: google.com: Name or service not known  
  • Check the network configuration were all seems to be fine:

    $ cat /etc/sysconfig/network-scripts/ifcfg-enp0s31f6   NAME=enp0s31f6  ONBOOT=yes  HWADDR=C8:5B:76:1A:8E:55  MACADDR=C8:5B:76:1A:8E:55  UUID=0af812a3-ac8e-32a0-887d-10884872d6c7  BOOTPROTO=static  PEERDNS=no  DNS1=8.8.8.8  DNS2=8.8.4.4  DNS3=192.168.1.10  NM_CONTROLLED=yes  IPADDR=192.168.1.66  NETMASK=255.255.255.0  BROADCAST=192.168.1.255  GATEWAY=192.168.1.1  TYPE=Ethernet  DEFROUTE=yes  IPV4_FAILURE_FATAL=no  IPV6INIT=no  
  • Restart the network service:

    $ sudo service network restart  [sudo] password for <current_user>:   Restarting network (via systemctl):                        [  OK  ]  
  • Try to ping Google servers again, with no success:

    $ ping google.com  ping: google.com: Name or service not known  
  • Check for file /etc/resolv.conf:

    $ cat /etc/resolv.conf   cat: /etc/resolv.conf: No such file or directory  
  • File doesn't exists anymore - and this is the problem something is deleting it on every reboot

  • Create the file and add the content of DNS:

    $ sudo nano /etc/resolv.conf   
  • Ping Google servers this time with success:

    $ ping google.com  PING google.com (216.58.192.110) 56(84) bytes of data.  64 bytes from mia07s35-in-f110.1e100.net (216.58.192.110): icmp_seq=1 ttl=57 time=3.87 ms  

Any ideas in what could be happening here?

Uid/Gid privileged LXC container : systemd lxc-start failed on ubuntu 16.04

Posted: 22 Mar 2021 09:04 AM PDT

I would like to create & start LXC container for specific UID & GID for below purpose.

Login to root user(sudo user) , Do lxc-create of container, then do lxc-start of the container with same root user id. while staring container I need to start all the process inside the container with low privilege(un-priv) user id in which access to the user is restricted to only container and not to host.basically when I say ps -axu , I should be able to see low privilege user id for all the container process.

PS : my host which is VM with ubuntu 16.04 LTS is systemd init system and my container(type busybox) will be started with systemd services . for that I have modified busybox template as below Code:

lxc.init_cmd=/lib/systemd/systemd  

and also removed all rcS & inittab related scripts in the busybox default template

and for user id map , I have changed as below in my template Code:

   lxc.id_map=u 0 165536 65536     lxc.id_map=g 0 165536 65536  

after that I just followed below steps

Container created normally with below commend (and I cross checked config file at /var/lib/lxc/testecho_uid/config to make sure that all my template changes are reflected or not, found ok) Code:

sudo lxc-create -n testecho_uid -t busybox_systemd_uid  

Entered below command to start the container with foreground Code:

sudo lxc-start -n testecho_uid -F  

Error is :

vijay@vijay-VirtualBox:~$ sudo lxc-start -n testecho_uid -F  lxc-start: cgfsng.c: cgfsng_create: 1072 No such file or directory - Failed to create /sys/fs/cgroup/systemd//lxc/testecho_uid: No such file or directory                                           lxc-start: cgfsng.c: cgfsng_create: 1072 No such file or directory - Failed to create /sys/fs/cgroup/systemd//lxc/testecho_uid-1: No such file or directory                                                                                      newuidmap: uid range [0-65536) -> [165536-231072) not allowed                                   lxc-start: start.c: lxc_spawn: 1161 failed to set up id mapping                                                                                                  lxc-start: start.c: __lxc_start: 1353 failed to spawn 'testecho_uid'                                                      newuidmap: uid range [0-65536) -> [165536-231072) not allowed  lxc-start: conf.c: userns_exec_1: 4315 Error setting up child mappings  lxc-start: cgfsng.c: recursive_destroy: 983 Error destroying /sys/fs/cgroup/systemd//lxc/testecho_uid-2  newuidmap: uid range [0-65536) -> [165536-231072) not allowed  lxc-start: conf.c: userns_exec_1: 4315 Error setting up child mappings  lxc-start: cgfsng.c: recursive_destroy: 983 Error destroying /sys/fs/cgroup/perf_event//lxc/testecho_uid-2  newuidmap: uid range [0-65536) -> [165536-231072) not allowed  lxc-start: conf.c: userns_exec_1: 4315 Error setting up child mappings  lxc-start: cgfsng.c: recursive_destroy: 983 Error destroying /sys/fs/cgroup/hugetlb//lxc/testecho_uid-2  newuidmap: uid range [0-65536) -> [165536-231072) not allowed  lxc-start: conf.c: userns_exec_1: 4315 Error setting up child mappings  lxc-start: cgfsng.c: recursive_destroy: 983 Error destroying /sys/fs/cgroup/cpu//lxc/testecho_uid-2  newuidmap: uid range [0-65536) -> [165536-231072) not allowed  lxc-start: conf.c: userns_exec_1: 4315 Error setting up child mappings  lxc-start: cgfsng.c: recursive_destroy: 983 Error destroying /sys/fs/cgroup/memory//lxc/testecho_uid-2  newuidmap: uid range [0-65536) -> [165536-231072) not allowed  lxc-start: conf.c: userns_exec_1: 4315 Error setting up child mappings  lxc-start: cgfsng.c: recursive_destroy: 983 Error destroying /sys/fs/cgroup/pids//lxc/testecho_uid-2  newuidmap: uid range [0-65536) -> [165536-231072) not allowed  lxc-start: conf.c: userns_exec_1: 4315 Error setting up child mappings  lxc-start: cgfsng.c: recursive_destroy: 983 Error destroying /sys/fs/cgroup/blkio//lxc/testecho_uid-2  newuidmap: uid range [0-65536) -> [165536-231072) not allowed  lxc-start: conf.c: userns_exec_1: 4315 Error setting up child mappings  lxc-start: cgfsng.c: recursive_destroy: 983 Error destroying /sys/fs/cgroup/cpuset//lxc/testecho_uid-2  newuidmap: uid range [0-65536) -> [165536-231072) not allowed  lxc-start: conf.c: userns_exec_1: 4315 Error setting up child mappings  lxc-start: cgfsng.c: recursive_destroy: 983 Error destroying /sys/fs/cgroup/net_cls//lxc/testecho_uid-2  newuidmap: uid range [0-65536) -> [165536-231072) not allowed  lxc-start: conf.c: userns_exec_1: 4315 Error setting up child mappings  lxc-start: cgfsng.c: recursive_destroy: 983 Error destroying /sys/fs/cgroup/devices//lxc/testecho_uid-2  newuidmap: uid range [0-65536) -> [165536-231072) not allowed  lxc-start: conf.c: userns_exec_1: 4315 Error setting up child mappings  lxc-start: cgfsng.c: recursive_destroy: 983 Error destroying /sys/fs/cgroup/freezer//lxc/testecho_uid-2  lxc-start: lxc_start.c: main: 344 The container failed to start.  lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.  

Can anyone please tell me whether I am missing anything here.

below are my ubuntu 16.04 setup for uid & gid Code:

vijay@vijay-VirtualBox:~$ sudo cat  /etc/subgid  vijay:100000:65536  usrlxc:165536:65536  vijay:165536:65537  

Code:

vijay@vijay-VirtualBox:~$ sudo cat  /etc/subuid  vijay:100000:65536  usrlxc:165536:65536  vijay:165536:65537  

if above my question is not clear , please see below one more question similar to same scenario. Is there a way to access(lxc start & attach) unprivileged container from root user or sudo user . That is , I have created , started and attached un-priv container using lxc user(not sudo user/root user) by login into lxc user without any issue. Now I would like to start & attach the lxc user created un-priv container from root user or sudo user.

Is that possible? if yes please let me know how to do that?. I checked lxc-ls from sudo/root user and it just listed only the containers created by sudo user and does not display the container created by lxc user.

or

All the processes/threads of Privilege container can be executed/run for specific UID(eg: lxc user) by root/sudo user while doing lxc-start or by any means? I also tried by giving below lxc user uid & gid in config(ultimately changing busybox template). it gave above comment error. Code: lxc.id_map=u 0 165536 65536 lxc.id_map=g 0 165536 65536 I tried all the possible way , but no luck , please educate me this topic.

Below are user detail in my ubuntu desktop lxc user --> "usrlxc" which I have created as part of un-priv container creation experiment. Sudo user --> "vijay" - this is sudo user in my ubuntu 16.04 Virtual box machine. root user --> # which all of you aware Please let me know if any information from my ubuntu setup or lxc config

How to compare a program's version in a shell script?

Posted: 22 Mar 2021 09:58 AM PDT

Suppose I want to compare gcc version to see whether the system has the minimum version installed or not.

To check the gcc version, I executed the following

gcc --version | head -n1 | cut -d" " -f4  

The output was

4.8.5  

So, I wrote a simple if statement to check this version against some other value

if [ "$(gcc --version | head -n1 | cut -d" " -f4)" -lt 5.0.0 ]; then      echo "Less than 5.0.0"  else      echo "Greater than 5.0.0"  fi  

But it throws an error:

[: integer expression expected: 4.8.5  

I understood my mistake that I was using strings to compare and the -lt requires integer. So, is there any other way to compare the versions?

NginX + PHP-FPM displays blank php pages

Posted: 22 Mar 2021 10:24 AM PDT

I have a problem where my server running NginX with php-fpm loads blank PHP pages (strangely except for my phpinfo.php file, which loads normally). If I put an index.html page in the same directory and browse to it, it loads. The fact that phpinfo.php (which calls the phpinfo(); function) loads, confirms that php-fpm works.

I am hoping somebody might have some advice. I apologise in advance for the bulk of info I am about to give, but I would rather give too much information than too little. Here are my configuration files.

/etc/nginx/conf.d/default.conf:

server {      listen   80;      server_name  45.55.182.120;        #charset koi8-r;      #access_log  /var/log/nginx/log/host.access.log  main;            root   /usr/share/nginx/html;          index  index.php index.html index.htm;        location / {         try_files $uri $uri/ =404;      }        error_page  404              /404.html;        # redirect server error pages to the static page /50x.html      #      error_page   500 502 503 504  /50x.html;      location = /50x.html {          root   /usr/share/nginx/html;      }        # proxy the PHP scripts to Apache listening on 127.0.0.1:80      #      #location ~ \.php$ {      #    proxy_pass   http://127.0.0.1;      #}        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000      location ~ \.php$ {      try_files $uri =404;      fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;      fastcgi_index index.php;      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;      fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;      include fastcgi_params;        }    server {      listen   80;      server_name  45.55.182.120;        #charset koi8-r;      #access_log  /var/log/nginx/log/host.access.log  main;            root   /usr/share/nginx/html;          index  index.php index.html index.htm;        location / {         try_files $uri $uri/ =404;      }        error_page  404              /404.html;        # redirect server error pages to the static page /50x.html      #      error_page   500 502 503 504  /50x.html;      location = /50x.html {          root   /usr/share/nginx/html;      }        # proxy the PHP scripts to Apache listening on 127.0.0.1:80      #      #location ~ \.php$ {      #    proxy_pass   http://127.0.0.1;      #}        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000      location ~ \.php$ {      try_files $uri =404;      fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;      fastcgi_index index.php;      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;      fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;      include fastcgi_params;        }  

/etc/php-fpm.d/www.conf:

; Start a new pool named 'www'.  [www]    ; The address on which to accept FastCGI requests.  ; Valid syntaxes are:  ;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific address on  ;                            a specific port;  ;   'port'                 - to listen on a TCP socket to all addresses on a  ;                            specific port;  ;   '/path/to/unix/socket' - to listen on a unix socket.  ; Note: This value is mandatory.  listen = /var/run/php-fpm/php-fpm.sock    ; Set listen(2) backlog. A value of '-1' means unlimited.  ; Default Value: -1  ;listen.backlog = -1    ; List of ipv4 addresses of FastCGI clients which are allowed to connect.  ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original  ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address  ; must be separated by a comma. If this value is left blank, connections will be  ; accepted from any ip address.  ; Default Value: any  listen.allowed_clients = 127.0.0.1    ; Set permissions for unix socket, if one is used. In Linux, read/write  ; permissions must be set in order to allow connections from a web server. Many  ; BSD-derived systems allow connections regardless of permissions.  ; Default Values: user and group are set as the running user  ;                 mode is set to 0666  ;listen.owner = nobody  ;listen.group = nobody  ;listen.mode = 0666    ; Unix user/group of processes  ; Note: The user is mandatory. If the group is not set, the default user's group  ;   will be used.  ; RPM: apache Choosed to be able to access some dir as httpd  user = nginx  ; RPM: Keep a group allowed to write in log dir.  ; accepted from any ip address.  ; Default Value: any  listen.allowed_clients = 127.0.0.1    ; Set permissions for unix socket, if one is used. In Linux, read/write  ; permissions must be set in order to allow connections from a web server. Many  ; BSD-derived systems allow connections regardless of permissions.  ; Default Values: user and group are set as the running user  ;                 mode is set to 0666  ;listen.owner = nobody  ;listen.group = nobody  ;listen.mode = 0666    ; Unix user/group of processes  ; Note: The user is mandatory. If the group is not set, the default user's group  ;   will be used.  ; RPM: apache Choosed to be able to access some dir as httpd  user = nginx  ; RPM: Keep a group allowed to write in log dir.  group = nginx    ; Choose how the process manager will control the number of child processes.  ; Possible Values:  ;   static  - a fixed number (pm.max_children) of child processes;  ;   dynamic - the number of child processes are set dynamically based on the  ;             following directives:  ;             pm.max_children      - the maximum number of children that can  ;                                    be alive at the same time.  ;             pm.start_servers     - the number of children created on startup.  ;             pm.min_spare_servers - the minimum number of children in 'idle'  ;                                    state (waiting to process). If the number  ;                                    of 'idle' processes is less than this  ;                                    number then some children will be created.  ;             pm.max_spare_servers - the maximum number of children in 'idle'  ;                                    state (waiting to process). If the number  ;                                    of 'idle' processes is greater than this  ;                                    number then some children will be killed.  ; Note: This value is mandatory.  pm = dynamic  ; Choose how the process manager will control the number of child processes.  ; Possible Values:  ;   static  - a fixed number (pm.max_children) of child processes;  ;   dynamic - the number of child processes are set dynamically based on the  ;             following directives:  ;             pm.max_children      - the maximum number of children that can  ;                                    be alive at the same time.  ;             pm.start_servers     - the number of children created on startup.  ;             pm.min_spare_servers - the minimum number of children in 'idle'  ;                                    state (waiting to process). If the number  ;                                    of 'idle' processes is less than this  ;                                    number then some children will be created.  ;             pm.max_spare_servers - the maximum number of children in 'idle'  ;                                    state (waiting to process). If the number  ;                                    of 'idle' processes is greater than this  ;                                    number then some children will be killed.  ; Note: This value is mandatory.  pm = dynamic    ; The number of child processes to be created when pm is set to 'static' and the  ; maximum number of child processes to be created when pm is set to 'dynamic'.  ; This value sets the limit on the number of simultaneous requests that will be  ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.  ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP  ; CGI.  ; Note: Used when pm is set to either 'static' or 'dynamic'  ; Note: This value is mandatory.  pm.max_children = 50    ; The number of child processes created on startup.  ; Note: Used only when pm is set to 'dynamic'  ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2  pm.start_servers = 5    ; The desired minimum number of idle server processes.  ; Note: Used only when pm is set to 'dynamic'  ; Note: Mandatory when pm is set to 'dynamic'  pm.min_spare_servers = 5    ; The desired maximum number of idle server processes.  ; This value sets the limit on the number of simultaneous requests that will be  ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.  ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP  ; CGI.  ; Note: Used when pm is set to either 'static' or 'dynamic'  ; Note: This value is mandatory.  pm.max_children = 50    ; The number of child processes created on startup.  ; Note: Used only when pm is set to 'dynamic'  ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2  pm.start_servers = 5    ; The desired minimum number of idle server processes.  ; Note: Used only when pm is set to 'dynamic'  ; Note: Mandatory when pm is set to 'dynamic'  pm.min_spare_servers = 5    ; The desired maximum number of idle server processes.  ; Note: Used only when pm is set to 'dynamic'  ; Note: Mandatory when pm is set to 'dynamic'  pm.max_spare_servers = 35    ; The number of requests each child process should execute before respawning.  ; This can be useful to work around memory leaks in 3rd party libraries. For  ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.  ; Default Value: 0  ;pm.max_requests = 500    ; The URI to view the FPM status page. If this value is not set, no URI will be  ; recognized as a status page. By default, the status page shows the following  ; information:  ;   accepted conn    - the number of request accepted by the pool;  ;   pool             - the name of the pool;  ;   process manager  - static or dynamic;  ;   idle processes   - the number of idle processes;  ;   active processes - the number of active processes;  ;   total processes  - the number of idle + active processes.  ; The values of 'idle processes', 'active processes' and 'total processes' are  ; updated each second. The value of 'accepted conn' is updated in real time.  pm.max_spare_servers = 35    ; The number of requests each child process should execute before respawning.  ; This can be useful to work around memory leaks in 3rd party libraries. For  ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.  ; Default Value: 0  ;pm.max_requests = 500    ; The URI to view the FPM status page. If this value is not set, no URI will be  ; recognized as a status page. By default, the status page shows the following  ; information:  ;   accepted conn    - the number of request accepted by the pool;  ;   pool             - the name of the pool;  ;   process manager  - static or dynamic;  ;   idle processes   - the number of idle processes;  ;   active processes - the number of active processes;  ;   total processes  - the number of idle + active processes.  ; The values of 'idle processes', 'active processes' and 'total processes' are  ; updated each second. The value of 'accepted conn' is updated in real time.  ; Example output:  ;   accepted conn:   12073  ;   pool:             www  ;   process manager:  static  ;   idle processes:   35  ;   active processes: 65  ;   total processes:  100  ; By default the status page output is formatted as text/plain. Passing either  ; 'html' or 'json' as a query string will return the corresponding output  ; syntax. Example:  ;   http://www.foo.bar/status  ;   http://www.foo.bar/status?json  ;   http://www.foo.bar/status?html  ; Note: The value must start with a leading slash (/). The value can be  ;   anything, but it may not be a good idea to use the .php extension or it  ;   may conflict with a real PHP file.  ; Default Value: not set  ;pm.status_path = /status    ; The ping URI to call the monitoring page of FPM. If this value is not set, no  ; URI will be recognized as a ping page. This could be used to test from outside  ;   pool:             www  ;   process manager:  static  ;   idle processes:   35  ;   active processes: 65  ;   total processes:  100  ; By default the status page output is formatted as text/plain. Passing either  ; 'html' or 'json' as a query string will return the corresponding output  ; syntax. Example:  ;   http://www.foo.bar/status  ;   http://www.foo.bar/status?json  ;   http://www.foo.bar/status?html  ; Note: The value must start with a leading slash (/). The value can be  ;   anything, but it may not be a good idea to use the .php extension or it  ;   may conflict with a real PHP file.  ; Default Value: not set  ;pm.status_path = /status    ; The ping URI to call the monitoring page of FPM. If this value is not set, no  ; URI will be recognized as a ping page. This could be used to test from outside  ; that FPM is alive and responding, or to  ; - create a graph of FPM availability (rrd or such);  ; - remove a server from a group if it is not responding (load balancing);  ; - trigger alerts for the operating team (24/7).  ; Note: The value must start with a leading slash (/). The value can be  ;   anything, but it may not be a good idea to use the .php extension or it  ;   may conflict with a real PHP file.  ; Default Value: not set  ;ping.path = /ping    ; This directive may be used to customize the response of a ping request. The  ; response is formatted as text/plain with a 200 response code.  ; Default Value: pong  ;ping.response = pong    ; The timeout for serving a single request after which the worker process will  ; be killed. This option should be used when the 'max_execution_time' ini option  ; does not stop script execution for some reason. A value of '0' means 'off'.  ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)  ; Default Value: 0  ;request_terminate_timeout = 0  ; - remove a server from a group if it is not responding (load balancing);  ; - trigger alerts for the operating team (24/7).  ; Note: The value must start with a leading slash (/). The value can be  ;   anything, but it may not be a good idea to use the .php extension or it  ;   may conflict with a real PHP file.  ; Default Value: not set  ;ping.path = /ping    ; This directive may be used to customize the response of a ping request. The  ; response is formatted as text/plain with a 200 response code.  ; Default Value: pong  ;ping.response = pong    ; The timeout for serving a single request after which the worker process will  ; be killed. This option should be used when the 'max_execution_time' ini option  ; does not stop script execution for some reason. A value of '0' means 'off'.  ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)  ; Default Value: 0  ;request_terminate_timeout = 0    ; The timeout for serving a single request after which a PHP backtrace will be  ; dumped to the 'slowlog' file. A value of '0s' means 'off'.  ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)  ; Default Value: 0  ;request_slowlog_timeout = 0    ; The log file for slow requests  ; Default Value: not set  ; Note: slowlog is mandatory if request_slowlog_timeout is set  slowlog = /var/log/php-fpm/www-slow.log    ; Set open file descriptor rlimit.  ; Default Value: system defined value  ;rlimit_files = 1024    ; Set max core size rlimit.  ; Possible Values: 'unlimited' or an integer greater or equal to 0  ; Default Value: system defined value  ;rlimit_core = 0  ; dumped to the 'slowlog' file. A value of '0s' means 'off'.  ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)  ; Default Value: 0  ;request_slowlog_timeout = 0    ; The log file for slow requests  ; Default Value: not set  ; Note: slowlog is mandatory if request_slowlog_timeout is set  slowlog = /var/log/php-fpm/www-slow.log    ; Set open file descriptor rlimit.  ; Default Value: system defined value  ;rlimit_files = 1024    ; Set max core size rlimit.  ; Possible Values: 'unlimited' or an integer greater or equal to 0  ; Default Value: system defined value  ;rlimit_core = 0    ; Chroot to this directory at the start. This value must be defined as an  ; absolute path. When this value is not set, chroot is not used.  ; Note: chrooting is a great security feature and should be used whenever  ;   possible. However, all PHP paths will be relative to the chroot  ;   (error_log, sessions.save_path, ...).  ; Default Value: not set  ;chroot =    ; Chdir to this directory at the start. This value must be an absolute path.  ; Default Value: current directory or / when chroot  ;chdir = /var/www    ; Redirect worker stdout and stderr into main error log. If not set, stdout and  ; stderr will be redirected to /dev/null according to FastCGI specs.  ; Default Value: no  ;catch_workers_output = yes    ; Limits the extensions of the main script FPM will allow to parse. This can  ; prevent configuration mistakes on the web server side. You should only limit  ; FPM to .php extensions to prevent malicious users to use other extensions to  ; exectute php code.  ; Note: chrooting is a great security feature and should be used whenever  ;   possible. However, all PHP paths will be relative to the chroot  ;   (error_log, sessions.save_path, ...).  ; Default Value: not set  ;chroot =    ; Chdir to this directory at the start. This value must be an absolute path.  ; Default Value: current directory or / when chroot  ;chdir = /var/www    ; Redirect worker stdout and stderr into main error log. If not set, stdout and  ; stderr will be redirected to /dev/null according to FastCGI specs.  ; Default Value: no  ;catch_workers_output = yes    ; Limits the extensions of the main script FPM will allow to parse. This can  ; prevent configuration mistakes on the web server side. You should only limit  ; FPM to .php extensions to prevent malicious users to use other extensions to  ; exectute php code.  ; Note: set an empty value to allow all extensions.  ; Default Value: .php  ;security.limit_extensions = .php .php3 .php4 .php5    ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from  ; the current environment.  ; Default Value: clean env  ;env[HOSTNAME] = $HOSTNAME  ;env[PATH] = /usr/local/bin:/usr/bin:/bin  ;env[TMP] = /tmp  ;env[TMPDIR] = /tmp  ;env[TEMP] = /tmp    ; Additional php.ini defines, specific to this pool of workers. These settings  ; overwrite the values previously defined in the php.ini. The directives are the  ; same as the PHP SAPI:  ;   php_value/php_flag             - you can set classic ini defines which can  ;                                    be overwritten from PHP call 'ini_set'.  ;   php_admin_value/php_admin_flag - these directives won't be overwritten by  ;                                     PHP call 'ini_set'  ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.  ;security.limit_extensions = .php .php3 .php4 .php5    ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from  ; the current environment.  ; Default Value: clean env  ;env[HOSTNAME] = $HOSTNAME  ;env[PATH] = /usr/local/bin:/usr/bin:/bin  ;env[TMP] = /tmp  ;env[TMPDIR] = /tmp  ;env[TEMP] = /tmp    ; Additional php.ini defines, specific to this pool of workers. These settings  ; overwrite the values previously defined in the php.ini. The directives are the  ; same as the PHP SAPI:  ;   php_value/php_flag             - you can set classic ini defines which can  ;                                    be overwritten from PHP call 'ini_set'.  ;   php_admin_value/php_admin_flag - these directives won't be overwritten by  ;                                     PHP call 'ini_set'  ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.    ; Defining 'extension' will load the corresponding shared extension from  ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not  ; overwrite previously defined php.ini values, but will append the new value  ; instead.    ; Default Value: nothing is defined by default except the values in php.ini and  ;                specified at startup with the -d argument  ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com  ;php_flag[display_errors] = off  php_admin_value[error_log] = /var/log/php-fpm/www-error.log  php_admin_flag[log_errors] = on  ;php_admin_value[memory_limit] = 128M    ; Set session path to a directory owned by process user  php_value[session.save_handler] = files  php_value[session.save_path] = /var/lib/php/session  

What do you think could be the issue?

ELAN Touchscreen on Ubuntu 14.04 and Debian 7.6

Posted: 22 Mar 2021 10:04 AM PDT

I recently purchased an ASUS Q550LF laptop with Windows 8.1 preinstalled, and subsequently installed Ubuntu 14.04 and Debian 7.6. I use Ubuntu for most tasks, but occasionally have reason to boot Debian. The problem is that Debian won't boot. At some point during the boot process, I receive variations on the following error messages:

[time] usb 1-7: unable to read config index 0 descriptor/start: -71  [time] usb 1-7: can't read configurations, error -71    [time] usb 1-7: unable to read config index 0 descriptor/start: -110  [time] usb 1-7: can't read configurations, error -110  

They repeat indefinitely, and the boot process hangs. I don't have a problem with the touchscreen in Windows or Ubuntu, so I suspect some problem with Debian. When booting Ubuntu the same error message occurs, but eventually the touchscreen is recognized:

$ lsusb  Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub  Bus 001 Device 006: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller  Bus 001 Device 023: ID 04f3:010c Elan Microelectronics Corp.   Bus 001 Device 004: ID 13d3:5188 IMC Networks   Bus 001 Device 003: ID 8087:07dc Intel Corp.   Bus 001 Device 002: ID 046d:c00c Logitech, Inc. Optical Wheel Mouse  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub    $ dmesg -k | grep 'usb 1-7'  [    1.685457] usb 1-7: new full-speed USB device number 5 using xhci_hcd  [    1.702858] usb 1-7: New USB device found, idVendor=04f3, idProduct=010c  [    1.702862] usb 1-7: New USB device strings: Mfr=4, Product=14, SerialNumber=0  [    1.702864] usb 1-7: Product: Touchscreen  [    1.702866] usb 1-7: Manufacturer: ELAN  [    1.703007] usb 1-7: ep 0x2 - rounding interval to 64 microframes, ep desc says 80 microframes  [    3.822847] usb 1-7: USB disconnect, device number 5  [    4.095373] usb 1-7: new full-speed USB device number 7 using xhci_hcd  [    6.233335] usb 1-7: unable to read config index 0 descriptor/start: -71  [    6.233371] usb 1-7: can't read configurations, error -71  [    6.345226] usb 1-7: new full-speed USB device number 8 using xhci_hcd  [    8.483093] usb 1-7: unable to read config index 0 descriptor/start: -71  [    8.483135] usb 1-7: can't read configurations, error -71  [    8.594952] usb 1-7: new full-speed USB device number 9 using xhci_hcd  [   10.733650] usb 1-7: unable to read config index 0 descriptor/start: -71  [   10.733688] usb 1-7: can't read configurations, error -71  [   10.900889] usb 1-7: new full-speed USB device number 10 using xhci_hcd  [   13.040048] usb 1-7: unable to read config index 0 descriptor/start: -71  [   13.040053] usb 1-7: can't read configurations, error -71  [   13.318826] usb 1-7: new full-speed USB device number 11 using xhci_hcd  [   13.336201] usb 1-7: New USB device found, idVendor=04f3, idProduct=010c  [   13.336202] usb 1-7: New USB device strings: Mfr=4, Product=14, SerialNumber=0  [   13.336204] usb 1-7: Product: Touchscreen  [   13.336205] usb 1-7: Manufacturer: ELAN  [   13.336354] usb 1-7: ep 0x2 - rounding interval to 64 microframes, ep desc says 80 microframes  [   15.458888] usb 1-7: USB disconnect, device number 11  [   15.788782] usb 1-7: new full-speed USB device number 12 using xhci_hcd  [   15.806165] usb 1-7: New USB device found, idVendor=04f3, idProduct=010c  [   15.806169] usb 1-7: New USB device strings: Mfr=4, Product=14, SerialNumber=0  [   15.806171] usb 1-7: Product: Touchscreen  [   15.806173] usb 1-7: Manufacturer: ELAN  [   15.806291] usb 1-7: ep 0x2 - rounding interval to 64 microframes, ep desc says 80 microframes  [   17.928881] usb 1-7: USB disconnect, device number 12  [   18.218822] usb 1-7: new full-speed USB device number 13 using xhci_hcd  [   18.236215] usb 1-7: New USB device found, idVendor=04f3, idProduct=010c  [   18.236218] usb 1-7: New USB device strings: Mfr=4, Product=14, SerialNumber=0  [   18.236221] usb 1-7: Product: Touchscreen  [   18.236222] usb 1-7: Manufacturer: ELAN  [   18.236328] usb 1-7: ep 0x2 - rounding interval to 64 microframes, ep desc says 80 microframes  [   20.359363] usb 1-7: USB disconnect, device number 13  [   21.265243] usb 1-7: new full-speed USB device number 14 using xhci_hcd  [   21.283198] usb 1-7: New USB device found, idVendor=04f3, idProduct=010c  [   21.283203] usb 1-7: New USB device strings: Mfr=4, Product=14, SerialNumber=0  [   21.283205] usb 1-7: Product: Touchscreen  [   21.283207] usb 1-7: Manufacturer: ELAN  [   21.283339] usb 1-7: ep 0x2 - rounding interval to 64 microframes, ep desc says 80 microframes  [   23.406502] usb 1-7: USB disconnect, device number 14  [   23.687181] usb 1-7: new full-speed USB device number 15 using xhci_hcd  [   25.828401] usb 1-7: unable to read config index 0 descriptor/start: -71  [   25.828406] usb 1-7: can't read configurations, error -71  [   25.993113] usb 1-7: new full-speed USB device number 16 using xhci_hcd  [   28.134506] usb 1-7: unable to read config index 0 descriptor/start: -71  [   28.134512] usb 1-7: can't read configurations, error -71  [   28.298972] usb 1-7: new full-speed USB device number 17 using xhci_hcd  [   30.440820] usb 1-7: unable to read config index 0 descriptor/start: -71  [   30.440825] usb 1-7: can't read configurations, error -71  [   30.552709] usb 1-7: new full-speed USB device number 18 using xhci_hcd  [   32.694248] usb 1-7: unable to read config index 0 descriptor/start: -71  [   32.694253] usb 1-7: can't read configurations, error -71  [   32.970694] usb 1-7: new full-speed USB device number 19 using xhci_hcd  [   35.111542] usb 1-7: unable to read config index 0 descriptor/start: -71  [   35.111546] usb 1-7: can't read configurations, error -71  [   35.276520] usb 1-7: new full-speed USB device number 20 using xhci_hcd  [   37.417528] usb 1-7: unable to read config index 0 descriptor/start: -71  [   37.417533] usb 1-7: can't read configurations, error -71  [   37.582405] usb 1-7: new full-speed USB device number 21 using xhci_hcd  [   39.723735] usb 1-7: unable to read config index 0 descriptor/start: -71  [   39.723740] usb 1-7: can't read configurations, error -71  [   39.888351] usb 1-7: new full-speed USB device number 22 using xhci_hcd  [   47.031720] usb 1-7: unable to read config index 0 descriptor/start: -110  [   47.031725] usb 1-7: can't read configurations, error -110  [   47.271826] usb 1-7: new full-speed USB device number 23 using xhci_hcd  [   47.289529] usb 1-7: New USB device found, idVendor=04f3, idProduct=010c  [   47.289534] usb 1-7: New USB device strings: Mfr=4, Product=14, SerialNumber=0  [   47.289536] usb 1-7: Product: Touchscreen  [   47.289538] usb 1-7: Manufacturer: ELAN  [   47.289666] usb 1-7: ep 0x2 - rounding interval to 64 microframes, ep desc says 80 microframes  

I can't disable the touchscreen in the BIOS, and most of the purported solutions I've encountered when researching the problem don't work. I'm not even sure how I would go about solving the problem. If someone could point me in the right direction, I would appreciate it. Thanks in advance!

Using xargs with git

Posted: 22 Mar 2021 10:00 AM PDT

I am trying to practice using xargs. I tried the following, passing the SHA1 via xargs:

$ git show SHA1 --name-only  

I also tried:

$ git log --author=jim --grep="patch" |head -n 1|cut -d ' ' -f2|xargs {} git show {} --name-only  

It returned xargs: {}: No such file or directory

So, I moved on to this:

$ git log --author=jim --grep="patch" |head -n 1|cut -d ' ' -f2|xargs -0 -I {} git show {} --name-only  

Which returned:

fatal: ambiguous argument 'a1237ac27321f2daea365787664e4119b339c483': unknown revision or path not in the working tree.  Use '--' to separate paths from revisions, like this:  'git <command> [<revision>...] -- [<file>...]'  

The SHA mentioned is the correct one, but I don't understand why this does not work either

What is the difference between running "bash script.sh" and "./script.sh"?

Posted: 22 Mar 2021 09:11 AM PDT

If script.sh is just something typical like

#!/bin/bash  echo "Hello World!"  

Is there a preferred way to run the script? I think you first have to chmod it so it becomes executable?

No comments:

Post a Comment