Sunday, June 20, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Udev rule not triggered

Posted: 20 Jun 2021 10:14 AM PDT

i'm trying to write an udev rule to mount a specific partition of an usbkey as rw for the owner and no access for group and other user. This is my rule:

SUBSYSTEM=="block", KERNEL=="sdc1", MODE="0600" , GROUP="mygroup"

as far i know this rule should match the first partition of the sdc drive and mount the fs according to the octal permission 600 ( rw-------)

i ran also the command udevadm control --reload-rules but nothing is changed, my partition is mounted with 644

any hint?

Pop!_OS installation without Bootloader

Posted: 20 Jun 2021 09:31 AM PDT

I'm trying to install Pop! altogether with 4 more Linux distros, and I would like to let the Grub bootloading to Manjaro (or I'm also thinking about installing rEFind). However, I cannot find anywhere in the documentation how to install Pop Os without bootloader, and my installation cannot proceed.

I'm trying to install the system on LVM with 3 volumes for Pop! and 1 shared volume for SWAP. For some reason the installation is failing with potential Hardware issue, and the installation log does not state any problems, only debug info and Info logs. I'm having some thoughts that bootloader maybe the issue here, because the log stops after the discovery phase of most of the OS-es.

Thanks in advance for the help! :)

Rsync copies junk data when file is a sparse file instead of just returning some form or read IO error

Posted: 20 Jun 2021 08:46 AM PDT

I'm trying to work out why rsync behaves in the way it does, when compared to other 'simpler' commands like cp.

I have a test setup involving an AWS File gateway and an appropriate NFS share and S3 bucket. The file gateway allows access to data in an S3 bucket as if it were any 'normal' NFS mount.

In the background S3 is moving old data to Glacier but those files remain visible within the NFS mount in what I'm calling a 'sparse file' (ie metadata is there, but no actual data is - not sure if that's the correct term or not), so that process is transparent. I have setup S3 with a lambda function using the cloudwatch logs to automatically initiate glacier restores when a file is requested, but found to be in Glacier (here for details on that for the interested).

My issue / question related to the difference in behaviour between rsync and others like cp.

When I try to cp the files in the NFS mount to another location, if the file is in glacier (ie unreadable) it pretty much immediately comes back with an IO Error for the file, and exits. To me, that is a desirable behaviour.

However, if I run rsync -rvhWP it acts as if its actually transferring data, it creates a file at the destination with the correct file size etc.. but its just data of random 1's and 0's.. it does at the end of the transfer say rsync: read errors mapping "<FILE PATH>": Input/output error (5) then WARNING: <FILE> failed verification -- update discarded (will try again). and it tries again and again... but that's AFTER its transferred like 150GB of junk data into the destination, which is just left there and not removed.

Why does rsync do this? Is it expected (if undesirable) behaviour? Why does cp immediately report file IO error when rsync doesn't? Is there a way to stop this undesirable rsync behaviour?

You may say 'just use cp then' and that's a valid point, just a case that rsync provides progress data that can be tracked, and I feel rsync is more robust for transferring files from a network location.

Automatically locking screen while youtube video is playing

Posted: 20 Jun 2021 07:55 AM PDT

Automatically locking screen is disabled while playing youtube video even it has been stop , that will cause security issue, how to configure my Linux to Automatically lock screen in all cases?

How to cd into the only subfolder by auto-completion in bash?

Posted: 20 Jun 2021 09:32 AM PDT

I am using Centos 7 and bash. I know on some machines, if there is only one subfolder (and some files) in current folder, when you type cd <tab> it will auto-complete the name of the subfolder. However, it doesn't work on my machine, although <tab> can do other auto-completion on my machine, e.g., less ab<tab> will auto-complete the filename starting with ab. How can I fix it?

Edit:

Another working machine has same Centos and bash. On my machine, cd <tab> does nothing but a beep. For cd <tab><tab>, it shows all files and the single subfolder in current folder. The single folders on both machine are proper (command ls -ld the_single_folder shows drwxrwxr-x 2 user user ...).

Some shell options (output of command shopt) are different. The output of diff shoptA shoptB is (my machine is B):

18c18  < extglob           on  ---  > extglob           off  27c27  < hostcomplete      off  ---  > hostcomplete      on  42a43  > syslog_history    off  

I tried to change those different options (extglob and hostcomplete) on my machine using commands shopt -s extglob and shopt -u hostcomplete. But it didn't work

Command complete -p cd on that machine output complete -o nospace -F _cd cd, on my machine output -bash: complete: cd: no completion specification.

Command type _cd on that machine output:

_cd is a function  _cd ()   {       local cur prev words cword;      _init_completion || return;      local IFS='  ' i j k;      compopt -o filenames;      if [[ -z "${CDPATH:-}" || "$cur" == ?(.)?(.)/* ]]; then          _filedir -d;          return 0;      fi;      local -r mark_dirs=$(_rl_enabled mark-directories && echo y);      local -r mark_symdirs=$(_rl_enabled mark-symlinked-directories && echo y);      for i in ${CDPATH//:/'  '};      do          k="${#COMPREPLY[@]}";          for j in $( compgen -d $i/$cur );          do              if [[ ( -n $mark_symdirs && -h $j || -n $mark_dirs && ! -h $j ) && ! -d ${j#$i/} ]]; then                  j+="/";              fi;              COMPREPLY[k++]=${j#$i/};          done;      done;      _filedir -d;      if [[ ${#COMPREPLY[@]} -eq 1 ]]; then          i=${COMPREPLY[0]};          if [[ "$i" == "$cur" && $i != "*/" ]]; then              COMPREPLY[0]="${i}/";          fi;      fi;      return 0  }  

How do I append contents of a file to other file in a CRON job? [closed]

Posted: 20 Jun 2021 06:37 AM PDT

52 15 * * 1-5 cat /root/Algo/algo-01/logs/algo-01.log >> /root/Algo/algo-01/logs/algo-01-old.log  53 15 * * 1-5 > /root/Algo/algo-01/logs/algo-01.log  

Use case : The above command appends the content of file1 to file2 and clears the file1.

This is working absolutely fine when I am executing manually.

But it is not working in CRON job. Why content is not copied. Why is this happening and how to fix it?

How to move the last n files in hdfs

Posted: 20 Jun 2021 05:52 AM PDT

I have a folder in HDFS contains 830000 files, and I want to move the last "8797" files enter code here to another folder in HDFS? I tried using xargs but didn't work fine. Any other ideas?

Here is the exact split point between all files. I want to move files after "2021-03-09 15:15"

-rw-rw-r--+ 3 talend_user talend_group 102013 2021-03-09 15:14 /user/file_1

-rw-rw-r--+ 3 talend_user talend_group 9360 2021-03-09 15:15 /user/file_2

Extract part of filename?

Posted: 20 Jun 2021 08:47 AM PDT

I have a file in the form of:

XXX XXXX XXX-6VwvOkZvzuI.description  

How can I get just the file name XXX XXXX XXX? I've tried:

for file in $(ls .d*)  do      fname="${file%*-}"      ext="${filename%.*}"  done  

Is it possible to add files in-place to a tar archive?

Posted: 20 Jun 2021 09:08 AM PDT

Suppose I have two files A and B that are 50 GB each, along with about 100 other files of negligible size. I only have 120 GB of disk space (of which 100 GB is taken up by files A and B). I want to create a tar archive containing files A and B and the 100 other files. Is it possible to achieve this with less than 20 GB of disk space remaining?

The tar archive will be uploaded to a long-term cloud storage solution (e.g. Amazon S3 Glacier Deep Archive, Google Cloud Archive Storage, etc.).

How to solve sd-bus problem when building images with Podman?

Posted: 20 Jun 2021 07:01 AM PDT

Building a Payara image with podman 3.0.1 results in

sd-bus call: Connection reset by peer

Below example should build a Payara server. The same problem occurs when building a Postgres server. So it seems to relate to some kind of "sd-bus" problem.

I have installed package podman on Ubuntu 20.04.2 LTS (running on Raspi 4) with

apt install podman  podman -v  -> podman version 3.0.1  

Trying to build a Payara image results in following output

podman build --build-arg CPU_TYPE=armhf -t djarjo/payara -f payara .    STEP 1: FROM openjdk:11.0.3-jdk-slim  Resolved "openjdk" as an alias (/var/cache/containers/short-name-aliases.conf)  Getting image source signatures  Copying blob 6aebced65d80 done  Copying blob 3abff36f6719 done  Copying blob fc6e1cf441f8 done  Copying blob b41def3f3781 done  Copying config e46baa009c done  Writing manifest to image destination  Storing signatures  STEP 2: ARG CPU_TYPE=armhf  --> c63842c40fb  STEP 3: ENV MAVEN_SHA512_VAL=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0  --> 5385dbdeddb  STEP 4: ENV M3_HOME=/opt/maven  --> 9ab87eebd56  STEP 5: ENV MAVEN_HOME=/opt/maven  --> a285de5e4cd  STEP 6: ENV PATH=${PATH}:${M3_HOME}/bin  --> 77520ec480d  STEP 7: ADD https://github.com/just-containers/s6-overlay/releases/download/v2.1.0.2/s6-overlay-$CPU_TYPE.tar.gz /tmp/s6-overlay.tar.gz  --> 7355f412041  STEP 8: ADD https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz /tmp/apache-maven-3.6.3-bin.tar.gz  --> 8283cffaece  STEP 9: RUN set -ex &&  apt update  error running container: error creating container for [/bin/sh -c set -ex &&  apt update]: sd-bus call: Connection reset by peer  : exit status 1  Error: error building at STEP "RUN set -ex &&  apt update": error while running runtime: exit status 1  

The build file (payara) is:

FROM openjdk:11.0.3-jdk-slim    ARG CPU_TYPE=armhf    ENV MAVEN_SHA512_VAL=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0  ENV M3_HOME=/opt/maven  ENV MAVEN_HOME=/opt/maven  ENV PATH=${PATH}:${M3_HOME}/bin    ADD https://github.com/just-containers/s6-overlay/releases/download/v2.1.0.2/s6-overlay-$CPU_TYPE.tar.gz /tmp/s6-overlay.tar.gz  ADD https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz /tmp/apache-maven-3.6.3-bin.tar.gz    # Required software packages  RUN set -ex &&  apt update  RUN set -x  &&  apt install -y procps wget    COPY rootfs /  COPY djarjo.conf /defaults  COPY djarjo.log.conf /defaults    RUN set -x && \          groupadd -r --gid "8080" "payara" && \          useradd -r --uid "8080" --gid "8080" "payara" && \      echo payara:payara | chpasswd && \          tar xfz /tmp/s6-overlay.tar.gz -C / && \      mkdir -p /opt/payara/bin && \      mkdir -p /opt/payara/conf && \      mkdir -p /opt/payara/deployments && \      mkdir -p /opt/payara/install && \      mkdir -p /opt/payara/lib && \      mkdir -p /opt/payara/log && \      mkdir -p /opt/payara/server    ENTRYPOINT ["/init"]    CMD ["/bin/sh", "-c", "/opt/payara/bin/start-payara.sh"]    # Default payara ports to expose  EXPOSE 8080 9009  

Remove all lines with only one dot character

Posted: 20 Jun 2021 09:19 AM PDT

I have a huge text. I want to remove all lines with only one . in it.

Sample input:

abc.google.org  yahoo.com  abc.yahoo.in  abcd.bing.com  abcd.xyz.bing.uk  abcd.xyz.mnp.bing.uk  stackexchange.com  yas.sxs.sxs.zs.sxstackexchange.com  

Expected output:

abc.google.org  abc.yahoo.in  abcd.bing.com  abcd.xyz.bing.uk  abcd.xyz.mnp.bing.uk  yas.sxs.sxs.zs.sxstackexchange.com  

I really appreciate any help you can provide.

How to resolve IPv4 first on alpine linux?

Posted: 20 Jun 2021 08:22 AM PDT

It seems that when resolving hosts on Alpine the default behavior is to try IPv6 first and falling back to IPv4, but sometimes it takes a lot of time to resolve, and there are connections when IPv6 is blocked entirely making it frustating.

Is there a way to configure the resolver to try IPv4 first?

Centos 8.4 what is POSIXLY_CORRECT and what makes it change?

Posted: 20 Jun 2021 09:25 AM PDT

I am testing using this script from github:

https://github.com/rocky-linux/rocky-tools/blob/main/migrate2rocky/migrate2rocky.sh

I tested this yesterday and it worked fine. Today I reverted to a snapshot to do it again. This time the script fails on the first check:

if [ -n "$POSIXLY_CORRECT" ] || [ -z "$BASH_VERSION" ]; then      printf '%s\n' "bash >= 4.0 is required for this script." >&2      exit 1  fi  

Specifically, it fails on $POSIXLY_CORRECT (ran the code snippet independently to verify). I checked the running bash version:

[user@server ~]$ rpm -qa | grep bash  bash-completion-2.7-5.el8.noarch  bash-4.4.20-1.el8_4.x86_64  [user@server ~]$ echo $BASH_VERSION  4.4.20(1)-release  [user@server ~]$ echo $POSIXLY_CORRECT    [user@server ~]$  

From what i can tell posix is a standard set to ease application portability between UNIX OS.

No changes were made on our servers to explain why the script no longer works. I tested the script on servers I haven't used the script on yet and the same issue occurs.

The servers are all CentOS 8.4.

I don't know what the POSIXLY_CORRECT does and why it;s erroring now when it was fine yesterday.

Please let me know if you have any queries, i'm really lost.

EDIT: Output of "bash -x migrate2rocky.sh" command

[user@server ~]$ sudo bash -x migrate2rocky.sh  + '[' -n '' ']'  + '[' -z '4.4.20(1)-release' ']'  + ((  BASH_VERSINFO < 4  ))  + ((  EUID != 0  ))  + logfile=/var/log/migrate2rocky.log  + truncate -s0 /var/log/migrate2rocky.log  + exec  ++ tee -a /var/log/migrate2rocky.log  ++ tee -a /var/log/migrate2rocky.log  + errcolor=  + blue=  + nocolor=  + export LANG=en_US.UTF-8  + LANG=en_US.UTF-8  + shopt -s nullglob  + SUPPORTED_MAJOR=8  + SUPPORTED_PLATFORM=platform:el8  ++ arch  + ARCH=x86_64  + gpg_key_url=https://dl.rockylinux.org/pub/rocky/RPM-GPG-KEY-rockyofficial  + gpg_key_sha512=88fe66cf0a68648c2371120d56eb509835266d9efdf7c8b9ac8fc101bdf1f0e0197030d3ea65f4b5be89dc9d1ef08581adb068815c88d7b1dc40aa1c32990f6a  + declare -A repo_urls  + repo_urls=([rockybaseos]="https://dl.rockylinux.org/pub/rocky/${SUPPORTED_MAJOR}/BaseOS/$ARCH/os/" [rockyappstream]="https://dl.rockylinux.org/pub/rocky/${SUPPORTED_MAJOR}/AppStream/$ARCH/os/")  + unset CDPATH  + convert_info_dir=/root/convert  + unset convert_to_rocky reinstall_all_rpms verify_all_rpms update_efi  + noopts=0  + getopts hrVR option  + ((  ! noopts  ))  + usage  + printf '%s\n' 'Usage: migrate2rocky.sh [OPTIONS]' '' Options: '-h Display this help' '-r Convert to rocky' '-V Verify switch' '   !! USE WITH CAUTION !!'  Usage: migrate2rocky.sh [OPTIONS]    Options:  -h Display this help  -r Convert to rocky  -V Verify switch     !! USE WITH CAUTION !!  + exit 1  [user@server ~]$  

Curiously the command works, as you can see above, when running via "bash" command rather than "sh" which i did yesterday.

Is there a distribution for a web server with control panel?

Posted: 20 Jun 2021 05:55 AM PDT

I don't know much about Linux but want to set up a web server and I have searched but can't find a Linux distribution which sets you up a fully functional web server with control panel.

I have seen other distributions like SME Server which makes it simple to set up an office server and hoped there would be something similar for a web server that would install and set up:

  • Linux
  • Apache
  • PHP
  • MySQL or MariaDB
  • Mail server
  • DNS
  • FTP
  • Control panel of some sort to manage it all

Is there anything available like this?

Disable button on mouse (Logitech M720 Triathlon)

Posted: 20 Jun 2021 05:56 AM PDT

There's a button on my mouse that I'm unable to disable. It's right next to my thumb and I keep clicking it by accident. It triggers some kind of alt+tab function and it's very annoying!

Here is my xinput output:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]  ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]  ⎜   ↳ Logitech M720 Triathlon                   id=11   [slave  pointer  (2)]  ⎜   ↳ Wacom Pen and multitouch sensor Finger touch  id=13   [slave  pointer  (2)]  ⎜   ↳ Wacom Pen and multitouch sensor Pen stylus    id=14   [slave  pointer  (2)]  ⎜   ↳ Elan Touchpad                             id=15   [slave  pointer  (2)]  ⎜   ↳ Elan TrackPoint                           id=16   [slave  pointer  (2)]  ⎜   ↳ Wacom Pen and multitouch sensor Pen eraser    id=20   [slave  pointer  (2)]  ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]      ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]      ↳ Power Button                              id=6    [slave  keyboard (3)]      ↳ Video Bus                                 id=7    [slave  keyboard (3)]      ↳ Sleep Button                              id=8    [slave  keyboard (3)]      ↳ Apple, Inc Apple Keyboard                 id=9    [slave  keyboard (3)]      ↳ Apple, Inc Apple Keyboard                 id=10   [slave  keyboard (3)]      ↳ Integrated Camera: Integrated C           id=12   [slave  keyboard (3)]      ↳ AT Translated Set 2 keyboard              id=17   [slave  keyboard (3)]      ↳ ThinkPad Extra Buttons                    id=18   [slave  keyboard (3)]      ↳ Logitech M720 Triathlon                   id=19   [slave  keyboard (3)]  

Here is the xinput test 11 output, when I click the button:

key press   37   key press   64   key press   23   key release 23   key release 64   key release 37  

edit: xev output

KeyPress event, serial 40, synthetic NO, window 0x4e00001,      root 0x16b, subw 0x0, time 3927972, (-192,136), root:(679,596),      state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,      XLookupString gives 0 bytes:       XmbLookupString gives 0 bytes:       XFilterEvent returns: False    KeyPress event, serial 40, synthetic NO, window 0x4e00001,      root 0x16b, subw 0x0, time 3927980, (-192,136), root:(679,596),      state 0x14, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,      XLookupString gives 0 bytes:       XmbLookupString gives 0 bytes:       XFilterEvent returns: False    KeyPress event, serial 40, synthetic NO, window 0x4e00001,      root 0x16b, subw 0x0, time 3927988, (-192,136), root:(679,596),      state 0x1c, keycode 23 (keysym 0xff09, Tab), same_screen YES,      XLookupString gives 1 bytes: (09) " "      XmbLookupString gives 1 bytes: (09) "   "      XFilterEvent returns: False    

Is there a way to ignore device ID 11 on startup? If so, how, and how do I make sure it doesn't ignore something else on boot up? I could just ignore these keypresses in xinput but then my keyboard won't be able to press these anymore.

shell script to activate development environment

Posted: 20 Jun 2021 06:07 AM PDT

Several times a day I need to open my development environment by opening a terminal window (the default xfce4-terminal) and typing the following commands:

cd ~/Desktop/xyz  conda activate tf_gpu  

I want to automate this process with a shell script that I can double-click. I've seen lots of similar questions but none of the answers open the window for me.

Not sure if it matters, this is on Linux Mint 20.1.

I've tried putting the following files on my Desktop with "Allow this file to run as a program" ticked in Permissions.

  1. This seems to do nothing:
#!/bin/bash  cd ~/Desktop/xyz  conda activate tf_gpu  
  1. This:
#!/bin/sh  x-terminal-emulator -e "cd ~/Desktop/xyz && conda activate tf_gpu"  

throws the following error:

Error  Failed to execute child  Failed to execute child process "cd" (No such file or directory)  

Unwanted defragmentation of forwarded ipv4 packets

Posted: 20 Jun 2021 06:09 AM PDT

I want to handle ip fragments in user-space, and I am using the iptables NF_QUEUE to direct packets to user-space.

The problem is that IPv4 packets are always re-assembled and delivered as one packet rather than individual fragments. For IPv6, fragments are delivered as they should.

I thought that the conntracker might be causing it and disabled it in the raw iptables table, but it turns out that the packet is already re-assembled when it reaches the raw table:

# iptables -t raw -nvL  Chain PREROUTING (policy ACCEPT 58 packets, 62981 bytes)   pkts bytes target     prot opt in     out     source               destination               1 30028 CT         all  --  *      *       0.0.0.0/0            10.0.0.0/24          NOTRACK  

This is when sending a 30000 byte UDP packet over IPv4. The corresponding for IPv6:

# ip6tables -t raw -nvL  Chain PREROUTING (policy ACCEPT 46 packets, 62304 bytes)   pkts bytes target     prot opt in     out     source               destination              21 31016 CT         all      *      *       ::/0                 1000::               NOTRACK  

This is in a virtual environment kvm/qemu with virtio network devices, mtu=1500. Some HW offload does not seem to cause this, since I can see all IPv4 fragments with tcpdump -ni eth2 host 10.0.0.0.

So my question is what in the Linux kernel can force IPv4 packets to be re-assembled before the raw/PREROUTING netfilter chain?

I suspect "ingress/qdisc" as it is in between AF_PACKET (tcpdump) and the raw/PREROUTING chain, but I can't find the problem.

Packet flow: https://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg

mirroring and controlling Ubuntu touch

Posted: 20 Jun 2021 06:10 AM PDT

I recently installed Ubuntu Touch on my Oneplus One and was wondering if it is possible to control and mirror it on my laptop.

Like scrcpy for android, is there something for ubuntu touch?

Alsa doesn't recognize soundcards but kernel does

Posted: 20 Jun 2021 10:05 AM PDT

I've an issue with alsa which seems not to recognize my soundcards. Before I didn't have that issue...

    !!################################      !!ALSA Information Script v 0.4.64      !!################################        !!Script ran on: Mon Jan  6 18:28:00 UTC 2020          !!Linux Distribution      !!------------------        ID_LIKE=arch          !!DMI Information      !!---------------        Manufacturer:      Gigabyte Technology Co., Ltd.      Product Name:      B450M DS3H      Product Version:   Default string      Firmware Version:  F41      Board Vendor:      Gigabyte Technology Co., Ltd.      Board Name:        B450M DS3H-CF          !!ACPI Device Status Information      !!---------------        /sys/bus/acpi/devices/AMDI0030:00/status     15      /sys/bus/acpi/devices/AMDIF030:00/status     15      /sys/bus/acpi/devices/LNXTHERM:00/status     11      /sys/bus/acpi/devices/PNP0103:00/status      15      /sys/bus/acpi/devices/PNP0501:00/status      15      /sys/bus/acpi/devices/PNP0A08:00/status      15      /sys/bus/acpi/devices/PNP0C01:00/status      15      /sys/bus/acpi/devices/PNP0C02:01/status      15      /sys/bus/acpi/devices/PNP0C02:03/status      15      /sys/bus/acpi/devices/PNP0C0C:00/status      11      /sys/bus/acpi/devices/PNP0C0F:00/status      11      /sys/bus/acpi/devices/PNP0C0F:01/status      11      /sys/bus/acpi/devices/PNP0C0F:02/status      11      /sys/bus/acpi/devices/PNP0C0F:03/status      11      /sys/bus/acpi/devices/PNP0C0F:04/status      11      /sys/bus/acpi/devices/PNP0C0F:05/status      11      /sys/bus/acpi/devices/PNP0C0F:06/status      11      /sys/bus/acpi/devices/PNP0C0F:07/status      11      /sys/bus/acpi/devices/PNP0C14:01/status      11          !!Kernel Information      !!------------------        Kernel release:    5.4.6-2-MANJARO      Operating System:  GNU/Linux      Architecture:      x86_64      Processor:         unknown      SMP Enabled:       Yes          !!ALSA Version      !!------------        Driver version:     k5.4.6-2-MANJARO      Library version:    1.2.1.2      Utilities version:  1.2.1          !!Loaded ALSA modules      !!-------------------            !!Sound Servers on this system      !!----------------------------        Pulseaudio:            Installed - Yes (/usr/bin/pulseaudio)            Running - Yes        Jack:            Installed - Yes (/usr/bin/jackd)            Running - No          !!Soundcards recognised by ALSA      !!-----------------------------        --- no soundcards ---          !!PCI Soundcards installed in the system      !!--------------------------------------        07:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev a1)      09:00.3 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) HD Audio Controller          !!Advanced information - PCI Vendor/Device/Subsystem ID's      !!-------------------------------------------------------        07:00.1 0403: 10de:0fb9 (rev a1)          Subsystem: 10de:11c0      --      09:00.3 0403: 1022:1457          Subsystem: 1458:a182          !!Loaded sound module options      !!---------------------------          !!ALSA Device nodes      !!-----------------        crw-rw----+ 1 root audio 116,  1 Jan  6 18:50 /dev/snd/seq      crw-rw----+ 1 root audio 116, 33 Jan  6 18:50 /dev/snd/timer          !!Aplay/Arecord output      !!--------------------        APLAY        aplay: device_list:272: no soundcards found...        ARECORD        arecord: device_list:272: no soundcards found...        !!Amixer output      !!-------------          !!Alsactl output      !!--------------        --startcollapse--      --endcollapse--          !!All Loaded Modules      !!------------------        Module      ccm      fuse      squashfs      loop      rtl8192ee      btcoexist      rtl_pci      rtlwifi      edac_mce_amd      mac80211      kvm_amd      snd_intel_nhlt      kvm      snd_hda_codec      irqbypass      cfg80211      r8169      snd_hda_core      crct10dif_pclmul      crc32_pclmul      snd_hwdep      ghash_clmulni_intel      realtek      uinput      mousedev      rfkill      snd_pcm      joydev      input_leds      aesni_intel      nvidia_drm      wmi_bmof      snd_timer      nvidia_modeset      snd      crypto_simd      ccp      cryptd      sp5100_tco      glue_helper      pcspkr      soundcore      i2c_piix4      k10temp      libarc4      libphy      rng_core      drm_kms_helper      wmi      drm      pinctrl_amd      gpio_amdpt      evdev      mac_hid      acpi_cpufreq      agpgart      syscopyarea      sysfillrect      sysimgblt      fb_sys_fops      nvidia      ipmi_devintf      ipmi_msghandler      crypto_user      ip_tables      x_tables      ext4      crc32c_generic      crc16      mbcache      jbd2      hid_logitech_hidpp      hid_logitech_dj      hid_generic      usbhid      hid      sd_mod      ahci      libahci      libata      crc32c_intel      xhci_pci      scsi_mod      xhci_hcd          !!ALSA/HDA dmesg      !!--------------  
      ➜  ~ alsactl init        alsactl: sysfs_init:48: sysfs path '/sys' is invalid        alsactl: init:1759: No soundcards found...      ➜  ~ alsamixer       le mixeur ne peut pas être ouvert: Aucun fichier ou dossier de ce type  
[redgl0w redgl0w]# rmmod snd-hda-intel; modprobe snd-hda-intel; dmesg | tail  rmmod: ERROR: Module snd_hda_intel is not currently loaded  modprobe: ERROR: Error running install command for snd_hda_intel  modprobe: ERROR: could not insert 'snd_hda_intel': Operation not permitted  [   57.223367] audit: type=1100 audit(1578342370.883:68): pid=2098 uid=1000 auid=1000 ses=2 subj==unconfined msg='op=PAM:authentication grantors=pam_unix,pam_permit acct="redgl0w" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'  [   57.223711] audit: type=1101 audit(1578342370.886:69): pid=2098 uid=1000 auid=1000 ses=2 subj==unconfined msg='op=PAM:accounting grantors=pam_unix,pam_permit,pam_time acct="redgl0w" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'  [   57.224131] audit: type=1110 audit(1578342370.886:70): pid=2098 uid=0 auid=1000 ses=2 subj==unconfined msg='op=PAM:setcred grantors=pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'  [   57.229977] audit: type=1105 audit(1578342370.890:71): pid=2098 uid=0 auid=1000 ses=2 subj==unconfined msg='op=PAM:session_open grantors=pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'  [   57.232712] audit: type=1106 audit(1578342370.893:72): pid=2098 uid=0 auid=1000 ses=2 subj==unconfined msg='op=PAM:session_close grantors=pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'  [   57.232852] audit: type=1104 audit(1578342370.893:73): pid=2098 uid=0 auid=1000 ses=2 subj==unconfined msg='op=PAM:setcred grantors=pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'  [   61.145820] audit: type=1101 audit(1578342374.806:74): pid=2107 uid=1000 auid=1000 ses=2 subj==unconfined msg='op=PAM:accounting grantors=pam_unix,pam_permit,pam_time acct="redgl0w" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'  [   61.146060] audit: type=1110 audit(1578342374.806:75): pid=2107 uid=0 auid=1000 ses=2 subj==unconfined msg='op=PAM:setcred grantors=pam_unix,pam_permit,pam_env acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'  [   61.151701] audit: type=1105 audit(1578342374.813:76): pid=2107 uid=0 auid=1000 ses=2 subj==unconfined msg='op=PAM:session_open grantors=pam_limits,pam_unix,pam_permit acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'  [   61.160687] audit: type=1100 audit(1578342374.823:77): pid=2108 uid=0 auid=1000 ses=2 subj==unconfined msg='op=PAM:authentication grantors=pam_rootok acct="root" exe="/usr/bin/su" hostname=redgl0w addr=? terminal=pts/0 res=success'  [redgl0w redgl0w]#   

Thank you !

Unable to generate keys for openvpn using easy-rsa

Posted: 20 Jun 2021 06:00 AM PDT

I've been following a tutorial to set up my Raspberry Pi to run OpenVPN (I'm quite new to the Pi and networking, and this seemed to be a fun intro project). However, I've run into a road block when trying to generate keys using easy-rsa. I've edited the vars file to point to the easy-rsa directory, but whenever I try to source the vars file, I get the following message:

-bash: /etc/openvpn/easy-rsa: Is a directory  -bash: /whichopensslcnf: No such file or directory  NOTE: If you run ./clean-all, I will be doing a rm -rf on /keys  

/etc/openvpn/easy-rsa is the location of the directory, so I find the first line to be a bit redundant. Also, the /whichopensslcnf file is clearly right there inside the directory.

Any advice or pointers would be much appreciated.

UPDATE #1

The tutorial can be found here: https://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing/

source ./vars is the command being given that results in the error.

# easy-rsa parameter settings    # NOTE: If you installed from an RPM,  # don't edit this file in place in  # /usr/share/openvpn/easy-rsa --  # instead, you should copy the whole  # easy-rsa directory to another location  # (such as /etc/openvpn) so that your  # edits will not be wiped out by a future  # OpenVPN package upgrade.    # This variable should point to  # the top level of the easy-rsa  # tree.  export EASY_RSA="`/etc/openvpn/easy-rsa`"    #  # This variable should point to  # the requested executables  #    export OPENSSL="openssl"  export PKCS11TOOL="pkcs11-tool"  export GREP="grep"      # This variable should point to  # the openssl.cnf file included  # with easy-rsa.  export KEY_CONFIG=`$EASY_RSA/whichopensslcnf`    # Edit this variable to point to  # your soon-to-be-created key  # directory.  #  # WARNING: clean-all will do  # a rm -rf on this directory  # so make sure you define  # it correctly!  export KEY_DIR="$EASY_RSA/keys"    # Issue rm -rf warning  echo NOTE: If you run ./clean-all, I will be doing a rm -rf on $KEY_DIR    # PKCS11 fixes  export PKCS11_MODULE_PATH="dummy"  export PKCS11_PIN="dummy"    # Increase this to 2048 if you  # are paranoid.  This will slow  # down TLS negotiation performance  # as well as the one-time DH parms  # generation process.  export KEY_SIZE=2048    # In how many days should the root CA key expire?  export CA_EXPIRE=3650    # In how many days should certificates expire?  export KEY_EXPIRE=3650  # These are the default values for fields  # which will be placed in the certificate.  # Don't leave any of these fields blank.  export KEY_COUNTRY="US"  export KEY_PROVINCE="CA"  export KEY_CITY="SanFrancisco"  export KEY_ORG="Fort-Funston"  export KEY_EMAIL="me@myhost.mydomain"  export KEY_OU="MyOrganizationalUnit"    # X509 Subject Field  export KEY_NAME="EasyRSA"    # PKCS11 Smart Card  # export PKCS11_MODULE_PATH="/usr/lib/changeme.so"  # export PKCS11_PIN=1234    # If you'd like to sign all keys with the same Common Name, uncomment the   KEY_C$  # You will also need to make sure your OpenVPN server config has the   duplicate-$  # export KEY_CN="CommonName"  

Line 14 is the only one I've modified.

Update #2

Thanks to sim, I was able to move past this initial problem, but now when I try to issue the ./clean-all command, I'm told to source the vars file even though I've already done that.

pi@cympi:/etc/openvpn/easy-rsa $ source ./vars  NOTE: If you run ./clean-all, I will be doing a rm -rf on /etc/openvpn/easy-   rsa/keys  pi@cympi:/etc/openvpn/easy-rsa $ sudo ./clean-all  Please source the vars script first (i.e. "source ./vars")  Make sure you have edited it to reflect your configuration.  

I've gone 'round and 'round a couple times but I can't seem to get past this point.

How do I start KDE Desktop via X11? CentOS 7

Posted: 20 Jun 2021 09:06 AM PDT

I wonder how to start the KDE Desktop via X11 on my CentOS 7.

So I installed:

    yum groupinstall "KDE Plasma Workspaces" -y  

and set:

    systemctl set-default graphical.target  

I am using putty from a Windows 10 client with working ssh login and I set the "Enable X11 forwarding". I also installed Xming and tried xclock& and xeyes& in my terminal.

Both are working like a charm.

Sum multiple columns

Posted: 20 Jun 2021 08:05 AM PDT

I need to do multiple sums; my input file is:

DATE|NATION|CITY|FILES|REVENUE|FREQUENCY|INVESTMENT  20170807|USA|VIRGINIA|TIMES|1919150|1779|282075  20170807|USA|NYC|ROADS|92877|41|1599  20170808|USA|PENS|ROADS|133001|7|1  20170808|USA|NYC|TIMES|361625|1592|0  
  1. Sum $5 in every uniq of $1 (date)
  2. sum $5 in every uniq where $4=="TIMES"
  3. sum $5 in every uniq where $4=="ROADS"
  4. sum $5 in every uniq where $4=="ROADS" and $3=="NYC"
  5. arrange based on column $1

my expected output

DATE|REV|TIMES|ROADS|ROADS&NYC  20170807|2012027|1919150|92877|92877  20170808|494626|361625|133001|0  

I only know how to sum based on 1 column

awk -F"|" '{FS=OFS="|"}{col[$1]+=$5} END {for (i in col) print i, col[i]}'  

Ubuntu 16.04 minimal - extremely slow internet connection

Posted: 20 Jun 2021 08:37 AM PDT

I have a server on Hetzner that running Ubuntu 16.04 minimal.

The issue is a slow connection to external sources. When I'm trying to ping everything looks fine. But when I'm trying to retrieve files from git server (Bitbucket) it takes ages.

The situation gets worse when I'm trying to request using Python Interpreter. Here are the results: command results

When I wrote to support about this issue, they requested mtr results so I'm adding those too:mtr

List of current rules:

qdisc mq 0: root    Sent 188170970 bytes 419951 pkt (dropped 0, overlimits 0 requeues 44)    backlog 0b 0p requeues 44   qdisc pfifo_fast 0: parent :1 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1   Sent 50287079 bytes 107135 pkt (dropped 0, overlimits 0 requeues 8)    backlog 0b 0p requeues 8   qdisc pfifo_fast 0: parent :2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1   Sent 44682112 bytes 105143 pkt (dropped 0, overlimits 0 requeues 13)    backlog 0b 0p requeues 13   qdisc pfifo_fast 0: parent :3 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1   Sent 47973033 bytes 104060 pkt (dropped 0, overlimits 0 requeues 6)    backlog 0b 0p requeues 6   qdisc pfifo_fast 0: parent :4 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1   Sent 45228746 bytes 103613 pkt (dropped 0, overlimits 0 requeues 17)    backlog 0b 0p requeues 17  

Can anybody please help me to resolve the issue?

Kill a process cleanly

Posted: 20 Jun 2021 10:04 AM PDT

I need to make Linux Ubuntu platform automatically start and kill one process, for example, if time is 8am process starts, if time is 7pm process is killed, and that have to be every day, and should be quite okay, if time interval will be easy to change.

I'm trying to use simple codes in crontab:

28 12 * * * /home/pi/Desktop/start.sh  50 11 * * * pkill led.py  

Don't look at times, I've tried to change them, start.sh starts led.py script, but I cant stop it if I'm using pkill -9 -f led.py. The process gets killed, but LEDs won't turn off. If I manually start the program and then kill it with Ctrl+c, the LEDs turn off. Where is the problem? Why I can't kill the process and at the same time turn off the LEDs?

Why do I get the message set no match when I run this script?

Posted: 20 Jun 2021 06:24 AM PDT

#! /usr/bin/tcsh -f    set ps_output = "`ps -u $user`"  @ i = 2    echo "$ps_output"    set ps_test    while ( $i <= $#ps_output )      set line = ( $ps_output[$i] )      if ( $line[4] != "ps" && $line[4] != "tcsh" && $line[4] != "zap" ) then          set ps_test = ( $ps_test $i )      endif      @ i ++  end        foreach i ( $ps_test )      set line = ( $ps_output[$i] )      set process_no = $line[1]      if ( $line[4] == "HAL9000" || $line[4] == "HALos" || $line[4] == "HALshell" || $line[4] == "HALkeyboardDriv" || $line[4] == "HALdisplayDrive" || $line[4] == "HALdiskDriver" ) then          kill -9 $process_no      endif  end      exit 0  

So I keep getting the set no match error in my script, but i couldn't find which set is responsible for that , I mean even when I commented out set ps_test , I still get a no set match, is there a way to fix this

Java SDK on NixOS for IntelliJ

Posted: 20 Jun 2021 07:03 AM PDT

I have recently installed NixOS on my machine, for Java development I have added IntelliJ CE 14.1.5 and the Oracle JDK 8.

However IntelliJ does not automatically recognize the path to the Java SDK

readlink -f $(which java)  /nix/store/...-oraclejdk-8u60/bin/java  

when selecting /bin/ in the "Select Home Directory for JDK" it does not accept it.

I have been searching around for some time now but I can't really find the right stuff to get it working.

Any help is appreciated.

No comments:

Post a Comment