Open, command Mac terminal: Most Mac users will know that the open command in the Terminal will open files in the GUI or open a directory in Finder for example open . will open Finder in the current directory, this is useful, but there are a few more things it can do including opening in a specified application.
Here is the usage dump from the tool:
Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-s <partial SDK name>][-b <bundle identifier>] [-a <application>] [-u URL] [filenames] [--args arguments] Help: Open opens files from a shell....
Multiple Symbolic Links Windows
Create a batch file, for example: symlink.bat with the following content and edit the source and target locations to suit.
@echo off set "source=c:\source\directory" set "target=c:\target\directory" set "exclude=%temp%\exclude.txt" ( rem exclude files/dires with these strings into full path echo .txt echo pipe.cmd rem escaped backslash and initial and final quotes to avoid partial matches echo "c:\\source\\directory\\something.txt" rem exclude thisNot file/directory from source directory echo "%source:\=\\%\\thisNot" )> "%exclude%" forfiles /P "%source%" /C "cmd /c (echo @path|findstr /i /v /g:"%exclude%" >nul) && if @isdir==TRUE (mklink /d \"%target%\\\"@file @path) else (mklink \"%target%\\\"@file @path)" del "%exclude%" > nul Original answer posted on: stackoverflow
Git Version Control Setup
After a few false starts I have finally got my Hugo site setup to use git submodule to push the HTML output to the remote webserver.
It was a little involved at first, but once I got my head around the idea of a git repo within a git repo, not being a git repo but rather just a folder marked as a submodule of some parent module… you get the idea....
Change Mac Machine Name via Terminal
I needed to change the name of one of my Macs remotely and this is the command to do it:
sudo scutil --set HostName [NewHostNameHere]
SSH copy keys from Windows
I have recently been setting up an old Mac Mini as Webserver and NAS server. One of the things I wanted to do was enable ssh key pair login and wondered how one used ssh-copy-id on a Windows machine to get the public key from a local machine to the server. It turns out you can’t but the cat command can do it just fine.
Here is the template: