Thursday, September 2, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How to list DHCP options sent to a client from a DHCP server in Linux?

Posted: 02 Sep 2021 10:37 AM PDT

How does one list the options that are sent to a client from a DHCP server? Using a utility run from bash?

Slackware 14.2 huge kernel cannot load 9pnet_virtio module

Posted: 02 Sep 2021 09:53 AM PDT

I am running Slackware 14.2 virtual machine running a huge kernel 4.4.14 on UEFI mode and I have a problem with loading the 9pnet_virtio module. This module is needed for my init script.

root@slackware64-14-2-vm:~# modprobe 9pnet_virtio  modprobe: ERROR: could not insert '9pnet_virtio': Exec format error  root@slackware64-14-2-vm:~# lsmod        Module                  Size  Used by  ipv6                  334729  12  cfg80211              524168  0  rfkill                 18649  1 cfg80211  fuse                   83890  1  i2c_dev                 6188  0  kvm_intel             160123  0  kvm                   501407  1 kvm_intel  fb_sys_fops             1730  0  syscopyarea             3458  0  efi_pstore              4965  0  sysfillrect             3950  0  irqbypass               3519  1 kvm  crct10dif_pclmul        5461  0  crc32_pclmul            3238  0  crc32c_intel           13564  0  sysimgblt               2608  0  evdev                  13220  2  psmouse               110844  0  serio_raw               5146  0  efivars                 8413  1 efi_pstore  i2c_i801               16204  0  lpc_ich                14738  0  intel_agp              11809  0  xhci_pci                4873  0  i2c_core               47925  2 i2c_i801,i2c_dev  xhci_hcd              116670  1 xhci_pci  acpi_cpufreq            8189  0  shpchp                 26296  0  intel_gtt              13810  1 intel_agp  tpm_tis                11588  0  agpgart                31796  2 intel_agp,intel_gtt  tpm                    35481  1 tpm_tis  8250_fintek             3214  0  processor              26834  1 acpi_cpufreq  button                  5722  0  loop                   21270  0  

What should I do? I want to have modules 9p, 9pnet, and 9pnet_virtio available.

Does UNOS still exist?

Posted: 02 Sep 2021 09:52 AM PDT

UNOS is a derivative of UNIX by Charles River Information Systems.

Google and Wikipedia doesn't have much information on it.

Is there any version of it still in use?

/dev/sde install disk is seen as /dev/sda at boot time

Posted: 02 Sep 2021 09:47 AM PDT

I'm SystemImager image deployment software developper. I'm trying to support external disk drivers, but I'm stuck with a silly problem.

When I run preinstall scripts (udev has already settled) I fetch via network the driver (example, a specific megaraid_sas.ko that support old hardware on RHEL 8)

When the driver loads, it recognize the disk as /dev/sde Install works fine (EFI System), initramfs are rebuilt to include the driver. grub2-mkconfig generates a config file with root=(hd4,gpt2) efibootmgr creates the correct entry (it uses UUID)

Unfortunately, when rebooting grub fails to find the kernel (hd4 while BIOS sees hd0) => 1st problem. When I fix that, => 2nd problem: kernel loads the megaraid_sas.ko (as it is in intrants file) and this megaraid disk is seen as /dev/sda ! If I try to continue from emergency mode, mounting by hand /sysroot, lvm fails trying to find /dev/sde....

Is there a way to: -> At install time tell UDEV to not use /dev/sda until I say it's ok? (best solution as it would also solve the grub and lvm issues) or at boot time, is there a way to tell kernel that megaraid_sas should use /dev/sde?

I tried to look at the anaconda dracut module, but was unable to understand how the OEMDRV is handled after reboot. (they download the driver from network far after disk devices have been detected by dev).

Any idea?

Kernel error when external display connected. Needs to be reconnected several times

Posted: 02 Sep 2021 09:28 AM PDT

About 50% of the time when I connect my LG external monitor to my x1c7 laptop, the displays are both on and working, but I can only see my mouse and nothing else.

It flashes every few seconds like it's adjusting the resolution and occasionally a window will appear briefly on one of the displays (in the wrong resolution) and then it will flash black and keep trying. It can get stuck in a loop like this for at least 10 minutes (the longest I've had patience for) and sometimes takes disconnecting and reconnecting the display (sometimes even after multiple tries that doesn't work either and I have to restart).

Also, the display manager in Linux Mint takes suspiciously long to open, and sometimes when I open it, I get the same issue described above (without touching the HDMI cable).

Linux x1c7 5.11.0-27-generic #29~20.04.1-Ubuntu SMP Wed Aug 11 15:58:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux  
No LSB modules are available.  Distributor ID: Linuxmint  Description:    Linux Mint 20.2  Release:    20.2  Codename:   uma  

/var/log/kern.log

Sep  2 11:10:56 x1c7 kernel: [20024.427975] [drm:drm_dp_dual_mode_detect [drm_kms_helper]] *ERROR* Unexpected DP dual mode adaptor ID 50  Sep  2 11:11:29 x1c7 kernel: [20057.799471] [drm:drm_dp_dual_mode_detect [drm_kms_helper]] *ERROR* Unexpected DP dual mode adaptor ID 54  Sep  2 11:11:33 x1c7 kernel: [20062.152448] [drm:drm_dp_dual_mode_detect [drm_kms_helper]] *ERROR* Unexpected DP dual mode adaptor ID 54  Sep  2 11:11:35 x1c7 kernel: [20063.602035] [drm:drm_dp_dual_mode_detect [drm_kms_helper]] *ERROR* Unexpected DP dual mode adaptor ID 50  Sep  2 11:11:42 x1c7 kernel: [20070.809420] [drm:drm_dp_dual_mode_detect [drm_kms_helper]] *ERROR* Unexpected DP dual mode adaptor ID 54  Sep  2 11:11:48 x1c7 kernel: [20076.536745] [drm:drm_dp_dual_mode_detect [drm_kms_helper]] *ERROR* Unexpected DP dual mode adaptor ID 54  Sep  2 11:11:49 x1c7 kernel: [20078.042194] [drm:drm_dp_dual_mode_detect [drm_kms_helper]] *ERROR* Unexpected DP dual mode adaptor ID 50  Sep  2 11:11:51 x1c7 kernel: [20079.487640] [drm:drm_dp_dual_mode_detect [drm_kms_helper]] *ERROR* Unexpected DP dual mode adaptor ID 54  

Overwritten software raid 1 (mdadm) by Truenas raid 1

Posted: 02 Sep 2021 09:22 AM PDT

I made a stupid mistake. After I created a backup to a separate USB disk and checked for a successful backup (or so I thought) I made a new raid 1 pool with Truenas which overwrote old raid 1 made with mdadm on Linux with ext4 file system. To make things worse, I then copied backup to the new dataset on Truenas. It turned out, one folder wasn't backed up and I lost approximately 20% of data.

Is there any way to try to recover some data?

Brgrds, Mathew

How to change dwm taskbar size

Posted: 02 Sep 2021 09:20 AM PDT

I am running DWM on Artix and I can not seem to change the bar at the top height. it is too small and I want it larger but do not know how. I have looked in config.h for dwmblocks and dwm but can not find it. I will accept anything thank you in advance. (I have tried the dwm-height-bar patch but it never works. It says successful but doesn't change anything.)

How to use grep with matching stdout to list values in a file?

Posted: 02 Sep 2021 10:19 AM PDT

I have a file that contains a list of items.

* API,  * API,  * API  

I am using a gcloud command to list services gcloud services list --available to my terminal and the output is similar to

*.googleapis.com * API

I am looking to run the gcloud command then grep for each item in the list above and output the associated *.googleapis.com into a new file but I'm having some trouble with getting a grep command to work.

I've tried something such as gcloud services list --available | grep -F -f list.txt associatedfile.txt but no output is seen in associatedfile.txt.

How can I get xeyes to work? - XQuartz Display Error on Local System

Posted: 02 Sep 2021 08:50 AM PDT

I installed XQuartz on my Mac (Big Sur, v. 11.5.2), but I have been unable to use it. I've been failing to fix this issue for the past couple of weeks, and I'm really hoping someone can help point me in the right direction.

I've been using xeyes to test the installation and get the following response:

(base) magnoliafork ~ % xeyes                              Error: Can't open display: :0.0  (base) magnoliafork ~ % echo "$DISPLAY"  :0.0  

One of the ways in which I have tried fixing it is to set my DISPLAY inside my .zshrc file to ":0", "localhost=0", and just the number 0. I also tried putting my IP address in front of the :0.0 at one point. None of those solutions worked.

##### DISPLAY, for plotting  PATH="/opt/:$PATH"  export DISPLAY  DISPLAY=":0.0"  

Someone in another thread recommended changing the default options in the sshd_config file, so I updated the X11 options as shown below:

#AllowAgentForwarding yes  #AllowTcpForwarding yes  #GatewayPorts no  X11Forwarding yes  X11UseForwarding yes  X11DisplayOffset 10  X11UseLocalhost yes  #PermitTTY yes  #PrintMotd yes  #PrintLastLog yes  #TCPKeepAlive yes  #PermitUserEnvironment no  #Compression delayed  #ClientAliveInterval 0  #ClientAliveCountMax 3  #UseDNS no  #PidFile /var/run/sshd.pid  #MaxStartups 10:30:100  #PermitTunnel no  #ChrootDirectory none  #VersionAddendum none  

It's still not working, and I suspect the previous solution was to fix the case where you can get XQuartz to work locally but not through ssh. I can't even get it to work locally, and at this point, I have no idea what to try next. Any ideas would be really helpful!

Don't know if this is helpful, but I copied this from my console:

X11.app: do_start_x11_server(): argc=7       argv[0] = /opt/X11/bin/Xquartz       argv[1] = :0       argv[2] = -nolisten       argv[3] = tcp       argv[4] = -iglx       argv[5] = -auth       argv[6] = /Users/magnoliafork/.serverauth.2211  

Setting IP address in Centos 7

Posted: 02 Sep 2021 08:42 AM PDT

I recently received a 64 core server for work. It has centos, SLURM and several things already installed. I can log into the server fine if I connect a keyboard. However, I need to rackmount it, and access it from a laptop.

I have been unable to ssh into it. When I try, it says password denied. When I check var/log/secure/ it shows no record of attempted ssh logins, failed or successful.

When I try to check the IP address using ip a I get the following

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     inet 127.0.0.1/8 scope host lo          valid_lft forever preferred_lft forever  2: enp2s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default glen 1000      link/ether d4:5d:64:be:32:c2 brd ff:ff:ff:ff:ff:ff  3: stuff  4: stuff  

I expected to see the IP address in item 2, but it says DOWN. I am not sure how to change this or even, what I am missing?

Once the IP address is fixed, I would expect to be able to SSH in fine?

Arch linux, set up user to use pacman without full root privileges

Posted: 02 Sep 2021 08:07 AM PDT

I am trying to set up multiple levels of users on my arch linux system. I want to lock the root user, and then have 3 levels of user. On top is essentially is a full wheel root user, then under that I want a less privileged user that do some high level functions like using pacman. So I have not added the submasteruser to the wheel group I have used visudo and added the following lines

User_Alias    SUBMASTER = submasteruser  Cmnd_Alias    SUBMASTER = /usr/bin/pacman  SUBMASTER ALL=(ALL) SUBMASTER  

but still when I try to user sudo pacman -Syu or sudo pacman -S git etc I get an error: sorry submasteruser is not allowed to execute /usr/bin/pacman

is there some other files I need to include in my /etc/sudoers Cmnd_Alias for SUBMASTER? Or am I missing some basic info here?

Sending request to local computer from anywhere

Posted: 02 Sep 2021 08:33 AM PDT

Few days ago I have made an application on raspberrypi that turn on the alight when you send to it an http request "http://rspi:8080/light". Secondly I have made an Android application that sends that request to it. Everything works fine when both devices are in the same network. My question is: how i can send this request from any other network. How I have to connect or how make route from my phone to this raspberry pi?

M2 SSD disk - bad sectors

Posted: 02 Sep 2021 08:14 AM PDT

I have a m2 SSD disk and it has 100 bad sectors (over 3 years). Is there a risk that this type of drive will eventually break, should i do something about it or not necessarily ?

enter image description here

thanks

How to log flag changes to files on ext4 and xfs filesystems?

Posted: 02 Sep 2021 10:02 AM PDT

I was wondering how to log flag changes in a file, e.g. chattr +a somefile.

I realized that timestamps shown by stat somefile are not useful to audit flag changes: when the file is appended, it overrides the last time a flag was changed.

How to get the embedded filename of a GPG encrypted file

Posted: 02 Sep 2021 08:56 AM PDT

One can see the embedded filename of an encrypted file using gpg --list-packets 001.gpg, which shows:

[...]    :literal data packet:      mode b (62), created 1630584912, name="elephant.jpg",      raw data: 87417 bytes    [...]  

Is there a way to get the embedded filename only? Is there a command that displays elephant.jpg only?

Is it possible to get the screen/monitor name where a specific application is displayed on?

Posted: 02 Sep 2021 10:46 AM PDT

I would like to find out what screen/monitor (not desktop) a GUI application is displayed on.

For example: my mail client is running on my third desktop, which is displayed on my second monitor ("DP-1-3"). So, my mail client is displayed on "DP-1-3".

I have tried using xdotool selectwindow get_desktop_for_window, but this returns the virtual desktop number/id, not the actual screen/monitor. Preferably, I would like to see the name of the screen/monitor as they are displayed in xrandr.

Thank you!

Freescale armhf iMX6Q board doesn't boot with kernel 5.10 or greater

Posted: 02 Sep 2021 08:10 AM PDT

I am upgrading the kernel from version 3.17.0-rc4 to latest kernel version in a board that uses a iMX6Q Freescale processor, but the board doesn't finish to boot.

I am cross-compiling using Debian 10 following these steps:

cp arch/arm/configs/imx_v6_v7_defconfig .config  make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- menuconfig  make -j`nproc` ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -k zImage modules  

And then copying the zImage and modules to the boot and root partition.

My uEnv.txt file is:

loadaddr=0x10008000  fdtaddr=0x18000000    fdtfile=imx6q-CIO100X50V01.dtb    console=ttymxc1,115200n8  optargs=console=ttyS0 quiet systemd.show_status=false  ethaddr=70:B3:D5:16:20:00    mmcroot=/dev/mmcblk0p2 ro  mmcrootfstype=ext4 rootwait fixrtc    loadkernel=load mmc ${mmcdev}:${mmcpart} ${loadaddr} zImage  loadinitrd=load mmc ${mmcdev}:${mmcpart} 0x12A00000 initrd.img; setenv initrd_size ${filesize}  loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /${fdtfile}    #zImage/initrd.img:  #boot_fdt=run loadkernel; run loadinitrd; run loadfdt    #zImage:  boot_fdt=run loadkernel; run loadfdt    mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype} video=${video} ethaddr=${ethaddr}    #zImage:  uenvcmd=run boot_fdt; run mmcargs; bootz ${loadaddr} - ${fdtaddr}  

I got this message trying to use kernel version 5.13.12, and then the boot freezes:

U-Boot 2016.07-rc1-g0b9fdb5-dirty (Oct 20 2016 - 15:57:37 +0200)    CPU:   Freescale i.MX6Q rev1.2 at 792 MHz  Reset cause: POR  Board: SABRE Lite  I2C:   ready  DRAM:  512 MiB  force_idle_bus: sda=0 scl=0 sda.gp=0xcb scl.gp=0x5  force_idle_bus: failed to clear bus, sda=0 scl=0  MMC:   FSL_SDHC: 0, FSL_SDHC: 1  *** Warning - bad CRC, using default environment    In:    serial  Out:   serial  Err:   serial  Net:   No ethernet found.  Hit any key to stop autoboot:  0   switch to partitions #0, OK  mmc0(part 0) is current device  280 bytes read in 32 ms (7.8 KiB/s)  Running bootscript from mmc ...  ## Executing script at 12000000  6x_bootscript -> uEnv.txt wrapper...  787 bytes read in 49 ms (15.6 KiB/s)  10801304 bytes read in 38345 ms (274.4 KiB/s)  33124 bytes read in 52 ms (622.1 KiB/s)  Kernel image @ 0x10008000 [ 0x000000 - 0xa4d098 ]  ## Flattened Device Tree blob at 18000000     Booting using the fdt blob at 0x18000000     Using Device Tree in place at 18000000, end 1800b163    Starting kernel ...      [    0.224790] debugfs: Directory 'dummy-iomuxc-gpr@20e0000' with parent 'regmap' already present!  

I've tried with another kernel versions and I am not having issues (eg. 4.19 or 5.9), but for some reason kernel version greater than or equal to 5.10, freezes the boot.

I thought about just use 5.9 kernel version, but I am a bit salty because I don't know what it's going on and I don't know how to debug what's happening. It's something I can do to debug what's happening or something I can try?

Maybe for some reason iMX6Q is not compatible with kernel greater than 5.10? I have searched but could not find anything.

Why should I kill ssh-agent on logout?

Posted: 02 Sep 2021 08:09 AM PDT

I have set up ssh-agent on my macOS laptop, and a 24x7 running server. Why do I need to kill ssh-agent on every logout?

Source of my knowledge of ssh-agent: https://kb.iu.edu/d/aeww

eval `ssh-agent`    # Start ssh-agent  echo $SSH_AGENT_PID    # 20552 (Check ssh-agent is running)  ssh-add    # Add id_rsa key to ssh-agent  kill $SSH_AGENT_PID    # Kill ssh-agent on logout  

Why is this last step required?

Delete illegal router from network

Posted: 02 Sep 2021 08:57 AM PDT

I have a default gateway with IP address 192.168.1.1 and MAC address 5c:77:76:6e:0d:7b. It is my only wi fi modem router from which I receive internet.

But in input nftables logs I saw another one router with the same IP address and different MAC address 5c:77:77:6e:0d:7b. This unknown router sends pages which I didn't open (spam).

I tried two ways to solve this problem:

  1. Set up static arp cache. Now my arp cache looks like this:

    arp -a mw40.home (192.168.1.1) at 5c:77:76:6e:0d:7b [ether] PERM on wlo1

  2. Drop packets from illegal router in etc/ nftables.conf:

    ether saddr 5c:77:77:6e:0d:7b counter drop;

But after the second step, I lost my internet connection.

My questions:

  1. What is happening in this piece of log (below)?

  2. How are the two routers communicating with each other?

  3. How I can remove from my network the illegal router with MAC address 5c:77:77:6e:0d:7b?

    Sep  1 15:16:03 flower kernel: [  133.359821] New Input packets: IN=wlo1 OUT= MAC=b8:81:98:cb:ef:a8:5c:77:77:6e:0d:7b:08:00 SRC=85.159.224.52 DST=192.168.1.2 LEN=76 TOS=0x18 PREC=0x60 TTL=49 ID=4873 DF PROTO=UDP SPT=123 DPT=47244 LEN=56       Sep  1 15:16:11 flower kernel: [  141.053122] New Input packets: IN=wlo1 OUT= MAC=b8:81:98:cb:ef:a8:5c:77:77:6e:0d:7b:08:00 SRC=192.168.1.1 DST=192.168.1.2 LEN=185 TOS=0x00 PREC=0x00 TTL=64 ID=32498 DF PROTO=UDP SPT=53 DPT=56881 LEN=165       Sep  1 15:16:12 flower kernel: [  141.660330] New Input packets: IN=wlo1 OUT= MAC=b8:81:98:cb:ef:a8:5c:77:77:6e:0d:7b:08:00 SRC=192.168.1.1 DST=192.168.1.2 LEN=111 TOS=0x00 PREC=0x00 TTL=64 ID=32521 DF PROTO=UDP SPT=53 DPT=36247 LEN=91       Sep  1 15:16:12 flower kernel: [  141.694208] New Input packets: IN=wlo1 OUT= MAC=b8:81:98:cb:ef:a8:5c:77:77:6e:0d:7b:08:00 SRC=172.67.68.8 DST=192.168.1.2 LEN=52 TOS=0x18 PREC=0x60 TTL=56 ID=0 DF PROTO=TCP SPT=443 DPT=50048 WINDOW=65535 RES=0x00 ACK SYN URGP=0       Sep  1 15:16:12 flower kernel: [  141.722991] New Input packets: IN=wlo1 OUT= MAC=b8:81:98:cb:ef:a8:5c:77:77:6e:0d:7b:08:00 SRC=192.168.1.1 DST=192.168.1.2 LEN=147 TOS=0x00 PREC=0x00 TTL=64 ID=32522 DF PROTO=UDP SPT=53 DPT=51721 LEN=127       Sep  1 15:16:12 flower kernel: [  141.743011] New Input packets: IN=wlo1 OUT= MAC=b8:81:98:cb:ef:a8:5c:77:76:6e:0d:7b:08:00 SRC=172.67.68.8 DST=192.168.1.2 LEN=40 TOS=0x18 PREC=0x60 TTL=56 ID=3764 DF PROTO=TCP SPT=443 DPT=50048 WINDOW=66 RES=0x00 ACK URGP=0       Sep  1 15:16:12 flower kernel: [  141.743028] New Input packets: IN=wlo1 OUT= MAC=b8:81:98:cb:ef:a8:5c:77:76:6e:0d:7b:08:00 SRC=172.67.68.8 DST=192.168.1.2 LEN=2840 TOS=0x18 PREC=0x60 TTL=56 ID=3765 DF PROTO=TCP SPT=443 DPT=50048 WINDOW=66 RES=0x00 ACK PSH URGP=0   

More logs from router with illegal MAC address here:  nftables logs from illegal router

Raspberry 4 stuck in initramfs

Posted: 02 Sep 2021 09:15 AM PDT

im new on this site so i hope im not making myself look super stupid (beside the fact that my english isnt that best)

I got myself a Raspberry Pi 4B with an 64GB SDCard of Sandisk Ultra. Installed on it is an Ubuntu server 20.04 ARM Version. It usually runs 24/7 in my local network for research and bit of education.

What happen:

After installing an Update with "Sudo apt update", "sudo apt upgrade" and finishing it with "reboot", i got stuck into initramfs.

The only message shown is:

ext4  Thu Jan 1 00:00:06 UTC 1970  writable:recovering journal  writable: superblock need_recovery flas is clear, but journal has data.  writable: Run journal anyway    writable: UNEXPECRED INCONSISTENCY; RUN fsck MANUALLY.            (i.e., without -a or -p options)   fsck exited with status code 4  The root filesystem on /dev/mmcblk0p2 requieres a manual fsck      BusyBox v1.30.1 (Ubuntu 1:1.30.1-6ubuntu2) built in shell (ahs)  Enter 'help'for a list of built-in commands.      (initramfs)_     

I did what it says to me and tried to run it manually with the command:

(initramfs) fsck /dev/mmcblk0p2  fsck from util-linux 2.36.1  e2fsck 1.45.7 (28-Jan-2021)  writable: recovering journal  Superblock needs_recovery flag is clear, but journal has data.  Run journal anyway<y>? yes  fsck.ext4: unable to set superblock flags on writable    writable: ********** WARNING: Filesystem still has errors **********    (initramfs) _  

After some research i found out it were problably the sd card soo i tried to reeinstall the ubuntu server on it again.

But the sd card doesnt get wiped. not wiped in windows neither Linux. The files inside are set into read only, but trying to wipe it with sudo on an other device doesnt affect it in anyway. Trying to delete anything or make it writable on the initramfs gives me a "Permission Denied".

because all my data is already save i would like to wipe it. But im still curios why this happens because i had it twice. in the first time it got fixed easy by just reeinstalling. And this is the second time.

I hope some of u got any idea to fix it. I googled my way down and up, but didnt find anything.

Who owns the UNIX trademark

Posted: 02 Sep 2021 10:55 AM PDT

I am currently enrolled in a course that is teaching me UNIX fundamentals, such as common commands and such. After doing some digging on UNIX, I came across the rabbit hole of legal battles over who owns UNIX, and the UNIX wars. I have done some research, but the sources are sort of dated (circa 2003 - 2004) and have conflicting information as far as who owns it.

Here are a couple of the sources I have found:

https://www.zdnet.com/article/who-really-owns-unix/ - states that the Open Group owns it

https://www.informit.com/articles/article.aspx?p=175171&seqNum=2 - states that the SCO owns it

After reading these sources, it sounds like the Open Group is claiming to own the UNIX trademark, while the SCO claims to own the UNIX source code. Am I understanding that correctly?

Using qemu/kvm with nftables? (without firewalld!)

Posted: 02 Sep 2021 10:04 AM PDT

With libvirt/qemu/kvm you can define a bridge (or more) to be used by the guest machines. The libvirt machinery should take care of the creation of the bridge - normally called virbr0 with virbr0-nic (to work around some quirks) - and will normally also take care to insert firewall rules - by way of iptables - to ensure connectivity (forwarding, accepting traffic between guests, sometimes denying outbound/inbound traffic on virbr0 altogether).

Now, I am currently in the process of migrating to nftables and I enjoy the added flexibility and the powerful syntax which for all my use cases surpasses my past experience with iptables/ip6tables and ipset in tandem. Alone the fact that I can express certain rules as pertaining to the inet family as a whole instead of IPv4 and IPv6 individually, makes it worthwhile.

Alas, libvirt officially only supports iptables or firewalld.

Now my question is this: is there a canonical way of dealing with this situation and what is it?

Here are a few scenarios I have contemplated (all without firewalld):

  1. use nftables but use the update-alternatives machinery to ensure libvirt will find an iptables (and so on) to call
  2. move bridge creation away from libvirt and into netplan, then use other means to dynamically insert the necessary rules
  3. use nftables but leave iptables active -- from all I understand this is probably the worst idea, because they are bound to clash in some edge cases or in general

VBox Guest Additions installation can't find headers for Kali kernal 4.14.0-kali1-amd64

Posted: 02 Sep 2021 10:04 AM PDT

I have installed Kali in VirtualBox and now trying to install Guest Additions to get full screen view.

I updated and installed my packages and installed dkms. When I try to install linux-headers I get the following:

# apt-get install linux-headers-$(uname -r)  Reading package lists... Done  Building dependency tree         Reading state information... Done  linux-headers-4.14.0-kali1-amd64 is already the newest version (4.14.2-1kali1).  0 upgraded, 0 newly installed, 0 to remove and 86 not upgraded.  

The headers installed are as follows:

# dpkg --get-selections | grep linux-headers  linux-headers-4.14.0-kali1-amd64        install  linux-headers-4.14.0-kali1-common       install  linux-headers-amd64             install  

When I try to run the Guest Additions CD I get the following:

Verifying archive integrity... All good.  Uncompressing VirtualBox 5.0.40 Guest Additions for Linux............  VirtualBox Guest Additions installer  Removing installed version 5.0.40 of VirtualBox Guest Additions...  Removing existing VirtualBox DKMS kernel modules ...done.  Removing existing VirtualBox non-DKMS kernel modules ...done.  update-initramfs: Generating /boot/initrd.img-4.13.0-kali1-amd64  update-initramfs: Generating /boot/initrd.img-4.14.0-kali1-amd64  Copying additional installer modules ...  Installing additional modules ...  Removing existing VirtualBox DKMS kernel modules ...done.  Removing existing VirtualBox non-DKMS kernel modules ...done.  Building the VirtualBox Guest Additions kernel modules  The headers for the current running kernel were not found. If the following  module compilation fails then this could be the reason.    Building the main Guest Additions module ...fail!  (Look at /var/log/vboxadd-install.log to find out what went wrong)  Doing non-kernel setup of the Guest Additions ...done.  Press Return to close this window...  

It appears to me that the correct linux headers for the kernal are installed. Why is VBox not able to find them?

Tried updating to VBox 5.2.2 but after removing existing version and installing 5.2.2 I was unable to launch Kali-Linux - screenshot attached .

Installing 32-bit Linux distribution on 32-bit Architecture with 32-bit UEFI

Posted: 02 Sep 2021 09:01 AM PDT

There's a lot of information on installing 64-bit Linux on 32-bit UEFI. It's a mess even here, but I've seen ways (rEFInd, etc).

But this laptop (HP Envy X2) has a 32-bit architecture and exclusively EFI (no CSM / legacy BIOS). So, how can I install a 32-bit Linux distribution on a 32-bit architecture, with EFI only?

At this point I'd be fine with pretty much any distribution. But if there's choice, I'd go with Arch-based, or Debian-based.

I have experience in GNU/Linux and installation / etc. I'm looking for EFI-specific help. The laptop currently runs Windows 10 with basically no drivers, but I have access to Debian and Windows on my desktop.

Thanks!

PS: This is not a duplicate as the questioner is (I believe) wrong in believing that the X2's CPU supports 64-bit. The answer there is also merely a distribution name.

How to generate a random string?

Posted: 02 Sep 2021 08:34 AM PDT

I would like to generate a random string (e.g. passwords, user names, etc.). It should be possible to specify the needed length (e.g. 13 chars).

What tools can I use?

(For security and privacy reasons, it is preferable that strings are generated off-line, as opposed to online on a website.)

Finding out what sh is [duplicate]

Posted: 02 Sep 2021 08:13 AM PDT

I am writing a set of scripts that I want to be portable, but I need to know whether sh on the current platform stands for bash, ksh, or ash. Is there a clear way to do it?

What comes to my mind first is to inspect which shell has which --version:

$ zsh --version  zsh 5.0.2 (x86_64-apple-darwin13.0)    $ bash --version  GNU bash, version 4.3.39(1)-release (x86_64-apple-darwin13.4.0)  Copyright (C) 2013 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>    This is free software; you are free to change and redistribute it.  There is NO WARRANTY, to the extent permitted by law.    $ ksh --version    version         sh (AT&T Research) 93u+ 2012-08-01    $ dash --version  dash: 0: Illegal option --    $ pdksh --version  pdksh: pdksh: --: unknown option  

Apart from being clumsy, this doesn't even produce results in all cases.

Edit

I need it for my bashrc/zshrc/...-like project, where I assign my current working shell to a variable, and use that variable everywhere.

I can't post my code because I need to solve the problem to enable overall cleanliness of my work. Moreover, it would be too much monkeycode... don't misunderstand it, but POSIX compatibility is too narrow to make my project small enough. I'd need to crutch on system configs otherwise.

However, I can post my UNIX Shell defining function:

PROJ_GET_SHELL () {      local PROJ_SHELL="`ps -p $$ | tail -1 | tr ' ' '\n' | tail -1`"      PROJ_local=(pdksh bash dash mksh zsh ksh sh)      for i in ${PROJ_local[*]}      do          if ! [ -z `echo $PROJ_SHELL | grep $i` ]          then              echo "$i"              break          fi      done  }  

PS. The least bit of research shows that $SHELL doesn't change when running a shell as subprocess.

Run wc and display only the word count

Posted: 02 Sep 2021 10:38 AM PDT

I have been trying to create a file called ~/dictwords.txt, which contains the number of words found in the file /usr/share/dict/words.

I already created the file then I removed it because I did it wrong I originally did the echo command. Then I tried this command and was so excited because I thought I was correct.

wc -w /usr/share/dict/words > ~/dictwords.txt  

It's still wrong, I am supposed to have just the number, without a file name.

How to download an archive and extract it without saving the archive to disk?

Posted: 02 Sep 2021 08:35 AM PDT

I'd like to download, and extract an archive under a given directory. Here is how I've been doing it so far:

wget http://downloads.mysql.com/source/dbt2-0.37.50.3.tar.gz  tar zxf dbt2-0.37.50.3.tar.gz  mv dbt2-0.37.50.3 dbt2  

I'd like instead to download and extract the archive on the fly, without having the tar.gz written to the disk. I think this is possible by piping the output of wget to tar, and giving tar a target, but in practice I don't know how to put the pieces together.

How to get only files created after a date with ls?

Posted: 02 Sep 2021 08:32 AM PDT

With the ls command, is it possible to show only the files created after a specific date, hour...?

I'm asking it because I have a directory with thousand of files.

I want so see all files that were created since yesterday.

I use ls -ltr but I have to wait to see all files...

There is an equivalent of DIRECTORY/SINCE=date from OpenVMS ?

No comments:

Post a Comment