How to find IPv6 Address of a host?

On macOS & Linux
Use the host command
host -t AAAA
host is a terminal tool for performing DNS lookups.



On macOS & Linux
(or any platform in which “curl” is installed)



FORMATTING A USB from Terminal or CMD

On macOS
NOTE: Be cautious when using the following commands.

Finding the partition of the disk:
diskutil list
diskutil list

From the above picture, the 8 GB USB I plugged-in is partioned at /dev/disk2
diskutil eraseDisk FAT32 BOB /dev/disk2
diskutil is a macOS terminal tool.
eraseDisk is the command to erase the disk.
FAT32 is the file system that the USB is going to be formatted to.
BOB is the new name given to the USB.
/dev/disk2 is the partition of the USB (from above picture).
Formatting USB

On Windows (images to follow soon; soon as in, soon-soon)
Open Command Promt with Administrative privilages.
Type the following:
This will launch “diskpart”, a command-line disk partitioning utility.
list disk
This will list all the available disks.
Select the disk to be formatted.
select disk 1
Type the following commands:

create partition primary


format FS=FAT32 label=BOB quick


To assign the drive a drive-letter, type the following before typing exit:
assign letter=Z


USB showing the wrong size
wrong partition size

Change default settings of VIM

On UNIX, Linux & MacOS only
Type the following to change the current directory to Home directory:

cd $HOME

Edit the file “.vimrc” by typing:

vi .vimrc

Add the following lines at the end of the existing text.

syntax on
set number

If the file “.vimrc” does not exist, go to /usr/share/vim/
Copy the text of the file “vimrc” and paste it in a new file in $USER/.vimrc and add the above mentioned lines.

The final script would look similar to this:

" Configuration file for vim
set modelines=0         " CVE-2007-2438

" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible        " Use Vim defaults instead of 100% vi compatibility
set backspace=2         " more powerful backspacing

" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup nobackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup nobackup

let skip_defaults_vim=1

" Following lines are written by me
" The following line will switch ON Syntax Highlighting and Line Numbers.
syntax on
set number

Here is a screenshot:

Other Default Settings:
set tabstop=2
Will set 2 spaces to a tab.
set autoindent
Automatically indents all the new lines.

Credit: Ilmo Euro

Yet on the foggy windows,…


Yet on the foggy windows, its still your name I write

Hosting a Local Web server using PHP

php -S -t ~/wherever/your/index/file/is/located

Here, is the static IP Address assigned to the machine/laptop.

Deleting known SSH Hosts on UNIX

Using terminal, go to /Users/Username/.ssh

cd /Users/John/.ssh

Open the known_hosts file with a text editor of your choice

vi know_hosts

Each line here is a host that has been permenantly registered on your machine.
Delete the line that belongs to the unnecessary host.
Tip: In VIM, dd is the shortcut to delete the entire line.


PS. Life tip: To exit VIM, make sure you are in command mode by clicking ESC [escape] button on your keyboard/touch bar and type the following: