How to setup macOS Sonoma
Create Installation Disk
- In AppStore, download "Sonoma".
sudo /Applications/Install\ macOS\ Sonoma.app/Contents/Resources/createinstallmedia --volume /Volumes/Disk --nointeraction
- Reboot and Holding down OPTION(ALT). More Details.
Installation
- Region / Appearance (Dark) / Wi-Fi / Check Advances settings (there is a bit of dark pattern).
- Encrypted DNS (open with Safari, iOS): https://github.com/paulmillr/encrypted-dns
Install Apps, Utils, Libs
[ ! -e /usr/local/bin/brew ] && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/$USER/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew analytics off
brew install ansible git tig htop zsh npm iterm2 appcleaner signal telegram # Optional: ffmpeg ImageMagick
[ ! -e ~/.oh-my-zsh ] && /bin/bash -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
brew install --cask docker visual-studio-code brave-browser
Configure System & User
# Manual Settings
# Right Sidebar, Medium, Weather + Screen Time.
# Control Centre, Bluetooth / AirDrop, Show in Menu Bar.
# Siri & Spotlight, Disable.
# Desktop & Dock, Disable the Quick Note from Hot Corners (bottom).
# Internet Accounts, disable all, except Contacts, iCloud.
# Trackpad, Enable Tap to click.
# Lock Screen, Require password immediately.
# Accessibility, Pointer Control, Trackpad Options, Enable dragging.
# Open Finder: New finder: "home". Sidebar: Show "home", Disable Tags.
# Open Brave: Default browser and configure it.
# General
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false # Text: Disable auto-correct
defaults write com.apple.TextEdit RichText -int 0 # TextEdit, Use plain text mode for new TextEdit documents
# Finder
defaults write com.apple.finder _FXSortFoldersFirst -bool true # Keep folders on top when sorting by name
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" # When performing a search, search the current folder by default
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" # Use list view in all Finder windows by default
# Dock
defaults write com.apple.dock persistent-apps -array # Wipe all app icons from the Dock
defaults write com.apple.dock tilesize -int 36 # Size
defaults write com.apple.dock orientation -string "left" # Position on screen
defaults write com.apple.dock minimize-to-application -bool true # Minimise windows into application icon
defaults write com.apple.dock autohide -bool true # Automatically hide and show the Dock
defaults write com.apple.dock show-recents -bool false # Show recent applications in Dock
killall Dock
Configure from GUI
- Dock: Brave, iTerm2, Visual Studio Code.
- Run & Give access to Docker (cmd+space).
- Visual Studio Code, Install Extensions, vscode-icons, Markdown.
- iTerm2, Show tab even when there is only one tab / Profiles, Terminal, Unlimited Scrollback.
- Reboot after.
More Configs
zsh startup
~/.zshrc
git config --global user.email "git@cojocariu.org";
git config --global user.name "Teo Cojocariu"
export HISTTIMEFORMAT="%F %T: "
export HISTFILESIZE=5000000
export EDITOR=nano
sshkey() { ssh-keygen -b 4096 -N '' -f ~/.ssh/"$1".key -C "teo.cojocariu.org";cat ~/.ssh/"$1".key.pub; }
screen
~/.screenrc
startup_message off
defscrollback 20000
altscreen on
defutf8 on
defnonblock on
caption always ' %H | %L=%-Lw%{= gW}%50> %n%f* %t %{-}%+Lw%< %-020='
ssh config
~/.ssh/config
Host *
IdentitiesOnly yes
PasswordAuthentication yes
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
ControlMaster auto
ControlPath ~/.ssh/sockets_%r@%h:%p
ControlPersist yes
GatewayPorts yes
Host cojo.eu
HostName 1.1.1.1
Port 22
User teo
IdentityFile ~/.ssh/id_ed25519
#LocalForward 9000 127.0.0.1:9000
#LocalForward 8200 127.0.0.1:8200
#StrictHostKeyChecking no
Host github.com
HostName github.com
Port 22
User git
IdentityFile ~/.ssh/id_ed25519
Optional - Config Changes
# Save configs: `defaults read > 1.conf`.
# Change Config from GUI.
# Save & Check what configs changed: `defaults read > 2.conf; diff 1.conf 2.conf`.