Skip to content

Instantly share code, notes, and snippets.

@smithamax
Last active May 30, 2017 02:15
Show Gist options
  • Save smithamax/36a8703c16d7e8dcd6a4b42d47b5f79f to your computer and use it in GitHub Desktop.
Save smithamax/36a8703c16d7e8dcd6a4b42d47b5f79f to your computer and use it in GitHub Desktop.
Setup macos ready for remote admin
#!/bin/bash
# bash <(curl -sL http://mywebsite.com/myscript.txt)
set -e
sudo systemsetup -setremotelogin on
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask install anybar keepingyouawake
echo -n '[email protected] apple password: '
read -s PASSWORD
echo
security add-internet-password -a [email protected] -s [email protected] -w "$PASSWORD" -T /usr/bin/security "$HOME/Library/Keychains/login.keychain-db"
clear
# print the localip to finish, currently filtering for 172 prefix
ifconfig -a | grep -o 'inet \(addr:\)\?\(172\.[0-9]\+\.[0-9]\+\.[0-9]\+\)' | sed -e 's/inet \(addr:\)*//' | sed -e '/127\.[0-9]*\.[0-9]*\.[0-9]*/ d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment