Apple Notes

Downloads for Apple Developers

https://developer.apple.com/download/more/

Keyboard Shortcuts

Put mac to sleep

Option–Command–Power

Put display to sleep

Control–Shift–Power

Resources: https://support.apple.com/en-us/HT201236

OSX Terminal Stuff

SSH

Check ssh service status

sudo systemsetup -getremotelogin

Enable SSH

sudo systemsetup -setremotelogin on

Disable SSH

sudo systemsetup -setremotelogin off

Resource: http://osxdaily.com/2016/08/16/enable-ssh-mac-command-line/

Disable screensharing

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.screensharing.plist

Create account

sudo dscl . -create /Users/niceuser
sudo dscl . -create /Users/niceuser UserShell /bin/bash
sudo dscl . -create /Users/niceuser RealName "Super Nice Guy"   
sudo dscl . -create /Users/niceuser UniqueID *unique id*
sudo dscl . -create /Users/niceuser PrimaryGroupID 80 # Make user part of Admin group
sudo dscl . -passwd /Users/niceuser
sudo dscl . -append /Groups/admin GroupMembership niceuser

You can create a home directory for the user if you'd like as well:
sudo mkdir /Users/niceuser

Resources:
https://smallbusiness.chron.com/add-user-terminal-mac-os-x-screen-sharing-31846.html
https://discussions.apple.com/thread/8248721

Remove account

sudo dscl . -delete /Users/niceuser

Delete the home directory if you created it:
sudo rm -rf /Users/niceuser

Resource: https://apple.stackexchange.com/questions/310308/delete-a-standard-user-from-mac-os

List users

sudo dscl . list /Users | grep -v "^_"

Screen sharing via finder

  1. Open Finder
  2. Ctrl-k
  3. vnc://target_ip

Resource: http://hints.macworld.com/article.php?story=20100927085636535

Get version of OSX Running

sw_vers -productVersion

Resource: https://www.tecmint.com/send-a-message-to-logged-users-in-linux-terminal/