My New MacBookPro

2023 04 02 head

I just received my new MacBookPro M2 Max with 32 GB of RAM and 1 TB SSD [1].

I know. I am a geek who loves his technical gadgets. I convinced my wife these gadgets are way cheaper than a sports car.

More seriously, I easily use my workstation forty hours a week. I really appreciate a stable and fast machine. My eyes are thankful if the display has a high resolution and the refresh rate fulfills ergonomic criteria [2].

The new notebook replaces my older MacBookPro 2018 I bought five years ago.

The new machine is so fast [3]. It is a pleasure to work with it. The only visible difference with the older notebook is the newer version has a bulkier build.

I decided to set up the machine from the ground up. I want to find out which programs I am really using in my work. The setup activities took around one and a half hours [4].

The older notebook is now my backup computer. It can be quite useful. A battery replacement on a MacBook notebook takes easily one week in Switzerland. You have to send the notebook to an approved reseller and have no access during this time.

Standard Programs

First, update the operating system to the newest version.

I installed manually the following applications:

Browsers
  • Google Chrome is my primary browser.

  • Firefox

  • Safari is installed with macOS.

Office Applications
  • AsciiDocFX as I write all technical documents using Asciidoc markup language.

  • LibreOffice is my primary office suite for all documents.

    • Microsoft Office is optional in case I receive a related file. I do not use it for productive work.

    • Apple Office Suite is optional in case I receive a related file. I do not use it for productive work.

  • Conference Tools: Slack, Zoom, Discord, Microsoft Teams [5] , ClickShare [6].

  • Amazon Kindle because I have all my technical and science-fiction books on Amazon Kindle. [7].

  • JabRef for bibliography references [8].

  • Google Drive to access all our company drives.

  • Switch Drive for the Swiss technical university drives.

  • Spotify to listen to music.

  • GPG Tools to sign all company related emails and encrypt sensitive documents. I am using PGP for the last thirty years.

  • Escalidraw

  • Wacom tablet drivers.

  • Banana for accounting as a local installation. The complete accounting activities including VAT declarations are performed with this application.

  • vlc as multimedia player

Developer Tools
  • JetBrains IntelliJ IDEA with AsciiDoc, Cursive, SonarLint, Statistics, Grazie Professional, and Snyk plugins.

  • Java JDK 17 LTS, JDK 20, and JDK 21 including the documentation for the latest JDK. [9].

  • VisualVM

  • Docker Desktop is used for clean validation and local deployment of complex applications.

  • Integrity to check the links on my websites.

The JDK documentation shall be copied in the folder /Library/WebServer/Documents. You need sudo rights to move the files into the web server documents folder.

You can access the JavaDoc documentation with URI localhost/docs-jdk20/api/index.html.

I need local access to the documentation when traveling in Switzerland. The official Swiss railway company does not provide Internet access in the trains.

If you never started the Apache server, you need to execute once:

sudo apachectl start

You can either migrate your whole user account to the new machine or copy manually the needed files

  • Copy the ssh keys files and zhrc configuration files.

  • Copy the music, photos and video files. The fastest approach is to copy the files from the backup drive to the new machine.

  • Download all the Kindle books you want to read offline on the train.

Brew Packages

Homebrew is an awesome tool to install libraries, tools and applications on macOS.

2023 04 02 homebrew
brew install maven gradle git git-lfs node pmd ruby protobuf          (1)
brew install hugo asciidoctor graphviz plantuml mermaid-cli python    (2)
brew install clojure leiningen                                        (3)
brew install wget rsync ghostscript                                   (4)
brew install --cask asciidocfx                                        (5)
brew install --cask jabref                                            (6)
xattr -d com.apple.quarantine /Applications/JabRef.app

npm install --global state-machine-cat                                (7)

gem install asciidoctor-bibtex asciidoctor-diagram asciidoctor-chart  (8)
gem install asciidoctor-rouge asciidoctor-kroki asciidoctor-revealjs
gem install --prerelease asciidoctor-tabs
gem update system & gem update

brew install --cask netnewswire                                       (9)
npm install @mermaid-js/mermaid-cli

brew install cmake ninja doxygen                                      (10)
1 Development tools for Java projects. Ant is an obsolete tool and no more part of the set.
2 Documentation tools used to produce all technical documents. The applications are used to generate static websites. I had to update the PATH variable with /opt/homebrew/opt/ruby/bin to ensure that brew ruby installation is used instead of the macOS one.
3 Clojure tools for the technical university lectures I gave.
4 Utilities for developers.
5 Applications managed through homebrew.
6 JabRef for bibliography references management. Due to macOS Ventura, you need to enable the application with xattr command.
7 State machine cat smcat to generate nice statecharts as an asciidoc diagram type.
8 Install the ruby packages used with asciidoctor to create the static websites.
9 Install a newsreader for RSS feeds. It is also used to check if tangly blog RSS feed is working.
10 Development tools for C++ projects.

I use a URL link checker to validate my websites. The link checker was a python package. I replaced it with Integrity application.

Git and GitHub Configuration

I copied the ssh configuration files stored in .ssh/ folder on the new machine. These configuration files handle the access to the multiple remote repositories I am using.

I also set up the shell configuration files .zshrc and .gitconfig to have the same environment.

If you copy your .ssh folder to the new workstation, you could have access right troubles. Ssh is quite restrictive about the access rights of the various files in the configuration folders due to security considerations. Try the following changes.

sudo chown -R <user> ~/.ssh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*

Local Configuration

Folders

Collaborators shall store projects under a well-defined path.

mkdir /Users/Shared/Projects

The official company open-source project is under /Users/Shared/Projects/tangly-os.

The tangly blog is under /Users/Shared/Projects/tangly-os-site. The site folder is where the site content is generated using Hugo and Docsy.

Configuration

Here is the startup script

plugins=(ssh-agent)


export PATH="/opt/homebrew/bin:/opt/homebrew/opt/ruby/bin:$PATH"                (1)

export MAVEN_OPTS="--enable-preview"
export GRADLE_OPTS="--enable-preview"
export JAVA_HOME=`/usr/libexec/java_home`
export GRAPHVIZ_DOT="/opt/homebrew/bin/dot"

alias la="ls -al"
alias brewup='brew update; brew upgrade; brew cleanup; brew doctor'

alias java17="export JAVA_HOME=`/usr/libexec/java_home -v 17`; java -version"   (2)
alias java20="export JAVA_HOME=`/usr/libexec/java_home -v 20`; java -version"
alias java21="export JAVA_HOME=`/usr/libexec/java_home -v 21`; java -version"
alias java22="export JAVA_HOME=`/usr/libexec/java_home -v 22`; java -version"

java21                                                                          (3)
1 Add homebrew to the path.
2 Command to select a JDK version and set it as default under macOS. Beware the command changes only between different JDK versions. You cannot switch between multiple JDK vendors with the same JDK version using this command.
3 Select the default JDK version.

Remember to install newly released JDKs containing security fixes every three months.

Regularly run the following commands to update your homebrew and ruby packages.

brewup
gem update

If you install a JDK with brew, read the brew output. Do not forget to create the link to the java installation. This step is necessary because brew installs a JDK as keg-only package. MacOS expects JDKs to be installed in the /Library/Java/JavaVirtualMachines directory.

sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk
             /Library/Java/JavaVirtualMachines/openjdk.jdk

You can check the installed JDKs with the command /usr/libexec/java_home -V.

Housekeeping

Once the new machine is up and running, I need to clean up the backup drive and remove the backups of the old machine.

sudo tmutil delete -p /Volumes/Backup/Backups.backupdb/<MACHINE-NAME>

Beware that the delete operation take a very long time.

Thoughts

All developers in our company are using Apple notebooks since the company’s inception. Our primary development stack is Java. We are regularly working on embedded industrial products and sometimes use C++.

The Apple ecosystem and the full access to a Unix system validated the assumption that this platform is best for the kinds of product development we are involved in.

The macOS operating system is a cool environment to easily install all the applications you need to work. The Unix terminal console is a game changer for any software engineer [10]. The Homebrew package manager streamlines installation and update of needed software packages.

An incredible useful feature is time machine. Buy an external storage medium and setup regular backups. It costs almost nothing and could save your professional life.

Minimize local files. All business information should be stored on the company shared drive. All product development files should be versioned in a remote Git repository.

The new MacBookPro is awesome. It is fast, slick, and the display is gorgeous. The trade-off is the weight of 2.2 kilograms you have to carry around. The build-in loudspeakers are an audible improvement against the sound of the previous machine.

I was surprised how much faster write operations on the build-in solid state disk are.

It is worth the price I paid [11]. [12].

The only feature I am truly missing is a finer control of the audio outputs. I would like to send the music stream to the loudspeakers and the conference call to the headset. My loudspeakers deliver high-quality sound but do not have a microphone. The headset has a microphone and is used for incoming calls. Currently, all audio streams are aggregated and sent to exactly one output device.


1. I am using Apple products for the last thirty-five years. I am certainly not objective when discussing the advantages and drawbacks of Apple computers. I also used Linux-based workstations and regularly compiled kernels and configured drivers. Some companies forced me to use Windows computers. I learnt to hate virus scanners and firewalls impeding my daily developer tasks.
2. If you are forced to work with a full HD display instead of a 4K display, it is probably time either to bring your own display or move to a company not being stingy. I really mean it. A good 4K display costs around 600 Euros. If your company cannot afford it, they are undoubtedly penny-pinching.
3. To be fair, I am not involved in machine learning or vision application development. Apple support for standard ML libraries is abysmal. The company decided to create their own standard with Metal and do not assume the consequences.
4. The synchronization of the various Cloud storages was performed overnight. We store company related or personal data either on Cloud drives or in Git repositories.
5. I love the Jabra Evolve2-65 headset for audio and video sessions. This bluetooth headset always connects without problems. The audio quality is excellent. The price is reasonable for a professional headset.
6. I need the ClickShare application because the drivers preinstalled on the ClickShare devices are old and do not work with current macOS versions.
7. Amazon still has not released an ARM native application. Shame on them. The worst missing feature is bulk download of purchased books. I like to explore my library during commute train travel. You do not have wireless access to trains in Switzerland. The books shall be stored in the notebook otherwise you cannot read them.
8. I love the bibtex to keep track to all my literature references.
9. I always install the last long-term support LTS Java version, the last official release, and the version under development. I use the development version to validate all projects to ensure they will run when the new version is officially released. I only use the LTS version for legacy activities. I am not aware of any scenarios why an organization should use an older Java version and have an advantage.
10. Professional programmers shall have access to a terminal and have local administrator rights.
11. The price of the Macbook notebook in 2023 was CHF 3'300. I buy a new notebook every five years, meaning the yearly costs are ridiculous low.
12. Due to customer policy, I had to give back my 2023 MacBook and buy a new notebook in 2024. I got a MacBookPro M3 Pro with 36 GB of RAM and 1 TB SSD for the price of CHF 3'000. The above instructions were used to set up the notebook from scratch in less than two hours. The JDK versions just needed to be upgraded to the newly released ones.