Sunday, May 16, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


A question about wait system call and related macros

Posted: 16 May 2021 10:26 AM PDT

I study the family of the wait system calls and I noticed that there are some macros, for example, WIFSTOPPED (status) that they are not associated with a definition (according to elixir.bootlin.com) but they are used in the kernel code. For example, in the source file /arch/um/os-Linux/skas/process.c in the lines 112-113 there is the code

if ((n < 0) || !WIFSTOPPED(status)) goto bad_wait;   

Is it possible to use a macro without defining it? What happens in this case? Thanks a lot !!!

How to find all the dependencies (both linked statically and dynamically) with its version

Posted: 16 May 2021 10:24 AM PDT

I have made a cpp project in windows using visual studio few years back and now it seems like it's not running, so there's some issue of version, maybe I've to use the latest version of some libraries on which my project is dependent on.

so, I've sln file and .exe and all the other files available. (within default folders created by the visual studio). and I want to find the dependencies on which my .exe is dependent on. I've tried using dependency runner, dumpbin, verbosity option while linking in visual studio, ldd in Linux, sigcheck, etc.But it seems like it does not shows a way to find the version of any dll(dynamically linked lib). It just shows the name.

How to find all the recursive libraries used by our project (in other words how to find all the dependencies (recursive) on which our project is dependent on) with versions of those dependecies.

i want something like this at the end dependencies_version.txt file: msvcp140d : 14.0.24215.1, ucrtd : 10.0.19041.0, OpenSSL : 1.1.0i, etc.

Dell XPS 13 9300 Intel WiFi Not Working

Posted: 16 May 2021 10:24 AM PDT

The WiFi on my new Dell XPS 13 9300 refuses to work. Many solutions online that I found online involve downloading it on device... which I can't do because the WiFi is broken (the issue) and I don't have a USB-C to Ethernet adapter. I've downloaded the firmware-iwlwifi_20210315-2~bpo10+1_all.deb package from Debian's firmware repo using my Mac and put it on a USB stick, and then transferred it over to my device. I tried installing it both with apt install and dpkg -i. Both claim to be successful, but it still doesn't work. I then tried running sudo modprobe -r iwlwifi ; sudo modprobe iwlwifi, still to no avail (no interface other than loopback is displayed when I run ip a and ping 1.1.1.1 says that the network is unreachable).

I've seen some solutions that say to install a newer kernel, but they all involve accessing the internet from the device that's having the issues... If it's possible to download the kernel on a different device and move it over via USB, that would be nice.

I've also tried restarting the device. That doesn't work either.

I've considered the possibility that I need to select a network and enter a password, but since even the interface doesn't show up I'm guessing that that's not the issue.

Any ideas?

Note: before I installed Linux, Windows had working WiFi, so it doesn't seem like it's a hardware issue. I can't go back to test since I wiped Windows.

X11 forwarding, how to force audio to the host?

Posted: 16 May 2021 10:22 AM PDT

i am connecting from a laptop:

$ uname -a  Linux fedora 5.11.18-200.fc33.x86_64 #1 SMP Mon May 3 15:05:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux  

to a single-board-computer:

$ uname -a  Linux mobian 5.10-sunxi64 #2 SMP PREEMPT Tue Jan 12 09:55:56 UTC 2021 aarch64 GNU/Linux    

over SSH with compressed X11 forwarding:

ssh -YC user@remote  

everything seems great except for the fact, that audio plays in the laptop and I want it to play in the remote machine. how is this achieved?


P.S. I suspect this is something fedora-specific as the same ssh -YC user@remote connection from a different device:

$ uname -a  Linux sxmo 5.11.0 #1-postmarketos-allwinner SMP Sat Mar 27 14:48:00 UTC 2021 aarch64 GNU/Linux  

leaves the audio-output on the remote machine.

can't resolve defined symbol?

Posted: 16 May 2021 09:56 AM PDT

How is it possible when python -c 'import ctypes;ctypes.CDLL("libEGL.so")' shows symbol 'rpc_send_ctrl_write': can't resolve symbol, but nm -C -D --defined-only libEGL.so shows this symbol among those defined in that library?

VLAN switching between trunk ports on CentOS

Posted: 16 May 2021 09:26 AM PDT

I am using CentOS Linux release 8.3.2011 and am struggling to set it up as a switch. The network topology is as follows:

[switch1]--------[vsphere]--------------[centos]--------------------[vRouter]       gi0/0     vmnic2   SW1-trunk   end224   lnkbe296edcl2b     Gi0/0.10                       SW1                bridge11  

So, in summary:

  • A physical switch, switch1, with interface gi0/0 configured as trunk and with some switched virtual interfaces configured with IP addresses for testing. For this test, I will use the interface vlan 10, which has the IP address 192.168.0.10/24;
  • vSphere hypervisor, with a vSwitch SW1, containing port group "SW1 - trunk" and a physical adapter vmnic2. The port group is configured with VLAN ID 4095, which is the way to configure a port as trunk on vmware;
  • A CentOS VM, called CML, which uses KVM to host virtual network functions. I've configured a virtual router on top of it. I've created bridge11 and associated the vmware facing interface (ens224) and vrouter facing interface (lnkbe296edcl2b) to it.
  • A vRouter, which is an IOSv (virtualized Cisco IOS), with a IP subinterface with IP address 192.168.0.11/24.

vSphere topology below:

Well, with this configuration, I cannot ping from vRouter (192.168.0.11) to switch1 SVI (192.168.0.10).

R1#sh ip int br  Interface                  IP-Address      OK? Method Status                Protocol  GigabitEthernet0/0         unassigned      YES manual up                    up        GigabitEthernet0/0.10      192.168.0.11    YES TFTP   up                    up        GigabitEthernet0/1         unassigned      YES unset  administratively down down      GigabitEthernet0/2         unassigned      YES unset  administratively down down      GigabitEthernet0/3         unassigned      YES unset  administratively down down      R1#ping 192.168.0.10  Type escape sequence to abort.  Sending 5, 100-byte ICMP Echos to 192.168.0.10, timeout is 2 seconds:  .....  Success rate is 0 percent (0/5)  R1#sh arp  Protocol  Address          Age (min)  Hardware Addr   Type   Interface  Internet  192.168.0.10            0   Incomplete      ARPA     Internet  192.168.0.11            -   5254.0000.b61d  ARPA   GigabitEthernet0/0.10  R1#  

If I change the network topology to the one below:

[switch1]--------[vsphere]--------------[centos]--------------------[vRouter]       gi0/0     vmnic2   SW1-trunk  end224.10   lnkbe296edcl2b     Gi0/0                       SW1                bridge11  

In this topology:

  • I am using a subinterface on centos towards vmware, so, it receives untagged traffic from the bridge and send it tagged to VMWare port group SW1-trunk;
  • I am using the main interface in the router. So, the traffic leaves untagged;
  • I've added an IP address to bridge11 - 192.168.0.1/24, for testing.

In this scenario, I can ping from bridge11 to switch1 and from bridge11 to vRouter, but not from vRouter to switch1.

  • CentOS tests:
[~]$ping -c5 -q 192.168.0.11  PING 192.168.0.11 (192.168.0.11) 56(84) bytes of data.    --- 192.168.0.11 ping statistics ---  5 packets transmitted, 5 received, 0% packet loss, time 11ms  rtt min/avg/max/mdev = 1.718/2.151/2.879/0.407 ms  [~]$ping -c5 -q 192.168.0.10  PING 192.168.0.10 (192.168.0.10) 56(84) bytes of data.    --- 192.168.0.10 ping statistics ---  5 packets transmitted, 5 received, 0% packet loss, time 103ms  rtt min/avg/max/mdev = 0.398/0.515/0.656/0.090 ms  [~]$ip nei show dev bridge11  192.168.0.10 lladdr 00:12:43:7e:4b:c1 STALE  192.168.0.11 lladdr 52:54:00:00:b6:1d STALE  [~]$  
  • vRouter (R1) tests:
R1#ping 192.168.0.1   Type escape sequence to abort.  Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:  !!!!!  Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms  R1#ping 192.168.0.10  Type escape sequence to abort.  Sending 5, 100-byte ICMP Echos to 192.168.0.10, timeout is 2 seconds:  .....  Success rate is 0 percent (0/5)  R1#show arp           Protocol  Address          Age (min)  Hardware Addr   Type   Interface  Internet  192.168.0.1             0   000c.2997.7368  ARPA   GigabitEthernet0/0  Internet  192.168.0.10            0   Incomplete      ARPA     Internet  192.168.0.11            -   5254.0000.b61d  ARPA   GigabitEthernet0/0  R1#  

I've searched and only found references with linux untagging traffic and routing... I need linux to behave as a vlan switch without need to look at the ip headers.

Any hints on how to make CentOS to switch vlan traffic, from trunk to trunk port?

Thanks in advance

Extracting text from an xml file

Posted: 16 May 2021 10:14 AM PDT

If I have an xml file containing entries like this

<root>    <d:entry d:title="OYSTER">      <span class="foot">        <span role="text">        foo</span>      </span>      <span class="sg">        <span id="004">      <span role="text">        <span class="pos">          <span class="baz">tart</span>          <d:pos></d:pos>        </span>      </span>      <span id="005" class="star">        <span class="NAME">GUYBRUSH THREEPWOOD        <d:def></d:def></span>        <span role="text" class="bar">:</span>        <span role="text" class="grog">          <span class="ex">pirate          </span>          <span class="parrot">.</span>        </span>      </span>        </span>      </span>    </d:entry>  </root>  

how can I extract the text 'GUYBRUSH THREEPWOOD' by supplying the (d:)title 'OYSTER' and the class 'NAME'?

On which parameters one can determine which PCI devices available on host are assignable to the KVM guests

Posted: 16 May 2021 08:49 AM PDT

I have the following PCI devices available on my host (centos 7):

[root@sumeet-KVM ~]# lspci -kD  0000:00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)      Subsystem: Red Hat, Inc. Qemu virtual machine  0000:00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]      Subsystem: Red Hat, Inc. Qemu virtual machine  0000:00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]      Subsystem: Red Hat, Inc. Qemu virtual machine      Kernel driver in use: ata_piix      Kernel modules: ata_piix, pata_acpi, ata_generic  0000:00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)      Subsystem: Red Hat, Inc. QEMU Virtual Machine      Kernel driver in use: uhci_hcd  0000:00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)      Subsystem: Red Hat, Inc. Qemu virtual machine      Kernel driver in use: piix4_smbus      Kernel modules: i2c_piix4  0000:00:02.0 VGA compatible controller: Cirrus Logic GD 5446      Subsystem: Red Hat, Inc. QEMU Virtual Machine      Kernel driver in use: cirrus      Kernel modules: cirrus  0000:00:03.0 Ethernet controller: Red Hat, Inc. Virtio network device      Subsystem: Red Hat, Inc. Device 0001      Kernel driver in use: virtio-pci      Kernel modules: virtio_pci  0000:00:04.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)      Subsystem: Red Hat, Inc. QEMU Virtual Machine      Kernel driver in use: snd_intel8x0      Kernel modules: snd_intel8x0  0000:00:05.0 SCSI storage controller: Red Hat, Inc. Virtio block device      Subsystem: Red Hat, Inc. Device 0002      Kernel driver in use: virtio-pci      Kernel modules: virtio_pci  0000:00:06.0 SCSI storage controller: Red Hat, Inc. Virtio block device      Subsystem: Red Hat, Inc. Device 0002      Kernel driver in use: virtio-pci      Kernel modules: virtio_pci  0000:00:07.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon      Subsystem: Red Hat, Inc. Device 0005      Kernel driver in use: virtio-pci      Kernel modules: virtio_pci  

Now, on what parameters I could determine which PCI devices are available to be assigned to vms?

I have read that most to the people PCI passthrough USBs, GPUs, etc to their VMs. How would one add these devices on KVM Host server for passthrough?

I have had an overview look on libvirt docs, where it say:

pci-bridge or cardbus-bridge

This shows merely that the lower 7 bits of PCI header type have either value of 1 or 2 respectively. Usually this means such device cannot be used for PCI passthrough. Since 1.3.3

I have found only one indicator i.e. pci-bridge which if pci device has in its xmldump then that particular device is not available for PCI passthrough.

Otherthan this, what all the indicator are there to find out which pci devices are actually assignable to VMs?

I have already enabled the iommu in my OS kernel:

[root@sumeet-KVM ~]# dmesg | grep -e DMAR -e IOMMU  [    0.000000] DMAR: IOMMU enabled  

SNMPWalk module not found

Posted: 16 May 2021 08:47 AM PDT

I am currently trying to get extended output on SNMPWalk.

I have installed snmp-mibs downloader and have been running download-mibs.

I am using the following command:

snmpwalk -v2c -c public [ip] -m NET-SNMP-EXTEND-MIB::nsExtendObjects  

and get the following error:

MIB search path:  /usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/var/lib/mibs:/var/lib/mibs/ietf:/var/lib/mibs/iana  Cannot find module (nsExtendObjects): At line 1 in (none)  

I can confirm that my modules are in the right place, as I have verified manually.

I have tried using -M to specify the location of modules.

I use NET-SNMP version: 5.9

After the error, I get the same output as if I did not use extended mode.

I can also confirm that there should be a different output, as another machine using the same configuration is able to get extended output. The "public" string is the right one.

Thank you for any help :)

Remote file transfer (rsync, scp, sftp) times out

Posted: 16 May 2021 08:56 AM PDT

I am running into a problem where my connection times out when I try to transfer a file remotely from a MAC OS (11.2.3) to Ubuntu 18.04.05. I am able to connect and have write access to files via ssh. Here are examples using three different methods of file transferring, all seeming to give a similar error, which makes me think it has something to do with my local configuration or a firewall, but am at a loss on how to troubleshoot this.

Note that I've replaced my username and IP with fake fillers, but I'm using the real names when running the script.

ssh

This works fine, but putting here just in case it is helpful.

ssh -p 9922 [remote-user]@[remote-IP]  

scp

Running the following code:

scp -vvvP 9922 /Users/[local-user]/Desktop/moving-files-ssh.txt [remote-user]@[remote-IP]:~/  

Results in the connection timing out, not requesting a password or anything:

Executing: program /usr/bin/ssh host [remote-IP], user [remote-user], command scp -v -t ~/  OpenSSH_8.1p1, LibreSSL 2.7.3  debug1: Reading configuration data /etc/ssh/ssh_config  debug1: /etc/ssh/ssh_config line 47: Applying options for *  debug2: resolve_canonicalize: hostname [remote-IP] is address  debug2: ssh_connect_direct  debug1: Connecting to [remote-IP] [[remote-IP]] port 9922.  debug1: connect to address [remote-IP] port 9922: Operation timed out  ssh: connect to host [remote-IP] port 9922: Operation timed out  lost connection  

I have also tried this the other way, logging into the remote machine and attempting to transfer files back to my local machine via scp, and ran into the same issue.

sftp

I am unable to establish the sftp connection:

sftp -oPort=9922 [remote-user]@[remote-IP]  

The cursor seems to hang for several minutes and then prints out:

ssh: connect to host [remote-IP] port 9922: Operation timed out  

rsync

Similar problem as to scp:

rsync -ahvz -e 'ssh -p9922' /Users/[local-user]/Desktop/moving-files-ssh.txt [remote-user]@[remote-IP]:/  

Results in:

ssh: connect to host [remote-IP] port 9922: Operation timed out  rsync: connection unexpectedly closed (0 bytes received so far) [sender]  rsync error: unexplained error (code 255) at /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/io.c(453) [sender=2.6.9]  

This also sometimes results in error code 12.

ssh config

Here is what is in my ssh configurations:

# Host *  #   ForwardAgent no  #   ForwardX11 no  #   PasswordAuthentication yes  #   HostbasedAuthentication no  #   GSSAPIAuthentication no  #   GSSAPIDelegateCredentials no  #   BatchMode no  #   CheckHostIP yes  #   AddressFamily any  #   ConnectTimeout 0  #   StrictHostKeyChecking ask  #   IdentityFile ~/.ssh/id_rsa  #   IdentityFile ~/.ssh/id_dsa  #   IdentityFile ~/.ssh/id_ecdsa  #   IdentityFile ~/.ssh/id_ed25519  #   Port 22  #   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc  #   MACs hmac-md5,hmac-sha1,umac-64@openssh.com  #   EscapeChar ~  #   Tunnel no  #   TunnelDevice any:any  #   PermitLocalCommand no  #   VisualHostKey no  #   ProxyCommand ssh -q -W %h:%p gateway.example.com  #   RekeyLimit 1G 1h  

Output from running ssh -vvv

OpenSSH_8.1p1, LibreSSL 2.7.3  debug1: Reading configuration data /etc/ssh/ssh_config  debug1: /etc/ssh/ssh_config line 47: Applying options for *  debug2: resolve_canonicalize: hostname XXX.XX.XXX.XX is address  debug2: ssh_connect_direct  debug1: Connecting to XXX.XX.XXX.XX [XXX.XX.XXX.XX] port 9922.  debug1: Connection established.  debug1: identity file /Users/username/.ssh/id_rsa type 0  debug1: identity file /Users/username/.ssh/id_rsa-cert type -1  debug1: identity file /Users/username/.ssh/id_dsa type -1  debug1: identity file /Users/username/.ssh/id_dsa-cert type -1  debug1: identity file /Users/username/.ssh/id_ecdsa type -1  debug1: identity file /Users/username/.ssh/id_ecdsa-cert type -1  debug1: identity file /Users/username/.ssh/id_ed25519 type -1  debug1: identity file /Users/username/.ssh/id_ed25519-cert type -1  debug1: identity file /Users/username/.ssh/id_xmss type -1  debug1: identity file /Users/username/.ssh/id_xmss-cert type -1  debug1: Local version string SSH-2.0-OpenSSH_8.1  debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3  debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002  debug2: fd 3 setting O_NONBLOCK  debug1: Authenticating to XXX.XX.XXX.XX:9922 as 'username'  debug3: put_host_port: [XXX.XX.XXX.XX]:9922  debug3: hostkeys_foreach: reading file "/Users/username/.ssh/known_hosts"  debug3: record_hostkey: found key type ECDSA in file /Users/username/.ssh/known_hosts:1  debug3: load_hostkeys: loaded 1 keys from [XXX.XX.XXX.XX]:9922  debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521  debug3: send packet: type 20  debug1: SSH2_MSG_KEXINIT sent  debug3: receive packet: type 20  debug1: SSH2_MSG_KEXINIT received  debug2: local client KEXINIT proposal  debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c  debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa  debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com  debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com  debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1  debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1  debug2: compression ctos: none,zlib@openssh.com,zlib  debug2: compression stoc: none,zlib@openssh.com,zlib  debug2: languages ctos:   debug2: languages stoc:   debug2: first_kex_follows 0   debug2: reserved 0   debug2: peer server KEXINIT proposal  debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1  debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256  debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com  debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com  debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1  debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1  debug2: compression ctos: none,zlib@openssh.com  debug2: compression stoc: none,zlib@openssh.com  debug2: languages ctos:   debug2: languages stoc:   debug2: first_kex_follows 0   debug2: reserved 0   debug1: kex: algorithm: curve25519-sha256  debug1: kex: host key algorithm: ecdsa-sha2-nistp256  debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none  debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none  debug3: send packet: type 30  debug1: expecting SSH2_MSG_KEX_ECDH_REPLY  debug3: receive packet: type 31  debug1: Server host key: ecdsa-sha2-nistp256 SHA256:XXXXXXXXXXXXXXXX  debug3: put_host_port: [XXX.XX.XXX.XX]:9922  debug3: put_host_port: [XXX.XX.XXX.XX]:9922  debug3: hostkeys_foreach: reading file "/Users/username/.ssh/known_hosts"  debug3: record_hostkey: found key type ECDSA in file /Users/username/.ssh/known_hosts:1  debug3: load_hostkeys: loaded 1 keys from [XXX.XX.XXX.XX]:9922  debug3: hostkeys_foreach: reading file "/Users/username/.ssh/known_hosts"  debug3: record_hostkey: found key type ECDSA in file /Users/username/.ssh/known_hosts:1  debug3: load_hostkeys: loaded 1 keys from [XXX.XX.XXX.XX]:9922  debug1: Host '[XXX.XX.XXX.XX]:9922' is known and matches the ECDSA host key.  debug1: Found key in /Users/username/.ssh/known_hosts:1  debug3: send packet: type 21  debug2: set_newkeys: mode 1  debug1: rekey out after 134217728 blocks  debug1: SSH2_MSG_NEWKEYS sent  debug1: expecting SSH2_MSG_NEWKEYS  debug3: receive packet: type 21  debug1: SSH2_MSG_NEWKEYS received  debug2: set_newkeys: mode 0  debug1: rekey in after 134217728 blocks  debug1: Will attempt key: /Users/username/.ssh/id_rsa RSA SHA256:XXXXXXXXXXXXXXXX  debug1: Will attempt key: /Users/username/.ssh/id_dsa   debug1: Will attempt key: /Users/username/.ssh/id_ecdsa   debug1: Will attempt key: /Users/username/.ssh/id_ed25519   debug1: Will attempt key: /Users/username/.ssh/id_xmss   debug2: pubkey_prepare: done  debug3: send packet: type 5  debug3: receive packet: type 7  debug1: SSH2_MSG_EXT_INFO received  debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>  debug3: receive packet: type 6  debug2: service_accept: ssh-userauth  debug1: SSH2_MSG_SERVICE_ACCEPT received  debug3: send packet: type 50  debug3: receive packet: type 51  debug1: Authentications that can continue: publickey  debug3: start over, passed a different list publickey  debug3: preferred publickey,keyboard-interactive,password  debug3: authmethod_lookup publickey  debug3: remaining preferred: keyboard-interactive,password  debug3: authmethod_is_enabled publickey  debug1: Next authentication method: publickey  debug1: Offering public key: /Users/username/.ssh/id_rsa RSA SHA256:XXXXXXXXXXXXXXXXXXXX  debug3: send packet: type 50  debug2: we sent a publickey packet, wait for reply  debug3: receive packet: type 60  debug1: Server accepts key: /Users/username/.ssh/id_rsa RSA SHA256:XXXXXXXXXXXXXXXXXXXX  debug3: sign_and_send_pubkey: RSA SHA256:XXXXXXXXXXXXXXXXXXXX  debug3: sign_and_send_pubkey: signing using rsa-sha2-512  

Chrome still opens Nautilus in spite changing the default file manager to Dolphin in Pop!_OS

Posted: 16 May 2021 07:48 AM PDT

Recently, I changed my default file manager from Nautilus to Dolphin in Pop!_OS by this command:

xdg-mime default org.kde.dolphin.desktop inode/directory'  

and checked again which is the default file manager by executing this command:

xdg-mime query default inode/directory  

and I get this output:

org.kde.dolphin.desktop  

But, Gogle Chrome still opens Nautilus as the default file manager. I thought of removing it, but doing so will result in potential damage to my system since it is a built-in file. Here is the picture to view the scenario.

enter image description here

And, instantly when I browsed that picture, Chrome, as usual, used Nautilus to browse the picture.

enter image description here

Anyway to sort out this issue? I just want to sure that all applications use Dolphin as the default file manager without removing Nautilus.

Update: As suggested, I also used xdg-open command to find the default file manager the system is using. And I noticed that, Dolphin opens up automatically with the entered file location.

Replace Nth line after match

Posted: 16 May 2021 09:24 AM PDT

let's say, I have this file with five hundred lines of text.

one  two  three  four  five  six  seven  eight  nine  ten  .  .  .  five-hundred  

If I wanted to replace the fifth line after match with some string, I would just do this:

sed '/two/{n;n;n;n;n;s/.*/MODIFIED/}' inputfile  

output:

one  two  three  four  five  six  MODIFIED  eight  nine  ten  .  .  .  five-hundred  

But what if I want to replace the 60th line after match? I don't want to write 'n' sixty times.

I tried playing around with x, h/H, g/G, and ranges, but I can't still get my desired output.

shebang on vagrant mount doesn't work: bad interpreter: Invalid argument

Posted: 16 May 2021 08:53 AM PDT

I run in a strange problem if I try to execute a file inside vagrant mount, but not outside:

$ cat test   #!/usr/bin/env node    console.log('works!')    $ ls -la test   -rwxr-xr-x 1 vagrant vagrant 43 May 13 23:17 test    $ ./test   bash: ./test: /usr/bin/env: bad interpreter: Invalid argument    $ /usr/bin/env node test  works!    $ cp test /tmp/; cd /tmp/  $ ./test   works!  

Some details:

$ cat /etc/fstab | grep workspace  home_vagrant_workspace /home/vagrant/workspace vboxsf uid=1000,gid=1000,_netdev 0 0    $ mount | grep workspace  home_vagrant_workspace on /home/vagrant/workspace type vboxsf (rw,nodev,relatime,iocharset=utf8,uid=1000,gid=1000,_netdev)  

Tried also:

$ cat /etc/fstab | grep workspace  home_vagrant_workspace /home/vagrant/workspace vboxsf defaults,dev,exec,uid=1000,gid=1000 0 0    $ mount | grep workspace  home_vagrant_workspace on /home/vagrant/workspace type vboxsf (rw,nodev,relatime,iocharset=utf8,uid=1000,gid=1000)  

Guest:

$ uname -a  Linux vagrant 5.11.0-11-generic #12-Ubuntu SMP Mon Mar 1 19:26:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux    $ cat /etc/lsb-release   DISTRIB_ID=Ubuntu  DISTRIB_RELEASE=21.04  DISTRIB_CODENAME=hirsute  DISTRIB_DESCRIPTION="Ubuntu Hirsute Hippo (development branch)"  

Host: MacOS BigSur 11.3 (20E232)

Vagrant snippet:

    config.vm.box = properties["data"]["machine"]["box"] // bento/ubuntu-21.04      # Shared Folders Configuration      if (properties["data"].include? "shared_folders")          properties["data"]["shared_folders"].each do |folder, index|              config.vm.synced_folder folder["item"]["host"], folder["item"]["guest"], id: index, owner: "vagrant", group: "vagrant"          end      end  

Any suggestions how to deal with that?

How can I parallelize command sha256sum or other hashing commands?

Posted: 16 May 2021 07:42 AM PDT

I want to parallelize hash calculation process because I have a very large amount of file counts and sizes. When I see CPU usage of these commands, I get upset because they are only using one thread; how can I parallelize these?

sha256sum foo.mp4  OR  openssl -dgst sha256 foo.mp4  

Is it even possible to correct my LVM mistakes?

Posted: 16 May 2021 07:45 AM PDT

I have this Proxmox (PVE) installation on an old server and I wanted to swap the old drives in order to get more space. But first I wanted to move the PVE installation to an SSD. Simple enough.

Starting Point:

  • 1x76GB SATA (PVE Root LVM)
  • 2x500GB SATA (VG1 configured as RAID1 with mdadm - LVM Thinpool)

End Goal:

  • 1x120GB SSD (PVE Root LVM)
  • 2x500GB SATA (VG1 for a while longer)
  • 1x2000GB SATA* (in VG1 in order to pvmove all files to this drive from the old RAID)

*This drive is to be configured in an mdraid setup with another 2TB drive which is to be added at a later time (due to lack of cables and SATA ports).

I inserted the SSD and booted up a live USB with Linux, ran a dd command I found online to copy the old 76GB drive to the new (but used) 120GB SSD. This worked out ok, apart from the disk still showing 76GB in size.

So to fix this I'm not exactly sure what I did in hindsight. Looking at the history I believe I ran the following commands

echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan  parted -l   # At this point I got a few questions and I chose Fix and/or Ignore until it was finished  pvresize /dev/sda3  lvresize /dev/pve/data -l 100%FREE  

Now I thought I was done and started working with my next item on the list. This is where I met my late night brain Stu Pid.

I created the RAID with the one drive

mdadm --create /dev/md2 --level 1 --raid-devices 2 /dev/sdd missing   # Next, I forgot to RTFM..  mkfs.ext4 /dev/md2   # I actually aborted the above command Ctrl-C...   # Uhhhh. I create the Physical Volume and extended the VG  pvcreate /dev/md2  vgextend vg1 /dev/md2   # Next, I dunno  lvextend /dev/vg1/tpool /dev/md2  resize2fs /dev/mapper/vg1-tpool   # Again what? And now something from Youtube  /usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf  dpkg-reconfigure pve-kernel-`uname -r`    

From this point I, for some reason, ran parted -l again and resize2fs on the vg1-tpool. All I know is that I don't know what I'm doing at this point.

So to sum up, this is what I end up with (some info omitted for brevity):

root@host:~# lsblk  NAME                           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT  sda                              8:0    0 111.8G  0 disk  ├─sda1                           8:1    0  1007K  0 part  ├─sda2                           8:2    0   512M  0 part  └─sda3                           8:3    0 111.3G  0 part    ├─pve-swap                   253:0    0     8G  0 lvm   [SWAP]    ├─pve-root                   253:1    0  18.5G  0 lvm   /    ├─pve-data_tmeta             253:2    0     1G  0 lvm    │ └─pve-data-tpool           253:4    0  82.8G  0 lvm    │   ├─pve-data               253:5    0  82.8G  0 lvm    │   ├─pve-vm--102--disk--0   253:6    0    15G  0 lvm    │   └─pve-vm--103--disk--0   253:7    0     4G  0 lvm    └─pve-data_tdata             253:3    0  82.8G  0 lvm      └─pve-data-tpool           253:4    0  82.8G  0 lvm        ├─pve-data               253:5    0  82.8G  0 lvm        ├─pve-vm--102--disk--0   253:6    0    15G  0 lvm        └─pve-vm--103--disk--0   253:7    0     4G  0 lvm  sdb                              8:16   0 465.8G  0 disk  └─sdb1                           8:17   0 465.8G  0 part    └─md1                          9:1    0 465.7G  0 raid1      ├─vg1-tpool_tmeta          253:8    0   108M  0 lvm      │ └─vg1-tpool-tpool        253:10   0   2.3T  0 lvm      │   ├─vg1-tpool            253:11   0   2.3T  0 lvm      │   ├─vg1-vm--100--disk--0 253:12   0    32G  0 lvm      │   ├─vg1-vm--100--disk--1 253:13   0   350G  0 lvm      │   └─vg1-vm--101--disk--0 253:14   0    32G  0 lvm      └─vg1-tpool_tdata          253:9    0   2.3T  0 lvm        └─vg1-tpool-tpool        253:10   0   2.3T  0 lvm          ├─vg1-tpool            253:11   0   2.3T  0 lvm          ├─vg1-vm--100--disk--0 253:12   0    32G  0 lvm          ├─vg1-vm--100--disk--1 253:13   0   350G  0 lvm          └─vg1-vm--101--disk--0 253:14   0    32G  0 lvm  sdc                              8:32   0 465.8G  0 disk  └─sdc1                           8:33   0 465.8G  0 part    └─md1                          9:1    0 465.7G  0 raid1      ├─vg1-tpool_tmeta          253:8    0   108M  0 lvm      │ └─vg1-tpool-tpool        253:10   0   2.3T  0 lvm      │   ├─vg1-tpool            253:11   0   2.3T  0 lvm      │   ├─vg1-vm--100--disk--0 253:12   0    32G  0 lvm      │   ├─vg1-vm--100--disk--1 253:13   0   350G  0 lvm      │   └─vg1-vm--101--disk--0 253:14   0    32G  0 lvm      └─vg1-tpool_tdata          253:9    0   2.3T  0 lvm        └─vg1-tpool-tpool        253:10   0   2.3T  0 lvm          ├─vg1-tpool            253:11   0   2.3T  0 lvm          ├─vg1-vm--100--disk--0 253:12   0    32G  0 lvm          ├─vg1-vm--100--disk--1 253:13   0   350G  0 lvm          └─vg1-vm--101--disk--0 253:14   0    32G  0 lvm  sdd                              8:48   0   1.8T  0 disk  └─md2                            9:2    0   1.8T  0 raid1    └─vg1-tpool_tdata            253:9    0   2.3T  0 lvm      └─vg1-tpool-tpool          253:10   0   2.3T  0 lvm        ├─vg1-tpool              253:11   0   2.3T  0 lvm        ├─vg1-vm--100--disk--0   253:12   0    32G  0 lvm        ├─vg1-vm--100--disk--1   253:13   0   350G  0 lvm        └─vg1-vm--101--disk--0   253:14   0    32G  0 lvm    root@host:~# vgdisplay    --- Volume group ---    VG Name               pve    VG Access             read/write    VG Status             resizable    VG Size               <111.29 GiB    PE Size               4.00 MiB    Total PE              28489    Alloc PE / Size       28489 / <111.29 GiB    Free  PE / Size       0 / 0      --- Volume group ---    VG Name               vg1    VG Access             read/write    VG Status             resizable    VG Size               2.27 TiB    PE Size               4.00 MiB    Total PE              596101    Alloc PE / Size       596101 / 2.27 TiB    Free  PE / Size       0 / 0    root@host:~# lvdisplay vg1    --- Logical volume ---    LV Name                tpool    VG Name                vg1    LV Write Access        read/write    LV Creation host, time host, 2020-09-11 00:05:40 +0200    LV Pool metadata       tpool_tmeta    LV Pool data           tpool_tdata    LV Status              available    # open                 4    LV Size                2.27 TiB    Allocated pool data    15.16%    Allocated metadata     50.58%    Current LE             596047    Segments               1    Allocation             inherit    Read ahead sectors     auto    - currently set to     256    Block device           253:10    

From Proxmox environment

What are the actual mistakes and how could I fix them? It seems like I've somehow allocated all the extents on every VG, So now I can't really do anything! Again, Is it still possible to:

  • Get the "free space" back, whatever that means
  • Fix /dev/md2 so that I can pvmove from /dev/md1 properly

How do I remove a line containing text and then everything after that up until another token?

Posted: 16 May 2021 10:44 AM PDT

I'm using bash shell. I have a YAML file from which I want to remove certain blocks of text.

  /image-content:      post:        operationId: createEventPublic        summary: Process events        description: Process events        parameters: []        requestBody:          required: true          content:            application/json:              schema:                $ref: '#/components/schemas/Content'        responses:          '201':            description: Created            content:              application/json:                schema:                  $ref: '#/components/schemas/Content'    /text-content:      post:        operationId: createStaticText        summary: Process text events        description: Process text events        parameters: []        requestBody:      ...  

I would like to remove (as an example) the block of text where the path contains "image-content". Normally I can use this to remove a single line with that text

sed -i '/image-content/d' ./infile  

but I'm less clear how to replace every line after that up until the next line that begins with two spaces and a "/" (e.g. " /"). In the above, I would want to remove everything up until

  /text-content:  

Edit: Although this may not be valid openapi 3 swagger, I believe it is still a valid YAML file

openapi: 3.0.0  components:    /static/image-content:      post:        type: hello    /api/hello:      post:        type: hello    /static/css-content:      post:        type: hello  

Ultimately, I would like to remove the blocks beginning with "/static". So the ending doc would be

openapi: 3.0.0  components:    /api/hello:      post:        type: hello  

How to detect EOF on a BASH script's stdin?

Posted: 16 May 2021 07:46 AM PDT

I have a bash function inside a script that needs to read data from stdin in fixed size blocks and send those, one at a time, to external programs for further processing. The function itself should run in a loop for as long as there is data (the input is always guaranteed to be a whole number of blocks), but it doesn't otherwise need to interpret the data, so I'd like to have a way to detect EOF on the function's stdin without consuming data in case there is still some to process.

The apparently natural way to do this would be to use the read builtin, as in:

while read -r -n 0 ; do external_program ; done

The -n option to read tells it to read only at most those many bytes instead of up to newline, but unfortunately it doesn't work with 0 bytes, which would make it an ideal test for EOF. It does work with -n 1, but then it consumes the first byte of a block, which has to be 'replayed' into the stream going into the external program.

So, is there a better way, preferably using only bash builtins?

How to set up r8168-kms?

Posted: 16 May 2021 07:47 AM PDT

My OS:

uname -a  Linux debian 5.10.0-0.bpo.5-amd64 #1 SMP Debian 5.10.24-1~bpo10+1 (2021-03-29) x86_64 GNU/Linux  

Something is wrong with my r8168-dkms; every time I install some other package, this appears at the end of the output:

Setting up r8168-dkms (8.046.00-1) ...  Removing old r8168-8.046.00 DKMS files...    ------------------------------  Deleting module version: 8.046.00  completely from the DKMS tree.  ------------------------------  Done.  Loading new r8168-8.046.00 DKMS files...  Building for 5.10.0-0.bpo.5-amd64  Building initial module for 5.10.0-0.bpo.5-amd64  Error! Bad return status for module build on kernel: 5.10.0-0.bpo.5-amd64 (x86_64)  Consult /var/lib/dkms/r8168/8.046.00/build/make.log for more information.  dpkg: error processing package r8168-dkms (--configure):   installed r8168-dkms package post-installation script subprocess returned error exit status 10  Processing triggers for man-db (2.8.5-2) ...  Errors were encountered while processing:   r8168-dkms  E: Sub-process /usr/bin/dpkg returned an error code (1)  

How to fix the issue?

make error 127 /bin/sh: 1: /usr/bin/g++: not found using Ubuntu

Posted: 16 May 2021 07:40 AM PDT

I am trying to make a program (hisat2) from the source code through Ubuntu. When I do, I get an error 127 and it says the following:

/bin/sh: 1: /usr/bin/g++: not found  Makefile:273: recipe for target 'hisat2-build-s' failed  make: *** [hisat2-build-s] Error 127  

The folder with g++.exe is already added to path. I am a newbie so I was wondering if someone can guide me.

Retrieve both HTTP status code and content from curl in a shell script

Posted: 16 May 2021 08:10 AM PDT

I want a script to curl to a file and to put the status code into a variable (or, at least enable me to test the status code)

I can see I can do it in two calls with e.g.

url=https://www.gitignore.io/api/nonexistentlanguage  x=$(curl -sI $url | grep HTTP | grep -oe '\d\d\d')  if [[ $x != 200  ]] ; then    echo "$url SAID $x" ; return  fi  curl $url # etc ...  

but presumably there's a way to avoid the redundant extra call?

$? doesn't help: status code 404 still gets an return code of 0

How to check entire hard disk for errors and bad sectors

Posted: 16 May 2021 07:34 AM PDT

I may be misunderstanding some concepts here, but as far as I know, each disk has a partition table and actual partitions.

I'm looking to test a hard drive for bad sectors and errors, but the tools I found to do this are meant for partitions -- not disks. badblocks takes a partition /dev/sda1 not /dev/sda. Same story with e2fsck.

As far as I understand, those tools only test space assigned to partitions, not a whole disk. Is there any way to test an entire disk?

How to boot Kali Linux in GUI mode

Posted: 16 May 2021 08:37 AM PDT

I just installed Kali Linux MATE 2019.2 into VMware, and it boots in console mode.

Q: Is this the standard behavior of Kali or has something gone wrong in my setup?

I can start the GUI by typing startx and it works perfectly, but I'd prefer to boot directly into GUI.

Q: How can I reconfigure Kali Linux to start with the GUI before the logon?

This is not a duplicate of the various "why my distribution suddenly stopped to boot to GUI" questions:

  • This is a fresh install: even at the first boot it didn't boot to GUI (apart from the graphical installer).
  • I certainly don't want to just add startx to a user script. I want the GUI to start before the login, and get the graphical logon screen (i.e. the "display manager").

Use meta/super/windows/whatever key to open KDE Plasma's application launcher (KDE Plasma + i3)

Posted: 16 May 2021 08:01 AM PDT

I have a setup with KDE Plasma and i3 that I've been absolutely loving, except for the fact that the windows key no longer works to open Plasma's application launcher like it does with Kwin. I did some research and found out that normally Plasma handles it by assigning Alt+F1 to the launcher and then using ksuperkey to allow a single windows key press to emulate that action. However, ksuperkey depends on Kwin to work - and that's been replaced by i3. I haven't found another way to do this.

Also, I mostly followed this when setting everything up.

Delay systemd service if file exist

Posted: 16 May 2021 11:01 AM PDT

I want to delay the start of a service if a file exists (instead of fail the service if the file exist, as with ConditionPathExists=) but did not find anything in unit documentation

Is it technically possible with systemd ? How ?

How to install vbetool on 64bit Fedora

Posted: 16 May 2021 09:21 AM PDT

On Xubuntu I've used vbetool to turn off/on the display in my laptop, assigned to touchpad key because the display key didn't work. I now just installed Fedora 26 and want to use my script, but It seems that vbetool is not in the repository anymore. How can I install vbetool on Fedora 26?

I've tried to install from the source following this article How to install vbetool on CentOS 6.6? but got warnings when running make and got an error

make: *** No rule to make target '/usr/local/lib/libpci.a', needed by 'vbetool'.  Stop.  

Simultaneous wlan0 & wlan1 access points (via hostapd)

Posted: 16 May 2021 10:01 AM PDT

I am trying to set up 2 wireless access points from linux device (Debian Jessy). Both AP's should work simultaneously & share Internet connection (as shown below).

    _____       ___________       |   | eth0 |           | wlan0(AccessPoint 2.5G)       |box|-----< Eth       USB1>WLAN0_Stick <<<<<<  Smartphone      |___|      | Debian    |                  | Device    | wlan1(AccessPoint 5G)                 |          USB2>WLAN1_Stick <<<<<<  PC/Laptop                 |___________|  
My initial config (hostapd & dnsmasq) for single wlan0 (AccessPoint 2.5G)

/etc/hostapd.conf

    # Define interface      interface=wlan0      # Select driver      driver=nl80211      # Set access point name      ssid=AP-wifi-2G      # Set access point harware mode to 802.11g      hw_mode=g      # Set WIFI channel (can be easily changed)      channel=6      # Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)      wpa=2      wpa_passphrase=wifi123456  
/etc/dnsmasq.conf
    # Bind to only one interface      bind-interfaces      # Choose interface for binding      interface=wlan0      # Specify range of IP addresses for DHCP leasses      dhcp-range=192.168.150.2,192.168.150.10  
In order to initialize AP1 I use following bash-script

start.sh

    !/bin/bash      # Start      # Configure IP address for WLAN      sudo ifconfig wlan0 192.168.150.1      # Start DHCP/DNS server      sudo service dnsmasq restart      # Enable routing      sudo sysctl net.ipv4.ip_forward=1      # Enable NAT      sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE      # Run access point daemon      sudo hostapd /etc/hostapd.conf      # Stop      # Disable NAT      sudo iptables -D POSTROUTING -t nat -o eth0 -j MASQUERADE      # Disable routing      sudo sysctl net.ipv4.ip_forward=0      # Disable DHCP/DNS server      sudo service dnsmasq stop  

This config works fine for single AP (wlan0, AccessPoint 2.5G) I added the 2nd config /etc/hostapd_5G.conf for wlan1 similar as /etc/hostapd.conf & changed dnsmasq.conf & start.sh (wlan0->wlan1 for testing) - it also worked good in 5G.

But I need to run wlan0 AP & wlan1 AP simultaneously. I think I need to modify dnsmasq.conf for second interface. But I don't know how to do this.

Anyone please help with simultaneous configuration (wlan0 AP & wlan1 AP).

Sudo Broken But Need pkexec

Posted: 16 May 2021 07:41 AM PDT

So I'm having this problem where I can't use "sudo"

sudo: /etc/sudoers is world writable  sudo: no valid sudoers sources found, quitting  sudo: unable to initialize policy plugin  

I researched and my solution to solving this would be using this command

pkexec chmod 555 /etc/sudoers  

But apparently I don't have pkexec

-bash: pkexec: command not found  

And there isn't any google searches that would help me solve this problem now =[.

Anyone know why this is occuring

How do I find available versions of package for downgrade?

Posted: 16 May 2021 11:05 AM PDT

I am having issues with an update of the ImageMagick package breaking 3rd party software on a CentOS 6.x server. I know that some prior version of ImageMagick worked OK.

How do I find out which versions of ImageMagick are available to perform a yum downgrade operation ?

$> sudo yum downgrade ImageMagick-c++  Only Upgrade available on package: ImageMagick-c++-6.7.2.7-2.el6.i686  Nothing to do  

And, if I try the following, I get:

$> sudo yum --showduplicates list ImageMagick-c++ | expand  Installed Packages  ImageMagick-c++.i686                      6.7.2.7-2.el6                    @base    Available Packages  ImageMagick-c++.i686                      6.7.2.7-2.el6                    base   ImageMagick-c++.x86_64                    6.7.2.7-2.el6                    base   

ioctl: invalid argument for HDIO_GET_IDENTITY

Posted: 16 May 2021 09:00 AM PDT

I wrote a program to get the details of hard disk drive using HDIO_ ioctl calls.

For writing program, I'm referring Documentation/ioctl/hdio.txt in kernel source(2.6.32).

Here is my main part of code:

fd = open("/dev/sda", O_RDONLY);  // validated fd.  retval = ioctl(fd, HDIO_GET_IDENTITY, &driveid);  if(retval < 0) {              perror("ioctl(HDIO_GET_IDENTITY)");              exit(3);  }  

When I run(as root) the above code, I got below error:

ioctl(HDIO_GET_IDENTITY): Invalid argument  

What is the wrong in the program? Why I'm getting error?

Additional Info: OS: CentOS-6.5, kernel version: 2.6.32, IA:x86_64 (running on VMware).

Result of hdparm -i /dev/sda is

SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  HDIO_GET_IDENTITY failed: Invalid argument  

How to start tmux with attach if a session exists

Posted: 16 May 2021 08:37 AM PDT

If I use

tmux attach  

I can attach to a running session but if there is no session running, I only get the error

no sessions  

How can I automatically start a new session if there is none running? something like

tmux attach-or-create-new-session  

No comments:

Post a Comment