Guides
How website valuation actually works, what traffic estimates can and cannot tell you, and which once-standard metrics have quietly stopped existing.
Bash Script: Find Out In What Directory Script Is Stored Under Unix Or Linux
You can use the following line of code in a bash script to determine the directory in which the script is stored:rn rn rn SCRIPT_DIR= " $(cd "$(dirname " $0 ")" && pwd) " rn rn rnHere's how it works:rn rn dirname "$0" returns the directory component of the script's file path. rn cd "$(dirnam
Sed: Find and Replace The Whole Line [ Regex ]
You can use the sed command to find and replace the whole line using a regular expression (regex). The basic syntax is as follows:rn rn rn sed 's/ < regex to match > / < replacement string > /g' < input file > rn rn rnWhere <regex to match> is the pattern you want to search f
Debian/Ubuntu: Setup Planet Venus To Combine Two Or More RSS Feeds
Planet Venus is a software that allows you to combine multiple RSS feeds into a single feed. It can be used on Debian/Ubuntu systems to set up a custom feed aggregator. Here is an example of how to install and set up Planet Venus on a Debian/Ubuntu system:rn rn Install Planet Venus: rn rn rn rn s
HowTo: Bash Shell Split String Into Array
You can split a string into an array in bash using the IFS (Internal Field Separator) variable and parameter expansion. n Here is an example of how to split a string into an array: n n n string= "one two three four" nIFS= ' ' read -ra arr <<< " $string " n for i in " ${arr } " ; do n echo "
HowTo: Bash Extract Filename And Extension In Unix / Linux
You can extract the filename and extension from a file path in bash using parameter expansion and string manipulation. Here are a few examples of how to extract the filename and extension:rn rn Extract the filename and extension using parameter expansion: rn rn rn rn path= "/path/to/file.ext" rnf
Linux / Unix: Test Internet Connection Speed From SSH Command
You can test the internet connection speed from the command line using the speedtest-cli tool. This tool can be installed on Linux or Unix systems using the package manager for your distribution, such as apt , yum , or homebrew . n Here is an example of how to install and use speedtest-cli on a Debi
Debian / Ubuntu Linux: Install Cherokee Web Server
To install the Cherokee web server on Debian/Ubuntu Linux, you can follow these steps:rn rn Add the Cherokee repository to your system's repository list: rn rn rn rn echo "deb http://www.cherokee-project.com/deb/ $distro $arch " | sudo tee /etc/apt/sources.list.d/cherokee.listrn rn rnwhere $distro i
Linux Security: Mount /tmp With nodev, nosuid, and noexec Options
The /tmp directory is a temporary file storage location that is world-writable. To increase the security of the system, you can mount /tmp with the nodev , nosuid , and noexec options. These options have the following meanings:rn rn nodev : This option disables the ability to access device files on
Linux Configure Firewall Using Shorewall Under RHEL / CentOS
To configure a firewall using Shorewall under Red Hat Enterprise Linux (RHEL) / CentOS, you can follow these steps:rn rn Install Shorewall: rn rn rn rn yum install shorewallrn rn rn rn Start the firewall and enable it to start at boot: rn rn rn rn systemctl start shorewallrnsystemctl enable shorewal
HowTo: grep All Sub-directory For Files
To search all subdirectories for files using grep you can use the following command:rn rn rn grep -r pattern directoryrn rn rnwhere pattern is the search string and directory is the top-level directory to search. The -r or --recursive option tells grep to search recursively through subdirectories.rn
Linux pidof Command Examples To Find PID of A Program/Command
The pidof command in Linux is used to find the process ID (PID) of a program or command. Here are some examples of how to use the pidof command:rn rn Find the PID of a specific process: rn rn rn rn pidof process_namern rn rnwhere process_name is the name of the process you want to find the PID of. F
How to change directory in Linux using cd command
In the Linux terminal, you can change the current working directory using the cd command. n Here’s how you can use the cd command to change to a different directory: n n n cd path/to/directory n n n where path/to/directory is the path of the directory you want to change to. n For example, to c
Ubuntu / Debian Linux Install ethtool To Display / Set Ethernet Device Settings
In Ubuntu or Debian Linux, you can install the ethtool utility to display and set Ethernet device settings by using the following command:rn rn rn sudo apt- get install ethtoolrn rn rnAfter installing ethtool , you can use it to display the settings of an Ethernet device, such as eth0 , by using the
Debian Linux: Configure Network Interfaces As A Bridge / Network Switch
In Debian Linux, you can configure network interfaces as a bridge, also known as a network switch, using the brctl utility and the /etc/network/interfaces file. Here's an example of how to configure two network interfaces, eth0 and eth1 , as a bridge:rn rn Install the bridge-utils package: sudo a
How to change directory in Linux terminal
In the Linux terminal, you can change the current working directory using the cd command. Here's how you can use the cd command to change to a different directory:rn rn rn cd path/to/directoryrn rn rnwhere path/to/directory is the path of the directory you want to change to. For example, to ch
Linux Rename Eth0 Network Interface Card Name [ Udev ]
In Linux, you can change the name of a network interface card using the udev subsystem. Here's how you can change the name of the eth0 interface to new_name :rn rn Create a new udev rule file: sudo nano /etc/udev/rules.d/10-network.rules rn Add the following lines to the file: rn rn rn rn SUBSYST
less Command Display Line Numbers
To display line numbers while using the less command, you can add the -N option when running the less command:rn rn rn less -N file.txtrn rn rnIn this example, the -N option causes less to display line numbers in front of each line of the file. This can be useful when you need to refer to specific l
CentOS Linux: Start / Stop / Restart SSHD Command
In CentOS Linux, you can start, stop, or restart the sshd service using the systemctl command. Here are the commands to start, stop, and restart sshd :rn rn Start sshd : sudo systemctl start ssh rn Stop sshd : sudo systemctl stop ssh rn Restart sshd : sudo systemctl restart ssh rn rnNote: You may
Python Delete/Remove a File If Exists On Disk
In Python, you can remove/delete a file from disk using the os module's remove function. Here's an example:rn rn rn import os file_path = "path/to/file.txt" if os . path .exists(file_path):rn os . remove (file_path)rn print ( "File removed successfully." )rn else :rn print ( "File not fo
How to change DNS ip address in RHEL (Red Hat Enterprise Linux)
You can change the DNS IP address in Red Hat Enterprise Linux by editing the network configuration file. Here's how:rn rn Open the network configuration file: sudo nano /etc/sysconfig/network-scripts/ifcfg-<interface> where <interface> is the name of your network interface (e.g. eth0 ).
2,685 guides published.
