Guides
How website valuation actually works, what traffic estimates can and cannot tell you, and which once-standard metrics have quietly stopped existing.
Bash Shell: Check File Exists or Not
To check if a file exists in a bash shell script, you can use the if statement and the test operator. The test operator returns true if the file exists, and false if the file does not exist. Here is an example of how you can use the if statement and the test operator to check if a file exists:rn
Linux / Unix: Show Shares on NFS Server [ Shared Directories ]
To show the shares (or exported directories) on an NFS server in Linux or Unix, you can use the showmount command. The showmount command is used to display the information about an NFS server's exported directories. For example, to show the shares on an NFS server with the hostname nfsserver , yo
Install IPTraf on a CentOS / RHEL / Fedora Linux To Get Network Statistics
To install IPTraf on a CentOS, RHEL, or Fedora Linux system, you can use the following steps:rn rn First, make sure that the EPEL (Extra Packages for Enterprise Linux) repository is enabled on your system. You can enable the EPEL repository by running the following command: rn rn rn rn sudo yum inst
How To Set Readonly File Permissions On Linux / Unix Web Server DocumentRoot
To set read-only permissions on a directory in Linux or Unix, you can use the chmod command. The chmod command is used to change the permissions of a file or directory. For example, to set read-only permissions on the /var/www/html directory (which is often used as the document root for web serve
Where Is The Xorg.conf File Located under Unix / Linux / BSD?
The location of the xorg.conf file depends on the operating system and distribution you are using. Here are some common locations for the xorg.conf file:rn rn On modern systems running Xorg, the xorg.conf file may not be present by default, and the X server will instead use automatic configuration.
Linux/Unix: Bash Set Shell Variable Command
In the bash shell, you can set the value of a shell variable using the following syntax:rn rn rn variable_name=valuern rn rnFor example:rn rn rn message= "Hello World" rn rn rnThis sets the value of the message variable to "Hello World" . You can also set a variable to the result of a command:rn
Bash Assign Output of Shell Command To Variable
You can assign the output of a shell command to a variable in bash by using command substitution. Command substitution is achieved using either the backtick ( ` ) or the dollar sign and parentheses ( $( ) ). Here's an example using the backtick syntax:rn rn rn output= $(ls) rn rn rnThis will assi
How To Find Out DNS Server IP Address Used By My Router
To find out the DNS server IP address used by your router, you can use the following steps:rn rn Connect to your router: You can do this by opening a web browser and navigating to the IP address of your router. This is usually http://192.168.0.1 or http://192.168.1.1 , but it may vary depending on y
Linux: Start / Stop / Restart BIND DNS Server
To start, stop, or restart the BIND DNS server on a Linux system, you can use the following commands, executed as the root user or a user with sudo privileges:rn rn Start the BIND DNS server: rn rn rn rn systemctl start namedrn rn rn rn Stop the BIND DNS server: rn rn rn rn systemctl stop namedrn rn
Unix / Linux Shell: Get Third Field Separated by Forward Slash (/) Delimiter
To extract the third field separated by forward slash (/) delimiter in Unix/Linux shell, you can use the following command:rn rn rn echo "field1/field2/field3/field4" | awk -F '/' '{print $3}' rn rn rnThis uses the awk command to split the input string on forward slashes ( / ) and then prints the th
HowTo: Nginx Block User Agent
You can block specific user agents in Nginx by using the if directive in the server block. Here's an example:rn rn rn server {rn ...rn if ( $http_user_agent ~* (bad-agent1|bad-agent2)) {rn return 403;rn }rn ...rn}rn rn rnThis example blocks requests from user agents that contain the string "bad-agen
Bash source Command: $0 Can Not Determine Its Own Location
The $0 variable in a bash script refers to the name of the script itself. However, if the script is being sourced (i.e., run with the source command) rather than executed as a standalone script, $0 will not be able to determine its own location. Here's an example to illustrate this:rn rn rn # scr
Linux / Unix Command To Find Out NFS Clients Connected To My NFS Server
To find out NFS clients connected to an NFS server in Linux or Unix, you can use the following command:rn rn rn showmount -e nfs-server-hostnamern rn rnReplace "nfs-server-hostname" with the actual hostname or IP address of the NFS server. The output of this command will show a list of all
Apple OS X: Remove a Symbolic Link (Symlink) Command
To remove a symbolic link (also known as a symlink) in Apple OS X, you can use the following command:rn rn rn rm /path/to/symlinkrn rn rnReplace "/path/to/symlink" with the actual path to the symlink you want to remove. This will remove the symlink itself, not the target it points to. If you want to
Linux Reboot Command Example
To reboot a Linux system, you can use the following command:rn rn rn sudo rebootrn rn rnThis will immediately restart the system. Note that you need to have root privileges to execute this command. If you are logged in as a regular user, you can use sudo to temporarily elevate your privileges.
Unix HowTo: Start / Stop / Restart Network Service Command
To start, stop, or restart network services in Unix, you can use the following commands: Start network service:rn rn rn sudo service network - manager start rn rn rnStop network service:rn rn rn sudo service network-manager stop rn rn rnRestart network service:rn rn rn sudo service network-manage
Linux Check User Password Expiration Date and Time
You can use the following command to check a user’s password expiration date and time in Linux: n n n chage -l username n n n Replace “username” with the actual username you want to check. The output will include information about the account, including the password expiration date
HowTo: Change Password of Specific User Account In Linux
To change the password of a specific user account in Linux, follow these steps:rn rn Open the terminal or console. rn Type the following command and press Enter:rn rn rn sudo passwd rn rn rnReplace with the actual username of the account you want to change the password for. rn Enter your administrat
Unix / Linux: grep Word Count Command
In Unix or Linux, you can use the grep command to count the number of occurrences of a word in a file. Here's how:rn rn Open a terminal window and navigate to the directory where the file you want to search is located using the cd command. rn Use the following command to count the number of occurren
Unix / Linux Remove (Delete) OpenSSH Server
To remove or uninstall OpenSSH server in a Unix or Linux environment, follow these steps:rn rn Stop the OpenSSH service. Depending on your Unix or Linux distribution, use one of the following commands:rn rn rn systemctl stop sshrnservice ssh stop rn/etc/init.d/ssh stop rn rn rn Uninstall the OpenSSH
2,685 guides published.
