Skip to content

Instantly share code, notes, and snippets.

@PLP-GTR
Last active March 10, 2025 20:53
Show Gist options
  • Save PLP-GTR/fb67974f9774e4e71469f4312c49ea23 to your computer and use it in GitHub Desktop.
Save PLP-GTR/fb67974f9774e4e71469f4312c49ea23 to your computer and use it in GitHub Desktop.
macos_setup_and_infos

Setup steps

System

  • Set computer name: Systemeinstellungen > Freigaben > Gerätename
    • Change hostname also in the same window with "edit" button below the input or use the terminal ...
    • Set primary hostname (FQDN): sudo scutil --set HostName <hostname>.home.arpa
    • Set bonjour hostname: sudo scutil --set LocalHostName <hostname>
    • Set computer name (finder): sudo scutil --set ComputerName <hostname>
    • after this, dscacheutil -flushcache and
    • reboot

Package managers

  • homebrew package manager
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    • If you are planning to use Python, the Apple Xcode Command Line Tools are required
      xcode-select --install
  • composer, a dependency Manager for PHP
    Visit download page for instructions on global installation: https://getcomposer.org/download/

Apps

Install / Update / Remove

App installation order

  1. via homebrew
brew search telegram
brew install telegram-desktop
  1. via Apple App Store → visit it here
  2. via composer global
composer global search laravel
composer global install laravel/installer
  1. Install via .dmg or other installation format natively

App update order

  1. Check SystemeinstellungenAllgemeinSoftwareupdate
  2. Check App Store for updates → visit it here
  3. Check package managers:
# Homebrew: Update homebrew and formulae. Show outdated installed apps, upgrade them
brew update && brew outdated
brew upgrade

brew update && brew outdated --cask --greedy --verbose
brew upgrade --cask --greedy

composer global outdated
composer global update
composer global upgrade
  1. Use in-app update mechanism or download new .dmg or other setup file of application

App uninstall order

  1. Check App Store for installed application, remove from there
  2. Check package managers:
# Homebrew: Update homebrew and formulae. Show outdated installed apps, upgrade them
brew uninstall <app>
composer global remove <app>
  1. Check Application directory if there is a uninstaller, i.e. Bitdefender/EndpointSecutiryforMacUninstaller.app
  2. Drag and Drop the .app in Application directory into AppCleaner and remove all related directories and files

Apps to start with

Some CLI helpers

Some useful applications

  • itsycal via homebrew
    brew install --cask itsycal
    • Format to show full clock: E, d. MMM, HH:mm:ss 'Uhr' ('KW': w, qqq/yyyy)
      Output example: Di., 12. Apr., 13:37:00 Uhr (KW: 15, Q2/2022)
  • Telegram Desktop via homebrew:
    brew install --cask telegram-desktop
  • rectangle via homebrew:
    brew install --cask rectangle
  • Opera GX via homebrew:
    brew install --cask opera-gx
  • Logitech Options for MX Master & MX Keys, via LogiMgr Installer 9.50.122.app
    • reboot if your macOS has an active FileVault
  • AppCleaner via homebrew:
    brew install --cask appcleaner

Microsoft Office if you need it ...

Development related

Various settings

macOS

Safari

  • Disable asking for passwords in Safari: Safari > Einstellungen > Automatisch ausfüllen > Benutzernamen und Passwörter

Sublime

  • Set font in Sublime
{
    "font_face": "MesloLGMDZ Nerd Font",
    "font_size": 15,
}
# oh-my-zsh -- https://ohmyz.sh
# @see my config at https://gist.github.com/PLP-GTR/fb67974f9774e4e71469f4312c49ea23#file-2-1-zsh-oh-my-zsh-bash
source ~/.zsh/.oh-my-zsh
# oh-my-posh -- https://ohmyposh.dev/docs/prompt
if [ $TERM_PROGRAM != "Apple_Terminal" ]; then
eval "$(oh-my-posh init zsh --config ~/.zsh/rudolfs-dark.omp.json)"
fi
# iterm2 shell integration -- https://iterm2.com/documentation-shell-integration.html
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" || true
# Include own shell aliases
# @see https://gist.github.com/PLP-GTR/fb67974f9774e4e71469f4312c49ea23#file-2-2-zsh_aliases
source ~/.zsh_aliases
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS="yyyy-mm-dd"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='nano'
else
export EDITOR='nano'
fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
alias zshconfig="mate ~/.zshrc"
alias ohmyzsh="mate ~/.oh-my-zsh"
# Aliases are defined here to not clutter the .zshrc too much
# -------------------------------
# 1. ENVIRONMENT CONFIGURATION
# -------------------------------
#export EDITOR=/usr/bin/nano # Defined up at the zsh settings
# -----------------------------
# 2. MAKE TERMINAL BETTER
# -----------------------------
# use exa as ll replacement
alias l="exa --header --long --git --all --color-scale"
alias ll="l"
alias lls="exa --header --long --group --git --all --color-scale"
# show files as tree but without dot-files
alias llt="exa --header --long --group --git --color-scale --tree"
# old aliases, using GNU ls
alias gl='gls -oAhp --color --time-style=+" %Y %b %d, %H:%M "' # Preferred 'ls' implementation
alias gll="gl"
alias glls='gls -lAhp --color --time-style=+" %Y %b %d, %H:%M "' # Preferred 'ls' implementation displaying groups
# -------------------------------
# 3. FILE AND FOLDER MANAGEMENT
# -------------------------------
# ---------------------------
# 4. SEARCHING
# ---------------------------
# ---------------------------
# 5. PROCESS MANAGEMENT
# ---------------------------
# ---------------------------
# 6. NETWORKING
# ---------------------------
alias myip='curl https://wtfismyip.com/text' # myip: Public facing IP Address
alias netCons='lsof -i' # netCons: Show all open TCP/IP sockets
alias flushDNS='dscacheutil -flushcache' # flushDNS: Flush out the DNS Cache
alias lsock='sudo /usr/sbin/lsof -i -P' # lsock: Display open sockets
alias lsockU='sudo /usr/sbin/lsof -nP | grep UDP' # lsockU: Display only open UDP sockets
alias lsockT='sudo /usr/sbin/lsof -nP | grep TCP' # lsockT: Display only open TCP sockets
alias ipInfo0='ipconfig getpacket en0' # ipInfo0: Get info on connections for en0
alias ipInfo1='ipconfig getpacket en1' # ipInfo1: Get info on connections for en1
alias openPorts='sudo lsof -i | grep LISTEN' # openPorts: All listening connections
# ---------------------------------------
# 7. SYSTEMS OPERATIONS & INFORMATION
# ---------------------------------------
#export GPGKEY=
# ---------------------------------------
# 8. WEB DEVELOPMENT
# ---------------------------------------
# Tools
uid () {
UUID_VAR="$(uuidgen | awk '{print tolower($0)}')";
echo "${UUID_VAR}" | tr -d '\n' | pbcopy;
echo "UUID (v4) '${UUID_VAR}' copied to clipboard";
}
httpHeaders () { /usr/bin/curl -I -L $@ ; } # httpHeaders: Grabs headers from web page
# Docker
alias dps='docker ps' # Just shortening (using "$ ps" as base)
alias dcp='docker-compose' # Just shortening
alias dcu='docker compose up -d'
# Laravel Sail
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
# OneArmy
alias oneredo='docker compose down && docker rm community-platform-onearmycommunityplatform-1 && docker rmi onearmycommunityplatform && docker compose up'
alias oneclean='docker rm community-platform-onearmycommunityplatform-1 && docker rmi onearmycommunityplatform'
# ---------------------------------------
# 9. MISCELLANEOUS
# ---------------------------------------
# Download a YouTube video via "youtube-dl". Usage: $ mp3 https://youtu.be/xyzxyzxyzxyz
alias mp3='youtube-dl --rm-cache-dir && youtube-dl -x --audio-quality 0 --audio-format mp3 --no-playlist '
alias mp3l='youtube-dl --rm-cache-dir && youtube-dl -x --audio-quality 0 --audio-format mp3 '
# Include private config
Include config_plpgtr
Host *
UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment