Wilson Mar bio photo

Wilson Mar


Email me Calendar Skype call

LinkedIn Twitter Gitter Instagram Youtube

Github Stackoverflow Pinterest

How I setup several Macbooks while I sleep

US (English)   Español (Spanish)   Français (French)   Deutsch (German)   Italiano   Português   Cyrillic Russian   中文 (简体) Chinese (Simplified)   日本語 Japanese   한국어 Korean


This is a hands-on tutorial for the fastest way to configure everything on your Mac for software developement, specific to what you want installed.

There are several categories:

  • GUI desktop and apps
  • Command-line profile and apps

GUI Manual config

These steps customizes a new Mac based on notes on GitHub:

  • Remove from Dock at the bottom of the screen
  • [0:21] In System Preferences, General, Dark Menu
  • [0:27] Dock, Automatically hide and show the Dock
  • [0:31] Install Chrome browsesr, as default browser
  • [0:48] Dropbox, 1Password, Alfred 2, Contexts, Sublime Text 3
  • [1:51] Dropbox password file for 1Password
  • [1:58] Command+Space key for Spotlight
  • [2:09] Sublime Text configuration
  • [2:44] iTerm, Command-line tools, Homebrew
  • [3:32] Vagrant, Virtualbox
  • [4:21] SQL Pro database, [4:32] Path Finder 7
  • [5:09] Telegram messaging
  • [5:20] App Store paid apps download Airmail, Slack, Navicat,
  • [5:41] Transmit FTP, Tower Git client

  • etc.

To practice, use a virtual machine (VMWare Fusion, Vagrant, or Virtualbox).

CLI for development config

  1. Homebrew
  2. brew install git
  3. ~/.bash_profile
  4. ~/.zsh

  5. brew install –cask visual-studio-code
  6. code [editor to bring up folder and edit files]

  7. brew install curl jq

  8. cd / mkdir .ssh / cd .ssh / ssh-keygen

  9. Collaboration (Zoom, WebEx, etc.)
  10. Social media ()

Automate much?

There are several alternatives:

  • https://github.com/minamarkham/formation
  • Ansible

If you’ve already run this, click here to skip to view and edit the install specifications further down this tutorial.

To automate preparation of third-party software for mass deployment onto managed clients:

  • Autopkg at https://github.com/autopkg/autopkg (requies Git) aims to define the steps in a “Recipe” which can be defined in an understood (plist XML-based) format, run automatically instead of by hand, and shared with others.

  • Software distribution server software: Munki (pronounced like “monkey”), Casper, Absolute Manage, etc.

There are two phases to this:

  1. Phase one - supply your password to install Xcode, Homebrew, Tap, and Cask, and Ansible

  2. Phase two - supply your password again for Ansible to install what is not commented out in specification files:

Dot files and Ansible

I haven’t seen it elsewhere on the internet, so I created an explanation of MacOS customizations and “dot files” that set them automatically.

  1. Copy from below this shell script call (highlight the line, then hold down command and press C to the invisible Clipboard):

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/wilsonmar/ansible-macos-setup/master/install.sh)"
  2. Make a folder and navigate into it:

    cd ~
    mkdir gits
    cd gits
    mkdir siyelo
    cd siyelo

    You can create another folder name if you prefer, but folder names in this tutorial will be wrong.

  3. In the Terminal window, paste the call from clipboard (hold down command and press V).
  4. Press the enter/return key to invoke the command which causes files to be downloaded and folders created:


    The command also downloads folder laptop from https://github.com/siyelo/laptop

    NOTE: Download and installation is skipped if it’s already installed.

  5. When SUDO password: appears, hold down the control key and press C. This message should appear (in red):

    “[ERROR]: User interrupted execution failed”

  6. While still in the Terminal window from above, change to the directory just created:

    cd laptop

    You should now be at:


    Instead of “mac” above, it would show your account name.

    The siyelo playbook.yml file lists the applications to be loaded.

    The scripts/system_settings.sh file are commands to configure the Mac operating system for better security and productivity. It would take hours to set them all manually.

Mac Programs Google Sheet

Switch to use an internet browser to see my list of programs for Mac OSX at this Google spreadsheet online.

The _installer column identifies the technique to install to install each program named:

  • brew (formulas) are installed using the brew command. Programs installed this way are invoked using a text-based Terminal command-line interface.

  • tap uses the brew tap command to install a package within another repository. interesting brew tap.

  • cask packages are installed using the brew cask command which is an extension to Homebrew that allows management of applications with a graphical user interface (GUI).

  • pip are Python plug-ins.
  • npm are Node modules (such as Express).

  • store indicates manual installation using the Apple iTunes program accessing the Apple Store.

  • zip programs are installed after a download, requiring an Ansible task to replace manual clicks and data entry.

WARNING: Each program added uses up more disk space.

WARNING: This may make obsolete documentation based on default Mac settings.

Ansible configurations are “idempotent”, which means that if you run it again, the result is the same. With declarative specifications, items specified for install are not re-installed.

The other columns in the spreadsheet:

_want contains Y for the generator to include in Ansible file.




GitHub’s Dotfiles manage files containing preferences for command-line programs.

For example, the configuration file for Zsh is .zshrc. The SSH configuration folder is .ssh. And on.

Such files have a dot because they are hidden.

Famous collections of dotfiles from:

  • https://github.com/holman/dotfiles from Zach Holman
  • Matthias Bynens
  • Paul Irish
  • https://github.com/mattstauffer/ohmyzsh-dotfiles

Features added by dotfiles:

  • Color grep output
  • Boost ls commands
  • Adding plugins to vim

Symlinks to files allow you to git pull and watch your dotfiles instantly update.

One stores .ssh-config file in his Dropbox folder which he symlinks:

   touch ~/Dropbox/.ssh-config
   ln -s ~/Dropbox/.ssh-config ~/.ssh/config

The .ssh-config file contains:

# My Awesome Web Site
Host awesome
    User me_duh

The above enables him to invoke:

   ssh awesome

No more remembering ip addresses, fumbling with command line switches for multiple SSH IDs, or even remembering your ssh usernames.

  • https://mattstauffer.co/blog/setting-up-a-new-os-x-development-machine-part-3-dotfiles-rc-files-and-ssh-config

Edit playbook.yml

  1. Use the vi text editor program to edit the file:

    vi ~/gits/siyelo/laptop/playbook.yml

    • To quit without editing type :q
    • To save changes type :wq (colon, w, and q)
    • To enter insert mode, press I.
    • To escape insert mode, press the Esc key.


  2. Have a # (pound sign) in front of each package based on your evaluation.

    Click on each link to open a web page about each. Some links take you to a section lower in this tutorial.

    NOTE: The playbook.yml file contains code to run the system_settings.sh file.

Edit System Settings

  1. List the files and change directory into the scripts folder:

    ls -al cd scripts

    The above list the files and change directory into the scripts folder.

  2. Use the vi text editor program to edit the file:

    vi ~/gits/siyelo/laptop/scripts/system_settings.sh

    • To quit without editing type :q
    • To save changes type :wq (colon, w, and q)


  1. Search for packages at this site where resources are downloaded for install:


npm install -g yo

The -g globally installs for access from any folder.

Inventory of Hosts

The inventory of hosts can be defined within /etc/ansible/hosts containing .ini format Microsoft uses:




Items in square brackets define group names.

Alternately, a YAML format:

Other Ansible Playbooks

Consider other Ansible playbooks for Mac:

|-- README.md
|-- files
|   |-- etc
|   |   `-- sudoers
|   |-- sublime
|   |   `-- Library
|   |       `-- Packages
|   |           `-- User
|   |               |-- DashDoc.sublime-settings
|   |               |-- Package\ Control.sublime-settings
|   |               `-- Preferences.sublime-settings
|   `-- terminal
|       `-- JJG-Term.terminal
|-- inventory
|-- main.yml
|-- requirements.txt
|-- tasks
|   |-- ansible-setup.yml
|   `-- preferences.yml
`-- vars
    `-- main.yml

The requirements.txt file specifies files to download from the Ansible Gaxlaxy sharing site.

Use a text editor to edit the main.yml file at the root. Change user: value from “jgeeling” to your Mac account name.

- hosts: localhost
  user: jgeerling
  connection: local

    - vars/main.yml

    - geerlingguy.homebrew
    - geerlingguy.dotfiles

    - include: tasks/ansible-setup.yml
    - include: tasks/preferences.yml

    # TODO: Use sudo once .osx can be run via root with no user interaction.
    - name: Run .osx dotfiles.
      shell: ~/.osx --no-restart
      changed_when: false

Under the vars folder main.yml file is a list of several Homebrew packages.

Run Installation

  1. Open a Termial, go to the directory:

    cd ~/gits/siyelo/laptop/

  2. Run Ansible:

    ansible-playbook playbook.yml -i hosts –ask-sudo-pass -vvvv

  3. Press the return key to invoke the command.

  4. A restart is needed at the end.

Remove app

QUESTION: How to remove apps

Apple Store programs

Programs are installed into the Applications folder. Two different ones:

  • cd /Applications

  • cd ~/Applications to see programs installed by clicking browser links, such as GoToMeeting, etc.

To get rid of the GarageBand music program, which comes with Apple MacOS:

  1. In a Terminal, go to where Apple stores its default apps at:

    cd "/Library/Application Support/GarageBand/"

    The quotes are needed because there is a space in the folder name.

  2. See how much disk space it takes.

    ls -al

    The number of bytes is to the left of the date:

    -rw-rw-r--   1 root  admin  31211520 Oct 25  2013 Themes.db
  3. PROTIP: Delete the contents, but leave the folder name.

    rm -rf *.* /s

Ansible Tower

Ansible Tower is a hub for automation tasks. It is a commercial product supported by Red Hat, Inc. but open sourced as AWX in September 2017 at https://github.com/ansible/awx.

An open source alternative to Tower is Semaphore, written in Go.

Others like this

The script described here was based on reviews of other similar “Mac booststrap” scripts:

  • https://gist.github.com/zeekay/7394565

  • https://github.com/fs/osx-bootstrap is a setup for Rails developement, including http://fs.github.io/fs-tool/ for creating pull-requests from command line and Ruby in Heroku.


  • https://github.com/divio/osx-bootstrap also asks for RSA keys to GitHub

  • https://github.com/monfresh/laptop provides a set of shell scripts.


Since Ansible was acquired by Red Hat, Inc. in October 2015, the company also controls certification and provides three training for it.



Red Hat’s YouTube channel has all products together.


To uninstall, select it and press Command+Delete or drag the program into the Trash.




5 minutes Kubernetes Cluster on Mac

Ansible on Azure

READ: Ansible & Azure: Automating the Basic Building Blocks of the Azure Cloud

More on OSX

This is one of a series on Mac OSX:

More on DevOps

This is one of a series on DevOps:

  1. DevOps_2.0
  2. ci-cd (Continuous Integration and Continuous Delivery)
  3. User Stories for DevOps
  4. Enterprise Software)

  5. Git and GitHub vs File Archival
  6. Git Commands and Statuses
  7. Git Commit, Tag, Push
  8. Git Utilities
  9. Data Security GitHub
  10. GitHub API
  11. TFS vs. GitHub

  12. Choices for DevOps Technologies
  13. Pulumi Infrastructure as Code (IaC)
  14. Java DevOps Workflow
  15. Okta for SSO & MFA

  16. AWS DevOps (CodeCommit, CodePipeline, CodeDeploy)
  17. AWS server deployment options
  18. AWS Load Balancers

  19. Cloud services comparisons (across vendors)
  20. Cloud regions (across vendors)
  21. AWS Virtual Private Cloud

  22. Azure Cloud Onramp (Subscriptions, Portal GUI, CLI)
  23. Azure Certifications
  24. Azure Cloud

  25. Azure Cloud Powershell
  26. Bash Windows using Microsoft’s WSL (Windows Subsystem for Linux)
  27. Azure KSQL (Kusto Query Language) for Azure Monitor, etc.

  28. Azure Networking
  29. Azure Storage
  30. Azure Compute
  31. Azure Monitoring

  32. Digital Ocean
  33. Cloud Foundry

  34. Packer automation to build Vagrant images
  35. Terraform multi-cloud provisioning automation
  36. Hashicorp Vault and Consul to generate and hold secrets

  37. Powershell Ecosystem
  38. Powershell on MacOS
  39. Powershell Desired System Configuration

  40. Jenkins Server Setup
  41. Jenkins Plug-ins
  42. Jenkins Freestyle jobs
  43. Jenkins2 Pipeline jobs using Groovy code in Jenkinsfile

  44. Docker (Glossary, Ecosystem, Certification)
  45. Make Makefile for Docker
  46. Docker Setup and run Bash shell script
  47. Bash coding
  48. Docker Setup
  49. Dockerize apps
  50. Docker Registry

  51. Maven on MacOSX

  52. Ansible

  53. MySQL Setup

  54. SonarQube & SonarSource static code scan

  55. API Management Microsoft
  56. API Management Amazon

  57. Scenarios for load
  58. Chaos Engineering