User Tools

Site Tools


operating_systems:macos

MacOS

Intro/links/basics

Apple Documentation

General

iCloud

  • Adding .nosync to the end of a folder in iCloud Drive stops it being synced (via @jimconacher).

.bash_profile vs .bashrc

.bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells

By default Terminal.app runs a login shell.

If you're adding aliases, exporting environment variables or setting a custom prompt that code should go in .bash_profile.

Source

See also .bash_profile vs .bashrc

.hushlogin

Add a .hushlogin file to the directory you terminal starts in to suppress the Last login: message at the top of your terminal.

touch .hushlogin

Lock Screen

Change Key Combo

Go to System Prefs > Keyboard > Shortcuts > App Shortcuts

Click + to add a new one called Lock Screen and set the key combo (eg. ⌥⌘+L)

Stop Wifi dropping on screen lock

cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/

sudo ./airport en0 prefs DisconnectOnLogout=NO

Disk Images

Random

Homebrew

Going to start this off with it's own section but might fold it into General Advice later on

Homebrew (brew) is a package manager for macOS akin to the Advanced Package Tool (apt) on Debian and Ubuntu.

Taps

Taps are third party repositories for homebrew.

Example

If you run brew tap sidaf/homebrew-pentest you'll be able to install any formulas from the sidaf/homebrew-pentest repository via brew install. brew install panoptic will search the default Homebrew repository then any tapped repositories for a formula with the name panoptic.

Python

As of Homebrew 1.5.0 brew install python installs python3.x not python2.7.x. This was not PEP 394 compliant as running python would execute the python3.x binary which violates “all distributions should ensure that python refers to the same target as python2”.

This was fixed in 1.6.0. brew install python still installs python3.x but will not symlink python to the python3.x binary. Running python will execute the system python2.7.x binary and running python3 will execute the brew python3.x binary.

See Homebrew and Python for more info.

Upgrading Packages

By default Homebrew does not automatically update itself or installed packages. To manually update Homebrew and upgrade all installed packages run:

  1. brew update (Update the formulae and Homebrew itself)
  2. brew upgrade (Upgrade all packages installed by Homebrew)

By default, Homebrew does not uninstall old versions of formula. From time to time you'll want to run brew cleanup to remove old version of formula.

See FAQ for more info.

Virtualisation

VMWare Fusion

We get VMWare Fusion free from VMWare DreamSpark. Used by most mac wankers on the course. Would recommend over all other virtualisation programs for Mac.

defaultVMPath

By default Fusion creates ${HOME}/Documents/Virtual Machines to store VMs in. This is likely sub optimal for those using iCloud Drive, you probably don't want to upload your 20GB VM to iCloud.

The location Fusion saves VMs to can be changed:

  1. Create a new directory to store VMs e.g. ${HOME}/VMware Fusion
  2. Add the line “prefvmx.defaultVMPath = ${HOME}/VMware Fusion” to ${HOME}/Library/Preferences/VMware Fusion/preferences

Taken from bittersweet.sh.

Parallels

Apps

General

Programming

For general information see Programmming. This section list macOS specific tools.

Security/ Privacy

Objective-See

Objective-See was created by Patrick Wardle to provide simple, effective and free macOS security tools. Some of his most useful tools are listed below.

  • BlockBlock (Beta) Alerts when something is persistently installed
  • OverSight Monitors and alerts on mic and webcam access
  • What's Your Sign? Adds a menu item to Finder.app to view the cryptographic signature of files

Touch Bar

  • HapticKey “trigger haptic feedback when tapping Touch Bar”

Research

Blogs

Talks

Older

2015

2016

2017

2018

Slides

Articles

Papers

Forensics

Exploits

Books

MacOS and iOS Internals (Levin)

operating_systems/macos.txt · Last modified: 2019/06/14 12:47 by gorzilla