How Do You Get quota Commands to Return Current Data?

Problem scenario
You run a quota -au or quota -ag command to see the latest/up-to-date statistics. You see the number of blocks or inodes is discrepant with what is currently on your system for the user or group. You tried rebooting, but that did not help. How do you get the use blocks and used inodes to be updated with a quota command?

Possible Solution #1
Run a command like this:

sudo quotacheck -vug

If you think something is still misleading/inaccurate,

How Do You Set a Date-Time Value with a Default Year in Python?

Problem scenario
You are printing out some dates with a Python program. You are using the datetime module and the strptime method. The year is always defaulting to 1900 because the log entries have no year designated in them. How do you seed the dates with a specific year of your choice?

Solution
Here is an example of how to seed the dates with the year 2021 (but it assumes you have a file name auth.log with dates without years in it):

import datetime
from datetime import datetime, …

Is It a Best/Recommended Practice to Rotate Passwords?

Problem scenario
You know hackers and malicious social engineers love passwords. You are considering enforcing password rotations temporally (as a systems administrator, security consultant, or I.T. manager). You want planned periodic password changes to happen in a mandatory way. In theory if a password was once lost, changing it mitigates the damage. This is intuitive and consistent with a variety of sources. Many OSes and LDAPs facilitate built-in password expirations based on time intervals.

How Do You Get a Lost Clothes Item in a GE Washer?

Problem scenario
You have a stackable GE washer. The cylindrical basin of the washing machine allows for clothes items to disappear into the cubic chasis/frame of the washing machine. You are missing a washcloth, a sock or a glove. (You may or may not have seen it fall over the cylindrical tub basin into the square body of the washer when taking out the clean clothes. Sometimes an item just spins into the crevice between the agitator basin and the external body of the washer.) You want to get this small clothes item from your washing machine.

How Do You Correct a /etc/fstab File That is Read Only?

Problem scenario
You boot up and log in. You cannot write to /tmp/.

What should you do?

Solution
First, mentally identify the file system in the /etc/fstab file (e.g., /dev/desk/by-id/dm-uuid-LVM-abcd1234).

Here is an example of an /etc/fstab file to determine what the file system string you need is:

/dev/disk/by-id/dm-uuid-LVM-abcd1234 / ext4 defaults,quota,grpquota 0 0
# /boot was on /dev/sda2 during curtin installation
/dev/sdc /var ext4 defaults 1 2
/dev/sda /opt ext4 defaults 0 0
/dev/disk/by-uuid/987654321 /boot ext4 defaults 0 0

Procedure
Run a command like this (but replace /dev/desk/by-id/dm-uuid-LVM-abcd1234 with the file system you need):

sudo mount -o remount,rw /dev/desk/by-id/dm-uuid-LVM-abcd1234

Now you should be able to modify the /etc/fstab file.

How Do You Troubleshoot the Python Problem “ValueError: time data … does not match %m”?

Problem scenario
You are trying to parse a log file with Python. The date entries use abbreviated spellings of months — not integer month values. You get an error like this:

“ValueError: time data ‘Jul 15 06:10:32’ does not match format ‘%m %d %H:%M:%S'”

What should you do?

Solution
Replace the “%m” with “%b”.

import datetime
log_reader = open(‘auth.log’, …

How Do You Find out if a VIN Has a Letter “o” or the Numeral 0?

Question
How do you determine/identify a vehicle identification number having the letter “O” (as in “Oscar”) or the numeral 0? The Arabic number 0 can be confused with the letter “O.”

Answer
It is numeral 0. The letter “O” is not allowed according to
https://checkventory.com/articles/whats-your-number/
. Apparently letters “I” and “Q” are not allowed either (presumably due to their potential confusion with numerals “1” and “0”).

Why Do yum/dnf Commands Fail with the –installroot Flag and How Do You Fix Them?

Problem scenario
dnf or yum commands always fail when you use the –installroot flag. The destination of the –installroot directory do not matter. You see error messages about epel, version, 404 and reaching external servers.

Solution
Root cause: There is an invocation of chroot behind the scenes (according to https://bugzilla.redhat.com/show_bug.cgi?id=850686).

Procedures
The –installroot=/foo/bar flag should always be used in conjunction with –releasever=X where “X” is the major version of your RedHat server.