My MacBook Noob Experience
23 June 2020
My employer is issuing new laptops during pandemic (I'm not sure if this is part of the Work From Home (WFH) whenever possible initiative). Nevertheless, it's a good thing since we are getting MacBook instead of Windows machine. Don't get me wrong, Dell machines are reliable in general. The only thing missing on Windows is the opensource toolchain. And to be specific, I'm missing a good console that's pleasing to my eye while reading texts. With my git bash
, I have to type clear every time since texts overlap each other (a common experience after tailing a log file). Another specific I'm missing is the package manager though I survived with choco.
To my surprise, I received a brand spanking new MacBook Pro 2019. It has Intel Core i9 and AMD Radeon Pro with 4GB of GDDR6 memory, hardware specs that I'm really proud of!
What I'm about to write is my out-of-the-box experience and the commands I used to set it up.
First thing first
Get the latest IOS version which is Catalina 10.15.5 at the time of writing.
Get a package manager
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
My Cellar
∞ brew install wget
% brew install git
% brew install maven
% brew install tree
% brew install nmap
% brew install inetutils
% brew install awscli
% brew install jenv
% brew install nvm
% brew install rbenv
% brew install postgresql
% brew tap mongodb/brew
% brew install mongodb-community
My Caskroom
% brew cask install google-chrome
% brew cask install firefox
% brew cask install adoptopenjdk/openjdk/adoptopenjdk8
% brew cask install zulu7
% brew cask install intellij-idea
% brew cask install eclipse-jee
% brew cask install slack
% brew cask install fork
% brew cask install keepassx
% brew cask install atom
% brew cask install postman
% brew cask install dotnet
% brew cask install visual-studio-code
% brew cask install adobe-acrobat-reader
% brew cask install iterm2
% brew cask install drawio
% brew cask install mongodb-compass
% brew cask install diffmerge
Manually Downloaded applications
- awsconnect-osx-x64.tar
- mysql-workbench-community-6.3.10-macos-x86_64.dmg (since Cask version is too high for our db)
Caveats
- Maven downloaded its own version of OpenJDK but I want to match it with my lower version of Java. I followed this post to fix it. I have to use nano since vim keeps on saying the file is read-only even if I sudo.
% sudo nano /usr/local/Cellar/maven/3.6.3_1/bin/mvn
#!/bin/bash
# JAVA_HOME="${JAVA_HOME:-/usr/local/opt/openjdk}" exec "/usr/local/Cellar/maven/3.6.3_1/libexec/bin/mvn" "$@"
JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home)}" exec "/usr/local/Cellar/maven/3.6.3_1/libexec/bin/mvn" "$@"
- NVM didn't create it's working directory. I also added some lines to my
.zshrc
% mkdir ~/.nvm
% vim ~/.zshrc
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm"
- Insecure directories, run compaudit for list
% sudo chown -R drmanalo /usr/local/share/zsh/site-functions
% sudo chmod -R 755 drmanalo /usr/local/share/zsh/site-functions
% sudo chown -R drmanalo /usr/local/share/zsh
% sudo chmod -R 755 /usr/local/share/zsh
- Running multiple versions of Java
% vim ~/.zshrc
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
:wq
% source ~/.zshrc
% unset JAVA_TOOL_OPTIONS
% jenv enable-plugin maven
maven plugin activated
% jenv enable-plugin export
You may restart your session to activate jenv export plugin echo export plugin activated
% jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
openjdk64-1.8.0.252 added
1.8.0.252 added
1.8 added
% jenv add /Library/Java/JavaVirtualMachines/zulu-7.jdk/Contents/Home
zulu64-1.7.0.262 added
1.7.0.262 added
1.7 added
% jenv global 1.8.0.252
- Running mongodb community
brew services start mongodb/brew/mongodb-community