Cleanup & Troubleshoot
Prosedur uninstall, teardown, cleanup, dan backup. Agar development machine tetap bersih dan ringan.
Maintenance & Cleanup
"Mesin yang bersih adalah mesin yang cepat."
Karena laptop berganti setiap bulan, penting untuk punya prosedur yang jelas tentang cara membersihkan tools yang tidak lagi digunakan, dan cara backup konfigurasi sebelum migrasi.
Sebelum Ganti Laptop (Backup)
Checklist yang harus dilakukan sebelum pindah ke laptop baru:
Backup Brewfile
cd ~/path/to/news_faisal
brew bundle dump --force
git add Brewfile && git commit -m "chore: backup Brewfile"
git push origin devPush Semua Perubahan
git status
git add -A && git commit -m "chore: pre-migration backup"
git push origin devExport VSCode Extensions (Opsional)
code --list-extensions > ~/vscode-extensions-backup.txtCatat Environment Variables
# Pastikan .env.example up-to-date
# JANGAN commit .env yang berisi secrets
cat .env.exampleBackup SSH Keys (PENTING)
# Copy SSH keys ke tempat aman (encrypted USB / password manager)
cp ~/.ssh/id_ed25519 /path/to/secure/backup/
cp ~/.ssh/id_ed25519.pub /path/to/secure/backup/JANGAN commit SSH private keys atau .env files ke repository. Simpan di password manager atau encrypted storage.
Brew Cleanup
Hapus Package Individual
# Uninstall package
brew uninstall <package-name>
# Hapus dependensi yang tidak dipakai lagi
brew autoremove
# Bersihkan cache download
brew cleanupLihat Apa yang Terinstall
# Semua yang diinstall via brew
brew list
# Hanya yang diinstall user (bukan dependensi)
brew leaves
# Cask (GUI apps)
brew list --caskFull Brew Cleanup
# Hapus semua cache
brew cleanup --prune=all
# Diagnosa masalah
brew doctorNode.js Cleanup
Hapus node_modules
# Project ini saja
rm -rf node_modules
pnpm install # Re-install fresh
# Atau gunakan Makefile
make clean-all # Hapus .next, .source, node_modules
make install # Re-installHapus Global Packages
# Lihat global packages
pnpm list -g
# Hapus specific global package
npm uninstall -g <package>
# Reset pnpm store
pnpm store pruneHapus Cache
# pnpm cache
pnpm store prune
# npm cache
npm cache clean --force
# Next.js cache
rm -rf .nextDocker Cleanup
Lihat Resource Usage
# Disk usage Docker
docker system df
# Running containers
docker ps
# All containers (termasuk stopped)
docker ps -a
# All images
docker imagesCleanup Bertahap
# 1. Stop semua container project ini
make docker-stop
# 2. Hapus stopped containers
docker container prune -f
# 3. Hapus unused images
docker image prune -f
# 4. Hapus unused volumes
docker volume prune -f
# 5. Hapus unused networks
docker network prune -fNuclear Option (Hapus Semua)
# Hapus SEMUA Docker resources (containers, images, volumes, networks)
docker system prune -a --volumes -fdocker system prune -a --volumes akan menghapus semua Docker data termasuk database volumes. Pastikan tidak ada data penting.
VSCode Cleanup
Hapus Extension yang Tidak Dipakai
# List semua extensions
code --list-extensions
# Uninstall
code --uninstall-extension <extension-id>Hapus Profile
Jika menggunakan VSCode Profiles:
Cmd+Shift+P> "Profiles: Delete Profile"- Pilih profile yang mau dihapus
Full VSCode Reset
# Uninstall VSCode
brew uninstall --cask visual-studio-code
# Hapus semua settings, extensions, cache
rm -rf ~/Library/Application\ Support/Code
rm -rf ~/.vscode
rm -rf ~/Library/Caches/com.microsoft.VSCodeProject-Level Cleanup
Quick Clean (Build artifacts saja)
make clean
# Hapus: .next, .source, node_modules/.cacheDeep Clean (Termasuk node_modules)
make clean-all
# Hapus: .next, .source, node_modules
# Jalankan 'make install' setelahnyaRe-generate Content Sources
# Jika .source/ bermasalah
rm -rf .source
pnpm exec fumadocs-mdxJadwal Maintenance
| Frekuensi | Aksi |
|---|---|
| Harian | git push semua perubahan |
| Mingguan | brew update && brew upgrade && brew cleanup |
| Bulanan | brew bundle dump, backup SSH keys, review dependencies |
| Pre-migrasi | Full backup checklist (lihat di atas) |
Troubleshooting
Edit on GitHub
Last updated on