Visual Studio Code and opening a file by file type

Visual Studio Code

Visual Studio Code and open the program that is associated with the file’s extension. This article covers both Mac and Windows.

Mac

  1. CMD-Shift-P
  2. Tasks: Configure Task
  3. Add this JSON to the task

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Open file",
            "type": "shell",
            "command": "open",
            "args": ["${file}"]
        }
    ]
}

Windows

  1. Ctrl-Shift-P or F1
  2. Tasks: Configure Task
  3. Add this JSON to the task file

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Open file",
            "type": "shell",
            "command": "explorer.exe",
            "args": ["${file}"]
        }
    ]
}




Setting SSH Key Permissions

Terminal

If you use ssh (Secure Shell) then you have likely encountered this error.

If you haven’t generated a key, then you’ll want to use ssh-keygen to create a key for ssh sessions.

Linux

Usually, your key file will be located at ~/.ssh/id_rsa.pub on UNIX based systems

chmod 600 path/to/key/keyfile

Windows

Usually, your key file will be located at %USERPROFILE%\.ssh\id_rsa.pub

Run this command to enable inheritance

icacls path/to/key/keyfile /inheritance:r
processed file: keyfile

Successfully processed 1 files; Failed processing 0 files

Run this command to grant read access to your user on the file

icacls file /grant:r yourusername:"(R)"
processed file: keyfile
Successfully processed 1 files; Failed processing 0 files