To extract a file path or filename from a full path, you can use various utilities like grep, sed, awk, etc. If it’s not a list from a file or variable, you can use find, but there’s an easier way: basename – returns the filename dirname – returns the path to the file Example: … Continue reading " Linux – Get path and filename from full path"
In order to mount an S3 Bucket as a file system, you need to install s3fs Create a directory to mount: And add the following to "/etc/fstab": Where: "artem-service-bucket:/upload/" – S3 bucket name and the directory inside the bucket to mount "url=https://s3.eu-central-1.amazonaws.com,endpoint=eu-central-1" – the region where the S3 bucket is located "iam_role" – … Continue reading " S3 – Mounting in Linux"
When trying to create a partition with the "fdisk" utility, 2 or more TB in size, the following message appears: The size of this disk is 2 TiB (2199023255552 bytes). DOS partition table format cannot be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT). … Continue reading "FIX ERROR – fdisk: DOS partition table format cannot be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors"
List of labels You can view the list of existing labels in the following path: If this directory does not exist, then there are no labels in the system Adding a label For different file systems, the label is added differently. ext2/ext3/ext4: reiserfs: jfs: xfs: Where, "LABEL" – a unique label, "/dev/sda1" … Continue reading "Linux – Mount partition by label"
We stop the mysqld service and start it with the following keys: Log in without a password: And run: Now the mysqld service running in the background needs to be stopped. We look at the process ID: Kill the process: And start the mysqld service:
This script clears all firewall rules, sets standard values for chains, and opens access via SSH, HTTP and HTTPS
We look at the rules in all chains: Can be viewed in a specific chain: See the rules in NAT: