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: Sort ls Command Output By Last Modified Date and Time
To sort the output of the ls command by last modified date and time, you can use the following command:rn rn rn $ ls -lt rn rn rnThe -l option will list the files in long format and the -t option will sort the files by last modification time, so the most recently modified files will appear first in
How To Find a Directory On Linux Based System
To find a directory on a Linux-based system, you can use the find command. Here's the basic syntax:rn rn rn $ find / path /to/search -name "directory-name" rn rn rnReplace /path/to/search with the path to the directory where you want to start the search and directory-name with the name of the dir
MacOS – Set / Change $PATH Variable Command
To set or change the $PATH variable in macOS, you can modify the .bash_profile file in your home directory.rn rn Open Terminal rn Open the .bash_profile file: rn rn rn rn $ nano ~/.bash_profile rn rn rn rn To add a new directory to the $PATH , add the following line: rn rn rn rn export PATH = $PATH
Ubuntu Linux LTS: Force Kernel Package Updates Which Have Been Kept Back
To force the installation of kept-back kernel packages in Ubuntu Linux LTS, you can use the following command:rn rn rn sudo apt-get install linux-image-generic-lts- < version > linux-headers-generic-lts- < version > rn rn rnReplace <version> with the desired version number. This co
SSH Into Google Cloud Compute Engine Instance Using Secure Shell Client
To SSH into a Google Cloud Compute Engine instance, follow these steps:rn rn Open the Secure Shell Client rn Generate a new SSH key pair if you don't already have one: rn rn rn rn $ ssh-keygen -t rsarn rn rn rn Add your public key to the instance: rn rn rn Go to the Google Cloud Console. rn Select y
OpenSSH Config File Examples For Linux / Unix Users
The OpenSSH config file is typically located at /etc/ssh/ssh_config and ~/.ssh/config . This file can be used to configure various options and settings for the OpenSSH client, such as setting a preferred port number, specifying private key files, enabling compression, and more. A common example of u
Linux Change Password Using passwd Command Over SSH
To change the password for a user over SSH, follow these steps:rn rn Connect to the remote Linux server using ssh: rn rn rn rn ssh username @remote -server-ip-addressrn rn rn rn Run the following command to change the password: rn rn rn rn passwdrn rn rn rn You will be prompted to enter the current
Debian / Ubuntu: Install Duplicity For Encrypted Backup In Cloud
To install duplicity in Debian or Ubuntu, you can use the following steps:rn rn Update the package list: rn rn rn rn sudo apt update rn rn rn rn Install the duplicity package: rn rn rn rn sudo apt install duplicityrn rn rn rn To make backups to the cloud, you'll need to install the required cloud st
Debian / Ubuntu: Install Duplicity For Encrypted Backup In Cloud
To install duplicity in Debian or Ubuntu, you can use the following steps:rn rn Update the package list: rn rn rn rn sudo apt update rn rn rn rn Install the duplicity package: rn rn rn rn sudo apt install duplicityrn rn rn rn To make backups to the cloud, you'll need to install the required cloud st
Python Get Today’s Current Date and Time
You can use the built-in datetime module in Python to get the current date and time. Here’s an example: n n n from datetime import datetime n current_time = datetime.now() n print ( "Current date and time: " , current_time) n n n This will give you the current date and time in the format: YYYY
GPG Change Passphrase Secret Key Password Command
To change the passphrase of a GPG secret key, you can use the gpg --edit-key command followed by the key ID and then the passwd subcommand. The process will prompt you to enter the current passphrase and then to enter the new passphrase twice for confirmation. Here's an example:rn rn rn gpg --edit-k
macOS Terminal Download File Command
The “curl” command is commonly used to download files in the terminal on macOS. You can download a file by specifying its URL after the “curl” command, like this: rn rn rn curl https : //example.com/file.txt -o file.txt rn rn rn This will download the file located at “
CentOS Linux: Add Static Routing
To add a static route on CentOS, you can use the route command. The basic syntax for adding a static route is as follows: n n n sudo route add -net netmask gw dev n n n For example, if you want to add a static route for the network 192.168.100.0/24 through gateway 192.168.0.1, you can use the follow
RHEL/CentOS: yum Update All Packages Except the Linux Kernel
You can update all packages on RHEL/CentOS using yum command, excluding the Linux kernel by using the following command:rn rn rn sudo yum update --exclude=kernel\* rn rn rnThis will update all the packages except for the packages that start with "kernel".
Ubuntu: Stat / Stop / Restart Iptables Firewall Service
In Ubuntu, you can manage the iptables firewall service using the following commands: n n To check the status of the iptables firewall service: n n n n sudo service iptables status n n n n To stop the iptables firewall service: n n n n sudo service iptables stop n n n n To start the iptables firewal
Unix / Linux: cat .GZ Compressed Text File On Screen
rn 1 / 2 rn rn rn rn rn To display the contents of a .gz compressed text file on the screen in Unix or Linux, you can use the following command:rn rn rn zcat file.gzrn rn rnThe zcat command decompresses the file and sends the output to the standard output, which is usually the screen. If you wan
CentOS / RHEL: Install iftop To Display Bandwidth Usage Per interface By Host
To install iftop on CentOS or Red Hat Enterprise Linux, you can use the following steps: n n Enable the EPEL repository: n n n n yum install epel - release n n n n Install iftop: n n n yum install iftop n n n Once installed, you can run iftop in the terminal to display bandwidth usage by host for ea
WordPress MySql Statement To Delete All Pending Comments
To delete all pending comments in a WordPress database, you can run the following SQL statement using a database management tool like phpMyAdmin:rn rn rn DELETE FROM wp_comments WHERE comment_approved = '0' ;rn rn rnNote: Replace "wp_" with your WordPress database table prefix if it is different.
HowTo: Create a Self-Signed SSL Certificate on Nginx For CentOS / RHEL
To create a self-signed SSL certificate on Nginx for CentOS or Red Hat Enterprise Linux, you can use the OpenSSL tool. Here's an example of how to do this:rn rn Install OpenSSL: rn rn rn rn # yum install openssl rn rn rn rn Create a directory to store the SSL certificate: rn rn rn rn # mkdir /etc/ng
Nginx: 301 Redirect To A Domain Name
To redirect all requests from one domain to another in Nginx, you can add the following code to your Nginx configuration file:rn rn rn server {rn listen 80 ;rn server_name olddomain.com;rn return 301 $scheme ://newdomain .com $request_uri ;rn}rn rn rnThis code listens on port 80 and checks the hostn
2,685 guides published.
