Guides
How website valuation actually works, what traffic estimates can and cannot tell you, and which once-standard metrics have quietly stopped existing.
Linux / Unix: Read a Man Page From Local Directory
You can use the man command to read a man page from a local directory in Linux or Unix. By default, the man command searches for man pages in the system-wide man page directories. To read a man page from a local directory, you need to specify the path to the man page file using the -M or --manpath o
RHEL / CentOS Linux install and activate Bash completion
Bash completion is a feature in the bash shell that allows you to auto-complete commands, file names, and other things by pressing the Tab key. To install and activate bash completion in RHEL/CentOS Linux, follow these steps:rn rn Install the bash-completion package: rn rn rn rn sudo yum install bas
How do I see what packages are installed on Ubuntu Linux?
You can use the dpkg command to see what packages are installed on Ubuntu Linux. The following command will list all installed packages:rn rn rn dpkg --list rn rn rnThis will display a list of all packages installed on the system, including their names, versions, and descriptions. Another way to
FreeBSD Laptop Find Out Battery Life Status Command
In FreeBSD, you can use the acpiconf command to find out the battery life status of a laptop. To get the battery status, run the following command in the terminal:rn rn rn acpiconf - i 0 rn rn rnThis will display information about the first (0th) battery in the system, including its current charg
Python Command Line Arguments Examples
Python has a built-in module called argparse which makes it easy to write user-friendly command-line interfaces. The following are some examples of using argparse to handle command-line arguments:rn rn rn import argparse parser = argparse.ArgumentParser(description= 'Process some integers.' )rnpa
GCC: Linux gnu/stubs-32.h: No such file or directory
This error message usually indicates that the required header file, "gnu/stubs-32.h", is missing from your system. This header file is part of the glibc library and provides stub definitions for 32-bit system calls on 64-bit systems. To resolve this issue, you can try installing the glibc-devel pack
Linux: Start Command In Background explain
The “start” command in Linux can be used to run a command in the background. When a command is run in the background, it executes as a separate process in the system and does not block the terminal. To run a command in the background, you can add an ampersand symbol (&) at the end of
Linux / Unix: Add Line Numbers To Files
To add line numbers to a file in Linux/Unix, you can use the nl command. Here is an example:rn rn rn nl file.txt > numbered_file.txtrn rn rnThis will create a new file numbered_file.txt with line numbers added to the contents of file.txt . The nl command can also be used with other options and ar
FreeBSD Install sudo Command To Execute Commands
To install sudo on a FreeBSD system, follow these steps:rn rn Run the following command as the root user to update the package database: rn rn rn rn # pkg update rn rn rn rn Install the sudo package: rn rn rn rn # pkg install sudo rn rn rn rn To configure sudo , you will need to edit the /usr/local/
Debian Linux Squeeze 6.0: Install Python v2.6/2.5 Argparse Module
To install the Python Argparse module on Debian Squeeze 6.0, you can use the following steps:rn rn Open a terminal window rn Update the apt-get package manager index by running the following command: rn rn rn rn sudo apt - get update rn rn rn rn Install the python-argparse package by running the fol
Linux: Jpeg Image Optimization / Compress Command
You can use the jpegoptim utility to optimize JPEG images in Linux. You can install jpegoptim using your package manager, for example, in Ubuntu:rn rn rn # apt-get install jpegoptim rn rn rnOnce installed, you can optimize a JPEG image by specifying the file name as an argument:rn rn rn # jpegoptim
FreeBSD: Delete User Account Command
You can delete a user account in FreeBSD using the pw command. The following command will delete a user account named “user1”: n n n # pw userdel user1 n n n By default, the user’s home directory and related files will also be deleted. If you want to preserve the user’s home
Linux / Unix Shell Script: Get The Current Directory
You can get the current directory in a shell script using the pwd command. However, it's recommended to use the $PWD shell variable, which is automatically set to the current working directory. Here's an example shell script that prints the current directory:rn rn rn #!/bin/bash echo "Curren
SSH: WARNING: UNPROTECTED PRIVATE KEY FILE! Error and Solution
The “WARNING: UNPROTECTED PRIVATE KEY FILE!” error message occurs when the permissions on the private key file used for SSH authentication are too open, allowing unauthorized access to the key. n To resolve this issue, you need to change the permissions on the private key file to make it
Linux: Start / Stop / Restart Apparmor
To start, stop, or restart AppArmor on a Linux system, you can use the following commands: Start AppArmor:rn rn rn $ sudo service apparmor startrn rn rnStop AppArmor:rn rn rn $ sudo service apparmor stoprn rn rnRestart AppArmor:rn rn rn $ sudo service apparmor restartrn rn rnNote: The exact comma
Linux: Force Close A Socket / Port On Server In a TIME_WAIT State
You can use the "ss" or "lsof" command to identify the process that is using the socket/port in a TIME_WAIT state and then use the "kill" command to force close it. Example using ss:rn rn rn $ ss -tna | grep <port_number>rn rn rnThe output will show the process using the socket/port.rn rn r
Linux / Unix: Use rsync Command Over FTP
To use the rsync command over FTP, you need to use a wrapper such as lftp . Here's how:rn rn Install lftp : rn rn rn rn sudo apt - get update rnsudo apt - get install lftprn rn rn rn Connect to the FTP server: rn rn rn rn lftp ftp:// < user > : < password > @ < hostname > : < po
How to check network adapter status in Linux
To check the status of a network adapter in Linux, you can use the ip command. Here's how:rn rn To view the status of all network adapters, run: rn rn rn rn ip addr show rn rn rn rn To view the status of a specific network adapter, run: rn rn rn rn ip addr show < interface >rn rn rnReplace <
Apache / Nginx / Lighttpd: PHP Disable File Upload
To disable file uploads in PHP for Apache, Nginx, or Lighttpd web servers, you need to modify the PHP configuration file php.ini . Here's how to disable file uploads in PHP:rn rn Open the php.ini file: rn rn rn rn sudo nano /etc/php/7.4/fpm/php.inirn rn rn rn Find the following line: rn rn rn rn
Linux: Turn On TCP SYN Cookie Protection
To turn on TCP SYN cookie protection in Linux, you need to modify the kernel parameters. You can do this by adding the following line to the /etc/sysctl.conf file:rn rn rn net.ipv4.tcp_syncookies = 1rn rn rnAfter adding this line, run the following command to apply the changes:rn rn rn sysctl - p
2,685 guides published.
