Contents

Creating a Proxmox EL9 VM

The CPU type must be ‘host’; otherwise the VM will kernel panic while booting the installer ISO.

That’s because EL9 now requires CPUs to be compatible with the x86-64 v2 instruction set, which the default Qemu x64 exposed vCPU doesn’t support.

CIDR & Subnet mask

CIDRSubnet maskWildcard mask# of IP addresses# of usable IP addresses
/32255.255.255.2550.0.0.011
/31255.255.255.2540.0.0.120*
/30255.255.255.2520.0.0.342
/29255.255.255.2480.0.0.786
/28255.255.255.2400.0.0.151614
/27255.255.255.2240.0.0.313230
/26255.255.255.1920.0.0.636462
/25255.255.255.1280.0.0.127128126
/24255.255.255.00.0.0.255256254
/23255.255.254.00.0.1.255512510
/22255.255.252.00.0.3.2551,0241,022
/21255.255.248.00.0.7.2552,0482,046
/20255.255.240.00.0.15.2554,0964,094
/19255.255.224.00.0.31.2558,1928,190
/18255.255.192.00.0.63.25516,38416,382
/17255.255.128.00.0.127.25532,76832,766
/16255.255.0.00.0.255.25565,53665,534
/15255.254.0.00.1.255.255131,072131,070
/14255.252.0.00.3.255.255262,144262,142
/13255.248.0.00.7.255.255524,288524,286
/12255.240.0.00.15.255.2551,048,5761,048,574
/11255.224.0.00.31.255.2552,097,1522,097,150
/10255.192.0.00.63.255.2554,194,3044,194,302
/9255.128.0.00.127.255.2558,388,6088,388,606
/8255.0.0.00.255.255.25516,777,21616,777,214
/7254.0.0.01.255.255.25533,554,43233,554,430
/6252.0.0.03.255.255.25567,108,86467,108,862
/5248.0.0.07.255.255.255134,217,728134,217,726
/4240.0.0.015.255.255.255268,435,456268,435,454
/3224.0.0.031.255.255.255536,870,912536,870,910
/2192.0.0.063.255.255.2551,073,741,8241,073,741,822
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,646
/00.0.0.0255.255.255.2554,294,967,2964,294,967,294

* /31 is a special case detailed in RFC 3021 where networks with this type of subnet mask can assign two IP addresses as a point-to-point link.

Find & delete files

find /path/to/dir -args

Delete empty directories

find /path/to/dir -empty -type d -delete

Delete empty files

find /path/to/dir -empty -type f -delete

Count all empty files or directories

Count empty dirs only

find /path/to/dir/ -empty -type d | wc -l

Count empty files only

find /path/to/dir/ -empty -type f | wc -l

Where :

  • -empty : Only find empty files and make sure it is a regular file or a directory.
  • -type d : Only match directories.
  • -type f : Only match files.
  • -delete : Delete files. Always put -delete option at the end of find command as find command line is evaluated as an expression, so putting -delete first will make find try to delete everything below the starting points you specified.

This is useful when you need to clean up empty directories and files in a single command.

Cleanup unnecessary files and Desktop OSses clutter

cd "$SOURCEDIR"
find ./ \( -name ".DS_Store" -or -name "._*" -or -name "Thumbs.db" -or -name "*.tmp" -or -name "*.lnk" -or -name "TemporaryItems" -or -name "folders.501" -or -name ".TemporaryItems" -or -name "__MACOSX" \) -ls -delete

Change ownership of files owned by a specific username

find /path/to/dir/ -user username -exec chown newuser:newgroup {} +

Disable or Enable Windows 11’s new context menu

To enable, run the following :

reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve

Then restart Windows Explorer e.g. via Task Manager.

to disable, run :

reg.exe delete "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" /f

Then restart Windows Explorer.

Add TLS Certificate to ESXi

1. Allow SSH access to ESXi/ESX hosts with public/private key authentication

To allow root access on the ESXi host, change PermitRootLogin no to PermitRootLogin yes in the /etc/ssh/sshd_config file. To disable password login, ensure that the ChallengeResponseAuthentication and PasswordAuthentication are set to no.

If changes were made to the SSHd config file, reload the service :

For ESXi :
/etc/init.d/SSH restart

For ESX :
service sshd reload

After activating the SSH service on the ESXi host (in the web UI : Host tab > Actions menu > Services > Enable Secure Shell (SSH)), backup the original certificates :

cd /etc/vmware/ssl
mv rui.key rui.key.ori
mv rui.crt rui.crt.ori

For ESXi 5.x, 6.0, 6.5 and 6.7, the authorized_keys is located at :

/etc/ssh/keys-<username>/authorized_keys

Copy the generated public/private key and test the connection to the ESXi host.

(source : https://kb.vmware.com/s/article/1002866)

2. Deploy TLS Certificates to ESXi

Create a TLS certificate (e.g. via acme.sh) and copy to the ESXi host the newly generated certificate :

scp tls_esxihost.cer root@esxihost.lan:/etc/vmware/ssl/rui.crt 
scp tls_esxihost.key root@esxihost.lan:/etc/vmware/ssl/rui.key

Then, reload services to serve the new certificate :

services.sh restart

(source : https://www.linuxtricks.fr/wiki/wiki.php?title=vmware-esxi-ajouter-son-propre-certificat)

Configure WPA Enterprise Wi-Fi connection on Raspbian Buster (10)

Add the following to /etc/wpa_supplicant/wpa_supplicant.conf :

eapol_version=2

network={
ssid="SSID_HERE"
proto=RSN
key_mgmt=WPA-EAP
pairwise=CCMP
auth_alg=OPEN
eap=PEAP
identity="USERNAME_HERE"
password=hash:#####################
phase1="peaplabel=0"
phase2="auth=MSCHAPV2"
}

and change /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant :
seach for this string in wpa_supplicant_start() function :

nl80211,wext

and replace the drivers’ order with

wext,nl80211

Check if the wlan0 interface gets an IP address :

ip a

Play sound with PHP on a Raspberry Pi

Configure the sound output interface :

sudo raspi-config
Option 1 System Options
Option S2 Audio

Install the necessary software : Apache HTTPd, PHP 7 and the PHP Apache module :

sudo apt install apache2 php libapache2-mod-php

Allow Apache to access audio devices by adding its user to the audio group :

sudo usermod -a -G audio www-data

in the PHP script, execute the aplay command :

<?php exec('aplay '.DIR.'/sound.wav'); ?>

Carriage return and line feed

Line feed and carriage return are two different ways of how your computer sees the Enter key.

While for example the character M is interpreted the same way in Windows and in UNIX, the ENTER key is interpreted differently. This causes problems when transferring files and data from one platform to another one.

When transferring files from one platform to another, you can experience that ENTERs are not translated in a way thay you would expect.

Windows uses carriage return – line feed.

UNIX uses line feed.

Macintosh uses carriage return.

A line feed is expressed in hexadecimal as 0a. A carriage return is noted as hexadecimal 0d. Windows carriage return – line feed is 0a0d in hexadecimal notation.

How do I spot a problem with carriage return and line feed?

When you take a UNIX file and open it in Windows NOTEPAD, you will most likely see something like the following example:

<?php // $Id: blog.module,v 1.271.2.2 2007/04/23 17:05:11 dries Exp $log_user($type, &$edit, &$user) {&nbsp;&nbsp; if ($type == 'view' && user_accesa page that displays the most recent blog entries from all the users tion handbook <a href="@blog">Blog page</a>.', array('@blog' => 'httpORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10))ser->uid) && user_access('edit own blog')) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output = '<li>'. blog entries of all users.&nbsp; */ function blog_page_last() {&nbsp;&nbsp; global $object(db_query('SELECT i.*, f.title as ftitle, f.link as flink FROM ge) {&nbsp;&nbsp;&nbsp;&nbsp; // Breadcrumb navigation&nbsp;&nbsp;&nbsp;&nbsp; $breadcrumb[] = array('path' =may_cache) {&nbsp;&nbsp;&nbsp;&nbsp; $items[] = array('path' => 'blog', 'title' => t('Bloblog', array('title' => t('Read the latest blog entries.'))) .'</div>

All the lines are compressed and enters are clearly missing. Well, they are not completely missing, they are just coded in a format that Notepad does not understand. Why this happens, you can find that at this page: Line termination: line feed versus carriage return.

How do I know what system a file was created in?

When you open the file in a HEX editor, you can tell by looking at the HEX code to find out whether your Enters were encoded as carriage returns, line feeds, or the pair of both.

Enter as line feed

This picture shows you that Enters have been encoded as line feed.

How do I fix a problem with carriage return?

One way to fix this is to open the file using a HEX editor and replace all the “bad” enters with the “good” ones. In our case, we would replace all references to 0a with 0d0a. Then, this file should be readable by Windows Notepad.

One very nice and easy fix is to:

-> open your file in Notepad,
-> copy the content of the file,
-> paste it into MS Word,
-> copy the text in MS Word,
-> and paste it back to Notepad

If you do this with the file pictured above, you will get the following result:

Enter as carriage return line feed

You can see that all Enters have been coded in a form of carriage return – line feed, that is 0d0a.

You can open the file in Windows Notepad and see the code nicely formatted line by line as they were on the UNIX computer.

Line termination: line feed versus carriage return 0d 0a

Line feed and carriage return are two different ways of computer interpretting the ENTER key. Line feed and carriage return are two different ways how lines are ended in the computer language. Both the line feed and carriage return originate in the typewriter age.

The best way to explain this is is to ask:

“What do you suppose your computer sees when you press the Enter key?”

You can rest assured that your computer translates the ENTER key stroke into something. But while for example the character A is interpreted the same way by all common platforms (Windows, UNIX, Mac), the ENTER key is interpreted differently.

This causes problems when porting files from one platform to another one.

How ENTER works in computer language?

When you press A on your keyboard, you will see letter A on the screen. When you press B on your keyboard, you will see letter B on the screen.

Each of these two characters gets translated into a code that the computer can understand. Each of these two characters is one byte long, and your computer has some algorithm for translating these human readable letters into code numbers.

The computer number assigned to the letter A happens to be 65 (you can find this in the ASCII table). In other words, the decimal representation of the letter or character A is 65. If you translate this into the computer zeros and ones, you will get 1000001, which is 8 bits, that is one byte.

Decimal binary hex or hexadecimal – What is it?

Characters’ code values are represented by various utilities using different numbering schemes. Some times we talk about the decimal number system. In this system, letter A is represented by number 65. Letter B is represented by number 66.

Some times (rarely) symbols are expressed in binary number system. In this numbering scheme, letter A would be 1000001 as we have already mentioned, and the letter B would be expressed as 1000010.

Quite often, symbols are expressed using the hexadecimal number system. Letter A in this system is expressed as 41 and letter B is 42.

Decimal 10000001, binary 65, and hexidecimal 41 are different numeric “languages” for the same letter.

There are other numbering schemes such as octal, but we won’t get into those.

So, what does my computer see when I hit ENTER?

When you look inside some file that you created, you can find out. All that you need for this job is some hexadecimal editor. You can use for example the PSPad editor.

Open a text file in the text editor and type the following sequence:

A
hit enter
B
hit enter

Now when you open the file in a hexadecimal editor in a HEX view, you should see the following:

Carriage return 0d line feed 0a

Note that the letter A shows as 41 and the letter B shows as 42.

If your file was created in Linux, you would also see a single character 0a after each letter, that is, wherever you pressed the ENTER key.

If your file was created in Windows, the pair of characters 0d and 0a would appear any place where you pressed the ENTER key.

The hexadecimal 0a, a control character as opposed to a printing character, is called a line feed.

The hexadecimal 0d is called a carriage return.

Pretty much all the programs on the Windows platform understand and expect the hexadecimal 0a0d pair in text. The 0d0a pair of characters is the signal for the end of a line and beginning of another.

On the other hand, a UNIX program expects the single 0a character to denote the same thing.

A problem arises with cross-platform exchange of files. If you transfer files from Linux to Windows or Mac, the software sees something other than what it expects.

Windows versus UNIX versus Macintosh

As if it was not enough, Macintosh makes the whole story even more complicated. The original Mac operating system used carriage return 0d as the line separator. 

So, to summarize, Windows uses carriage return – line feed, UNIX and newer Mac use line feed, and older Macs use carriage return.

Windows :

preceding text -> 0d 0a -> succeeding text

UNIX, Mac OS X :

preceding text -> 0a -> succeeding text

MAC (OS-9 and earlier):

preceding text -> 0d -> succeeding text

ASCII table

ASCII is a standard for character encoding used by computers and communications equipment to represent text. ASCII is short for American Standard Code for Information Interchange. You can find the ASCII table below.

Computers can only understand numbers, so a code ASCII is the numerical representation of a character such as M or 8 or $ or an action of some sort. ASCII uses a single byte to represent each character. A byte is generally the smallest addressable unit of data on a computer. It is a continuous sequence of eight bits, that is zeros or ones.

This means that one byte could represent any of 256 characters ranging in binary notation from 00000000 to 11111111. Eight bits allows 256 combinations of zeros and ones.

ASCII table

This following ASCII table lists the ASCII characters and their decimal, octal and hexadecimal numbers.

Below you can find the 128 standard character encodings in US-ASCII, which is the original and most basic version of ASCII. Each of these numbers in the ASCII table is a seven digit binary number between 00000000 and 01111111. The eighth bit (the left-most bit) was originally reserved for use as a parity bit.

The first 32 ASCII codes in the ASCII table below (zero through 31 in decimal notation, or 00000000 through 00011111 in binary) are reserved and are called control characters. These are non-printing ASCII characters. They were originally intended to control devices, most importantly printers. These characters appear in the most left column. The ASCII non-printing characters are rarely used for their original purpose these days.

CharDecOctHex/CharDecOctHex/CharDecOctHex/CharDecOctHex
null byte000000x00|space3200400x20|@6401000x40|`9601400x60
start of heading100010x01|!3300410x21|A6501010x41|a9701410x61
start of text200020x02|3400420x22|B6601020x42|b9801420x62
end of text300030x03|#3500430x23|C6701030x43|c9901430x63
end of transmission400040x04|$3600440x24|D6801040x44|d10001440x64
enquiry500050x05|%3700450x25|E6901050x45|e10101450x65
acknowledge600060x06|&3800460x26|F7001060x46|f10201460x66
bell character700070x07|3900470x27|G7101070x47|g10301470x67
backspace800100x08|(4000500x28|H7201100x48|h10401500x68
horizontal tab900110x09|)4100510x29|I7301110x49|i10501510x69
newline1000120x0a|*4200520x2a|J7401120x4a|j10601520x6a
vertical tab1100130x0b|+4300530x2b|K7501130x4b|k10701530x6b
formfeed1200140x0c|,4400540x2c|L7601140x4c|l10801540x6c
carriage return1300150x0d|4500550x2d|M7701150x4d|m10901550x6d
shift out1400160x0e|.4600560x2e|N7801160x4e|n11001560x6e
shift in1500170x0f|/4700570x2f|O7901170x4f|o11101570x6f
data link escape1600200x10|04800600x30|P8001200x50|p11201600x70
device control 11700210x11|14900610x31|Q8101210x51|q11301610x71
device control 21800220x12|25000620x32|R8201220x52|r11401620x72
device control 31900230x13|35100630x33|S8301230x53|s11501630x73
device control 42000240x14|45200640x34|T8401240x54|t11601640x74
negative acknowledge2100250x15|55300650x35|U8501250x55|u11701650x75
synchronous idle2200260x16|65400660x36|V8601260x56|v11801660x76
end of trans block2300270x17|75500670x37|W8701270x57|w11901670x77
cancel2400300x18|85600700x38|X8801300x58|x12001700x78
end of medium2500310x19|95700710x39|Y8901310x59|y12101710x79
substitute2600320x1a|:5800720x3a|Z9001320x5a|z12201720x7a
escape2700330x1b|;5900730x3b|[9101330x5b|{12301730x7b
file separator2800340x1c|<6000740x3c|\9201340x5c||12401740x7c
group separator2900350x1d|=6100750x3d|]9301350x5d|}12501750x7d
record separator3000360x1e|>6200760x3e|^9401360x5e|~12601760x7e
unit separator3100370x1f|?6300770x3f|_9501370x5f|delete12701770x7f
ASCII Table

Note that lower and upper case characters are understood by the computer differently.

Create bootable macOS install media

sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/UNTITLED

To avoid getting a ‘Installation Failed’ message, you need to change the date before installing :

date {month}{day}{hour}{minute}{year}

Set the Mac’s date to a date right around the time of release of the OS, e.g.

  • 10.7 : Mac OS X Lion was released on July 20, 2011.
  • 10.8 : OS X Mountain Lion was released on July 25, 2012.
  • 10.9 : OS X Mavericks was released on October 22, 2013.
  • 10.10 : OS X Yosemite was released on October 16, 2014.
  • 10.11 : OS X El Capitan was released on September 30, 2015.
  • 10.12 : macOS Sierra was released on September 20, 2016.
  • 10.13 : macOS High Sierra was released on September 25, 2017.
  • 10.14 : macOS Mojave was released on September 24, 2018.
  • 10.15 : macOS Catalina was released on October 7, 2019.
  • 11 : macOS Big Sur was released November 12, 2020.
  • 12 : macOS Monterey was released on October 25, 2021.

When creating an Intel install media on an ARM-based Mac, the OS expects the createinstallmedia executable to be signed before running, but the Apple-made program isn’t.
You’ll encounter a zsh : killed. error otherwise.
Sign the program with the following :

codesign -s - -f createinstallmedia

Permanently add SSH private key to Keychain

On OSX, the native ssh-add client has a special argument to save the private key’s passphrase in the OSX keychain, which means that your normal login will unlock it for use with ssh. On OSX Sierra and later, you also need to configure SSH to always use the keychain (see Step 2 below).

Alternatively you can use a key without a passphrase, but if you prefer the security that’s certainly acceptable with this workflow.

Step 1 – Store the key in the keychain

Just do this once:

ssh-add -K ~/.ssh/[your-private-key]

Enter your key passphrase, and you won’t be asked for it again.

(If you’re on a pre-Sierra version of OS X, you’re done, Step 2 is not required. In versions of macOS before Monterey, use --apple-use-keychain instead of -K)


Step 2 – Configure SSH to always use the keychain

It seems that OSX Sierra removed the convenient behavior of persisting your keys between logins, and the update to ssh no longer uses the keychain by default. Because of this, you will get prompted to enter the passphrase for a key after you upgrade, and again after each restart.

The solution is fairly simple, and is outlined in this github thread comment. Here’s how you set it up:

Ensure you’ve completed Step 1 above to store the key in the keychain.

If you haven’t already, create an ~/.ssh/config file. In other words, in the .ssh directory in your home dir, make a file called config.

In that .ssh/config file, add the following lines:

Host *
  UseKeychain yes
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_rsa

Change ~/.ssh/id_rsa to the actual filename of your private key. If you have other private keys in your ~.ssh directory, also add an IdentityFile line for each of them. For example, I have one additional line that reads IdentityFile ~/.ssh/id_ed25519 for a 2nd private key.

The UseKeychain yes is the key part, which tells SSH to look in your OSX keychain for the key passphrase.

That’s it! Next time you load any ssh connection, it will try the private keys you’ve specified, and it will look for their passphrase in the OSX keychain. No passphrase typing required.

Prevent creation of .DS_Store files on network shares

One thing that can be problematic when working with any shared storage is the existence of .DS_Store files on the network share, since these are intended for a single workstation’s use.

Enabling a policy to prevent the creation of .DS_Store files on network shares can speed up directory browsing (as described in this article) and prevent permission errors when moving/deleting files.

To prevent the Mac workstation from creating .DS_Store files on network shares, as well as instruct it to ignore existing .DS_Stores, open Terminal and enter:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE

and then log out/log in the macOS user account, or simply reboot the workstation.

To check the current policy in place, enter:

defaults read com.apple.desktopservices

If .DS_Store files are disallowed for network shares, “DSDontWriteNetworkStores = 1” should be displayed.

Note: To remove this policy and restore the default behavior, enter

defaults delete com.apple.desktopservices DSDontWriteNetworkStores

How to prevent the creation of .DS_Store files on network volumes

When working on network drives with Mac OS X every Mac user will by default create .DS_Store files. Those files are used by OS X to store custom attributes like icon positions. For more info on .DS_Store files read this article.

To prevent those files from being created:

  • Open up the Terminal
  • Run the following command
    defaults write com.apple.desktopservices DSDontWriteNetworkStores true
  • Restart your Mac or log out and back in.

Those .DS_Store files will now only be created on local volumes any you no longer have Windows users yelling at you about them. 😉

How to Change the Default Shell to Bash on macOS Catalina

With macOS Catalina, Apple is now using Zsh as the default shell. We love Zsh, but the trusty old Bash shell is still included with macOS, and you can quickly switch back to Bash if you prefer.

Zsh is only the default shell on newly created user accounts, so any existing accounts you have on an upgraded  Mac will still use Bash by default unless you change it. Each user account has its own default shell preference.

From the Terminal

To change a user account’s default shell on macOS, simply run the chsh -s (change shell) command in a Terminal window.

Change the default shell to Bash by running the following command:

chsh -s /bin/bash

You’ll have to enter your user account’s password. Finally, close the Terminal window and reopen it. You’ll be using Bash instead of Zsh.

Changing the default shell to Bash on macOS Catalina.

Change the default shell back to Zsh by running this command:

chsh -s /bin/zsh

Enter your password when prompted. After you close the terminal window and reopen it, you’ll be using Zsh.

Changing the default shell to Zsh on macOS Catalina.

You can see a list of included shells you can select by running the following command:

cat /etc/shells
Listing available shells in macOS Catalina's terminal.

From System Preferences

You can also change this option graphically from System Preferences if you prefer.

Head to System Preferences > Users & Groups on your Mac. Click the lock icon and enter your password. Hold the Ctrl key, click your user account’s name in the left pane, and select “Advanced Options.”

Opening Advanced Options in Users & Groups on macOS.

Click the “Login Shell” dropdown box and select “/bin/bash” to use Bash as your default shell or “/bin/zsh” to use Zsh as your default shell. Click “OK” to save your changes.

Changing the default login shell graphically in macOS Catalina.

Bash on macOS Is Still Outdated

Note that the version of Bash (Bourne Again SHell) included with macOS is still pretty outdated, however. If you run bash --version , you’ll see that Catalina includes Bash 3.2.57 when Bash 5.0 is the latest version. Newer versions are licensed under the GPLv3 license, while Apple still distributes a version licensed under GPLv2.

In contrast, the version of Zsh (Z shell) included with macOS (check with zsh --version ), is Zsh 5.7.2, which is the latest version at the time of Catalina’s release.

Viewing the versions of Bash and Zsh on macOS Catalina.

If you want the latest version of Bash, you can install it yourself via Homebrew.

How can I permanently add my SSH private key to Keychain so it is automatically available to ssh?

On OSX, the native ssh-add client has a special argument to save the private key’s passphrase in the OSX keychain, which means that your normal login will unlock it for use with ssh. On OSX Sierra and later, you also need to configure SSH to always use the keychain (see Step 2 below).

Alternatively you can use a key without a passphrase, but if you prefer the security that’s certainly acceptable with this workflow.

Step 1 – Store the key in the keychain

Just do this once:

ssh-add -K ~/.ssh/[your-private-key]

Enter your key passphrase, and you won’t be asked for it again.

(If you’re on a pre-Sierra version of OSX, you’re done, Step 2 is not required.)

Step 2 – Configure SSH to always use the keychain

It seems that OSX Sierra removed the convenient behavior of persisting your keys between logins, and the update to ssh no longer uses the keychain by default. Because of this, you will get prompted to enter the passphrase for a key after you upgrade, and again after each restart.

The solution is fairly simple, and is outlined in this github thread comment. Here’s how you set it up:

  1. Ensure you’ve completed Step 1 above to store the key in the keychain.
  2. If you haven’t already, create an ~/.ssh/config file. In other words, in the .ssh directory in your home dir, make a file called config.
  3. In that .ssh/config file, add the following lines:
    Host *
    UseKeychain yes
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_rsa

    Change ~/.ssh/id_rsa to the actual filename of your private key. If you have other private keys in your ~.ssh directory, also add an IdentityFile line for each of them. For example, I have one additional line that reads IdentityFile ~/.ssh/id_ed25519 for a 2nd private key. The UseKeychain yes is the key part, which tells SSH to look in your OSX keychain for the key passphrase.
  4. That’s it! Next time you load any ssh connection, it will try the private keys you’ve specified, and it will look for their passphrase in the OSX keychain. No passphrase typing required.

Skip Mojave/Catalina Screenshot Delay

When you take a screenshot with Mojave or Catalina using Command+Shift+3, 4 or 5, you get a thumbnail of the image in the lower right corner for a few seconds.

This can be handy if you want to access the image by clicking it, without needing to find the file.

But if you’d rather not have the thumbnail, you can turn it off.

Use Command+Shift+5 and then click on the Options button that appears in the controls.

Then uncheck Show Floating Thumbnail.