latop

Setting Up or Resetting My Macbook

โ€”

by

in

Every now and then, fresh start is a good idea.

These are some notes and links I’ve accrued from resetting my Macbook a time or two.

These are just notes and links, they might be non-sensical, if you think I should polish them up, let me know.

Backup:

  • get RaspberryPi and Linux images
  • SSH keys
  • .dotfiles and user files
  • file folders like Documents, Photos, etc.
  • double check all applications are in the Homebrew installs or accounted for

Export VSCode settings and keybindings

https://stackoverflow.com/questions/35368889/how-can-i-export-settings

With the current version of Visual Studio Code as of this writing (1.22.1), you can find your settings in:

  • ~/.config/Code/User on Linux
  • %APPDATA%\Code\User (C:\Users\username\AppData\Roaming\Code\User) on Windows
  • ~/Library/Application Support/Code/User/ on Mac OS X

The files are settings.json and keybindings.json. Simply copy them to the target machine.

I need to get a list of what I have installed:

code --list-extensions | xargs -L 1 echo code --install-extension

Save this output for later.

Log out of Apple Apps

Especially if you’re selling the computer, log out or deactivate/deregister these:

  • Messages
  • Music
  • iCloud

Backup Desktop and Screen Savers

Resetting the computer

At least as of Ventura (OSX v.13), you can go into System Settings >> Transfer or Reset and click a button “Erase all Content and Settings”.

There’s also a migration helper.

Otherwise, you need to reboot the computer in safemode, and then use the Disk Utility to erase the hardrive, but NOT the mac system installer.

Ok, I’m ready, this is what I do

Pretty much in this order…

Remove Startup Chime

In MacOS Ventura (at least), you can disable this in the System Preference (thank goodness!), otherwise, you can try:

###Catalina
# Disable:
sudo nvram SystemAudioVolume=%80
#Enable:
sudo nvram -d SystemAudioVolume
###Others
# Disable
sudo nvram StartupMute=%01 
# Enable (why, I don't know)
sudo nvram StartupMute=%00

Keyboard Settings

  • Key Repeat -> Fast
  • Delay Until Repeat -> Short
  • Disable
    • “Correct spelling automatically”
    • “Capitalize words automatically”
    • “Add period with double-space”
    • “Use smart quotes and dashes”
  • Disable Spotlight, I use Alfred
  • Accessibility >> Spoken Content >> turn on “speak selection” and in the “i”, set the Option + Esc to read a selection.
  • Keyboard >> Dictation >> turn this on, and set the shortcut to Ctrl + Esc

Application setup

  1. Homebrew: install and then brew install everything else
  2. Arc (via homebrew) set as default, log in should pull over all extensions and bookmarks
  3. Set up my .dotfiles
  4. Get Fira Font for terminal and VSCode
  5. Oh my zsh and Spaceship prompt
  6. Get old SSH keys or ssh key setup, make sure they have the right permission: chmod 600 /Users/myuser/.ssh/id_rsa
  7. Node Version Manager and install latest version of Node and any other versions I need (current using 10, 12, 16)
  8. Composer global installs
  9. NPM global installs, trash cli npm install --global trash-cli
  10. Install VSCode extensions (below)
  11. Atom One Dark for VSC
  12. Install Logitch Options

Homebrew Installs

Once hombrew is installed, run the following:

brew install 4k-video-downloader alfred arc bartender balenaetcher boop cleanmymac clipy discord disk-inventory-x firefox fork git insomnia kindle lastpass licecap local mailpit microsoft-edge node nosql-workbench notion nvm obsidian oracle-jdk postman pyenv rectangle rocket screaming-frog-seo-spider sequel-ace skitch slack speedtest tableplus transmit visual-studio-code vlc warp whatsapp zoom

Global NPM Installs

npm install -g netlify-cli trash-cli

PHP and Composer

After homebrew is set up, PHP can be installed with this package:

brew tap shivammathur/php
brew install shivammathur/php/php@8.2
brew link --overwrite --force shivammathur/php/php@8.1
php -v

After PHP is installed, run the following to install Composer globally:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

php composer-setup.php

php -r "unlink('composer-setup.php');"

mv composer.phar /usr/local/bin/composer

VSC Code

If the code CLI is not already installed:

  • Launch VS Code.
  • Open the Command Palette (โ‡งโŒ˜P) and type ‘shell command’ to find the Shell Command: Install ‘code’ command in PATH command.
  • Restart VSCode
  • Then do the following to get the installed extensions
code --install-extension aaron-bond.better-comments
code --install-extension akamud.vscode-theme-onedark
code --install-extension akamud.vscode-theme-onelight
code --install-extension alexcvzz.vscode-sqlite
code --install-extension amazonwebservices.aws-toolkit-vscode
code --install-extension anthonydiametrix.ACF-Snippet
code --install-extension apollographql.vscode-apollo
code --install-extension be5invis.toml
code --install-extension bmewburn.vscode-intelephense-client
code --install-extension calebporzio.better-phpunit
code --install-extension christian-kohler.path-intellisense
code --install-extension dbaeumer.vscode-eslint
code --install-extension dsznajder.es7-react-js-snippets
code --install-extension eamodio.gitlens
code --install-extension EditorConfig.EditorConfig
code --install-extension esbenp.prettier-vscode
code --install-extension fabiospampinato.vscode-highlight
code --install-extension file-icons.file-icons
code --install-extension GitHub.copilot
code --install-extension GitHub.copilot-chat
code --install-extension GitHub.copilot-labs
code --install-extension GraphQL.vscode-graphql
code --install-extension GraphQL.vscode-graphql-execution
code --install-extension GraphQL.vscode-graphql-syntax
code --install-extension hashicorp.terraform
code --install-extension hbenl.vscode-mocha-test-adapter
code --install-extension hbenl.vscode-test-explorer
code --install-extension mariusschulz.yarn-lock-syntax
code --install-extension mgmcdermott.vscode-language-babel
code --install-extension mikestead.dotenv
code --install-extension mquandalle.graphql
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-playwright.playwright
code --install-extension ms-python.autopep8
code --install-extension ms-python.black-formatter
code --install-extension ms-python.isort
code --install-extension ms-python.pylint
code --install-extension ms-python.python
code --install-extension ms-python.vscode-pylance
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-vscode.live-server
code --install-extension ms-vscode.test-adapter-converter
code --install-extension neilbrayfield.php-docblocker
code --install-extension nikitaKunevich.snippet-creator
code --install-extension njpwerner.autodocstring
code --install-extension onecentlin.laravel-blade
code --install-extension onecentlin.laravel5-snippets
code --install-extension patbenatar.advanced-new-file
code --install-extension persoderlind.vscode-phpcbf
code --install-extension Prisma.prisma
code --install-extension redhat.vscode-xml
code --install-extension rust-lang.rust-analyzer
code --install-extension ryannaddy.laravel-artisan
code --install-extension sleistner.vscode-fileutils
code --install-extension streetsidesoftware.code-spell-checker
code --install-extension styled-components.vscode-styled-components
code --install-extension svelte.svelte-vscode
code --install-extension syler.sass-indented
code --install-extension tauri-apps.tauri-vscode
code --install-extension tungvn.wordpress-snippet
code --install-extension wix.vscode-import-cost
code --install-extension wordpresstoolbox.wordpress-toolbox
code --install-extension xabikos.JavaScriptSnippets
code --install-extension xdebug.php-debug

Misc…

Arc: Sign into account, sync with iCloud should be on, make sure to open preferences, and “On startup” should be set to “Continue where you left off”.

Chrome: Sign into accounts, make sure to open preferences, and “On startup” should be set to “Continue where you left off”.

Setup, PHPCS and Formatting

intellij idea – Code reformatting on save in PhpStorm or other jetbrains ide – Stack Overflow

PHP CodeSniffer and Code Formatting

  • SSH Keys to Strattic Code
  • Jira integration?
  • Set up AWS CLI with account and aws configure --profile strattic-dev it.
  • CleanMyMac license from old computer
  • Transmit license from old computer

Third party mouse issues: https://www.isiko.de/how-to-disable/

Connecting iMessage from iPhone: https://support.apple.com/en-us/HT208386


Factory Reset

Dev Setup resources:

Ubuntu


laptop computer 2006 to current” by elizabeth.hargis is marked with Public Domain Mark 1.0.