How to remove carriage return in Linux or Unix

There are several ways to remove carriage returns (also known as “line endings” or “newline characters”) in Linux or Unix. Some common methods include: Using the “tr” command: tr -d ‘\r’ < input.txt > output.txt This command uses the “tr” (translate) command to delete all occurrences of the carriage return character (\r) from the input … Read more

How to password protect directory with Nginx .htpasswd authentication

To password protect a directory with Nginx using .htpasswd authentication, you can follow these steps: Create a .htpasswd file that contains a list of username and password pairs. You can create this file using the “htpasswd” command. For example: htpasswd -c /etc/nginx/.htpasswd user1 Add the following code to your Nginx server block configuration file: location … Read more

How to install Homebrew on Mac OS to use the brew package manager

Homebrew is a package manager for Mac OS that allows you to easily install and manage software packages. To install Homebrew on Mac OS, you can use the following steps: Open the Terminal application on your Mac. Run the following command in the terminal to install Homebrew: /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/main/install.sh)” Once the installation … Read more

How to set up static IP address on Debian Linux 10/11

Homebrew is a package manager for Mac OS that allows you to easily install and manage software packages. To install Homebrew on Mac OS, you can use the following steps: Open the Terminal application on your Mac. Run the following command in the terminal to install Homebrew: /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/main/install.sh)” Once the installation … Read more

How to install ShellCheck on FreeBSD – A shell script static analysis tool

ShellCheck is a static analysis tool for shell scripts that helps to identify and fix common issues and errors. You can install ShellCheck on FreeBSD using the package manager pkg. First, ensure that the package manager is updated by running the command: pkg update Next, install ShellCheck by running the command: pkg install shellcheck Once … Read more