Skip to content

🚀 Automatically install, configure, and run the most popular programs of several stacks to work offline on a Mac and in clouds.

License

Notifications You must be signed in to change notification settings

wilsonmar/mac-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here is the quickest way to automate get a new macOS running with all the stacks of tools most developer wants to work locally and in several clouds.

After you complete this, step by step, you can add to your resume or LinkedIn profile:

    Configured new Mac Mini M4, from scratch with a full set of utilities and AI apps and access to AWS, Azure, and Google cloud services. Time for this was reduced from days to less than an hour though custom shell script automation. Documentation of each step were documented and validated by others. The entire team can now pair program together efficiently with a common set of tools.

This has been refined over several years. What was formerly at wilsonmar.github.io/mac-setup has been incorporated into this document.

Summary of Stages

  1. Know Why: For teamwork, Fast Change!.

  2. Hardware selection and connection

  3. New Machine Manual Setup

  4. Time Machine Backup

  5. Reset to Factory Settings

  6. Shortcut to System Settings

  7. Login items

  8. Passkey

  9. Setup GitHub account

  10. Learn the Terminal app

  11. Learn the Finder and Folders $PATH

  12. View this README in Safari

  13. Get .bash_profile

  14. Load gh to fork & clone mac-setup automation folder

  15. Use Homebrew

  1. Edit mac-setup.env settings in $HOME

  2. View mac-setup.sh parameters

  3. Configure using Apple Script in Dotfiles

  4. Utilities Installed

  5. Apps Installed

  6. Final Steps


Why?

This repo enables you to get up and running on a new mac machine in a matter of minutes rather than days. Being able to get started quickly means that you can get working with applications.

This helps developers skip wasted days installing (and doing it differently than colleagues).

In contrast to most tutorials, docs, and videos that wastes your time to manually type or copy and paste strings (often with missing steps), automation here is less error-prone and faster because we've worked out the dependency clashes for you. In each stage, our script detects what has already been installed and verifies the success ofeach step. So it can perform workarounds for known issues.

You can use this script to upgrade or remove apps and modules by changing the list of apps in the script.

For teamwork

This automation enables teamwork by providing a common set of tools for working together: keyboard shortcuts (aliases), apps, etc.

This implements what well-known DevOps practitioners Ernest Mueller and James Wickett advocate in their book "The DevOps Handbook" and The DevOps Handbook (on OReilly.com): "focus on the core value of CAMS (culture, automation, measurement, and sharing)".

Fast Change!

Apps and modules can be installed by simply adding a keyword in a control file recognized by the automation, which installs and configures them quickly and reliably.

Instead of or in addition to the default apps, you can specify additional apps to install:

Default apps can be specified for removal (to save disk space) by changing a list of apps in the script.

This automated approach also enables you to update all apps and modules to the latest version with a single command - on a daily basis if you want.This helps meet cybersecurity directives to keep software up-to-date.

Scripts here are modular. It installs only what you tell it to by adding a keyword in the control file.

This repo brings DevSecOps-style "immutable architecture" to MacOS laptops. Immutability means replacing the whole machine instance instead of upgrading or repairing individual components.


Hardware selection and connection

  1. See my article about considerations of different hardware at
    Mac laptop hardware,

  2. Connect the computer to the monitor with (in order of preference): Thunderbot 4 or 5 cable; Display Port; HDMI 3; USB-C.

    The back of the Mac Mini has USB-C ports that supports Lightning 4 cables, which transfers data at 40Gbps and powers up to 100W.

    The front of the Mac Mini has USB-C ports that supports HDMI v3.2 cables, which transfers data at 40Gbps and powers up to 100W.

    Although an HDMI cable can connect the Mac Mini to a TV, we recommend using a monitor with the version of HTMI cable it supports.

    Some TVs do not show the top of the screen where the menu bar and Mission Control are displayed. Mission Control is a built-in feature of macOS to switch between groups of open apps and windows (using control + up arrow) and control + down arrow).

  3. If you have a Bluetooth keyboard, you can use the USB port for something else.

    PROTIP: A keyboard with a "delete" key is useful especially if you are used to working with Windows. The macOS keyboard requires users to awarkly press "fn" key and then "delete" key to delete.

    Some Logitech USB keyboard and mouse models come with a USB dongle.

    See my article about the macOS keyboards.

  4. Consider an ergonoic mouse. If you are right-handed, consider a left-handed mouse so that you write with your right hand while you use the mouse.

New Machine Manual Setup

  1. Press the power button on the monitor.

  2. See my article about the macOS boot-up process.

  3. After boot-up, select the new machine's language, time zone, keyboard layout, icloud email & password,user name & password are manual first steps.

  4. When prompted to upgrade your Mac, choose to upgrade to the latest version (which may take several minutes) to get your Mac up to date.

Once keyboard and mouse control is available:

Keyboards from Apple are different from generic USB keyboards for Windows:

  • Some don't have a "delete" key. Instead hold down the "fn" key and press the "delete" key.
  • The button at the upper-right is a fingerprint reader and on/off button
  • The modifier keys Command is used instead of Control.

Time Machine Backup

The built-in Time Machine app backs up files and folders so you can completely restore the whole computer to the state when backup occured.

CAUTION PROTIP: Complete backups are often NOT restored when malware may have been added and thus present in the backup files restored.

PROTIP: Our automation scripts also copies specific folders and text files to an external USB drive so they can be used to build a new machine from scratch after examination.

  1. Buy a new external USB NVMe SSD drive. They are $106 for 1TB at Costco.

  2. Plug in the new USB drive for storing backups. This you keep at home.

  3. Open Time Machine by clicking the Launchpad icon on the Dock for a list of apps, then click on the "Time Machine" app icon.

    The Dock is by default always visible on the bottom of the screen, but the automation script move it to the right side and appears when you hover over the right side of the screen.

  4. Select a location to store backups.

  5. Click "Add Backup Disk..." icon at the right side of the screen.

  6. Select the drive you just plugged in.

  7. Click "Add"

  8. Name the backup drive.

    PROTIP: Name the drive such as "1TB-MacMini24" to designate the size of the drive and the year of the machine it is being installed on.

  9. Encrypt the drive by clicking the "Encrypt" icon at the right side of the screen.

  10. Enter a password for the drive.

  11. Click "Encrypt"

  12. Click "Done".

  13. Click "Done" again.

  14. Click "Start Backup" to begin the backup process.

PROTIP: Take a Backup again to establish a new baseline before and after you upgrade your machine.

NOTE: The automation script is installed, it can do a Time Machine backup.

Reset to Factory Settings

You can now confidently reset the machine to factory settings, which erases all data.

  1. Shut down your Mac.

  2. Turn it on and immediately press and hold the Command (⌘) + R keys.

  3. Keep holding until you see the Apple logo or a spinning globe. This will boot your Mac into macOS Recovery.

  4. Select Disk Utility and click Continue.

  5. In Disk Utility, select your main drive (usually named Macintosh HD) from the list on the left.

  6. Click the Erase button at the top of the window.

  7. Name: You should leave it as "Macintosh HD" because it's the "Startup Volume"s.

  8. Format: Choose APFS (for most modern Macs) or Mac OS Extended (Journaled) for older Macs.

  9. Scheme: Choose GUID Partition Map.

  10. Click Erase to wipe the drive.

  11. Close Disk Utility to return to the macOS Utilities window.

  12. Select Reinstall macOS and click Continue.

  13. Follow the on-screen instructions to reinstall the operating system. This may take some time, depending on your internet speed and the version of macOS being installed.

  14. Once the macOS installation is complete, your Mac will restart and you’ll see the Setup Assistant.

    A. If you're selling or giving away the Mac, don’t complete the setup process. Simply press Command + Q and select Shut Down. The new owner can complete the setup with their own information.

    B. If you want to restore your Mac, Shut down your Mac, plug in your backup media, and press the start button. When the boot-up screen appears, select the backup media and press the start button.


Shortcut to System Settings

PROTIP:For some strange reason, Apple does not provide a default direct keyboard shortcut for System Settings. So create one:

  1. Click the Apple icon on the upper left corner of the screen.

  2. Click the "System Settings...".

  3. Type "Keyboard shortcuts".

  4. Click Keyboard Shortcuts.

  5. Click "App Shortcuts" on the left menu and click the + button.

  6. For "Applications", select "System Settings".

  7. In Menu title at the right, type "System Settings..." (make sure to include the ellipsis).

  8. For Keyboard shortcut, press CommandCommand + Option + Shift + P

  9. Click "Done" to save the shortcut.

  10. Try it out by clicking on the Apple icon on the upper left corner to see the keystrokes for "System Settings...". Try the keyboard sequence shown.

Login items

PROTIP: Review this once a month to ensure that you have control of your machine. Here is where malicious software can get access.

  1. Within Apple System Settings, click the "Search" text within the field at the upper-left corner.
  2. Type "Login" on top of "Search".
  3. If you don't want to have a program Open at Login, click on that app and click the "-" button.
  4. If you want to have Allow in the Background a program, click on the toggle to its left.

Install Passkey

https://wilsonmar.github.io/passkeys/

Even complex passwords can easily be cracked within seconds. So traditional passwords are replaced with biometric fingerprint Touch ID, Face ID, or Windows Hello to authenticate your identity. Biometrics are used instead of having to using an additional app such as Authy.

Passkeys was introduced in 2022 for Apple Safari on macOS 13 Ventura and later.

macOS 15 (Sequoia) introduced a standalone Passwords app, providing a more refined passkey management interface.

  1. Open the Passwords app from your Applications folder.
  2. Click on the Passkeys tab and select Add New Passkey.
  3. Follow the on-screen instructions to complete the setup, using biometric verification or your device password.
  4. Manage, edit, or delete your passkeys within this app.

Enable Two-Factor Authentication (2FA) for your Apple ID if not already activated1.

Google Chrome and Microsoft Edge support Passkeys. But Passkeys created with Apple Safari are not compatible with other ecosystems (such as Google Chrome).

Instead of create a separate Passkey on Chrome and Edge, if you’re logging in from a non-Apple device, you can use cross-device authentication through QR codes or Bluetooth.

To install passkeys on macOS, follow these steps:

Enable iCloud Keychain:

  1. Open Apple System Settings

  2. Click "Apple ID" at the top left. Click "iCloud".

  3. Click "Passwords and Keychain".

  4. Toggle on iCloud Keychain "Sync this Mac".

    https://medium.com/@corbado_tech/activate-apple-passkeys-on-macbooks-3cf5cc83bef7

    Create a passkey:

  5. Visit a website or app that supports passkeys, such as PayPal.com.

  6. Look for an option to create a passkey during account creation or in account settings.

  7. Select "Create Passkey" when prompted.

  8. Authenticate using Touch ID or your device passcode23

  9. Use the standalone Passwords app in the Applications folder

  10. Click on the Passkeys tab and select "Add New Passkey"

  11. Follow on-screen instructions to complete setup.

Default Browser

Safari is the default browser on MacOS.

The automation script will install other browsers if specified.

  1. To ensure that cookies in the browser are not confused, open the browser you want to use. Select the browser profile you want to use.

    You may need tonavigate to that browser's settings and make that the default and profile. For example: chrome://settings/defaultBrowser

GitHub account

If you have not yet obtained a GitHub account,

  1. In a web browser, sign up for one with your email address at

    https://github.com/

  2. We recommend installing Twillo's Authy app for two-factor authentication.

  3. TODO: Configure SSH and GPG keys.

View this README in Safari

So you can click links within this README file on the target machine:

  1. To open Safari, near the left among the default list of apps at the bottom of the screen, click on the "Safari" browser icon.

  2. Click on the middle field to type on top of "Search or enter website name".

  3. Type in this URL to reach this README file:

    https://github.com/wilsonmar/mac-setup/blob/main/README.md#ViewREADME

  4. Scroll down to this section:

View the mac-setup.sh automation script in Safari

PROTIP: This approach is designed so that you can examine the script before running it.

  1. To review the automation files to setup a new machine, click this link:

    https://github.com/wilsonmar/mac-setup/blob/main/mac-setup.sh

    CAUTION: The remainder of this article explains how to run the script.

    That automation script is manually invoked several times using different parameters on the Terminal command line, each time for a different phase of installation.

    This script uses Bash (.sh) rather than Zsh (.zsh) in order for the script to possibly be adapted for work on Linux and Windows machines as well.

    However, script mac-setup.sh can upgrade Bash to the latest version.

  2. Click "fork" to copy the script to your own GitHub account.

Next, let's get that script onto your machine using "Bash" CLI (Command Line Interface) commands within the Terminal app.

Learn the Terminal app

The built-in Terminal utility app executes shell scripts like on Linux machines.

Bash which is a contraction of the term "Bourne-agan shell" (a play on words).

There are several ways to

  1. Hold down the Command key and press spacebar to pop up the Spotlight Search modal dialog.

  2. Type on top of "Spotlight Search" Ter so enough of "Terminal.app" appears to press Enter to select it in the drop-down.

  3. When "Terminal.app" is highlighted, click it with your mouse or press the return key to launch the Terminal.app program selected.

    The default Terminal CLI (Command Line Interface) prompt begins with the user name value defined in the PS1 system variable that the automation script changes.

    Basic CLI commands

  4. Type pwd to see the "present working directory", which is the current folder you are in. The path shown is also stored in a variable named $HOME.

  5. Type ls -al to see the default folders and files in your $HOME folder. The -al parameter specifies to show all folders and files as a list.

  6. To reduce text wrapping of long lines, expand the width of your Terminal window by dragging the right edge with your mouse.

    keyboard aliases (shortcuts)

    PROTIP: The automation script installs keyboard aliases (shortcuts) you can use to improve typing speed and accuracy. Examples:

    • alias ll="ls -al"
    • alias l="ls -l"
    • alias h="history"
  7. View all the aliases defined in the aliases.sh file called from within .bash_profile in the $HOME folder:

    https://github.com/wilsonmar/mac-setup/blob/main/aliases.sh

    The

    User $HOME folders

    The first part of each line defines its attributes (permissions and ownership). Lines beginning with "d" define directories (folders).

    • .Trash
    • .zsh_sessions
    • Desktop
    • Documents
    • Downloads
    • Movies
    • Music
    • Pictures
    • Public

    TODO: $PATH folders separated by semicolons.

Fork and Clone using the GH CLI

  1. Open the Terminal app and type:

    gh auth login --web
    

    The response:

    ? What is your preferred protocol for Git operations on this host?  [Use arrows to move, type to filter]
    > HTTPS
    SSH
    
  2. Press Enter to accept "HTTPS" as the preferred protocol.

    ? What is your preferred protocol for Git operations on this host? HTTPS
    ? Authenticate Git with your GitHub credentials? (Y/n)
    
  3. Press Enter to accept the default capitalized "Y" to authenticate Git with your GitHub credentials. The response:

    ! First copy your one-time code: 17B4-A882
    Press Enter to open https://github.com/login/device in your browser...
    
  4. Highlight the code and press Command+C to copy it to your invisible Clipboard.

  5. Press Enter for GitHub "Device Activation" page to appear in whatever is set as default browser.

  6. Click the button associated with the account you want to use, such as "Continue".

  7. In the "Device Activation" page that appears, click on the first box and press command+V to paste the 8-digit code from your invisible Clipboard.

  8. Click "Continue".

  9. Click "Authorize github".

  10. Click "Use passkey" and touch your fingerprint for "Congratulations, you're all set!"

  11. Press command+W to close the "Device Activation" page.

  12. Switch to the Terminal by holding down command and pressing Tab repeatedly until it rests on the Terminal icon.

    ✓ Authentication complete.
    - gh config set -h github.com git_protocol https
    ✓ Configured git protocol
    ✓ Logged in as wmjomt
    
  13. Type the GitHub account name you want to fork to, such as:

    GH_ACCT="wmjomt"
    
  14. Fork and clone in this one command:

    gh repo fork "https://github.com/wilsonmar/mac-setup" --clone
    

    The response at time of writing:

    ✓ Created fork wmjomt/mac-setup
    Cloning into 'mac-setup'...
    remote: Enumerating objects: 4255, done.
    remote: Counting objects: 100% (1303/1303), done.
    remote: Compressing objects: 100% (500/500), done.
    remote: Total 4255 (delta 821), reused 1268 (delta 789), pack-reused 2952 (from 1)
    Receiving objects: 100% (4255/4255), 13.01 MiB | 12.71 MiB/s, done.
    Resolving deltas: 100% (1125/1125), done.
    From https://github.com/wilsonmar/mac-setup
    * [new branch]      main       -> upstream/main
    * [new branch]      master     -> upstream/master
    ✓ Cloned fork
    ! Repository wilsonmar/mac-setup set as the default repository. To learn more about the default repository, run: gh repo set-default --help
    

Learn Finder & Folders

The Finder app is the default GUI app for opening files and folders. So it is the one default app that can't be removed.

  1. Open the Finder app.

  2. Folders on the left panel may be rearranged by being dragged and dropped.

  3. Click the "Go" menu at the top. macos-finder-keys.png

    If you prefer the speed of using keyboard shortcuts Apple created, those entries can be deleted.

  4. From the $HOME folder, press command + up to display the previous level, where a "Shared" folder is shown.

  5. The same can be done on the Terminal by typing:

    cd ..
    
  6. Press command + up again to display the level containing folders referenced by the operating system:

    • Applications contain apps that can be opened by any user. There is also a
    • Library folder holds application files
    • System
    • Users

    REMEMBER: There are several Applications folders:

    • Folder "/Applications" contain apps that can be opened by any user.
    • Folder "/Users/___/Applications" contain apps that can only be used by that user.
    • Folder "/Applications/Utilities" contain apps Apple provides, such as the Terminal app.
  7. Switch to the Terminal. To see the folder for each application:

    ls -al "$HOME/Library/Application Support"
    

    Alternately:

    ls -al ~/Library/Application\ Support
    

    REMEMBER: Typing the "~" variable is the same as typing the "$HOME" variable. Typing a space character within "Application Support" require double-quotation marks unless that space is preceded by the "" escape command.

    REMEMBER: The folder for an application is not deleted when the application is deleted.

  8. Switch back to the Finder GUI.

  9. Press command + up again to display the top level containing "Macintosh HD" and "Network" folders.

    PROTIP: Installers of apps being installed are shown in this folder.

  10. Switch to the Terminal to get the disk space used by this folder using this command:

    du -sh "$HOME"
    
  11. Switch back to the Finder GUI.

  12. Press command + down to go down a level.

  13. Manually arrange to your liking the sequence of folders on the left panel of Finder.

    Added in $HOME folder

    NOTE: Folder and file names beginning with a "." are hidden by default. Press command + shift + . to toggle the display of hidden files and folders.

    The macsetup.sh automation script adds these files:

    • mac-setup.env

    • aliases.sh

    • .bash_profile

    • .bashrc

    • .zshrc

    • .zshenv

    • .zprofile

    • .zshrc

    • keepa.kdbx (Keepass database)

    The mac-setup.sh script adds these folders:

    • Applications (to hold GUI .app tooling executables installed)

    • Projects (or other name to hold files not managed by Git)

    • (various folders to hold database files)

    • github-wilsonmar (or whatever is your user account on GitHub.com holding code)

    • gh-wmjtm (another user name on GitHub)

    • go

    • gopkgs

  14. Switch to the Terminal by holding down the Command key and pressing Tab repeatedly until it rests on the Termial icon.

Phases of installation

  1. Download from GitHub mac-setup.sh automation script
  2. Edit settings in mac-setup.env (using textedit or VSCode)
  3. Install Homebrew and use it to install utilities Bash, Git, etc.
  4. Install and configure apps

View mac-setup.sh parameters

  1. We want to upgrade Bash to the latest version.

secrets.sh

The above list is from the secrets.sh file in your $HOME folder, which you edit to specify which port numbers and keywords to specify apps you want installed.

The file's name is suffixed with ".sh" because it is a runnable script that establishes memory variables for a Setup script to reference.

Use of Homebrew

Most of the apps installed make use of installers defined in the Homebrew repository online. There is a file (of Ruby code) for each brew install formula at:

https://github.com/Homebrew/homebrew-core/blob/master/Formula/httpd.rb

PROTIP: Before downloads a brew formula, we recommend that you look at its Ruby code to verify what really occurs and especially where files come from.

brew edit ___

We recommend that you install a binary repository proxy that supply you vetted files from a trusted server instead of retrieving whatever is the latest on the public Homebrew server.

Homebrew has over 4,500 formulas the last time we checked.

To install and configure programs which don't have brew installation formulas, various Libux utility commands such as curl, sed, cut, etc. are used in this automation script.

Yes, you can just run brew yourself, one at a time. But logic in the script goes beyond what Homebrew does, and configures the component just installed:

  • Undo a brew error (such as needing an unset)
  • Install dependent components where necessary
  • Display the version number installed (to a log)
  • Add alias and paths in .bash_profile (if needed)
  • Perform configuration (such as adding a missing file needed for mariadb to start)
  • Edit configuration settings (such as changing default port within Nginx within config.conf file)
  • Upgrade and uninstall if that is available
  • Run a demo using the component to ensure that what has been installed actually works.

Make this work for you

The section below explains to someone relatively new to Mac machines the steps to automate installation of additional MacOS application programs. Along the way, we explore basic skills to use a command-line Terminal and common commands.

Bash Version with Grep

Bash 4.0 was released in 2009, but Apple still ships version 3.x, which first released in 2007.

Bash Version 4 is needed for "associative arrays" needed in the script.

  1. Test if you have Bash updatedi by typing this:

    bash --version | grep 'bash'
    

    Hold the Shift key to press the | (called pipe) key at the upper-right of the keyboard.

    The grep 'bash' is needed to filter out lines that do not contain the word "bash" in the response such as:

    You have a recent version of Bash if you see:

    GNU bash, version 5.2.37(1)-release (aarch64-apple-darwin23.4.0)
    

    If instead you see you have bash v3 that comes with MacOS, this blog describes what is improved by version 5+.

    mac-bash4.sh initialization

  2. Switch to back to this web page by holding down the command key and pressing Tab repeatedly until it rests on the browser icon.

  3. Triple-click on the script line below to highlight it for copying:

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/wilsonmar/mac-setup/master/mac-bash-up.sh)"
  4. Press Command+C to copy it to your invisible Clipboard.

  5. Switch to the Terminal by holding down command and pressing Tab repeatedly until it rests on the Termial icon.

  6. At the Terminal, click on a Terminal window and paste in the command by holding down command then V. It doesn't matter what folder you're on at this point.

  7. Press Enter to run the command, which upgrades Bash to version 4 and copies a file to your Home folder.

    The script first makes use of the Ruby program to install Homebrew which, in turn, installs Bash v4 using the brew command to download and configure packages.

  8. After it runs, verify the version again as described above to ensure it's version 4.

    Home folder

  9. The default location the Terminal command opens to by default is your "Home" folder, which you can reach anytime by:

    cd
    
  10. The "~" (tilde character) prompt represents the $HOME folder, which is equivalent to a path that contains your user account, such as (if you were me):

    /Users/wilsonmar
  11. You can also use this variable to reach your account's Home folder:

    cd $HOME

    In other words these commands all achieve the same result:

    cd = cd ~ = cd $HOME

    secrets.sh at Home

    It's wise to avoid storing secrets in GitHub or other public repository. Files stored in your user $HOME holder (outside a Git-managed folder) have no chance to be uploaded from the Git repository. The script references secrets there.

    And if the script doesn't see a secrets file in your $HOME folder, it copies one there from the repo's sample file.

    NOTE the secrets.sh is a clear-text file.

    Encrypting and Decrypting secrets

    Optionally, you may store secrets and configurations in an encrypted file after some initial configuration.

    Run script ./secrets.edit.sh to decrypt the contents of secrets.sh for the mac-setup-all.sh script to use.

    Run script ./secrets.lock.sh to encrypt the contents of secrets.sh.

    Utilities "blackbox" or "git-secret" can be used to handle

    Text edit secrets.sh

  12. Use a text editor to edit the secrets.sh file using a text editor that comes pre-loaded on every Mac:

    textedit ~/secrets.sh

    The tilde character specifies that the file is in your Home folder.

    Top of file Shebang

    Looking in the file, consider the first line in the secrets.sh file:

    #!/bin/bash

    That is the "Bourne-compliant" path for the Bash v3.2 shell installed by default on MacOS up to High Sierra. BTW, other Linux flavors may alternately use this for portability:

    #!/usr/bin/env

    BTW, unlike Windows, which determines the program to open files based on the suffix (or extension) of the file name, Linux shell programs such as Bash reference the "shebang" on the first line inside the file.

  13. Open another Terminal window.

  14. View the above files to see that they are binary executable files, such as:

    textedit /usr/bin/bash
  15. Exit the file.

  16. Press the command key with the back-tick (`) at the upper-left of the keyboard to switch among textedit windows.

    Version 4 Shebang

    If you instead see this on the first line:

    #!/usr/local/bin/bash

    that is the Bash program associated with Bash v4.

    This is why we needed to first upgrade Bash before running other scripts.

    App keywords

    The initial secrets.sh file does not have keywords which specify additional apps to install.

  17. Scroll down or press command+F to type an app keyword to find its category.

    Edit port numbers

  18. Scroll to the list of ports (listed above).

  19. May sure that none of the ports are the same (conflicts).

  20. Save the file and exit the text editor.

    Setup all

  21. Now copy, switch, click and paste in a Terminal window to run this command:

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/wilsonmar/mac-setup/master/mac-setup-all.sh)"

    The script referenced in the command obtains more files needed by cloning from a public GitHub repository ( https://github.com/wilsonmar/mac-setup) to a folder under your home folder named "mac-setup".

  22. Wait for the script to finish.

    On a 4mbps network the run takes less than 5 minutes for a minimal install. PROTIP: A faster network or a proxy Nexus server providing installers within the firewall would speed things up and ensure that vetted installers are used.

    When the script ends it pops up a log file in the TextEdit program that comes with MacOS.

  23. Switch to the TextEdit window by clicking it.

  24. Scroll to review the log file. Press command+F to input text to search.

  25. Close the log file by clicking the red button.

  26. Switch to a Finder window to your account's Home folder and delete log files.

    mac-setup files

    The folder contains these files and folders:

    • Files within folder "hooks" are used by Git (if marked for install.)
    • File "mac-bash-profile.txt" contains starter entries to insert in ~/.bash_profile that is executed before MacOS opens a Terminal session.

    Subsequent runs

    To update what is installed on your Mac, re-run the mac-setup.zsh bash script.

  27. cd into your Home folder to find the secrets.sh file.

  28. Edit the file, then run again locally:

    chmod +x mac-setup-all.sh
    ./mac-setup-all.sh
    

    The chmod (pronounced "che-mod") changes the permissions for executing the file.

    Now let's look at the Bash coding techniques used in the scripts mentioned above, at: https://wilsonmar.github.io/bash-coding


Mas Mac apps

The brew formula "mas" manages Apple Store apps, but it only manages apps that have already been paid for. mas does not install apps new to your Apple Store account.

Apps on Apple's App Store for Mac need to be installed manually. Popular apps include:

.pkg and .dmg

.pkg and .dmg files can be downloaded to install apps.

Cloud Sync

Apps for syncing to cloud providers are installed mostly for manual use:

Dropbox, OneDrive, Google Drive, Amazon Drive

Additional apps

Wait, there's more

Lists of Mac programs:

Others like this

Here are other scripts to install on Mac:

About

🚀 Automatically install, configure, and run the most popular programs of several stacks to work offline on a Mac and in clouds.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages