Faisal Journals

macOS & Homebrew

Fondasi sistem operasi macOS, Homebrew package manager, Brewfile, dan core CLI tools yang harus diinstall pertama kali.

Phase 1: Base System

Semua dimulai dari sini. Install fondasi sebelum apapun.

⚙️ macOS System Preferences

Sebelum install tools, konfigurasi macOS agar optimal untuk development:

macos-defaults.sh
# Tampilkan hidden files di Finder
defaults write com.apple.finder AppleShowAllFiles -bool true

# Tampilkan path bar di Finder
defaults write com.apple.finder ShowPathbar -bool true

# Tampilkan status bar di Finder
defaults write com.apple.finder ShowStatusBar -bool true

# Key repeat rate (lebih cepat untuk vim-style editing)
defaults write NSGlobalDomain KeyRepeat -int 2
defaults write NSGlobalDomain InitialKeyRepeat -int 15

# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

# Screenshot: simpan ke folder khusus
mkdir -p ~/Screenshots
defaults write com.apple.screencapture location ~/Screenshots

# Restart Finder untuk apply changes
killall Finder

Semua command defaults write di atas bisa disimpan dalam satu script dan dijalankan sekali di laptop baru.

🍺 Homebrew

Homebrew adalah package manager utama di macOS. Semua tools di-install melalui Homebrew.

📥 Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

🔧 Konfigurasi PATH (Apple Silicon)

Jika menggunakan Mac dengan chip Apple Silicon (M1/M2/M3/M4):

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

✅ Verifikasi

brew --version
# Homebrew 4.x.x

📋 Brewfile

Brewfile adalah cara deklaratif untuk mendefinisikan semua software yang dibutuhkan. Cukup jalankan brew bundle dan semua tools terinstall otomatis.

📂 Lokasi File

File Brewfile ada di root project:

Brewfile
# =============================================================================
# NEWS FAISAL - Brewfile
# =============================================================================
# Install semua: brew bundle
# Backup current: brew bundle dump --force
# =============================================================================

# --- Core CLI Tools ---
brew "git"                    # Version control
brew "node"                   # JavaScript runtime (>= 18)
brew "jq"                     # JSON processor
brew "wget"                   # HTTP downloader
brew "tree"                   # Directory tree viewer

# --- JavaScript Ecosystem ---
brew "oven-sh/bun/bun"        # Fast JS runtime & bundler

# --- Container ---
cask "docker"                 # Docker Desktop

# --- Editor ---
cask "visual-studio-code"     # Primary IDE

# --- Terminal ---
cask "iterm2"                 # Terminal emulator (opsional)

# --- Browser ---
cask "google-chrome"          # Development browser
cask "firefox"                # Testing browser

# --- Productivity ---
cask "raycast"                # Spotlight replacement (opsional)

📥 Install Semua dari Brewfile

# Install semua yang ada di Brewfile
brew bundle

# Atau install dari lokasi spesifik
brew bundle --file=./Brewfile

💾 Backup Setup Saat Ini

Ketika sudah setup mesin dengan sempurna, backup state-nya:

# Export semua yang terinstall ke Brewfile
brew bundle dump --force

# Commit Brewfile ke repo
git add Brewfile && git commit -m "chore: update Brewfile"

Selalu jalankan brew bundle dump --force sebelum ganti laptop untuk memastikan Brewfile up-to-date.

🔑 SSH Key untuk GitLab

🔐 Generate SSH Key

ssh-keygen -t ed25519 -C "your-email@example.com"

📋 Copy Public Key

cat ~/.ssh/id_ed25519.pub | pbcopy

🌐 Tambahkan ke GitLab

Buka GitLab > Settings > SSH Keys > Add key, paste public key.

🧪 Test Koneksi

ssh -T git@gitlab.com
# Welcome to GitLab, @username!

🔧 Git Configuration

Setup git identity
git config --global user.name "Faisal Affan"
git config --global user.email "your-email@example.com"

# Default branch
git config --global init.defaultBranch dev

# Useful aliases
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.lg "log --oneline --graph --all"

📦 Core CLI Tools Summary

ToolInstallPurposeRequired
Homebrew(manual, lihat di atas)Package managerYa
Gitbrew install gitVersion controlYa
Node.jsbrew install nodeJavaScript runtimeYa
Bunbrew install oven-sh/bun/bunFast JS runtimeYa
jqbrew install jqJSON processorOpsional
wgetbrew install wgetHTTP downloaderOpsional
treebrew install treeDirectory tree viewerOpsional

🗑️ Cara Uninstall

Edit on GitHub

Last updated on