Notes

Quick notes / tips

Serve current directory with NodeJS

2021/10/15

When you want to statically serve files over HTTP:

npm install -g http-server
http-server -p 8000

Mount external drive in WSL

2021/10/14

When you want to mount an external drive in WSL (NOTE: replace f with the appropriate drive letter):

sudo mkdir /mnt/f && sudo mount -t drvfs f: /mnt/f

Then to unmount:

sudo umount /mnt/f && sudo rmdir /mnt/f

ssh-copy-id in PowerShell

2021/09/11

When you have a ssh key that was generated in PS (e.g. ssh-keygen -t rsa -b 4096 ) which you want to copy to a remote machine for automatic login (e.g. passwordless connections to remote machines via VS Code's Remote - SSH extension):

$USER_AT_HOST="your-user-name-on-host@hostname"
$PUBKEYPATH="$HOME\.ssh\id_rsa\.pub"
$pubKey=(Get-Content "$PUBKEYPATH" | Out-String); ssh "$USER_AT_HOST" "mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo '${pubKey}' >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"