Skip to content

Instantly share code, notes, and snippets.

@kus
Last active December 20, 2023 15:24
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kus/b04a4e12a1f210888f4dc151201ef63f to your computer and use it in GitHub Desktop.
Save kus/b04a4e12a1f210888f4dc151201ef63f to your computer and use it in GitHub Desktop.
Get a clean Mac OSX up and running as a developer machine.

Make sure OS is up-to-date

Install Xcode:

(To get around certain build tools that actually require Xcode and not the cli tools)

From the App Store, open it once it's done then close it

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license

Set machine name

sudo scutil --set LocalHostName "MacBook-Pro"
sudo scutil --set ComputerName "MacBook-Pro"
sudo scutil --set HostName "MacBook-Pro"

Install Homebrew:

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

Run these two commands in your terminal to add Homebrew to your PATH:

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

Install CLI tools

brew install git
brew install opencv
brew install tmux
brew install overmind

Install FFmpeg

Install FFmpeg with all libraries (including the proprietary ones). Install additional SDKs required by some libraries.

brew install chromaprint amiaopensource/amiaos/decklinksdk
brew tap lescanauxdiscrets/tap && brew install lescanauxdiscrets/tap/zvbi

brew tap homebrew-ffmpeg/ffmpeg
brew install homebrew-ffmpeg/ffmpeg/ffmpeg $(brew options homebrew-ffmpeg/ffmpeg/ffmpeg --compact)

If you have any errors installing ffmpeg with a module; run echo $(brew options homebrew-ffmpeg/ffmpeg/ffmpeg --compact) to get the string and remove any modules that are erroring and rerun the command brew install homebrew-ffmpeg/ffmpeg/ffmpeg MODIFIED_STRING_HERE

Install software

# essential
brew install --cask dropbox
brew install --cask 1password
brew install --cask appcleaner

# dev
brew install --cask charles
brew install --cask imageoptim
brew install --cask sourcetree
brew install --cask visual-studio-code
brew install --cask cyberduck
brew install --cask sublime-text
brew install --cask rapidapi
brew install --cask anaconda
brew install --cask wireshark
brew install --cask qflipper

# utils
brew install --cask the-unarchiver
brew install --cask keka
brew install --cask kap
brew install --cask disk-inventory-x

# browsers
brew install --cask firefox
brew install --cask google-chrome

# gaming
brew install --cask discord
brew install --cask steam

# entertainment
brew install --cask vlc
brew install --cask spotify

# others
brew install --cask evernote
brew install --cask todoist
brew install --cask little-snitch
brew install --cask private-internet-access
brew install --cask transmission
brew install --cask istat-menus
brew install --cask zoom
brew install --cask teamviewer
brew install --cask signal

If you installed Anaconda

Run (echo; echo 'export PATH="/opt/homebrew/anaconda3/bin:$PATH"') >> ~/.zprofile, close the terminal and open again and run conda init zsh

Check if you have a .conda file in your home folder and if it is owned by root, we need to change it cd ~/ && ls -lah If it is owned by root, run this sudo chown -R $USER ~/.conda

From the App Store

  • Gifski (convert video into high-quality Gifs)
  • Toggl (time tracking)

OSX settings

# Finder: show hidden files by default
defaults write com.apple.finder AppleShowAllFiles -bool true

# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true

# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true

# Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true

# Finder: Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

# Finder: Avoid creating .DS_Store files on network or USB volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

# Finder: Enable snap-to-grid for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist

# Save screenshots to the desktop
defaults write com.apple.screencapture location -string "${HOME}/Desktop"

# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"

# Disable shadow in screenshots
defaults write com.apple.screencapture disable-shadow -bool true

# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0

# Open and save files as UTF-8 in TextEdit
defaults write com.apple.TextEdit PlainTextEncoding -int 4
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4

# Prevent Time Machine from prompting to use new hard drives as backup volume
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true

Set git user

git config --global user.name "Your Name"
git config --global user.email youremail@gmail.com
git config --global github.user yourusername

Create a node.js Anaconda environment

I use Anaconda for environment virtulisation. So I don't install node.js or different versions of python to the OS. I make an environment for every project.

conda create -yn node nodejs
conda activate node
node --version
npm --version

Enter the following at a command prompt: curl https://sdk.cloud.google.com | bash

Restart your shell: exec -l $SHELL

Run gcloud init to initialize the gcloud environment: gcloud init

Remove zsh insecure directories message

zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]?

Run compaudit | xargs chmod g-w

Install Alfred Workflows

https://github.com/zenorocha/alfred-workflows/releases

Install VS Code plugins

# Lint:
code --install-extension DavidAnson.vscode-markdownlint

# Git:
code --install-extension eamodio.gitlens
code --install-extension huizhou.githd
code --install-extension donjayamanne.githistory

# Beautify:
code --install-extension HookyQR.beautify
code --install-extension bierner.markdown-preview-github-styles

# Tools:
code --install-extension formulahendry.code-runner
code --install-extension anseki.vscode-color
code --install-extension eg2.vscode-npm-script
code --install-extension ryu1kn.partial-diff
code --install-extension ms-vscode.sublime-keybindings
code --install-extension GrapeCity.gc-excelviewer
code --install-extension joelday.docthis

# Language support:
code --install-extension nodesource.vscode-for-node-js-development-pack
code --install-extension felixfbecker.php-pack
code --install-extension eg2.tslint

# IntelliSense:
code --install-extension Zignd.html-css-class-completion
code --install-extension robinbentley.sass-indented

Set VS Code config

Press ⌘ Command+⇧ Shift+P and type preferences and select Preferences: Open Settings (JSON).

{
  "editor.multiCursorModifier": "ctrlCmd",
  "editor.snippetSuggestions": "top",
  "editor.formatOnPaste": true,
  "editor.renderWhitespace": "all",
  "debug.allowBreakpointsEverywhere": true,
  "codemetrics.basics.DecorationModeEnabled": false,
  "codemetrics.basics.CodeLensEnabled": false,
  "editor.insertSpaces": false
}

Install Sublime packages

Install Package Control then ⌘ Command+⇧ Shift+P and type install package and enter the below one at a time:

BracketHighlighter
Color Highlighter
GitGutter
Javascript Beautify
Material Theme
Pretty JSON
Sass
SideBarEnhancements
SublimeLinter-jscs
SublimeLinter-jshint

If cloning or pushing git repositories isn't working or giving permission denied

Ensure you are using system Git (if running something like SourceTree) and open Terminal and run ssh -Tv git@github.com and accept fingerprint.

@RickyGoodlett
Copy link

RickyGoodlett commented Aug 20, 2023

You talk about a very useful thing. I didn't even know about this method. I also recently found out that you can still download steam games for mac and was a little surprised. Everyone just said that the games on the mac will not work. I recently read how to download steam games for mac and did it on my laptop. It turns out that it was impossible before, because the games were buggy. Now macbooks have become more powerful and it has become possible to play on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment