Skip to content

Instantly share code, notes, and snippets.

@dd5md
Forked from chadmayfield/Brewfile
Created July 23, 2023 15:20
Show Gist options
  • Save dd5md/a51fcef4bc90d37751be8497d21d122c to your computer and use it in GitHub Desktop.
Save dd5md/a51fcef4bc90d37751be8497d21d122c to your computer and use it in GitHub Desktop.
My current Brewfile used when setting up my mac and also for updating it.
# Brewfile: Homebrew bundle file for macOS app download/install (on Apple Silicone or Linux)
#
# Author : Chad Mayfield ([email protected])
# License : GPLv3
#
# INFO: * Links and comments are added because I'm too old to remember where/what everything is :)
# * install.sh can be used, but it needs love, some of it doesn't work correctly
# * TODO items are in a list at the bottom of this file
#
# Installation steps;
# 1. Install Xcode CLI Tools: sudo xcode-select --install
# 2. Install Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 3. Install Brewfile: brew bundle install
# 4. Verify Brewfile Install: brew bundle check --verbose
#
# Optional steps;
# 1. Mirror system to Brewfile: brew bundle --force cleanup (will delete non-existant pkgs)
# 2. Check for current updates: brew cu -a -f --include-mas
# 3. Setup autoupdate every 12 hours: brew autoupdate start 43200
#
# Ruby File Docs: https://ruby-doc.org/core-3.1.1/File.html
#
# --- Homebrew cheatsheet -----------------------------------
#
# Brew Docs : https://docs.brew.sh/
# Brew Manpage : https://docs.brew.sh/Manpage
# Brewfile Docs : https://github.com/Homebrew/homebrew-bundle
# FAQs : https://docs.brew.sh/FAQ
# Terminology : https://docs.brew.sh/Formula-Cookbook#homebrew-terminology
#
# brew help <cmd> # print help for sub-command
# brew doctor # diagnose brew issues
# brew analytics <on|off> # turn analytics on or off
# brew shellenv # display env variable exports
# brew --config # display brew configurations
# brew --cache # display cache download location
# brew --caskroom # display caskroom location for GUI apps
# brew --cellar # display location of CLI apps
# brew update # update brew and cask
# brew upgrade # upgrade all formulae
# brew upgrade --greedy # upgrade all formulae and casks with auto_update: true
# brew autoupdate start # start homebrew autoupdate (required interval)
# brew autoupdate status # check status of autoupdate
# brew cu # upgrade mac apps using 'buo/cask-upgrade'
# brew list # list installed
# brew list --cask # list installed applications
# brew tap # list current tapped repos
# brew deps --tree <frmla> # show dependencies
# brew outdated # what is due for an upgrade
# brew leaves # display unused formula to uninstall
# brew cleanup # remove older formulae versions
# brew search <string> # search for formulae
# mas search <string> # use mas to search for App Store apps
# brew info <formula> # display info on formulae
# brew install <formula> # install formulae
# brew uninstall <formula> # uninstall formulae
# brew pin <formula> # pin at version (to prevent upgrades)
# brew cu pin <caskname> # pin cask at version (to prevent upgrades)
# brew bundle list # list deps in Brewfile
# brew bundle check -v # check if apps from brewfile are installed
# brew bundle cleanup # cleanup unused deps left
#
# -----------------------------------------------------------
###############################################################################
# Add some third-party repos to use.
#
# 'brew tap user/repo'
#
# Docs: https://docs.brew.sh/Taps
# https://docs.brew.sh/Interesting-Taps-and-Forks
###############################################################################
# official taps
tap "homebrew/autoupdate" # [https://github.com/Homebrew/homebrew-autoupdate]
tap "homebrew/bundle" # [https://github.com/Homebrew/homebrew-bundle]
tap "homebrew/cask" # [https://github.com/Homebrew/homebrew-cask] - [https://formulae.brew.sh/cask/]
tap "homebrew/core" # [https://github.com/Homebrew/homebrew-core]
tap "homebrew/services" # [https://github.com/Homebrew/homebrew-services]
tap "homebrew/cask-fonts" # [https://github.com/Homebrew/homebrew-cask-fonts]
# third-party taps
tap "buo/cask-upgrade" # 'brew cu' [https://github.com/buo/homebrew-cask-upgrade]
tap "aquasecurity/trivy" # trivy [https://github.com/aquasecurity/trivy]
tap "anchore/grype" # grype [https://github.com/anchore/grype]
tap "wader/tap" # fq [https://github.com/wader/fq]
tap "neilotoole/sq" # sq [https://github.com/neilotoole/sq]
tap "natesales/repo" || true # q [https://github.com/natesales/q]
tap "hacker1024/hacker1024" # coretemp [https://github.com/hacker1024/coretemp]
tap "boz/repo" # kail [https://github.com/boz/kail]
tap "charmbracelet/tap" # softserve [https://github.com/charmbracelet/soft-serve]
# taps to use in future
#tap "bell-sw/liberica" # liberica-jdk11-full [https://bell-sw.com/pages/downloads/]
#tap "martido/homebrew-graph" # 'brew graph' [https://github.com/martido/homebrew-graph]
###############################################################################
# Install most used formulae.
#
# 'brew install <formula>'
#
# Docs: https://docs.brew.sh/
# https://docs.brew.sh/Bottles
# https://docs.brew.sh/Tips-N'-Tricks
#
# Formula browser: https://formulae.brew.sh/
#
###############################################################################
### homebrew appstore & docker deps
brew "mas"
brew "whalebrew" if File.symlink?("/usr/local/bin/docker")
#brew "cakebrew"
### ansible
brew "ansible"
brew "ansible-lint"
### communications
brew "curl"
brew "wget"
brew "netcat"
brew "mitmproxy" # interactive https proxy (https://github.com/mitmproxy/mitmproxy) https://mitmproxy.org/
brew "mtr" # network diagnostics [https://github.com/traviscross/mtr]
brew "mosh" # the mobile shell [https://mosh.org/]
brew "yt-dlp" # download all the videos [https://github.com/yt-dlp/yt-dlp]
brew "ipinfo-cli" # cli ip info from ipinfo.io [https://github.com/ipinfo/cli]
brew "speedtest-cli", link: true
brew "bandwhich" # bandwidth utilization tool [https://github.com/imsnif/bandwhich]
brew "vnstat" # network traffic monitor [https://github.com/vergoh/vnstat]
brew "iftop" # interface b/w stats [https://github.com/soarpenguin/iftop]
brew "httpstat" # curl statistics made simple [https://github.com/reorx/httpstat]
brew "httpie" # human-friendly http cli client [https://github.com/httpie/httpie] https://httpie.io/docs/cli
brew "curlie" # power of curl, ease of httpie [https://github.com/rs/curlie]
brew "plow" # high-performance http benchmarking [https://github.com/six-ddc/plow]
brew "hey" # http load generator [https://github.com/rakyll/hey]
brew "natesales/repo/q" # a tiny dns client [https://github.com/natesales/q]
brew "pop" # send email from your terminal (https://github.com/charmbracelet/pop)
### network services
brew "sdns", restart_service: true if OS.linux?
brew "coredns", restart_service: true if OS.linux?
### cloud
brew "doctl" # digitalocean
brew "vultr" # vultr
brew "azure-cli" # azure
brew "awscli" # aws
### stats
brew "node_exporter", restart_service: true
brew "gtop"
brew "archey4"
### development tools
# git
brew "git"
brew "git-extras"
brew "git-lfs"
brew "git-flow"
brew "git-cal"
brew "gh" #if Dir.exists?("~/Documents/code")
brew "bfg"
# build
brew "travis"
brew "drone-cli"
#brew "bazel"
# golang
brew "go"
brew "upx" # currently, bottled only for x86_64
# rust
brew "rust"
# java
#brew "liberica-jdk11-full"
#brew "openjdk"
#brew "groovy"
#brew "gradle"
# python (will always be installed)
brew "python", link: false if !File.exists?("/usr/bin/python3")
brew "pyenv", link: false if !File.exists?("/usr/bin/python3")
brew "pyenv-virtualenv", link: false if !File.exists?("/usr/bin/python3")
# json/yaml/binary filter tools
brew "jq"
brew "jo"
brew "yq"
brew "yamllint"
brew "sq"
brew "htmlq"
brew "wader/tap/fq"
brew "lemmeknow"
# diff tools
brew "diff-so-fancy"
#brew "colordiff"
# rpm build tools
brew "rpm2cpio", link: :overwrite
brew "rpm", link: :overwrite # ventura is required
brew "create-dmg"
# docs
brew "glow" # render markdown in terminal [https://github.com/charmbracelet/glow]
brew "mkdocs", link: true if OS.mac?
brew "hugo" if OS.mac?
### kubernetes/container tools
brew "colima" if OS.mac? # containers for macOS [https://github.com/abiosoft/colima]
brew "lima" if OS.mac? # linux vms for macOS [https://github.com/lima-vm/lima]
brew "ko" # build Go container images [https://github.com/ko-build/ko | https://ko.build/]
brew "kubectl"
brew "kube-linter" # static analysis of K8s yaml [https://github.com/stackrox/kube-linter]
brew "dive" # container layer explorer [https://github.com/wagoodman/dive]
brew "helm" if File.symlink?("/opt/homebrew/bin/kubectl")
brew "helmfile" if File.symlink?("/opt/homebrew/bin/helm")
brew "k3sup", link: true if File.symlink?("/opt/homebrew/bin/kubectl")
brew "faas-cli", link: :overwrite
brew "hadolint" # Dockerfile lint [https://github.com/hadolint/hadolint]
brew "k9s" # cli kubernetes management [https://github.com/derailed/k9s/]
brew "boz/repo/kail" # kubernetes tail [https://github.com/boz/kail]
#brew "kubetap" # intercepting proxy for K8s (https://github.com/soluble-ai/kubetap)
#brew "kube-score" # kubernetes obj analysis [https://github.com/zegl/kube-score]
#brew "kubeaudit" # audit kubernetes [https://github.com/Shopify/kubeaudit]
#brew "kubent" # deprecated api check for kubernetes [https://github.com/doitintl/kube-no-trouble]
#brew "kubescape" # kubernetes security platform [https://github.com/kubescape/kubescape]
#brew "kubespy" # observe k8s resources in real-time [https://github.com/pulumi/kubespy]
#brew "minikube" # OLD, now using colima. Kubernetes for MacOS [https://minikube.sigs.k8s.io/docs/]
#brew "octant" # DEPRECATED 2/7/23
### linux utilities (https://bit.ly/2KLMXDp)
# add to /etc/shells then run chsh
#brew "bash"
#brew "bash-completion"
brew "fish"
brew "shellcheck" if File.exists?("/bin/bash")
brew "brew-cask-completion"
brew "coreutils" # chown/chmod, du, cut, uniq, shred, etc.
brew "moreutils" # sponge, pee, parallel, etc.
brew "dos2unix"
brew "watch"
brew "tree"
brew "tmux"
brew "pstree"
brew "htop"
brew "lsusb"
brew "smartmontools"
brew "vim" if OS.linux?
#brew "macvim" if OS.mac?
#brew "neovim" if OS.mac?
### additional linux utils
brew "hacker1024/hacker1024/coretemp" # recommended for bpytop []
brew "bpytop" # resource monitor [https://github.com/aristocratos/bpytop]
brew "exa" # modern ls [https://github.com/ogham/exa]
brew "bat" # cat with syntax highlighting [https://github.com/sharkdp/bat]
brew "pv" # pipe viewer, monitor data through pipe [http://www.ivarch.com/programs/pv.shtml]
brew "tldr" # user-friendly man [https://tldr.sh/]
brew "duf" # a better df [https://github.com/muesli/duf]
brew "xz" # lossless compression, improved LZMA [https://tukaani.org/xz/]
brew "p7zip" # posix port of 7-zip [https://p7zip.sourceforge.net/]
#brew "unar" # the unarchiver [https://theunarchiver.com/command-line]
brew "ttyd" # ttyd over web (required s by vhs) [https://github.com/tsl0922/ttyd]
brew "vhs" # cli home video recorder [https://github.com/charmbracelet/vhs/]
brew "asciinema" # record shell [https://asciinema.org/]
brew "cloc" # count lines of code [https://github.com/AlDanial/cloc/]
brew "rmate", link: :overwrite # HOWTO: https://github.com/textmate/rmate
### misc
brew "tarsnap" if OS.linux?
### multimedia tools
brew "ffmpeg"
brew "jhead"
brew "exiftool"
#brew "imagemagick", args: ["with-webp"]
brew "spotify-tui" # https://github.com/Rigellute/spotify-tui#connecting-to-spotifys-api
### security tools
brew "gnupg"
brew "certbot" if OS.linux?
brew "nmap"
brew "rustscan" # a modern port scanner [https://github.com/RustScan/RustScan]
brew "socat" # bidirectional byte streams [http://www.dest-unreach.org/socat/]
brew "aircrack-ng"
brew "hydra"
brew "john"
brew "ffuf"
brew "fzf"
#brew "afl-fuzz" # DEPRECATED 9/17/22
brew "trivy" # kubernetes vuln/misconfiguration scanner [https://github.com/aquasecurity/trivy]
brew "grype" # container vuln scanner [https://github.com/anchore/grype]
#brew "ghidra" # sre tools [https://ghidra-sre.org/]
brew "sslscan" # sslscan test suite [https://github.com/rbsec/sslscan]
### virtualization tools
#brew "xhyve" if OS.mac?
brew "packer"
brew "terraform"
###############################################################################
# Add our casks (GUI applications) to the system.
#
# 'brew install --cask'
#
# Docs: https://formulae.brew.sh/formula/cask
# https://github.com/Homebrew/homebrew-cask
#
# Cask browser: https://formulae.brew.sh/cask/
#
###############################################################################
# specify a directory to install
cask_args appdir: "/Applications"#, require_sha: true
# BASE INSTALL
cask "1password"
cask "1password-cli"
cask "balenaetcher"
cask "coconutbattery"
cask "daisydisk"
cask "expressions"
cask "firefox"#, greedy: true
cask "fork"
cask "forklift"
cask "handbrake"
cask "intellij-idea"
cask "kaleidoscope"
cask "little-snitch"
cask "malwarebytes"
cask "micro-snitch"
cask "microsoft-remote-desktop"
cask "postman"
cask "protonmail-import-export"
cask "protonvpn"
cask "smartgit"
cask "sqlpro-studio"
cask "spotify"
cask "tableplus"
cask "textmate"
cask "the-unarchiver"
cask "transmit"
cask "versions"
cask "visual-studio-code"
cask "vlc"
cask "vmware-fusion"
cask "vnc-viewer"
cask "warp"
cask "zoom"
# FONTS
cask "font-anonymous-pro"
cask "font-bebas-neue"
cask "font-dejavu-sans-mono-nerd-font"
cask "font-inconsolata"
cask "font-inconsolata-go-nerd-font"
cask "font-liberation"
# OPTIONAL (install as needed)
#cask "appcleaner"
#cask "burn"
#cask "burp-suite"
#cask "caffeine"
#cask "displays"
#cask "docker"
#cask "expandrive"
#cask "fleet"
#cask "github"
#cask "goland"
#cask "google-chrome"
#cask "gpg-suite"
#cask "imazing"
#cask "insomnia"
#cask "intellij-idea-ce"
#cask "java" unless system "/usr/libexec/java_home --failfast"
#cask "keybase"
#cask "ksdiff"
#cask "lens"
#cask "makemkv"
#cask "mattermost"
#cask "microsoft-auto-update"
#cask "microsoft-excel"
#cask "microsoft-office" if !Dir.exists?("/Applications/Microsoft Word.app")
#cask "microsoft-powerpoint"
#cask "microsoft-teams"
#cask "microsoft-word"
#cask "ngrok"
#cask "obs"
#cask "obsidian"
#cask "pycharm-ce"
#cask "raspberry-pi-imager"
#cask "signal"
#cask "slack"
#cask "steam"
#cask "strongsync"
#cask "terminus"
#cask "tower"
#cask "transmission"
#cask "vagrant"
#cask "vagrant-manager"
#cask "virtualbuddy" # virtualize macOS on Apple Silicone
#cask "virtualbox" # intel only as of 2/1/23
#cask "virtualbox-extension-pack" # intel only as of 2/1/23
#cask "viscosity"
#cask "wireshark"
###############################################################################
# Install apps not available as casks from Mac App Store using mas-cli
#
# 'mas install'
#
# Docs: https://github.com/mas-cli/mas
#
# https://github.com/mas-cli/mas#-usage
# list : mas list
# search : mas search Xcode
# install : mas install <id>
# purchase : mas purchase <id>
# upgrade : mas upgrade
#
# https://github.com/mas-cli/mas#-sign-in
# sign-in : mas signin --dialog [email protected]
###############################################################################
mas "dayone", id: 1055511498
#mas "iawriter", id: 775737590
mas "imovie", id: 408981434
mas "keynote", id: 409183694
mas "numbers", id: 409203825
mas "pages", id: 409201541
#mas "patterns", id: 429449079
###############################################################################
# Create aliases for Docker images and run them as native commands
#
# 'whalebrew install'
#
# Docs: https://github.com/whalebrew/whalebrew
#
###############################################################################
whalebrew "whalebrew/wget" if File.exists?("/opt/homebrew/bin/whalebrew")
#################### TODO ####################
# *
# *
# *
# *
##############################################
#!/usr/bin/env bash
#
# Author : Chad Mayfield ([email protected])
# License : GPLv3
#
# setup macOS using Homebrew
#
# install rosetta on apple silicon
if [[ "$(sysctl -n machdep.cpu.brand_string)" == *'Apple'* ]]; then
if [ ! -d "/usr/libexec/rosetta" ]; then
echo "Installing Rosetta..."
sudo softwareupdate --install-rosetta --agree-to-license
fi
# show our install history, we should have rosetta
sudo softwareupdate --history
fi
# install xcode cli tools
command -v "xcode-select -p" >/dev/null 2>&1; has_xcode=1 || { has_xcode=0; }
if [ "$has_xcode" -eq 0 ]; then
echo "Installing XCode CLI Tools..."
sudo xcode-select --install
else
# show path
xcode-select -p
# show version
xcode-select --version
# show compiler version
#gcc -v
#llvm-gcc -v
#clang -v
fi
# install homebrew
command -v brew >/dev/null 2>&1; has_brew=1 || { has_brew=0; }
if [ "$has_brew" -eq 0 ]; then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# add 'brew --prefix' location to $PATH
# https://applehelpwriter.com/2018/03/21/how-homebrew-invites-users-to-get-pwned/
# https://www.n00py.io/2016/10/privilege-escalation-on-os-x-without-exploits/
if [[ "$(sysctl -n machdep.cpu.brand_string)" == *'Apple'* ]]; then
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/${USER}/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/${USER}/.bash_profile
eval "$(/opt/homebrew/bin/brew shellenv)"
#echo 'export PATH=/opt/homebrew/bin:$PATH' >> /Users/${USER}/.bash_profile
#echo 'export PATH=/opt/homebrew/sbin:$PATH' >> /Users/${USER}/.bash_profile
else
echo 'export PATH="/usr/local/sbin:$PATH"' >> /Users/${USER}/.bash_profile
fi
source /Users/${USER}/.bash_profile
# turn off brew analytics
brew analytics off
if
# update brew
brew update
# run brewfile to install packages
brew bundle install
# check for issues
brew doctor
# set brew to update every 12 hours (in seconds)
brew autoupdate start 43200
# show brew auto update status for feedback
brew autoupdate status
# display outdated apps and auto-update status
brew cu --include-mas
#EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment