Skip to main content

Posts

Showing posts from February, 2020

How to Undo and Redo in Vim / Vi

Sometimes, when editing a file, you may delete a wrong line or change your mind about an edit, and you’ll want to revert the changes. This article explains how to undo and redo changes in Vim / Vi. Either Vi or Vim is installed by default on macOS and almost all Linux distributions. Knowing the basics of Vim might be very useful when you encounter a situation where your favorite editor is not available. Undo Changes in Vim / Vi   Vim keeps track of all the changes you made in the current session. The undo command undoes one or more changes in the order in which they were made. To undo changes in Vim and Vi use the u, :u or :undo command: If you are in insert or any other mode, press the Esc key to go back to the normal mode, which is also known as command mode. Type u to undo the last change. In Vim, the u command also accepts quantifiers. For example, if you want to undo the 4 last changes, you would use 4u. Make sure you’re typing lowercase u, not the uppercase U command, w

Understanding the /etc/shadow File : information about the system’s users’ passwords : [Beginners Guide]

There are several different authentication schemes that can be used on Linux systems. The most commonly used and standard scheme is to perform authentication against the /etc/passwd and /etc/shadow files. /etc/shadow is a text file that contains information about the system’s users’ passwords. It is owned by user root and group shadow, and has 640 permissions. /etc/shadow Format   The /etc/shadow file contains one entry per line, each representing a user account. You can view the contents of the file, with a text editor or a command such as cat: sudo cat /etc/shadow Typically, the first line describes the root user, followed by the system and normal user accounts. New entries are appended at the end of the file. Each line of the /etc/shadow file contains nine comma-separated fields: 01. Username. The string you type when you log into the system. The user account that exist on the system. 02. Encrypted Password. The password is using the $type$salt$hashed forma

Install Docker on Linux [Beginners Guide]

Install Docker on Linux No matter your distribution of choice, you’ll need a 64-bit installation and a kernel at 3.10 or newer. Kernels older than 3.10 do not have the necessary features Docker requires to run containers; data loss and kernel panics occur frequently under certain conditions. Check your current Linux version with uname -r . You should see something like 3.10.[alphanumeric string].x86_64 . Debian and Ubuntu Docker runs on: Ubuntu Xenial 16.04 LTS Ubuntu Wily 15.10 Ubuntu Trusty 14.04 LTS Ubuntu Precise 12.04 LTS Debian testing stretch Debian 8.0 Jessie Debian 7.0 Wheezy (you must enable backports) Debian Wheezy If so, you need to enable backports (if not, ignore this section): Log into the system and open a terminal with sudo or root privileges (or run sudo -i from your terminal). Open /etc/apt/sources.list.d/backports.list with your favorite text editor (if the file does not exist, create it). Remove existing entries.