How Do You Troubleshoot a “File Not Found” Message?

Problem scenario
You run a command, but you get a message like “filenotfounderror”, “file or directory does not exist” or something similar. What should you do?

Possible Solution #1 (assuming that the file exists)
Do either i. or ii.
i.a. Find the original file with a command like this: sudo find / -name foobar
i.b. Create a symbolic link or a hard link to the file.

…

How Do You Troubleshoot the Error “flatpak … no version info or cannot open shared object file”?

Problem scenario
You open a terminal window in Linux. You get an error like one of the following:

flatpak: /lib64/libldap_r-2.4.so.2: no version information available (required by /lib64/libcurl.so.4)

flatpak: error while loading shared libraries: libsasl2.so.2: cannot open shared object file: No such file or directory

What should you do?

Solution
(This solution will work if the file is in a different location from where it was expected on your server.)
1.

…

How Do You Get a NIC on a Linux Server to Work?

Problem scenario
Your NIC on your Fedora Linux server totally will not work. The physical NIC has no lights on it. It seems it is disabled. You cannot enable it with commands.

You see errors like these in logs: “NetworkManager.service: Start request repeated too quickly.”

What should you do?

Solution
Run this command:

journalctl -u NetworkManager

Do you see lines like these?

…

How Is Training Different from Exercise?

Problem scenario
You work out regularly at a fitness gym. Is exercise the same as training?

Answer
Exercise is physical activity. Training involves a long-term goal designed to achieve results that will include regular physical activity. Training would include progressively more weights for specific lifts and/or cardio that is increasingly intense or longer in duration.

Source: Starting Strength page 292.

…

How Do You Get a NIC to Permanently Be in a firewalld Zone with a Single Command?

Problem scenario
A NIC or network interface is not being protected by a zone in the firewalld. You run firewall-cmd commands, and later run “firewall-cmd –runtime-to-permanent” afterward. But a NIC (e.g., a virtual NIC) will not persistently remain in a zone. You want your firewall-cmd commands to have a permanent effect. The “firewall-cmd –runtime-to-permanent” command is supposed to work, but it is not helping. What should you do?

…

How Do You Get a NIC to Permanently Be in a firewalld Zone with Multiple Commands?

Problem scenario
A NIC or network interface is not being protected by a zone in the firewalld. You run firewall-cmd commands with different flags, but some NIC (e.g., a virtual NIC) will not persistently remain in a zone. You want your firewall-cmd commands to have a permanent effect. The –permanent flag is supposed to work, but it is not helping. What should you do?

Solution
If a firewall-cmd command fails with a –permanent flag,

…

Should You Disable WPS on Your WiFi/Router at Home?

Problem scenario
You want to not broadcast your home’s network (e.g., to make sure people do not borrow your bandwidth or hack your devices such as your thermostat with ransomware). You want to keep using your WiFi. You try to disable the “Broadcast Network Name (SSID)”, but you get a prompt like “WARNING:
Disabling Broadcast Network Name (SSID) will disable Wi-Fi Protected Setup (WPS) functionality. Are you sure you want to change?”

Should you click “OK”?

…

How Do You Troubleshoot an IP Address That You Can SSH to, But You Cannot Ping It?

Problem scenario
nmap shows that the host seems down. You cannot ping the IP address. But you can SSH to the IP address. How is this possible?

Solution
Possible Solution #1

A host server could have multiple IP addresses (e.g., with a virtual server hosted by a type 2 hypervisor utilizing KVM or QEMU). The networking could be done at the kernel level.

…

How Do You Write a Python Program to Extract Lines of a Specific Date?

Problem scenario:
You have a log like this:

Sep 18 07:28:11 server1 sshd[29284]: Received disconnect from 125.52.17.109 port 46970:11: Bye Bye [preauth]
Sep 18 07:28:11 server1 sshd[29284]: Disconnected from 125.52.17.109 port 46970 [preauth]
Sep 18 07:28:11 server1 sshd[29282]: Failed password for root from 51.12.19.109 port 24844 ssh2
Sep 18 07:28:13 server1 sshd[29287]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=119.29.155.214 user=root
Sep 18 07:28:13 server1 sshd[29282]: Failed password for root from 51.12.19.109 port 24844 ssh2
Sep 18 07:28:14 server1 sshd[29282]: Received disconnect from 51.12.19.109 port 24844:11: [preauth]
Sep 18 07:28:14 server1 sshd[29282]: Disconnected from 51.12.19.109 port 24844 [preauth]
Sep 18 07:28:14 server1 sshd[29282]: PAM 2 more authentication failures; …