Using Python How Do You Print Log Entries for a Given Time Range?

Problem scenario
Using Python, you want to parse a log file. You want to print out entries that have a datetime stamp that are within 24 hours of a given date.

The log file is in this format:

Sep 18 07:28:11 server1 sshd[29284]: Received disconnect from 115.52.17.109 port 46970:11: Bye Bye [preauth]
Sep 18 07:28:11 server1 sshd[29284]: Disconnected from 115.52.17.109 port 46970 [preauth]
Sep 18 07:28:11 server1 sshd[29282]: Failed password for root from 51.10.7.109 port 24844 ssh2
Sep 18 07:28:13 server1 sshd[29287]: pam_unix(sshd:auth): authentication failure; …

How Do You Get Audio to Work on Your Linux System?

Problem scenario
There is no audio on your Linux system. The volume is not muted. In the control panel area for audio you see “Dummy …” for your sound device on your Linux system. What should you do?

Possible Solution
This assumes the hardware of the server, computer or laptop uses Intel.

  1. Backup the file /etc/default/grub (e.g., to your home directory as .bak).

…

Is the Term “Threadjacking” a Netiquette or Cybersecurity Issue?

Problem scenario
You have heard the term “threadjacking” in different contexts. What does it mean?

Answer
The word “threadjack” can have different meanings. It can be a netiquette issue, a cybersecurity issue, or both.

Threadjacking can refer to the practice of responding to an email thread or website posting to change the topic. These type of threadjackings have no security implication.

…

How Do You Install VirtualBox when you Encounter an Error Message “Unable to install VirtualBox as download failed … not (yet) available (404 Not Found)”?

Problem scenario
You try to install VirtualBox on a Linux server via the “Software” section of your GUI. It fails with an error message like this: “Unable to install VirtualBox as download failed … not (yet) available (404 Not Found)”

Solution
Run a command like one of the following depending on the type of Linux you have.

If you have a Debian distribution of Linux (such as Ubuntu or Mint): sudo apt -y update

If you have a Red Hat distribution of Linux (such as CentOS,

…

What Does LNEXT Mean or Stand for?

Question
You see “lnext” or “LNEXT”, and you want to know what it means. In the context of Linux, what does LNEXT refer to?

Answer
It is a special character in Linux that pertains to the terminal driver. It means “Literal next.” To invoke the literal next character (and bypass other interpretations), an operator would typr Control-V.

The answer above was taken from page 1296 and 1298 of The Linux Programming Interface.

…

What Does It Mean to Throttle a Hard Disk?

Problem scenario
You have read about disk throttling. What does it do?

Solution
Disk throttling is the limiting of I/O activity. Files are often downloaded at an even rate over the network. Batches of writes can happen while throttling read operations. This can allow for interruptions from other OS processes without excessive latency and a consistent user experience. A server’s performance can be improved by putting a cap on disk input/output operations.

…

How Do You Troubleshoot “quotacheck: Your kernel probably supports journaled quota but you are not using it.”?

Problem scenario
You are running a quotacheck command on a Linux system. You get an error “quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. “

Your /etc/fstab looks like this:

# <file system<mount point<type<options<dump<pass/dev/foo /bar ext4 errors=remount-ro 0 1

What should you do?

…