Tuesday, April 20, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


compare two same-size files, character by character, to generate a third of equivalent size

Posted: 20 Apr 2021 10:11 AM PDT

I have two lists of strings, all of equal length.

Example:

String A1: ATTCAGAATG  String A2: TGCCAGATAC    String B1: 0010011010  String B2: 0111010100  

I want to compare A1 to B1, A2 to B2, etc. character by character and modify the character in the A strings if there's a 1 in the same location in the B string. I want to leave it alone if the character in the B string is a 0.

The result of comparing A1 to B1 should be ATxCAxxAxG and I want to store that in a third file.

There are two text files of equal size and length, each containing a sequence on a single line. When the process is complete, there should be a third file of equivalent size and length, which is sort of a merger of the two.

This is a one time job, so I'm willing to do something hacky using only bash or something, although if some other script or simple c program is a more sensible way of handling the situation, I'm open to that too.

What are your suggestions for the simplest way to handle this?

How to create font alias that appears in font pickers?

Posted: 20 Apr 2021 10:06 AM PDT

I'm packaging a Java/AWT application that's hardcoded to use Microsoft fonts, which are missing on Linux.

I could just install them as a dependency, but there's a side effect: some websites now render Arial instead of my preferred sans, which is noticeable, since, for example, ttf-ms-fonts on Arch Linux are fonts from XP days.

The application is built on JasperReports, and as you can see here, it checks whether a font is available or not by first listing all installed fonts, so the standard metric-compatible aliases don't do anything here.

Is there a way to trick this application into picking up another font, e.g. Arimo, and using it as if it were Arial? Preferably something Fontconfig-based, but I'm open for any ideas, e.g. symlinking TTF files, etc.

update-grub caused non-booting configuration

Posted: 20 Apr 2021 10:04 AM PDT

I ran update-grub and after this, the system will not boot. It gets stuck in a blank screen.

If I boot on USB I can mount the /boot partition, and the grub/grub.cfg looks perfect.

So it is probably only the very first access that causes this problem.

How can I rescue this?

I have the feeling I can just boot on a USB-disk with GRUB and then edit the GRUB config to choose another harddisk to "exec" the GRUB installed on that drive.

Maybe there is even a specialized boot-rescue disk, that will simply give me a list of devices to "exec" to. boot-repair cannot repair the disk, because / is zfs on lvm on an encrypted block device.

The system uses legacy (not UEFI).

How to upgrade to newer OpenSSH version on OpenBSD

Posted: 20 Apr 2021 10:01 AM PDT

I'm on OpenBSD 6.8 and am running OpenSSH 8.4. How do I upgrade to OpenSSH 8.6, the newest version? Based off of this page https://www.openssh.com/openbsd.html , I know where to download it from, just not how. Where do I extract the .tar.gz to? Are there other steps besides just restarting sshd?

Remove paths from list if parent directory is also in the list

Posted: 20 Apr 2021 09:40 AM PDT

My title may be a bit oddly worded, so here's my situation: I have a bunch of directory paths, e.g.

/a/b  /a/b/c  /a/b/c/d  /a/e/f/g/h  /a/e/f/g/h/i/j/k/l  /a/e/f/g/m/n/o  /a/e/f/g/m/n/p  

and I want to filter out all lines that are child paths of an entry that already exists in the list, e.g.

/a/b  /a/e/f/g/h  /a/e/f/g/m/n/o  /a/e/f/g/m/n/p  

The directory paths are obtained from find, so they should reliably be in top-down order. Solutions for parsing as an array or multi-line string are both welcome.

How I can copy files to to mounted (nfs) directory?

Posted: 20 Apr 2021 08:02 AM PDT

I mount a remote folder via:

sudo mount --bind ip:/from_folder ~/to_folder

When I try to copy a folder mounted folder (remote server) via:

cp -r ~/some_folder ip:/from_folder

I've got the error:

cp: cannot create directory '~/to_folder/some_folder': Permission denied

What can be done in order to copy files to remote server ?

installation of wifi in debian

Posted: 20 Apr 2021 09:19 AM PDT

~$ lspci -nn  00:00.0 Host bridge [0600]: Intel Corporation 2nd Generation Core Processor Family DRAM Controller [8086:0104] (rev 09)  00:02.0 VGA compatible controller [0300]: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0126] (rev 09)  00:16.0 Communication controller [0780]: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 [8086:1c3a] (rev 04)  00:16.3 Serial controller [0700]: Intel Corporation 6 Series/C200 Series Chipset Family KT Controller [8086:1c3d] (rev 04)  00:19.0 Ethernet controller [0200]: Intel Corporation 82579LM Gigabit Network Connection [8086:1502] (rev 04)  00:1a.0 USB controller [0c03]: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 [8086:1c2d] (rev 04)  00:1b.0 Audio device [0403]: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller [8086:1c20] (rev 04)  00:1c.0 PCI bridge [0604]: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 [8086:1c10] (rev b4)  00:1c.1 PCI bridge [0604]: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 [8086:1c12] (rev b4)  00:1c.3 PCI bridge [0604]: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 [8086:1c16] (rev b4)  00:1c.4 PCI bridge [0604]: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 [8086:1c18] (rev b4)  00:1d.0 USB controller [0c03]: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 [8086:1c26] (rev 04)  00:1f.0 ISA bridge [0601]: Intel Corporation QM67 Express Chipset Family LPC Controller [8086:1c4f] (rev 04)  00:1f.2 SATA controller [0106]: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller [8086:1c03] (rev 04)  00:1f.3 SMBus [0c05]: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller [8086:1c22] (rev 04)  03:00.0 Network controller [0280]: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] [8086:0085] (rev 34)  0d:00.0 System peripheral [0880]: Ricoh Co Ltd PCIe SDXC/MMC Host Controller [1180:e823] (rev 07)  

As he was saying. I was following the Wiki.

root@debian:/home/istiak# apt update && apt install firmware-iwlwifi  Hit:1 http://security.debian.org/debian-security buster/updates InRelease  Hit:2 http://deb.debian.org/debian buster InRelease  Hit:3 http://deb.debian.org/debian buster-updates InRelease  Reading package lists... Done  Building dependency tree         Reading state information... Done  All packages are up to date.  Reading package lists... Done  Building dependency tree         Reading state information... Done  E: Unable to locate package firmware-iwlwifi  root@debian:/home/istiak# modprobe -r iwlwifi ; modprobe iwlwifi  bash: modprobe: command not found  bash: modprobe: command not found  

When I try to run iwconfig or ifconfig I get that command not found. How can I install wifi driver?

I have installed(iwlwifi-6000g2a-ucode-18.168.6.1.tgz) from here. When I extracted I got it(iwlwifi-6000g2a-6.ucode). What I have to do with it?

Output of /usr/sbin/modprobe --version :

kmod version 26  +XZ -ZLIB +OPENSSL -EXPERIMENTAL  

iwconfig :

root@debian:~# /sbin/iwconfig  enp0s25   no wireless extensions.    wwp0s29u1u4  no wireless extensions.    wlp3s0    IEEE 802.11  ESSID:off/any              Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm               Retry short limit:7   RTS thr:off   Fragment thr:off            Encryption key:off            Power Management:off              lo        no wireless extensions.  

How do I determine a device mentioned in "ld: final link failed: No space left on device" message during 'make'

Posted: 20 Apr 2021 07:49 AM PDT

I am trying to comlete make command when installing kernel 4.19.188-amd64. But I get No space left on device after 2 hours after make command. I increased /tmp folder, set TMPDIR to a folder in home directory but nothing helped.

Then I did watch command to monitor a space of /tmp, $TMPDIR, $TMPDIR in root environment and havn't notice any size increase at any of them.

Error:

  LD [M]  drivers/gpu/drm/mgag200/mgag200.ko    LD [M]  drivers/gpu/drm/nouveau/nouveau.ko    LD [M]  drivers/gpu/drm/qxl/qxl.ko    LD [M]  drivers/gpu/drm/r128/r128.ko    LD [M]  drivers/gpu/drm/radeon/radeon.ko  ld: final link failed: No space left on device  make[1]: *** [scripts/Makefile.modpost:129: drivers/gpu/drm/i915/i915.ko] Error 1  make[1]: *** Waiting for unfinished jobs....  ld: final link failed: No space left on device  make[1]: *** [scripts/Makefile.modpost:129: drivers/gpu/drm/radeon/radeon.ko] Error 1  ld: final link failed: No space left on device  make[1]: *** [scripts/Makefile.modpost:129: drivers/gpu/drm/amd/amdgpu/amdgpu.ko] Error 1  ld: final link failed: No space left on device  make[1]: *** [scripts/Makefile.modpost:129: drivers/gpu/drm/nouveau/nouveau.ko] Error 1  make: *** [Makefile:1262: modules] Error 2  u@ngff /media/u/fb07f3d2-e36b-4cfc-b671-cc9d7393f1d5/home/u/Downloads/linux-4.19.188  $ echo $TMPDIR  /home/u/temp  u@ngff /media/u/fb07f3d2-e36b-4cfc-b671-cc9d7393f1d5/home/u/Downloads/linux-4.19.188  $ du -sh $TMPDIR  4.0K    /home/u/temp  u@ngff /media/u/fb07f3d2-e36b-4cfc-b671-cc9d7393f1d5/home/u/Downloads/linux-4.19.188  

Well I know that there are threads about 'No space left on device' but I did what they told and now want to know how to determine which device is used actually, just to watch it more. These are commands before the error:

(as a user)

rm -rf linux-4.19.188 &&  tar xf linux-4.19.188.tar && ll &&  cd linux-4.19.188 &&  cp ../../../../boot/config-4.19.0-16-amd64 ./.config -v &&  sed -ri '/CONFIG_SYSTEM_TRUSTED_KEYS/s/=.+/=""/g' .config &&  make -j 4  

How much space would be enough? 100M, 1GB? How to determine the device?

Bash completion for nohup

Posted: 20 Apr 2021 09:28 AM PDT

I created a detach script, being a wrapper around nohup:

#!/bin/bash    /usr/bin/nohup "$@" &> /dev/null &  

and I want to get bash-completion to work for this script.

I try to use complete -c detach, but for all arguments there is an addition from the utilities from PATH.

How to properly implement bash-completion for my detach utility?

Sort directory list in reverse order

Posted: 20 Apr 2021 08:48 AM PDT

I'm trying to sort directory list in reverse alphabetical order, is there any Reason why it's random ?

ls -l /usr/bin/ | sort -r  

Edit : I'm obliged to use the command sort.

How I can return just some rows in shell script

Posted: 20 Apr 2021 08:59 AM PDT

I have this file of information:

Error code: CommonDomain.InvalidStateTransition      at com.lhs.ccb.sfw.application.ServiceObjectImpl.execute(Unknown Source)      at com.lhs.cil.core.AggregatedServiceObjectImpl.execute(Unknown Source)      at com.lhs.ccb.soi.ServiceObjectIPOA._invoke(Unknown Source)    РЯа. 19, 2021 4:14:16 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage  WARNING: no localized text available for:  ErrorCode : InvalidStateTransition  BundleName: CommonDomain_ErrorDictionary  Locale    : en_US  Reason    : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'  РЯа. 19, 2021 4:14:16 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage  WARNING: no localized text available for:  ErrorCode : InvalidStateTransition  BundleName: CommonDomain_ErrorDictionary  Locale    : en_US  Reason    : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'  РЯа. 19, 2021 4:15:42 PM com.lhs.ccb.sfw.application.ServiceObjectImpl executeLocaleI  SEVERE: ServiceObjectI.executeLocaleI CONTRACT.WRITE    Error code: CommonDomain.InvalidStateTransition      at com.lhs.ccb.sfw.application.ServiceObjectImpl.execute(Unknown Source)      at com.lhs.cil.core.AggregatedServiceObjectImpl.execute(Unknown Source)      at com.lhs.ccb.sfw.application.ServiceObjectImpl.executeLocaleI(Unknown Source)      at com.lhs.cil.core.AggregatedServiceObjectImpl.executeLocaleI(Unknown Source)      at com.lhs.ccb.soi.ServiceObjectIPOA._invoke(Unknown Source)    РЯа. 19, 2021 4:15:42 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage  WARNING: no localized text available for:  ErrorCode : InvalidStateTransition  BundleName: CommonDomain_ErrorDictionary  Locale    : en_US  Reason    : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'  РЯа. 19, 2021 4:15:42 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage  WARNING: no localized text available for:  ErrorCode : InvalidStateTransition  BundleName: CommonDomain_ErrorDictionary  Locale    : en_US  Reason    : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'  РЯа. 19, 2021 4:17:19 PM com.lhs.ccb.sfw.application.ServiceObjectImpl executeLocaleI  SEVERE: ServiceObjectI.executeLocaleI CONTRACT.WRITE  

I need to make two separate files where in one I will write only the warning information and in a separate file only the severe information. How I can do that?

for f in $sourceFolder do     echo " Warning $f" done  

When was smartctl last run?

Posted: 20 Apr 2021 09:14 AM PDT

I use smartctl -t long to execute full surface test on a drive, it automatically closes then the test is run in background.

Then I use smartctl -H to view the result. But it doesn't say how long ago the reported test was done, or if there's one running at the moment.

Is there any way to know it?

./infacondet.sh: line 40: syntax error at line 42: `pmrep' unexpected

Posted: 20 Apr 2021 08:06 AM PDT

pmrep connect -r IPC_REP_SBX -d $INFA_DEFAULT_DOMAIN -n $INFA_DEFAULT_DOMAIN_USER -X INFA_DEFAULT_DOMAIN_PASSWORD  rtnCode=$?  if [ ${rtnCode} -ne 0 ];then      echo "`date` ... [ALERT]: Exit 98 - Failed to connect to [$repName]"      exit 98  else      echo "`date` ... [INFO]: Connected to [$repName]"  fi  #  logfile=${ScriptDir}/conn_details.log  echo "Generating connection details for Salesforce connections"  echo "Generating connection details for Salesforce connections" > $logfile  for name in      pmrep listconnections -t | grep application | grep Salesforce| cut -d, -f1;do    echo "Getting details for $name"    pmrep getconnectiondetails -n $name -t relational | sed '1,8d'| sed '/successfully/,$d' >> $logfile    echo "------------------------------------------------" >> $logfile  done  

zsh arithmetic comparison giving false positive

Posted: 20 Apr 2021 07:44 AM PDT

Why is passing 0 as an argument working here?

#!/bin/zsh  k="$1"    if ((0 < k < 1))  then      echo "True"  fi  

Note this script is called stitch_applier.sh

Terminal

./stitch_applier.sh 0  True  

This was run on a Linux system.

Running a sudo command automatically on startup

Posted: 20 Apr 2021 10:05 AM PDT

In order to adjust the screenpad backlight on my ASUS Zenbook, I am using a kernel module I found here. Per his instructions, to make keybind shortcuts using a simple screenpad x command to adjust the brightness, I need to add sudo chmod a+w '/sys/class/leds/asus::screenpad/brightness' to 'rc.local', as the command is required with each reboot, and needs a password every time. By running automatically I could immediately use the custom keyboard shortcuts as they'd function normally with the drivers on Windows, without needing to run the command and enter my password each boot.

I'm a new Linux user, on Parrot OS. From what I've gathered, it's not recommend to use rc.local, and I should instead use either systemd, cronjob, or run it as process using the GUI startup applications menu.

I'm completely lost as to go about doing this with systemd or cronjob. I tried making a file called 'screenpad-perms.sh' and put it in /usr/local/bin, with just these lines in it based on what I've read:

#! /bin/bash    sudo chmod a+w '/sys/class/leds/asus::screenpad/brightness'  

I then made it executable using chmod +x screenpad-perms.sh. Finally, I opened the GUI Autostart app and added it as a Login Script.

Restarted the PC but it doesn't work, typing screenpad x gets a permissions denied error unless I manually type sudo chmod a+w '/sys/class/leds/asus::screenpad/brightness' and enter my password; so it seems to not be executing.

Again apologies as I'm very new to Linux, just really hoping to get this screen working properly. What am I missing here?

Capturing hostname & data when executing local script on remote server

Posted: 20 Apr 2021 07:25 AM PDT

While trying to execute a local script on remotely host unable to get hostname of the remoteserver to a local output file.

For example I am executing a script below.

ssh remotehost sh -s < sudo su - ; ./localscript --include Yes > output  

Above is working fine. below is an example output

script executed data from the remote machine  

But I need the hostname + data like this.

remotehost: script executed data from the remote machine  

For I tried using awk and it failed, can someone check this & help.

ssh remotehost sh -s < sudo su - ; ./localscript --include Yes | awk -vhostname=$(hostname) '{print hostname, $0}' > output  

This is giving me localhost hostname. Please correct me if I am doing this wrong.
Also sorry if I am not explaining this properly put a comment I will modify & correct it.

I tried this and its wotking, but unable to do "grep" / "awk" output

ssh remotehost sh -s < `./localscript --include Yes`     ssh remotehost sh -s < `./localscript --include Yes | awk -vhostname=$(hostname) '{print hostname, $0}' > output`  

How can I use fail2ban with ipv6?

Posted: 20 Apr 2021 08:22 AM PDT

I have used the Fail2ban for a long time ago. I think, this script is not able to manage the ipv6 or maybe it is worikng with ipv6?

How can I prevent ipv6 attacks with Fail2ban or I have to search other script?

Thx

Robert

Why does PulseAudio need system dbus?

Posted: 20 Apr 2021 10:07 AM PDT

On this single-user FreeBSD desktop, various desktop-components communicate using the user's own dbus-instance.

Yet, pulseaudio also tries to talk to the system-wide dbus (which is not enabled) and, unable to reach it, spams the log with messages:

Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory  

If I start the dbus-service manually, pulseaudio will log:

... : [(null)] oss-util.c: '/dev/dsp0' doesn't support full duplex  ... : [(null)] oss-util.c: '/dev/dsp1' doesn't support full duplex  ... : [(null)] oss-util.c: '/dev/dsp2' doesn't support full duplex  ... : [(null)] oss-util.c: '/dev/dsp3' doesn't support full duplex  

and shut up. Why does it need to talk to the system-wide dbus? What will I gain by enabling the system-wide service?

Ubuntu 20.10, DNS stops working after ip forwarding enabled

Posted: 20 Apr 2021 08:11 AM PDT

as I said my DNS stops working after I enabled ip forwarding, my machine is ubuntu server 20.10. I've tried setting manually a dns like 1.1.1.1 on resolv.conf but after a couple minits it goes back to the one that it already had attached on the localhost, thanks for the help.

virtual gateway via NAT

Posted: 20 Apr 2021 09:04 AM PDT

I have following networking setup:

Gateway:

Internet <-- eth0 : a.b.c.d (static address)  Clients <-- eth1  : DHCP at server at 172.16.0.1, leasing 172.16.0.0/24  

Client:

Gateway <-- eth0: 172.16.0.0/24  

Clients can reach internet and forwarding is working. I want to create some kind of "virtual" address, which clients can access via gateway, but that address would be in fact some machine on the Internet.

So, when they connect to 172.32.1.1 they in fact connect to google and so on. I tried it with NAT:

TARGET=$(dig -q google.com)  VIRTUAL=172.32.1.1  iptables -t nat -A PREROUTING -d "$VIRTUAL" -j DNAT --to "$TARGET"  iptables -t nat -A POSTROUTING -s "$TARGET" -j SNAT --to "$VIRTUAL"  

that somehow works, however when I ping it from gateway I get

From 20.249.x.y icmp_seq=1 Destination Net Unreachable  

(where 20.249.x.y is my Gateway's gateway), and when I traceroute to that virtual IP from the client, I get this:

traceroute to 172.32.1.1 (172.32.1.1), 30 hops max, 38 byte packets   1  172.32.1.1 (172.32.1.1)  31.886 ms  31.638 ms  34.029 ms   2  172.32.1.1 (172.32.1.1)  39.660 ms  40.489 ms  39.153 ms   3  172.32.1.1 (172.32.1.1)  41.879 ms  40.367 ms  40.436 ms   4  172.32.1.1 (172.32.1.1)  47.375 ms  48.200 ms  48.878 ms   5  172.32.1.1 (172.32.1.1)  47.801 ms  47.280 ms  47.405 ms  

That looks super weird to me. Is there a way to fix these issues? I was trying to use ip tunnel, but it looks like it needs different end setting up as well, which I obviously cannot do.

iptables config on server contains these two rules and -A FORWARD -i eth1 -j ACCEPT only.

How do I install NVIDIA drivers for very old GPU on antix 17?

Posted: 20 Apr 2021 08:47 AM PDT

I have a very very old PC that I found lying on the street. I'm actually typing this post from it, here are the specs:

  • CPU: AMD Athlon XP 2500+ (32-bit) (decent CPU, lacks SSE2 instruction set making life hell)
  • GPU: NVIDIA Riva TNT2 64
  • RAM: 1GB DDR (don't know the speed)
  • HDD: 40GB IDE Drive
  • PSU: 200w (probably off-brand)

The lack of the SSE2 instruction set limits my possibilities a lot, so I decided to go with a true lightweight distro, antix 17. The machine works at a reasonable speed, better than I'd expect from these specs, but I'm having trouble installing the NVIDIA drivers. It's currently using the noveau drivers, and we all know how crappy those are. The OS comes with an app to install the drivers, but it crashes whenever I launch it, so I need to do a manual installation. I found these drivers, but I never installed them this way. So I downloaded the file and chmodded it to try to run it, it told me I was running an x server. No big deal, I logged out and tried again from CLI, then it told me that the kernel header files didn't exist, and that was probably because I hadn't configured it. So I'm stuck here. Reading online it looks to be a compatibility problem with the kernel and the driver version, in which case I guess I'm kinda screwed. Any clues?

WSL 2 does not have /lib/modules/

Posted: 20 Apr 2021 07:38 AM PDT

I have the source code of a hello world kernel module that works in Ubuntu 20 in a laptop. Now I am trying to compile the same code in Ubuntu 20 but inside WSL2. For that I am using this:

make -C /sys/modules/$(shell uname -r)/build M=$(PWD) modules  

The problem is that /lib/modules is empty. It seems that WSL2 does not bring anything in /lib/modules/4.19.104-microsoft-standard/build

I tried getting the headers using:

sudo apt search linux-headers-`uname -r`    Sorting... Done  Full Text Search... Done  

But nothing get's populated in the modules folder

Is there anything I need to do in order that folder contains all required modules?

[EDIT]

Getting closer thanks to @HannahJ.

I am doing:

> sudo make -C /home/<user>/WSL2-Linux-Kernel M=$(pwd) modules    SL2-Linux-Kernel M=$(pwd) modules  make: Entering directory '/home/<user>/WSL2-Linux-Kernel'    CC [M]  /home/<user>/containers-assembly-permissionsdemo/demo-2/lkm_example.o    Building modules, stage 2.    MODPOST 1 modules    CC      /home/<user>/containers-assembly-permissionsdemo/demo-2/lkm_example.mod.o    LD [M]  /home/<user>/containers-assembly-permissionsdemo/demo-2/lkm_example.ko  make: Leaving directory '/home/<user>/WSL2-Linux-Kernel'  

At the end, I get the lkm_example.ko file created.

After that:

> sudo insmod lkm_example.ko  insmod: ERROR: could not insert module lkm_example.ko: Invalid module format    > dmesg  [200617.480635] lkm_example: no symbol version for module_layout  [200617.480656] lkm_example: loading out-of-tree module taints kernel.  [200617.481542] module: x86/modules: Skipping invalid relocation target, existing value is nonzero for type 1, loc 0000000074f1d70f, val ffffffffc0000158      > sudo modinfo lkm_example.ko  filename:       /home/<user>/containers-assembly-permissionsdemo/demo-2/lkm_example.ko  version:        0.01  description:    A simple example Linux module.  author:         Carlos Garcia  license:        GPL  srcversion:     F8B272146BAA2381B6332DE  depends:  retpoline:      Y  name:           lkm_example  vermagic:       4.19.84-microsoft-standard+ SMP mod_unload modversions  

This is my Makefile

obj-m += lkm_example.o  all:      make -C /home/<usr>/WSL2-Linux-Kernel M=$(PWD) modules  clean:      make -C /home/<usr>/WSL2-Linux-Kernel M=$(PWD) clean  test:      # We put a — in front of the rmmod command to tell make to ignore      # an error in case the module isn't loaded.      -sudo rmmod lkm_example      # Clear the kernel log without echo      sudo dmesg -C      # Insert the module      sudo insmod lkm_example.ko      # Display the kernel log      dmesg  unload:      sudo rm /dev/lkm_example      sudo rmmod lkm_example  

Zoom scheduling support in Evolution

Posted: 20 Apr 2021 07:25 AM PDT

I have recently started using Zoom, and would love if there is anyway of scheduling meetings in zoom through the calendar in Evolution. Evolution is already linked to an Exchange server for the calendar etc. Has anyone been able to do this?

lmgrd: No such file or directory

Posted: 20 Apr 2021 07:41 AM PDT

While there are comparable questions out there, I have not found a solution for this specific circumstance. And I admit that this particular question may be appropriate to only me; however, the question still stands in the general sense. Given a binary only, how do you determine which libraries it needs to run? The commands below are executing on:

chrisheady@linux:~/Dropbox$ uname -a  Linux linux 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux  

The file in question is "lmgrd." When I try to run the executable this is what I get:

chrisheady@linux:~/Dropbox$ ./lmgrd   bash: ./lmgrd: No such file or directory  

I have tried to debug using a few easy Linux commands, such as:

chrisheady@linux:~/Dropbox$ ls -la lmgrd  -rwxrwxrwx 1 chrisheady chrisheady 1562496 Mar 1 2018 lmgrd    chrisheady@linux:~/Dropbox$ file lmgrd  lmgrd: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-lsb-x86-64.so.3, for GNU/Linux 2.6.18, stripped    chrisheady@linux:~/Dropbox$ ldd -v lmgrd  linux-vdso.so.1 (0x00007ffc5b779000)  libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6f03ced000)  libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6f0394f000)  libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6f03737000)  libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6f03346000)  libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6f03142000)  /lib64/ld-lsb-x86-64.so.3 => /lib64/ld-linux-x86-64.so.2 (0x00007f6f03f0c000)    Version information:  ./lmgrd:      libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2      libpthread.so.0 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libpthread.so.0      libpthread.so.0 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libpthread.so.0      libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6      libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6      libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6  /lib/x86_64-linux-gnu/libpthread.so.0:      ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2      ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2      libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6      libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6      libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6      libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6      libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6  /lib/x86_64-linux-gnu/libm.so.6:      ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2      libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6      libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6      libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6  /lib/x86_64-linux-gnu/libgcc_s.so.1:      libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6      libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6  /lib/x86_64-linux-gnu/libc.so.6:      ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2      ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2  /lib/x86_64-linux-gnu/libdl.so.2:      ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2      libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6      libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6      libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6    chrisheady@linux:~/Dropbox$ objdump -p lmgrd        lmgrd:     file format elf64-x86-64        Program Header:          PHDR off    0x0000000000000040 vaddr 0x0000000000400040 paddr 0x0000000000400040 align 2**3               filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags r-x        INTERP off    0x0000000000000200 vaddr 0x0000000000400200 paddr 0x0000000000400200 align 2**0               filesz 0x000000000000001a memsz 0x000000000000001a flags r--          LOAD off    0x0000000000000000 vaddr 0x0000000000400000 paddr 0x0000000000400000 align 2**21               filesz 0x000000000016fc04 memsz 0x000000000016fc04 flags r-x          LOAD off    0x0000000000170000 vaddr 0x0000000000770000 paddr 0x0000000000770000 align 2**21               filesz 0x000000000000c4e9 memsz 0x0000000000019448 flags rw-       DYNAMIC off    0x00000000001707a8 vaddr 0x00000000007707a8 paddr 0x00000000007707a8 align 2**3               filesz 0x00000000000001d0 memsz 0x00000000000001d0 flags rw-          NOTE off    0x000000000000021c vaddr 0x000000000040021c paddr 0x000000000040021c align 2**2               filesz 0x0000000000000020 memsz 0x0000000000000020 flags r--      EH_FRAME off    0x00000000001542c0 vaddr 0x00000000005542c0 paddr 0x00000000005542c0 align 2**2               filesz 0x0000000000005104 memsz 0x0000000000005104 flags r--         STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3               filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-        Dynamic Section:        NEEDED               libpthread.so.0        NEEDED               libm.so.6        NEEDED               libgcc_s.so.1        NEEDED               libc.so.6        NEEDED               libdl.so.2        INIT                 0x0000000000404470        FINI                 0x00000000004d5ea4        HASH                 0x0000000000400240        STRTAB               0x00000000004020f0        SYMTAB               0x0000000000400950        STRSZ                0x0000000000000988        SYMENT               0x0000000000000018        DEBUG                0x0000000000000000        PLTGOT               0x0000000000770b58        PLTRELSZ             0x0000000000001188        PLTREL               0x0000000000000007        JMPREL               0x00000000004032e8        RELA                 0x0000000000402d00        RELASZ               0x00000000000005e8        RELAENT              0x0000000000000018        VERNEED              0x0000000000402c70        VERNEEDNUM           0x0000000000000003        VERSYM               0x0000000000402a78        Version References:        required from libdl.so.2:          0x09691a75 0x00 07 GLIBC_2.2.5        required from libpthread.so.0:          0x09691972 0x00 04 GLIBC_2.3.2          0x09691a75 0x00 03 GLIBC_2.2.5        required from libc.so.6:          0x0d696913 0x00 06 GLIBC_2.3          0x09691974 0x00 05 GLIBC_2.3.4          0x09691a75 0x00 02 GLIBC_2.2.5  

I attempted ln -s /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3 followed by ldconfig -n /lib64 but when I execute lmgrd, I still get the same error.

CMake returns linux/videodev.h not exist while build opencv

Posted: 20 Apr 2021 08:59 AM PDT

Got problem while building opencv accoding to link:

Determining if the include file linux/videodev.h exists failed with the following output:  Change Dir: /home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp    Run Build Command:"/usr/bin/make" "cmTC_affcb/fast"  /usr/bin/make -f CMakeFiles/cmTC_affcb.dir/build.make CMakeFiles/cmTC_affcb.dir/build  make[1]: Entering directory '/home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp'  Building C object CMakeFiles/cmTC_affcb.dir/CheckIncludeFile.c.o  /usr/bin/cc    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden  -O3 -DNDEBUG   -o CMakeFiles/cmTC_affcb.dir/CheckIncludeFile.c.o   -c /home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c  /home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:28: fatal error: linux/videodev.h: No such file or directory   #include <linux/videodev.h>                              ^  compilation terminated.  

..... .....

I just did cd linux in order to look file videodev.h is there, but system can't find such directory. File /usr/include/linux/videodev.h exist on my system. I suppose compiler is not able to find it. How to solve such problem?

Grub stuck loading kernel

Posted: 20 Apr 2021 08:18 AM PDT

I recently installed an SSD and have been trying to install Debian on it. For a few reasons it has been difficult on this machine; at the moment I've installed everything but it is failing to boot. Whenever I try to manually boot my install grub freezes after: linux /boot/vmlinuz... root=/dev/sda1 This is the second install where this issue has occurred.

In case it's relevant, in the past when I'd install debian I would always have to chroot from a live-cd or old install and install my video card driver. If not grub would freeze like it is doing now, although I never tried manually booting so I'm not sure it was failing at this step. Of course before trying to boot this time I followed all of the steps that have worked before.

I'm not getting any debug information. Is there perhaps a verbose mode for grub or does anyone have something I can try?

Edit: as an experiment I copied the kernel and initramfs to my other drive and tried booting from those. It brought me to the initramfs prompt where when I try to manually mount sda1 it tells me no such file or directory.

Clarification: Above when I saw manually boot, I mean that I'm in grub console trying to type something like

grub> set root=(hd0,1)  grub> linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1  grub> initrd /boot/initrd.img-3.13.0-29-generic  grub> boot  

But grub stops responding after I load either the kernel or the initrd from the ssd.

UPDATE

I retried what I did in the edit above and it is successfully booting now without going to the initramfs prompt. (perhaps I had a typo somewhere before) I'm not making this a solution because GRUB is only able to load the kernel and initrd from my second drive and not my ssd.

eth0: supported ports

Posted: 20 Apr 2021 07:47 AM PDT

I am having a board with RTL8111/8168B PCI Express Gigabit Ethernet controller, which requires r8169 kernel module to work. After inserting this module, network get started by eth0.

Now, due to old customer requirement, I have to run SLES10-sp4 on this board. But this OS is not allowing me use the network. Though, it have r8169 kernel module. ifconfig also list out eth0. When I run ethtool eth0, output came as Link Detection: NO

I noted one parameter in the output of ethtool eth0, which are different when run from new and old OS on the same board:

New kernel says (3.13.11):

Supported Ports: [TP MII]  .  .  Ports: MII  

while old kernel says(2.6.16):

Supported Ports: [FIBRE ]  .  .  Ports: FIBRE  

What is this Supported Ports ? and what does it mean "TP, MII and FIBRE" ?

Compare two files and print unmatched lines [duplicate]

Posted: 20 Apr 2021 10:02 AM PDT

I have two files with the below data; I need the difference between two files.

I tried with diff but it also shows line which are common in the two files: (22372 Dec 4 15:36 /opt/apache-tomcat-6.0.36/webapps/new/new.txt).

First file: (multiple data exists in the same way in file 1)

22677 Dec 4 15:36 /opt/apache-tomcat-6.0.36/webapps/new/abc.txt    22372 Dec 4 15:36 /opt/apache-tomcat-6.0.36/webapps/new/new.txt

Second file: (multiple data exists in the same way in file 2).

22372 Dec 4 15:36 /opt/apache-tomcat-6.0.36/webapps/new/new.txt    22677 Dec 3 15:36 /opt/apache-tomcat-6.0.36/webapps/new/abc.txt    12344 Dec 10 15:36 /opt/apache-tomcat-6.0.36/webapps/abc/.../test.txt

I need the below output:

22677 Dec 3 15:36 /opt/apache-tomcat-6.0.36/webapps/new/abc.txt    12344 Dec 10 15:36 /opt/apache-tomcat-6.0.36/webapps/abc/.../test.txt

How can I create a message box from the command line?

Posted: 20 Apr 2021 08:03 AM PDT

How can I create a message box from the command line, either GUI message boxes or message boxes shown inside the terminal?

It would also be interesting to be able to get a simple input back from the user, for example, an input given with radio buttons (yes/no, OK, etc).

No comments:

Post a Comment