VIKHOST Tech Blog
Useful Technical Articles, Notes and Instructions.
How To: Remount /etc/fstab Without Rebooting in Linux

How To: Remount /etc/fstab Without Rebooting in Linux

How To: Remount /etc/fstab Without Rebooting in Linux — The file /etc/fstab contains necessary information for automatic mountingof partitions. Usually, after this file editing, you reboot the Linux system for the changes to take effect. There is an easy way to remount all partitions from /etc/fstab without rebooting the system. You need to run the following command from root: # mount -a This simple command remounts all file systems which specified in /etc/fstab, with the exception of partitions with the noauto option ...
Read more
How to find out the external ip in Linux

How to find out the external ip in Linux

How to find out the external ip in Linux — If you need to find out external IP from Linux command line, you need to do one of next commands: How to find out the Public IP Address from the Linux Command Line You need to get external IP address using command curl: # curl ifconfig.me
# curl ip.appspot.com
# curl icanhazip.com How to get external IP using command wget: # wget -q -O - ifconfig.me
# wget -q -O - ip.appspot.com
# wget -q -O - icanhazip.com How to find out external IP Address using DynDNS.org 1. You can ...
Read more
Generating Random Passwords from the Command Line in Linux

Generating Random Passwords from the Command Line in Linux

Generating Random Passwords from the Command Line in Linux — You can use next command for generating random password in command line: # tr -dc A-Za-z0-9 < /dev/urandom | head -c 8 | xargs Password example: 4fFUND1d Also you can use next bash function (add it to yuor ~/.bashrc): Random Password Generator genpasswd() {
tr -dc A-Za-z0-9 < /dev/urandom | head -c ${1:-8} | xargs
} Reboot .bashrc: $ . ~/.bashrc Now use genpasswd to generate random passwords: $ genpasswd
vmuWt7TS
$ genpasswd 10
ymkIgxcdCh
$ genpasswd 16
wQnqgdc5tAQoiBdf ...
Read more
How to Clear BASH History in Linux, Centos, Debian and Ubuntu

How to Clear BASH History in Linux, Centos, Debian and Ubuntu

How to Clear BASH History in Linux, Centos, Debian and Ubuntu — If you don’t want to save history in Bash, since the commands may contain data such as passwords. This article will help keep Bash history in check. How to completely delete the Bash history: -c - Clear history file -w - add commands of the current session to the history file # history –cw How to remove a specific line from the Bash history: -d - Delete the line with the specified number from the history # history -dw 352 How to clear command history of current session: ...
Read more