nproc
(Threads x Cores) x Physical CPU Number = Number of vCPUs
lscpu
- Look for the following fields:
- CPU(s): Total number of logical CPUs (vCPUs).
- Core(s) per socket: Number of physical cores per CPU socket.
- Socket(s): Number of physical CPU sockets.
- Model name: CPU model and speed (e.g., `2.20 GHz`).
cat /proc/cpuinfo | grep processor | wc -l
dmidecode --type processor
Check disk type and performance
lsblk -d -o name,rota
- rota=1: Rotational disk (HDD).
- rota=0 Non-rotational disk (SSD).
fdisk /dev/sda
1. "d" to delete the only partition /dev/sda has.
2. "n" to create a new one. Running "n" will make fdisk interactively ask you some parameters for partition creation, you can just hit enter so it uses the default values.
3. Running the previous command does not write the changes to disk, to do this, you need to run the "w" command.
partprobe
lsblk
xfs_growfs /dev/sda1
Option 2: Resize by Adding a New Disk
# Create physical volume on the new disk
pvcreate /dev/sda
# Display volume group information
vgdisplay
# Extend volume group with the new disk
vgextend <VG Name> /dev/sda
# Resize logical volume
lvextend -r -l +100%FREE /dev/mapper/<VG Name>-opt
# Update partition information
partprobe
Crontab
Crontab Guru Crontab is a time-based job scheduling program used in Unix-like operating systems to schedule recurring tasks or jobs. The name "crontab" comes from "cron," the daemon (background process) that runs scheduled tasks, and "tab," which is short for "table" since the scheduling information is organized in tabular form.
With crontab, users can schedule scripts, commands, or programs to run at specified intervals or times, such as daily, weekly, monthly, or even at specific minutes within an hour. This makes it particularly useful for automating repetitive tasks, maintenance activities, or any operation that needs to be executed on a regular basis.
The crontab file follows a specific format.
# <Minute> <Hour> <Day of Month> <Month> <Day of Week> Command
Each line in the crontab file represents a scheduled task or command. Here's a breakdown of the different fields:
Minute: Specifies the minute(s) at which the task should run. Valid values are 0 to 59.
Hour: Specifies the hour(s) at which the task should run. Valid values are 0 to 23.
Day of Month: Specifies the day(s) of the month when the task should run. Valid values are 1 to 31.
Month: Specifies the month(s) when the task should run. Valid values are 1 to 12 or their corresponding names (e.g., Jan, Feb, etc.).
Day of Week: Specifies the day(s) of the week when the task should run. Valid values are 0 to 7 or their corresponding names (0 or 7 represents Sunday).
Command: The actual command or script to be executed at the specified time and date.
To schedule a task, you need to add a line to your crontab file following this format. Each field is separated by spaces or tabs, and you can use asterisks (*) to represent any value.
Remember to run the crontab -e command to edit the crontab file for the current user.