XmoduloDaily Linux FAQs, tips and tutorials
https://www.xmodulo.com
How to check if Intel Hyper-Threading is enabled in Linux
https://www.xmodulo.com/check-hyper-threading-enabled-linux.html
https://www.xmodulo.com/check-hyper-threading-enabled-linux.htmlSat, 7 Aug 2021 20:00:00 ESTHyper-Threading is an Intel's simultaneous multithreading (SMT) technology that is designed to improve execution parallelism of x86 CPU processors. This tutorial describes several ways to check whether or not Intel Hyper-Threading is enabled on your Linux system.How to use indexed arrays in bash
https://www.xmodulo.com/indexed-arrays-bash.html
https://www.xmodulo.com/indexed-arrays-bash.htmlSun, 4 Apr 2021 20:00:00 ESTBash supports one-dimensional indexed arrays, which are essentially ordered lists, where you can access the values by their index (i.e., position in the list). This bash tutorial teaches you how to use indexed arrays in bash. Various usages of indexed arrays in bash are illustrated with examples.Tcpdump cheat sheet with examples
https://www.xmodulo.com/tcpdump-cheat-sheet-examples.html
https://www.xmodulo.com/tcpdump-cheat-sheet-examples.htmlWed, 31 Mar 2021 20:05:00 ESTMain power of tcpdump packet sniffing tool comes from its flexible packet filtering rules and versatile protocol dissection capability. As you may know, only the sky is the limit when it comes to packet-level monitoring with tcpdump. This post provides a comprehensive tcpdump cheat sheet with detailed examples.How to use map, reduce and filter in Python
https://www.xmodulo.com/map-reduce-filter-python.html
https://www.xmodulo.com/map-reduce-filter-python.htmlTue, 30 Mar 2021 19:35:00 ESTFunctional programming approach in Python can be best illustrated by built-in functions called map(), filter(), and reduce(). This python tutorial teaches you how to use map(), filter() and reduce() functions with easy-to-follow examples.How to use range and sequence expression in bash
https://www.xmodulo.com/range-sequence-expression-bash.html
https://www.xmodulo.com/range-sequence-expression-bash.htmlMon, 29 Mar 2021 19:35:00 ESTThis bash tutorial explains the bash's built-in brace expansion, and presents examples that illustrate how to use brace expansions to define a range or to generate a sequence of strings.How to catch and handle errors in bash
https://www.xmodulo.com/catch-handle-errors-bash.html
https://www.xmodulo.com/catch-handle-errors-bash.htmlSun, 28 Mar 2021 21:49:00 ESTWriting a robust, bug-free bash script is always challenging even for a seasoned system administrator. While you cannot prevent all errors in your bash script, at least you should try to handle potential error conditions in a more predictable and controlled fashion. This tutorial introduces basic tips to catch and handle errors in bash.Natural language processing with Python
https://www.xmodulo.com/natural-language-processing-python.html
https://www.xmodulo.com/natural-language-processing-python.htmlThu, 25 Mar 2021 22:37:00 ESTPython has become the most preferred language for Natural Language Processing (NLP) because of its great library ecosystem, platform independence, and ease of use. In this post let's find out what are the common real-world uses of NLP and what open-source Python tools and libraries are available for the NLP tasks.How to install ELK stack on Ubuntu 20.04
https://www.xmodulo.com/install-elk-stack-ubuntu.html
https://www.xmodulo.com/install-elk-stack-ubuntu.htmlTue, 23 Mar 2021 20:40:00 ESTWhen many different services and applications are deployed across multiple servers, pulling all their logs and drawing meaningful operational insights from them are not an easy task. That is where the ELK stack comes to the rescue. This tutorial will help you get started with the ELK stack by showing how to configure the ELK stack on a single Ubuntu 20.04 development server.How to create virtual environments in Python 3 with venv module
https://www.xmodulo.com/python-virtual-environments-venv.html
https://www.xmodulo.com/python-virtual-environments-venv.htmlMon, 22 Mar 2021 14:30:00 ESTA Python virtual environment allows you to create a logically isolated software environment for a particular Python project, and choose a version of Python interpreter as well as install any necessary libraries for the project. The idea is for every project to have its own virtual environment. This means that Python tools installed for different projects within their own virtual environments will not interfere with one another. This tutorial describes how to create virtual environments in Python 3 using the built-in venv module.How to get started with Vagrant on Linux
https://www.xmodulo.com/get-started-with-vagrant.html
https://www.xmodulo.com/get-started-with-vagrant.htmlWed, 17 Mar 2021 19:50:00 ESTVirtualization allows DevOps teams to easily and quickly replicate necessary OS environments to build, test and deploy their development system on. Vagrant is an open-source, command-line based tool that allows generating reproducible and sharable virtualized environments in an automated fashion. This tutorial will help you understand the power of Vagrant and to guide you to quickly develop hands-on skills with Vagrant.How to get started with Git on Linux
https://www.xmodulo.com/get-started-with-git.html
https://www.xmodulo.com/get-started-with-git.htmlTue, 16 Mar 2021 16:30:00 ESTDeveloping applications is not as easy as many might think. It requires coding skills and the use of productivity tools that make the development process fast and efficient. One of those handy coding tools is a version control system called Git. This tutorial provides a beginner's guide on how to get started with Git version control system on Linux environment.How to wake up a sleeping bash script
https://www.xmodulo.com/wake-up-sleeping-bash-script.html
https://www.xmodulo.com/wake-up-sleeping-bash-script.htmlWed, 10 Mar 2021 21:40:00 ESTSuppose you want to have a bash script that sleeps in the background normally, and wakes up to perform some task only when you send a signal to the script. Once the script completes the task, it then goes back to sleep. In this tutorial, let's find out how you can wake up a sleeping bash script by utilizing a named pipe.How to measure elapsed time in bash
https://www.xmodulo.com/measure-elapsed-time-bash.html
https://www.xmodulo.com/measure-elapsed-time-bash.htmlTue, 9 Mar 2021 19:30:00 ESTElapsed time is the amount of wall-clock time that has passed between the beginning and the end of a particular event. This tutorial describes how to measure elapsed time with various resolutions (e.g., in seconds, in milliseconds, in microseconds) in bash.How to use screen command to improve your productivity on Linux terminal
https://www.xmodulo.com/linux-screen-command.html
https://www.xmodulo.com/linux-screen-command.htmlMon, 8 Mar 2021 20:10:00 ESTLinux screen command is one of the most useful command line utilities that can improve your productivity on command line. This tutorial introduces Linux screen command and presents several use cases of screen.How to manipulate strings in bash
https://www.xmodulo.com/manipulate-strings-bash.html
https://www.xmodulo.com/manipulate-strings-bash.htmlSun, 7 Mar 2021 21:35:00 ESTAll bash variables are by default treated as character strings. Therefore more often than not, you need to manipulate string variables in various fashions while working on your bash script. This bash tutorial presents a comprehensive list of useful string manipulation tips for bash scripting.How to write a function in bash
https://www.xmodulo.com/write-bash-function.html
https://www.xmodulo.com/write-bash-function.htmlTue, 2 Mar 2021 21:10:00 ESTThis bash tutorial discusses all about bash functions, such as how to create and call a bash function, how to pass arguments to it, how to exit a bash function, and how to return a value from it.How to read command line arguments in a bash script
https://www.xmodulo.com/command-line-arguments-bash-script.html
https://www.xmodulo.com/command-line-arguments-bash-script.htmlMon, 1 Mar 2021 20:40:00 ESTA bash script rarely runs standalone. Rather, you often pass one or more arguments to the script from the command line to modify its run-time behavior. In more advanced cases, you may want to pass command-line options to your script (e.g., "-h" or "-f my.txt") to optionally change the default settings of the script. In this tutorial let's find out how you can pass command-line arguments and how you can handle command-line options in a bash shell script.How to create an RPM package from a tarball
https://www.xmodulo.com/create-rpm-package-tarball.html
https://www.xmodulo.com/create-rpm-package-tarball.htmlSun, 28 Feb 2021 17:00:00 ESTCreating RPM package files can be both as easy or complicated as you desire. If you're needing to create an RPM package from a tarball (.tar.gz) that a vendor sent you, this tutorial will be beneficial for you. In this tutorial, I will describe a step-by-step procedure for building an RPM package from a tar file.How to embed a binary file in a bash shell script
https://www.xmodulo.com/embed-binary-file-bash-script.html
https://www.xmodulo.com/embed-binary-file-bash-script.htmlThu, 25 Feb 2021 20:50:00 ESTYou may have been in a situation where you want to embed a binary file in your shell script before sharing it with others. For example, you are working on an installation script that includes a tarball. Or you are writing a portable shell script that includes any external dependency. Find out find out how you can include a binary file in a bash script and how to retrieve it from the script.How to use arithmetic operations in bash
https://www.xmodulo.com/arithmetic-operations-bash.html
https://www.xmodulo.com/arithmetic-operations-bash.htmlWed, 24 Feb 2021 21:40:00 ESTWhen you are writing a bash script, sometimes you may want to crunch numbers quickly inside the script. For example, you want to convert a unit of data you are working with, round a divided value to the nearest integer, increment a counter in simple loops, etc. This tutorial presents tips on how to perform integer and floating point arithmetic operations in a bash shell script.How to read column data from a text file in a bash shell script
https://www.xmodulo.com/read-column-data-text-file-bash.html
https://www.xmodulo.com/read-column-data-text-file-bash.htmlTue, 23 Feb 2021 22:45:00 ESTOne common task in day-to-day shell scripting jobs is to read data line by line from a file, parse the data, and process it. The input file can be either a regular text file (e.g., logs or config files) where each line contains multiple fields separated by space, or a CSV file that is formatted with delimiter-separated values in each row. This bash tutorial describes how to read columns from a file and store them into separate variables for further processing.How to use a key-value dictionary in bash
https://www.xmodulo.com/key-value-dictionary-bash.html
https://www.xmodulo.com/key-value-dictionary-bash.htmlMon, 22 Feb 2021 22:35:00 ESTIn any programming language, a dictionary is one of the most fundamental data structures that can store a set of objects in the form of key-value pairs. While bash is not a general-purpose programming language, a recent version of bash (starting from version 4) has started to support dictionaries or associative arrays natively. This tutorial demonstrates how you can use a key-value dictionary in bash.How to encrypt a shell script
https://www.xmodulo.com/encrypt-shell-script.html
https://www.xmodulo.com/encrypt-shell-script.htmlSun, 21 Feb 2021 23:40:00 ESTSuppose you have written a bash shell script and you want to protect the content of the shell script while sharing it with others. For example, for whatever reason you don't want the shell script to be viewed for inspection and modified for re-distribution by others. Better yet, you want to set the expiration date on the script, so that the script may not be used beyond the set expiration date. This tutorial describes how you can encrypt your shell script on Linux.How to fix unzip error "End-of-central-directory signature not found"
https://www.xmodulo.com/fix-unzip-error.html
https://www.xmodulo.com/fix-unzip-error.htmlSat, 20 Feb 2021 10:15:00 ESTIf you are unable to extract files from a zip file and instead getting the error "End-of-central-directory signature not found", changes are that the zip file was incompletely downloaded or got corrupted on your disk somehow. This tutorial discusses how to fix, or at least get round, the unzip error when a zip file is corrupted or end of the file is truncated.How to use for/while/until loop in bash
https://www.xmodulo.com/for-while-until-loop-bash.html
https://www.xmodulo.com/for-while-until-loop-bash.htmlSat, 13 Feb 2021 23:00:00 ESTUndoubtedly the most useful feature of bash scripting is loop control. In any imperative programming language like bash, loop statements are commonly used along with conditional statements to perform repetitive tasks. In case of bash, three different types of loop statements are available: for, while and until. This tutorial demonstrates how to use for, while and until loops in bash using detailed examples.How to check if a file exists in bash
https://www.xmodulo.com/check-file-exists-bash.html
https://www.xmodulo.com/check-file-exists-bash.htmlTue, 9 Feb 2021 21:30:00 ESTWhen you are working on a shell script in bash, there are cases where you want to check if a particular file exists (or does not exist) in a directory, and then perform an action based on the condition. In bash, there are several ways to check whether or a file exists in bash. This tutorial demonstrates bash shell script examples for this use case.How to mount Box.com cloud storage on Linux
https://www.xmodulo.com/how-to-mount-box-com-cloud-storage-on-linux.html
https://www.xmodulo.com/how-to-mount-box-com-cloud-storage-on-linux.htmlSun, 7 Feb 2021 22:10:00 ESTBox.com is an online cloud storage provider targeting both individual users and enterprise customers. Box.com users can access its cloud storage via web interface or multi-platform mobile client software. As of yet Box.com does not offer a native Linux client for their platform. Thankfully, however, they provide a WebDAV interface, through which your Box.com account is exported as a WebDAV share. This tutorial demonstrates how you can mount your Box.com cloud storage account on Linux using its WebDAV interface.How to update sudo version on Linux
https://www.xmodulo.com/update-sudo-version-linux.html
https://www.xmodulo.com/update-sudo-version-linux.htmlSat, 6 Feb 2021 22:20:00 ESTThe latest heap buffer overflow vulnerability discovered in sudo (CVE-2021-3156) can trigger privilege escalation and allow any unprivileged user (those not in the sudoers list, or even nobody) to bypass password authentication and gain the root access. This vulnerability can easily be exploited as the second-stage attack once a low-level service account gets breached. This tutorial describes how to check if your sudo is vulnerable and how to update it on your Linux system.How to add a signature to a PDF document on Linux
https://www.xmodulo.com/add-signature-pdf-document-linux.html
https://www.xmodulo.com/add-signature-pdf-document-linux.htmlMon, 1 Feb 2021 00:05:00 ESTExisting open-source PDF readers such as Evince or Okular come with limited editing capabilities such as PDF annotations, but do not allow you to add your signature to a PDF document. This tutorial demonstrates how to add a signature to a PDF document using an open-source Linux tool called Xournal.How to mount an exFAT drive on Linux
https://www.xmodulo.com/mount-exfat-drive-linux.html
https://www.xmodulo.com/mount-exfat-drive-linux.htmlSun, 31 Jan 2021 12:35:00 ESTexFAT is a proprietary filesystem developed by Microsoft, and is commonly used for USB flash drives or SD cards. In order to mount an exFAT drive on Linux, you need to use exFAT FUSE or use kernel 5.4 or higher. This tutorial explains detailed procedures.How to create a Linux virtual machine step by step in Microsoft Azure
https://www.xmodulo.com/create-linux-virtual-machine-microsoft-azure.html
https://www.xmodulo.com/create-linux-virtual-machine-microsoft-azure.htmlSat, 30 Jan 2021 20:45:00 ESTAzure is a cloud computing platform from Microsoft, which features a comprehensive suite of cloud services delivered on demand for users. Azure is not just for large businesses or startups, but also can be great for your personal DIY projects as well. This tutorial offers a step-by-step guide on creating a Linux virtual machine on Microsoft Azure using its web-based Portal interface.How to boot multiple ISO images from one USB drive on Linux
https://www.xmodulo.com/boot-multiple-iso-from-usb.html
https://www.xmodulo.com/boot-multiple-iso-from-usb.htmlSun, 24 Jan 2021 23:10:00 ESTA typical bootable USB drive or memory stick can only boot from a single ISO file stored on the drive, which is not only inconvenient but also wasteful for a large USB storage. This tutorial covers how to create a multi-ISO USB drive using an open-source tool called Ventoy.How to create a Linux EC2 instance step by step on Amazon AWS
https://www.xmodulo.com/create-linux-ec2-instance-aws.html
https://www.xmodulo.com/create-linux-ec2-instance-aws.htmlSat, 23 Jan 2021 18:25:00 ESTAmazon EC2 (Amazon Elastic Compute Cloud) is a part of AWS product offerings, where users can rent virtual servers in the AWS public cloud. You pay for rented compute resources (CPU, memory, hard drive) at per-second granularity on a "pay-as-you-go" basis. For those of you who have just started with Amazon EC2, this tutorial covers a step-by-step procedure to create a Linux instance on AWS EC2 platform.How to detect the file system type of an unmounted device on Linux
https://www.xmodulo.com/detect-file-system-type-unmounted-device.html
https://www.xmodulo.com/detect-file-system-type-unmounted-device.htmlFri, 22 Jan 2021 22:00:00 ESTIt is often necessary to know the type of filesystem created on a hard disk or a USB thumb drive even before mounting it. For example, you may need to explicitly specify filesystem type when mounting a disk device, or have to use a filesystem-specific mount command.