Friday, March 18, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Windows host can ping VM but VM cannot ping Windows

Posted: 18 Mar 2022 07:35 AM PDT

I have NAT set for VM. I set a static IP on VM to be on the same network as host's IP.

I can ping the VM from the host, but not the other way around. Here is ifconfig for the VM.

I am running Kali Linux Debian.

ifconfig unreachable vmip

journalctl --user -u myservice "No journal files were found", for sss user

Posted: 18 Mar 2022 07:33 AM PDT

Problem:

systemd user units journalctl output display "No journal files were found." This only happens for the one sss user I am testing with, all local users seem to work fine. Exact command and output:

$journalctl --user -u myservice  No journal files were found.  

Troubleshooting:

I already read these posts and tried troubleshooting found within each:

I have tried the following:

  • Rebooting.
  • Redeploying the host OS.
  • Tried creating a local user to test with.
  • Made sure to login to all newly created local user account I am working with directly with SSH or terminal initially before continuing testing. Also tested sshing to the sss user account in question which I am able to.
  • Restarting journalctl services (systmectl restart systemd-journald.service)
  • Made sure /etc/systemd/journald.conf Storage=persistent. But also tried auto, and volatile, no change with any.
  • added export XDG_RUNTIME_DIR=/run/user/$(id -u) in ~/.bashrc for the local user and the user in question. Then sourced the file.
  • Confirmed linger is enabled.
  • Noticed that this problem is only happening one specific user on the box. Created new users, and this problem does not happen.
  • User account in question has a different uid from the gid/groups. However I tested adjusting a newly created account with a different uid from its gid/groups, adjusted the ~/.bashrc for the new uid, rebooted, and that account works showing the correct journalctl output.
  • User account in question appears to be an sss user.
  • Confirmed the user's d-bus channel is running with ps, I see the user is running /usr/lib/systemd/systemd --user
  • I am able to run other systmectl --user commands as the user in question. I can check status, start, stop, restart the user service.
  • When I run journalctl --user, here is the output:
    $ journalctl --user  No journal files were found.  -- No entries --  
  • When I run journalctl --user --verify, here is the output:
    $ journalctl --user --verify  No journal files were found.  
  • I did all the above on another box where the sss user is also built, problem follows the user account.

This problem appears to only happen for the user I am testing with which was built with sss. I am not able to remove or rebuild this user as I do not manage sss on this system. I do have root access to the box but do not feel comfortable restarting sssd service either. I am not sure how to start troubleshoot this issue either. I have not found much posts or documentation about sssd service problems with systemctl or journalctl.

Why does the sss user's journalctl --user output not appear but local user's do? What am I missing here? Not sure how else to troubleshoot this issue, any recommendations?

RHEL8 repo does not have python-sphinx package

Posted: 18 Mar 2022 07:30 AM PDT

Can't seem to find python-sphinx packages on freshly installed RHEL8. Previously on CentOS-7 there was an easy way to yum install python-sphinx. Should I be add another repo containing sphinx packages? I'm interested in python3-sphinx and python3-sphinx_rtd_theme (this are their names in CentOS-7)

Trying to loop values into curl command from a file

Posted: 18 Mar 2022 07:43 AM PDT

I am not even sure if this is possible or not. I am trying to create a loop where i can curl with different values from a file.

for i in `cat id`;  do curl -X POST 'https:/myurl \  --header 'X-XX-Authorization: XX' \  --header 'Content-Type: application/x-www-form-urlencoded' \  --header 'ACS-Licensing-Ack: XXXX' \  --header 'Authorization: Bearer XXXXX' \  --data-urlencode 'XXID=`find * -name $i`'  done  

I get a response

{"code":"400-bad-request","message":"XX app with ID `find * -name $i` not found"}  

How do i put in the value from $i that i captured earlier into this --data-urlencode field? My id file is very simple, it contains a few numbers like below. 1234 23232 32323 any help is highly appreciated. Thanks.

This is my id file. It is basically a list of numbers

1761  1762  1763  1764  1765  

So my ultimate aim is to go in a loop where the first curl request will go --data-urlencode 'XXID=1761' second request will go --data-urlencode 'XXID=1762', third goes --data-urlencode 'XXID=1763' etc

laptop second hdd in caddy does not show in bios but shows up after ubuntu boots

Posted: 18 Mar 2022 07:02 AM PDT

I want to dual boot ubuntu (primary ssd) with Fedora (caddy hdd). Couple of observations:

  1. caddy with hdd does not show in bios
  2. ls on grub command line shows only primary ssd
  3. when ubuntu boots second hdd is detected and shown in file system. I can also see it in Disks and Gparted
  4. If I reinsert original dvd drive, it is properly detected in bios
  5. I ran update-grub2and here it detected Fedora installation and added as an entry in grub menu list which I can see at boot also. Selecting the Fedora entry gives an error saying the hard drive is not present

I saw posts on stackexchange and changed bios settings to disable secure boot. Changed boot to Legacy mode, boot priority is Legacy First, reset settings to default. None of these detected the hdd.

Fedora installation was done on this same laptop.

My laptop is Lenovo - ideapad 110 - 15ISK

I want to know if the problem of not detecting caddy hdd is bios related or the caddy is faulty. Could the community assist me here?

How to get the PID of a program executed in a bash script with remote linux

Posted: 18 Mar 2022 07:02 AM PDT

I'm on a Mac computer accessing by ssh a linux machine to run simulations. I'm currently running multiple commands in parallel (I put them in background with &), when they finish I extract the files of interest then delete all commands output and redo it.

I wondered if it was possible to check using the PID if those tasks are finished in order to automatically extract the wanted files and launch one more time the exact same command. I'm posting a message here to know to get the PID of a command which is executed through a ssh -c, that is not done by me (as I'm in remote linux).

I tried the solutions shown in how-to-get-pid-of-just-started-process in order to get the PID, but neither $! nor ssh -c nor jobs -p give me the correct PID. I'm wondering if it doesn't work because I'm on remote access (the command appearing in htop is a ssh -c ...) or I'm just doing things poorly.

Here is my first bash script :

#!/bin/bash    ./createFiles.sh $1 # create the needed $1 folders    for i in $(seq 1 $1)  do      cd $i      myCommand &      cd ..  done  

When this one is finished I use :

#!/bin/bash    for i in $(seq 1 $1)  do      cd $i      cp output/file.txt ../file_$2_$i.txt # $2 is the number of the run      cd ..  done    ./deleteFiles.sh $2 # delete the needed $1 folders to start anew  

And then I loop 5 times those two. And I wanted to know if it's possible to loop automatically 5 times and not having me standing in front of my computer.

If any of you have any idea, it would be great :)

P.S: I hope it was clear, english is not my native language hihi

Ping on LL IPc4 works only few times

Posted: 18 Mar 2022 06:50 AM PDT

I came across a problem that I don't comprehend. Would someone be so kind to help me understand?

I have Linux embedded devices and PC on the same link. The embedded devices have avahi-daemon and avahi-autoip to get the LL IPv4 address and advertise by mDNS. They also have a global IP address on the same interface.

Device #1:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1      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      inet6 ::1/128 scope host          valid_lft forever preferred_lft forever  2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000      link/ether 00:05:4b:05:83:21 brd ff:ff:ff:ff:ff:ff      inet 169.254.4.92/16 brd 169.254.255.255 scope link eth0:avahi         valid_lft forever preferred_lft forever      inet 192.168.1.12/24 brd 192.168.1.255 scope global eth0         valid_lft forever preferred_lft forever      inet6 fe80::205:4bff:fe05:8321/64 scope link          valid_lft forever preferred_lft forever  

Device #2:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1      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      inet6 ::1/128 scope host          valid_lft forever preferred_lft forever  2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000      link/ether 00:05:4b:06:40:b9 brd ff:ff:ff:ff:ff:ff      inet 169.254.6.75/16 brd 169.254.255.255 scope link eth0:avahi         valid_lft forever preferred_lft forever      inet 192.168.1.107/24 brd 192.168.1.255 scope global eth0         valid_lft forever preferred_lft forever      inet6 fe80::205:4bff:fe06:40b9/64 scope link          valid_lft forever preferred_lft forever  

The PC has a routable IP address in the same segment as the devices (but even if these are from different segments, it is doing the same).

PC:

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      inet6 ::1/128 scope host          valid_lft forever preferred_lft forever  3: enx28ee521606d2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000      link/ether 28:ee:52:16:06:d2 brd ff:ff:ff:ff:ff:ff      inet 192.168.1.100/24 brd 192.168.1.255 scope global noprefixroute enx28ee521606d2         valid_lft forever preferred_lft forever      inet6 fe80::f7b3:e715:e9a9:a20f/64 scope link noprefixroute          valid_lft forever preferred_lft forever  

I can ping the devices using their LL addresses between each other with no limits.

But if I try to ping the device from PC, using the LL address, it normally passes 8-10 packets, until I start to get 'Destination Host Unreachable'. This applies for both devices and doesn't work until next reboot. Then it again gets another 8 packets.

Ping device#1 from device#2 - no problem

device#2:~$ ping 169.254.4.92  PING 169.254.4.92 (169.254.4.92): 56 data bytes  64 bytes from 169.254.4.92: seq=0 ttl=64 time=4.617 ms  64 bytes from 169.254.4.92: seq=1 ttl=64 time=2.310 ms  64 bytes from 169.254.4.92: seq=2 ttl=64 time=2.269 ms  64 bytes from 169.254.4.92: seq=3 ttl=64 time=2.255 ms  64 bytes from 169.254.4.92: seq=4 ttl=64 time=2.250 ms  64 bytes from 169.254.4.92: seq=5 ttl=64 time=2.285 ms  64 bytes from 169.254.4.92: seq=6 ttl=64 time=2.285 ms  64 bytes from 169.254.4.92: seq=7 ttl=64 time=2.254 ms  64 bytes from 169.254.4.92: seq=8 ttl=64 time=2.246 ms  64 bytes from 169.254.4.92: seq=9 ttl=64 time=4.063 ms  64 bytes from 169.254.4.92: seq=10 ttl=64 time=2.247 ms  64 bytes from 169.254.4.92: seq=11 ttl=64 time=2.296 ms  64 bytes from 169.254.4.92: seq=12 ttl=64 time=2.276 ms  64 bytes from 169.254.4.92: seq=13 ttl=64 time=2.243 ms  64 bytes from 169.254.4.92: seq=14 ttl=64 time=2.239 ms  64 bytes from 169.254.4.92: seq=15 ttl=64 time=2.247 ms  64 bytes from 169.254.4.92: seq=16 ttl=64 time=2.238 ms  64 bytes from 169.254.4.92: seq=17 ttl=64 time=2.281 ms  64 bytes from 169.254.4.92: seq=18 ttl=64 time=2.277 ms  64 bytes from 169.254.4.92: seq=19 ttl=64 time=2.274 ms  64 bytes from 169.254.4.92: seq=20 ttl=64 time=2.283 ms    

Ping device#2 from device#1 - no problem

device#1:~$ ping 169.254.6.75  PING 169.254.6.75 (169.254.6.75): 56 data bytes  64 bytes from 169.254.6.75: seq=0 ttl=64 time=2.293 ms  64 bytes from 169.254.6.75: seq=1 ttl=64 time=2.270 ms  64 bytes from 169.254.6.75: seq=2 ttl=64 time=2.302 ms  64 bytes from 169.254.6.75: seq=3 ttl=64 time=2.261 ms  64 bytes from 169.254.6.75: seq=4 ttl=64 time=5.611 ms  64 bytes from 169.254.6.75: seq=5 ttl=64 time=2.246 ms  64 bytes from 169.254.6.75: seq=6 ttl=64 time=2.257 ms  64 bytes from 169.254.6.75: seq=7 ttl=64 time=2.245 ms  64 bytes from 169.254.6.75: seq=8 ttl=64 time=2.666 ms  64 bytes from 169.254.6.75: seq=9 ttl=64 time=2.262 ms  64 bytes from 169.254.6.75: seq=10 ttl=64 time=2.247 ms  64 bytes from 169.254.6.75: seq=11 ttl=64 time=2.663 ms  64 bytes from 169.254.6.75: seq=12 ttl=64 time=2.239 ms  64 bytes from 169.254.6.75: seq=13 ttl=64 time=2.238 ms  64 bytes from 169.254.6.75: seq=14 ttl=64 time=2.297 ms  64 bytes from 169.254.6.75: seq=15 ttl=64 time=2.256 ms  64 bytes from 169.254.6.75: seq=16 ttl=64 time=2.243 ms  64 bytes from 169.254.6.75: seq=17 ttl=64 time=2.239 ms  64 bytes from 169.254.6.75: seq=18 ttl=64 time=2.233 ms    

After each boot of the device, pinging from PC to device passes just 8-10 times.

ping 169.254.6.75  PINK 169.254.6.75 (169.254.6.75) 56(84) bytes of data.  From 192.168.1.100 seq=0 Destination Host Unreachable  From 192.168.1.100 seq=2 Destination Host Unreachable  ... - here somewhere the device has booted ...  64 bytes od 169.254.6.75: seq=26 TTL=64 time=3,84 ms  64 bytes od 169.254.6.75: seq=27 TTL=64 time=2,58 ms  64 bytes od 169.254.6.75: seq=28 TTL=64 time=2,13 ms  64 bytes od 169.254.6.75: seq=29 TTL=64 time=1,71 ms  64 bytes od 169.254.6.75: seq=30 TTL=64 time=2,38 ms  64 bytes od 169.254.6.75: seq=31 TTL=64 time=2,92 ms  64 bytes od 169.254.6.75: seq=32 TTL=64 time=2,22 ms  64 bytes od 169.254.6.75: seq=33 TTL=64 time=1,67 ms  ...  From now on it is unreachable for ping until next reboot ...  From 192.168.1.100 seq=34 Destination Host Unreachable  From 192.168.1.100 seq=35 Destination Host Unreachable  From 192.168.1.100 seq=36 Destination Host Unreachable  From 192.168.1.100 seq=37 Destination Host Unreachable  From 192.168.1.100 seq=38 Destination Host Unreachable  

But for example HTTP requests are passing. I can access the web server on the device using the LL address anytime, even when ping cannot access the device.

It also doesn't matter how long I wait after boot with the ping. It always passes 8-10 times.

I can live with having just the HTTP access. But ping also used to work just fine yesterday. Today, suddenly (maybe an OS update came) it stopped working. Is there any explanation to why ping will not work, while http, requests do, so TCP/IP connection can be established?

Thank you for any thoughts.

How to run zgrep with multiple AND patterns?

Posted: 18 Mar 2022 07:01 AM PDT

I know how to do it with grep, but the command doesn't work with zgrep

grep -E 'Pattern1.*Patter2' fileName  

I'm using zgrep to match patterns inside a .json.gz file.
Because the files are too big, I want to zgrep BOTH pattern1 AND pattern2, the order doesn't matter.

Possible to achieve?

Strange behavior "find command" while using +mtime , +mmin options

Posted: 18 Mar 2022 06:37 AM PDT

I have one production server. On that I have 1 directory for particular object, which will keep piling up the files after it gathered from different network nodes. So it have the files in subdirectories from May-2021 . It generally creates hourly subdirectories for a day and pushed the files into those subdirectories. Subdirectory structure -

enter image description here

I have used the following command find . -type f -ctime +2 | xargs ls -ltr to list out the files which are 2 days older to get them deleted.

but when I ran the command to check I found that they are sorted in unexpected way.

enter image description here

As you can see above, ideally it should short 10-03 files then 11-03 ,but its doing exactly opposite. Another thing is it also listing the current day file(18-03). So can someone shade some light on it?

Please note that directory size is 11G . And files generally be keep piling up in every minute ,so does it has any effect on this ?

Distro - Red Hat Enterprise Linux Server release 7.6 (Maipo)

How to extract the first backup id from a shell output to a variable?

Posted: 18 Mar 2022 06:59 AM PDT

[user@laptop ~]$ cf adbr list-backups database  Getting backups of database  Backup ID                                         Time of Backup  bbf4277f-889a-4a9a-9274-683ed6e1553c_1647592205   Fri Mar 18 08:30:05 UTC 2022  bbf4277f-889a-4a9a-9274-683ed6e1553c_1647563402   Fri Mar 18 00:30:02 UTC 2022  bbf4277f-889a-4a9a-9274-683ed6e1553c_1647534606   Thu Mar 17 16:30:06 UTC 2022  bbf4277f-889a-4a9a-9274-683ed6e1553c_1647505803   Thu Mar 17 08:30:03 UTC 2022  bbf4277f-889a-4a9a-9274-683ed6e1553c_1647477003   Thu Mar 17 00:30:03 UTC 2022  

I would like to get a variable named BACKUP_ID set to bbf4277f-889a-4a9a-9274-683ed6e1553c_1647592205.

How to do this?

I've managed to get the following to arrive at the correct line:

cf adbr list-backups database-pre-prod | sed -n '/Backup ID/{n;p}'  

but I'm not sure how to get the id out of it into a variable.

Thanks!

Pipewire: autoconnect all audio sources to jack sink (instead of manually doing it with Helvum)

Posted: 18 Mar 2022 06:26 AM PDT

I'm trying to play VR games on my Oculus Quest 2 via Air Link. This is done using a free source code software called ALVR. I was able to connect by headset to this software with no much problems at all, except the audio part.

After some effort, I was able to make it run using a virtual sink created by ALVR with Pipewire. The problem is that this virtual sink is only created when the headset is placed on my head, and it is destroyed when I remove the headset from it. This causes that every time it is destroyed, all audio sources (Steam, Beat Saber, and so on) disconnects from this sink, so when I place again the headset I have to manually reconnect them using the program Helvum. I attached a screenshot of the Helvum program when the headset is connected (audio sink is alsa-jack.jackC.11829). As you can see, 'Beat Saber.exe' isn't connected automatically when the sink is created.

Headset connected (audio sink is alsa-jack.jackC.11829)

X Fails to start. Fedora 35

Posted: 18 Mar 2022 06:23 AM PDT

I have upgraded to fedora 35. When i run start x it fails. I am not sure where to start.

Here is the log.

https://pastebin.com/bKE0pBGy

I dont have a video card. Uses intel graphics.

There is this line in log:

1222.760] (EE) AIGLX error: dlopen of /usr/lib64/dri/swrast_dri.so failed (/usr/lib64/dri/swrast_dri.so: undefined symbol: _ZN4llvm19RTDyldMemoryManager16getSymbolAddressERKSs

How to monitor systemd timers and path-invoked systemd processes

Posted: 18 Mar 2022 06:19 AM PDT

We used to use cron and switched to systemd timers for a number of scheduled tasks on our machines. With cron, the solution wasn't perfect, but when things broke, we sent emails to a mailing list and when it got bad enough, we had to do something to stop the bleeding.

With systemd, everything just seems to fail silently. We've got a snmp based monitoring solution, but it has no built in support for monitoring systemd timers. What I'd like to know is, what solutions are there for an off-box Linux monitoring appliance to monitor the status of systemd timers?

How to copy shared library into initrd?

Posted: 18 Mar 2022 06:04 AM PDT

My initrd cannot convert text file from UTF-16 to UTF-8 by "iconv" and it seems to be caused by there is no the folder "/main/lib/x86_64-linux-gnu/gconv/" and the file "/main/lib/x86_64-linux-gnu/gconv/UTF-16.so" in initrd.

I only know copy_exec in mkinitramfs for copying binary, but how to copy shared library(.so) into initrd?

SSH Forwarding between client and two servers

Posted: 18 Mar 2022 06:15 AM PDT

I'm trying to figure out how to set up a shh tunnel between client and two servers. I need client to connect to ServerB via ServerA.

These are the facts:

  • Client can connect to ServerA (via public IP).
  • Client cannot connect to ServerB.
  • ServerA cannot connect to ServerB. (Server is remotely separated from ServerA and behind NAT).
  • ServerB can connect to ServerA (via public IP).
  • Neither ServerA or ServerB can connect to host. (Client does not have a public IP).

What would be the ssh command(s) to set it up exactly?

awk print does not work in bash -c

Posted: 18 Mar 2022 06:43 AM PDT

I noticed that this works fine (will print only the PID of unattended-upgrades process):

lslocks | awk '/unattended-upgrades/ { print $2 }'  

But this effectively ignores the print part (will print the entire line):

bash -c "lslocks | awk '/unattended-upgrades/ { print $2 }'"  

This is an Ubuntu 18.04 and Bash version 4.4.20.

What is spacial about bash -c that causes this?

/usr/bin/startx : has anyone ever fullfilled the urgency ? How?

Posted: 18 Mar 2022 06:43 AM PDT

I, as I can believe anyone around, have been firing /usr/bin/startx for decades experiencing nothing but 100% satisfaction for the job it serves.

If it works… don't fix it !

The author of the script is however explicit :

Site administrators are STRONGLY urged to write nicer versions.

I am left just curious :

  • Does anyone know what historical reasons compelled the author to write such strong statement ?
  • Has anyone ever written any "nicer version", how and what for ?

Nota : I see a number of requests to close this question for the reason it would trigger opinion based answers.
I understand how the "nicer" qualifier could suggest taste judgements but I just can't imagine the author "STRONGLY urging" administrators to commit aesthetic changes.

Just lots of things are opened to changes in that script, from forcing client / server arguments, honoring / ignoring users .*rc to even incidentally forking whatever else than /usr/bin/xinit.

All these fiddlings + many more I don't even imagine particularly in the field of security, would certainly depend on perfectly reasonable motives and fit the purpose of special use cases. This is exactly what this question is about.

Where is the official documentation for /etc/fstab?

Posted: 18 Mar 2022 07:21 AM PDT

I want to start editing my /etc/fstab file more comfortably and not rely on random forums anymore. But wherever I go, I see very scarce info about it. I can nowhere find a webpage that, for example, explains all of the options available. So, who owns the fstab file, what program uses it, and where can I find the official documentation for it from its creator?

Specifically, I want to understand the difference between none, mem and tmpfs devices (the first field). I know, I can probably google it and eventually find the answer, but as I said, I don't want to do it anymore, I want to go full-geek mode and read from the official resources.

EDIT: Quick answer: The difference should be only in the string (the name) and should only matter to systemd that reads the file when mounting filesystems.

Delete three lines in specific step

Posted: 18 Mar 2022 07:32 AM PDT

I have data like that (this is only a small part):

  454SOL     OW20704   0.317   0.251   5.525    454SOL    HW120705   0.388   0.322   5.531    454SOL    HW220706   0.229   0.290   5.553    462SOL     OW20728   0.130   1.821   5.295    462SOL    HW120729   0.120   1.806   5.394    462SOL    HW220730   0.044   1.857   5.259    469SOL     OW20749   0.461   1.266   5.451    469SOL    HW120750   0.411   1.267   5.365    469SOL    HW220751   0.398   1.248   5.527    500SOL     OW20842   1.754   1.223   5.312    500SOL    HW120843   1.845   1.184   5.299    500SOL    HW220844   1.762   1.319   5.336    502SOL     OW20848   1.592   1.629   5.349    502SOL    HW120849   1.619   1.663   5.259    502SOL    HW220850   1.671   1.591   5.395    515SOL     OW20887   1.587   0.779   5.394    515SOL    HW120888   1.495   0.817   5.389    515SOL    HW220889   1.647   0.826   5.329    516SOL     OW20890   1.013   0.105   5.494    516SOL    HW120891   1.019   0.190   5.442    516SOL    HW220892   1.045   0.029   5.437    522SOL     OW20908   1.728   0.935   5.578    522SOL    HW120909   1.682   0.928   5.489    522SOL    HW220910   1.666   0.979   5.644  

I want to delete three lines, the next 9 lines leave alone, and then again delete 3 lines. In this case, I want to delete lines 10,11,12 and 22,23,24. Expected output

  454SOL     OW20704   0.317   0.251   5.525    454SOL    HW120705   0.388   0.322   5.531    454SOL    HW220706   0.229   0.290   5.553    462SOL     OW20728   0.130   1.821   5.295    462SOL    HW120729   0.120   1.806   5.394    462SOL    HW220730   0.044   1.857   5.259    469SOL     OW20749   0.461   1.266   5.451    469SOL    HW120750   0.411   1.267   5.365    469SOL    HW220751   0.398   1.248   5.527    502SOL     OW20848   1.592   1.629   5.349    502SOL    HW120849   1.619   1.663   5.259    502SOL    HW220850   1.671   1.591   5.395    515SOL     OW20887   1.587   0.779   5.394    515SOL    HW120888   1.495   0.817   5.389    515SOL    HW220889   1.647   0.826   5.329    516SOL     OW20890   1.013   0.105   5.494    516SOL    HW120891   1.019   0.190   5.442    516SOL    HW220892   1.045   0.029   5.437  

I tried this:

#!/bin/bash   awk 'NR%10==0 || NR%11==0 || NR%12==0' sol.txt | tee sol_after.txt   

and it doesn't work.

I need to dele lines on the whole file, so delete 10-13, then 22-24, then 34-36, 46-48, etc

How to send systemd Start - Stop - Reload syslog messages to a file

Posted: 18 Mar 2022 06:07 AM PDT

I'd like to send Start/Stop/Reload systemd messages to a specific file. Specifically, mysqld doesn't seem to send daemon start/stop messages to the log-error file, so I'd like to have... something in the log indicating success/failure.

I'm at a point now where I'm messing around with ExecStartPost and ExecStopPost, but there has to be a better way. Inspiration here.

no public key on debian 11 unable to apt update

Posted: 18 Mar 2022 06:54 AM PDT

I've tried all methods published in older questions, such as adding from ubuntu.keyserver, using gpg, from hkp://pool.sks-keyservers.net:80 etc, any ideas ¿?

gpg:

gpg --recv-keys 0E61D3BBAAEE37FE  gpg: recepción del servidor de claves fallida: No data  

ubuntu keyserver:

Executing: /tmp/apt-key-gpghome.zPtWaE6tzD/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 0E61D3BBAAEE37FE  gpg: recepción del servidor de claves fallida: No data  

pool.sks-keyserver:

sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys 0E61D3BBAAEE37FE  Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).  Executing: /tmp/apt-key-gpghome.qLLaSgFMSM/gpg.1.sh --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys 0E61D3BBAAEE37FE  gpg: recepción del servidor de claves fallida: Server indicated a failure  

Edit:

List of servers that are apparently down, looking for useful ones in answers box.

https://keyserver.ubuntu.com Ubuntu Keyserver https://pgp.mit.edu MIT https://keys.openpgp.org OpenPGP hkp://pool.sks-keyservers.net:80 sus Keyserver

Intel wireless interface not showing up debian 11

Posted: 18 Mar 2022 06:00 AM PDT

I have a Galaxy Book Pro 360 with the onboard intel wifi 6e ax210 chip.

I installed a fresh dualboot net-install of debian via ethernet.

Now i want to use it with wifi but no success...

Here are some informations about my system:

lspci -kv:

...  2d:00.0 Network controller: Intel Corporation Device 2725 (rev 1a)      Subsystem: Intel Corporation Device 0024      Flags: bus master, fast devsel, latency 0, IRQ 18, IOMMU group 14      Memory at 82300000 (64-bit, non-prefetchable) [size=16K]      Capabilities: [c8] Power Management version 3      Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+      Capabilities: [40] Express Endpoint, MSI 00      Capabilities: [80] MSI-X: Enable+ Count=16 Masked-      Capabilities: [100] Advanced Error Reporting      Capabilities: [14c] Latency Tolerance Reporting      Capabilities: [154] L1 PM Substates      Kernel driver in use: iwlwifi      Kernel modules: iwlwifi  

it doesn't show up in rfkill list

iw list is empty

ip a returns:

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      inet6 ::1/128 scope host          valid_lft forever preferred_lft forever  2: enx4865ee1805b1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000  ...  
root@debian:~# iwconfig  lo        no wireless extensions.    enx4865ee1805b1  no wireless extensions.    

modprobe iwlwifi returns also nothing

and last but not least dmesg | grep iwl spits out these errors:

root@debian:~# dmesg | grep iwl  [   54.589514] iwlwifi 0000:2d:00.0: firmware: direct-loading firmware iwlwifi-ty-a0-gf-a0-59.ucode  [   54.589519] iwlwifi 0000:2d:00.0: api flags index 2 larger than supported by driver  [   54.589527] iwlwifi 0000:2d:00.0: TLV_FW_FSEQ_VERSION: FSEQ Version: 93.8.63.28  [   54.589754] iwlwifi 0000:2d:00.0: loaded firmware version 59.601f3a66.0 ty-a0-gf-a0-59.ucode op_mode iwlmvm  [   54.589760] iwlwifi 0000:2d:00.0: firmware: failed to load iwl-debug-yoyo.bin (-2)  [   54.598220] iwlwifi 0000:2d:00.0: Detected Intel(R) Wi-Fi 6 AX210 160MHz, REV=0x420  [   54.775103] iwlwifi 0000:2d:00.0: firmware: direct-loading firmware iwlwifi-ty-a0-gf-a0.pnvm  [   54.775122] iwlwifi 0000:2d:00.0: loaded PNVM version 0x324cd670  [   55.025425] iwlwifi 0000:2d:00.0: Timeout waiting for PNVM load!  [   55.025435] iwlwifi 0000:2d:00.0: Failed to start RT ucode: -110  [   55.025443] iwlwifi 0000:2d:00.0: iwl_trans_send_cmd bad state = 0  [   55.037571] iwlwifi 0000:2d:00.0: Failed to run INIT ucode: -110  

Also disabling fast startup in windows 11 dual boot didn't change anything: Windows Dual Boot wifi problems

Curl Hangs on Particular Website on Ubuntu 16.04 but not 18.04 Even with Updated Version

Posted: 18 Mar 2022 06:16 AM PDT

Can anyone tell me why or how to diagnose why the following curl command hangs:

curl 'https://www.nasdaq.com/' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1'  

When run with a -v option this is the output (hangs on "old SSL session..."):

*   Trying 104.81.179.248:443...  * Connected to www.nasdaq.com (104.81.179.248) port 443 (#0)  * ALPN, offering http/1.1  * successfully set certificate verify locations:  *   CAfile: /home/ubuntu/anaconda2/ssl/cacert.pem    CApath: none  * TLSv1.3 (OUT), TLS handshake, Client hello (1):  * TLSv1.3 (IN), TLS handshake, Server hello (2):  * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):  * TLSv1.3 (IN), TLS handshake, Certificate (11):  * TLSv1.3 (IN), TLS handshake, CERT verify (15):  * TLSv1.3 (IN), TLS handshake, Finished (20):  * TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):  * TLSv1.3 (OUT), TLS handshake, Finished (20):  * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384  * ALPN, server accepted to use http/1.1  * Server certificate:  *  subject: C=US; ST=Connecticut; L=Shelton; O=NASDAQ, INC.; CN=www.nasdaq.com  *  start date: Jun 15 00:00:00 2020 GMT  *  expire date: Oct 20 12:00:00 2020 GMT  *  subjectAltName: host "www.nasdaq.com" matched cert's "www.nasdaq.com"  *  issuer: C=US; O=DigiCert Inc; CN=DigiCert SHA2 Secure Server CA  *  SSL certificate verify ok.  > GET / HTTP/1.1  > Host: www.nasdaq.com  > Accept-Encoding: deflate, gzip  > User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0  > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8  > Accept-Language: en-US,en;q=0.5  > DNT: 1  > Connection: keep-alive  > Upgrade-Insecure-Requests: 1  >   * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):  * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):  * old SSL session ID is stale, removing  

Creating new AWS Ubuntu server 16.04 and 18.04 Amazon AMI instances and running the curl command hangs on 16.04 but not 18.04. On a different system running 14.04 I used Conda to update curl and openssl to a newer version than on the 18.04 system and it hangs despite the newer version.

Here is the output from running curl --version on the 14.04 system:

curl 7.71.1 (x86_64-conda_cos6-linux-gnu) libcurl/7.71.1 OpenSSL/1.1.1g zlib/1.2.11 libssh2/1.9.0  Release-Date: 2020-07-01  Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp   Features: AsynchDNS GSS-API HTTPS-proxy IPv6 Kerberos Largefile libz NTLM NTLM_WB SPNEGO SSL TLS-SRP UnixSockets  

Here is the same thing run on the Ubuntu 18.04 AWS instance that works:

curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3  Release-Date: 2018-01-24  Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp   Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL   

Here's the same thing on another 18.04 system that uses Conda's curl and works correctly:

curl 7.63.0 (x86_64-conda_cos6-linux-gnu) libcurl/7.63.0 OpenSSL/1.1.1g zlib/1.2.11 libssh2/1.8.0  Release-Date: 2018-12-12  Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp   Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy  

I notice the two working systems have HTTPS-proxy listed as a feature, while the non-working one does not. Could that be the problem?

LDAP server setup with GUI on CentOS7

Posted: 18 Mar 2022 06:03 AM PDT

I have, in the past, set up an LDAP server using OpenSuSE (13.2), which worked well since there was a YaST module which allowed a GUI set-up.

Now I have the problem that I must set up an OpenLDAP server on a small department cluster running CentOS 7, which apparently does not have a GUI/TUI for such purposes. Since I am not experienced with the LDIF-based set-up and I fully expect that the maintenance of the cluster is going to be dropped on a different PhD student when I'm gone I want to be able to configure the LDAP server using some sort of GUI.

To date I have tried Webmin, which was a total fiasco. It appears to set up the basic configuration of the server OK (at least slapd starts), but If I try to run any query against the DB the response is Search failed: No such object, even for the base DN.

If I attempt to add a tree (i.e. an organisational unit) using said interface the result is an error stating that Webmin could not find a suitable object class for the new DN. Therefore I'm giving up on this piece of software.

My question is thus: Is there a free tool which would allow one to configure an LDAP server in CentOS without having to write the entire configuration by hand?

Here I am looking specifically for tools which are not web-based (so not phpLDAPadmin) but come with a GUI/TUI. Something like authconfig-gtk in CentOS.

Hibernate not working on MacBook Pro with Debian

Posted: 18 Mar 2022 07:07 AM PDT

I've installed Debian testing/stretch on a brand new Macbook Pro 13" (early 2015), but hibernation isn't working properly.

When I try to hibernate, it appears to work (the screen shuts off after a few seconds), but the system seems to never fully power off (this is demonstrated by the fact that the cooling fan eventuall comes on if I put the laptop in my backpack, and also by the fact that to reboot I first have to do a forced shutdown by holding in the power button for a few seconds). And then when I try to reboot, it never wakes up from hibernation, either.

I've been googing for a solution, but can't find anyone else with the exact same symptoms, and can't find anything at all about hibernation on this specific hardware.

List all binaries from $PATH

Posted: 18 Mar 2022 07:45 AM PDT

Is there a one-liner that will list all executables from $PATH in Bash?

Listing packages in Yum that depend on another installed package

Posted: 18 Mar 2022 06:47 AM PDT

I am trying to install a 3rd-party RPM package on RHEL5 which depends on version 3.4 of sqlite. According to Yum I already have 3.3.6 installed.

Is there a way to list the installed packages that depend on sqlite 3.3.6?

No comments:

Post a Comment