How Do You Troubleshoot a “SyntaxError: invalid syntax” Error in Python?

Problem scenario
You do not know why you are getting the error. The line has an “l” (a lowercase “L”) or a numeral one (“1”) in it.

You may have identified that the line of code is different in one file from another. You cannot tell what is different about your code or why you are getting this error. What should you do?

Solution
Enter vi or open Notepad++ to view the code.

How Do You Set Up a New Linux Server on Hardware?

Problem scenario
You are configuring a new physical server without an image, without an automated unattended installation script or a remote ghosting-type tool (such as Ghost or the NIM tool). How should you format it, install Linux and configure it?

Solution

  1. Gather the requirements for what its purpose will be and how the monitoring/maintenance and support will be done.

How Do You Troubleshoot This Error: “no limited resources used”?

Problem scenario
You run quota -g foobar where “foobar” is the name of the group you want a quota to apply to. But you get this: “Disk quotas for group foobar: no limited resources used”

What should you do?

Possible solution
Run a command like this:
sudo quotacheck -gm /path/to/filesystem

(Don’t use the -u flag if you have no user quota configured.)

Now try the quota -g foobar command again.

How Do You Troubleshoot “mkfs unable to open device /dev/nvme device or resource busy”?

Problem scenario
You are trying to run an mkfs command. But you get “mkfs unable to open device /dev/nvme device or resource busy”. What should you do?

Solution
Are you 100% sure the target of the mkfs command is the one you want?

The target may be /dev/mapper/nvmeABC123 for example. Try to ascertain the destination (often the last argument) of the mkfs command.

How Do You Troubleshoot “Requested offset is beyond real size of device”?

Problem scenario
You are trying to run a cryptsetup open command. You enter the passphrase, but you get “Requested offset is beyond real size of device.” What should you do?

Solution
Try starting over with that partition. Can you create a partition that is at least 16 MB? If it is less than that, or there are some overlapping partitions, that may be your problem.

How Do You Handle Discrepant Results from df and du Commands?

Problem scenario
You run df and du. You see different amounts of CPU space that are free versus utilized. What should you do?

Possible Solution #1
Reboot the server. Rebooting may fix the problem.

Possible Solution #2
Run this command: lsof

Some files may be open that should not be. The lsof command should help you determine if a file’s utilization is lingering.

How Do You Troubleshoot The Message “no module named pandas”?

Problem scenario
From a Python command prompt or when you run a Python program, you get the error message “no module named pandas”. You have used pip and pip3 to install pandas. What should you do?

Solution
Use “python3” instead of “python” to ensure you are using Python 3.

You may also want to see this posting.

How Do You Determine What WordPress Theme Your Website Is Using?

Problem scenario
You use WordPress. You want to find (or identify) what theme you are using. What should you do?

Solution

  1. Find the URL you use to browse WordPress (e.g., with wp-admin).
  2. Hack (or create or draft) the URL in text by making it follow this convention: https://www.foobar.com/wp-admin/themes.php
  3. Be logged into WordPress, and then browse to that drafted/hacked URL.

How Do You Find Your Tibia to Femur Ratio?

Problem scenario
You want to find a sport or buy shoes that incorporates your legs anthropometry. How do you find the ratio of your tibia’s length to your femur’s length?

Answer
Depending on your style of dress, personal trainers may not be able to guess your femur length. You do have to measure.

How do you measure the tibia (the bone between your ankle and knee) length?

Should You Do Squats Barefoot?

Problem scenario
You see many strong people at the gym lift barefoot. Should you take your shoes off before squatting?

Possible Answer
It is not clear.

These articles give mixed treatment to squatting barefoot (with the top two being fairly favorable to the practice):

https://borntosweat.co/blog/the-benefits-of-barefoot-training-squatting-without-shoes/

Squatting Barefoot VS Lifting Shoes – Why Does it Matter?