Skip to content

Instantly share code, notes, and snippets.

@chadmayfield
Last active April 23, 2024 16:56
Show Gist options
  • Save chadmayfield/ada07e4e506d7acd577a665541a70c9b to your computer and use it in GitHub Desktop.
Save chadmayfield/ada07e4e506d7acd577a665541a70c9b 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 or Linux app install (with notes/source repos)
#
# Author : Chad Mayfield (chad@chadmayfield.com)
# License : GPLv3
#
# INFO: * Links and comments are added because I'm too old to remember where everything is :)
# * install.sh can be used, but it needs some love (some of it doesn't work correctly).
# * TODO items (and additional information) is listed at the bottom
#
# 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 Modules
# OS : https://rubydoc.brew.sh/OS.html (https://github.com/rdp/os)
#
# --- My 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
# Linuxbrew : https://docs.brew.sh/Homebrew-on-Linux
#
# 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 list --versions # list installed versions
# 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
#
# -----------------------------------------------------------
require 'date'
# brew version
hb = `brew -v`
# bash version
bv = `bash -c 'echo $BASH_VERSION'`
sh = `echo $SHELL`
# current date
now = DateTime.now
now.strftime("%B %d %Y")
# auto-update status
au = ENV.fetch("HOMEBREW_AUTO_UPDATE_COMMAND")
status = au ? "True" : "False"
# fail if Homebrew is not installed, (or if it's not in $PATH)
if !hb.include? "Homebrew"
abort("ERROR: Homebrew does not appear to be installed!")
end
# display some basic system env information
puts("--------------------------------")
puts("HOMEBREW_PRODUCT : " + ENV.fetch("HOMEBREW_PRODUCT"))
puts("HOMEBREW_SYSTEM : " + ENV.fetch("HOMEBREW_SYSTEM"))
puts("HOMEBREW_OS_VERSION : " + ENV.fetch("HOMEBREW_OS_VERSION"))
puts("HOMEBREW_VERSION : " + ENV.fetch("HOMEBREW_VERSION"))
puts("HOMEBREW_PROCESSOR : " + ENV.fetch("HOMEBREW_PROCESSOR"))
puts("AUTO_UPDATE_ENABLED : " + status + " (" + au + ")")
puts("BASH_VERSION : " + bv)
puts("CURRENT_USER_SHELL : " + sh)
puts("--------------------------------")
puts("\n")
# give us time to CTRL-C
sleep(5)
###############################################################################
# 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-fonts" # [https://github.com/Homebrew/homebrew-cask-fonts]
tap "homebrew/services" # [https://github.com/Homebrew/homebrew-services]
# unnecessary taps in v4: https://brew.sh/2023/02/16/homebrew-4.0.0/
if ENV.fetch("HOMEBREW_VERSION") < '4.0.0'
tap "homebrew/cask" # [https://github.com/Homebrew/homebrew-cask]
tap "homebrew/core" # [https://github.com/Homebrew/homebrew-core]
end
# third-party taps
tap "anchore/grype" # grype [https://github.com/anchore/grype]
tap "aquasecurity/trivy" # trivy [https://github.com/aquasecurity/trivy]
tap "boz/repo" # kail [https://github.com/boz/kail]
tap "buo/cask-upgrade" # 'brew cu' [https://github.com/buo/homebrew-cask-upgrade]
tap "charmbracelet/tap" # softserve/pop/vhs [https://github.com/charmbracelet/homebrew-tap]
tap "hacker1024/hacker1024" # coretemp [https://github.com/hacker1024/coretemp]
tap "itchyny/tap" # bed [https://github.com/itchyny/bed]
tap "knqyf263/pet" # pet [https://github.com/knqyf263/pet]
tap "localstack/tap" # localstack [https://github.com/localstack/homebrew-tap]
tap "natesales/repo" || true # q [https://github.com/natesales/q]
tap "neilotoole/sq" # sq [https://github.com/neilotoole/sq]
tap "tinygo-org/tools" # tinygo [https://tinygo.org/getting-started/install/macos/]
tap "wader/tap" # fq [https://github.com/wader/fq]
#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 "brew-cask-completion" # fish completion for brew-cask [https://github.com/xyb/homebrew-cask-completion]
#brew "cakebrew" # homebrew GUI [https://www.cakebrew.com/]
brew "mas" # mac app store cli [https://github.com/mas-cli/mas]
brew "whalebrew" if File.symlink?("/usr/local/bin/docker") # hombrew for docker [https://github.com/whalebrew/whalebrew]
### ansible
brew "ansible", link: :overwrite # config mgmt [https://www.ansible.com]
brew "ansible-lint", link: :overwrite # check best practices/behavior [https://ansible-lint.readthedocs.io/]
### backup utilities
brew "tarsnap" if OS.linux? # online backups for the paranoid [https://www.tarsnap.com/]
### cloud
brew "awscli", link: :overwrite # aws cli client [https://aws.amazon.com/cli/]
brew "azure-cli" # ms azure cli client [https://docs.microsoft.com/cli/azure/overview]
brew "doctl" # digitalocean cli client [https://github.com/digitalocean/doctl]
brew "faas-cli" # cli for openfaas [https://github.com/openfaas/faas-cli]
brew "localstack-cli" # local aws stack [https://github.com/localstack/localstack]
brew "vultr" # vultr cli client [https://jamesclonk.github.io/vultr]
### communications
brew "bandwhich" # bandwidth utilization tool [https://github.com/imsnif/bandwhich]
brew "curl" # cli data xfers [https://curl.se]
brew "curlie" # power of curl, ease of httpie [https://github.com/rs/curlie]
brew "hey" # http load generator [https://github.com/rakyll/hey]
brew "httpie" # human-friendly http cli client [https://github.com/httpie/httpie] https://httpie.io/docs/cli
brew "httpstat" # curl statistics made simple [https://github.com/reorx/httpstat]
brew "iftop" # interface b/w stats [https://github.com/soarpenguin/iftop]
brew "ipinfo-cli" # cli ip info from ipinfo.io [https://github.com/ipinfo/cli]
brew "k6" # k6 loadtest util (https://github.com/grafana?q=k6) https://k6.io
brew "mailpit" # email/SMTP testing tool [https://github.com/axllent/mailpit]
brew "mosh" # the mobile shell [https://mosh.org/]
brew "mtr" # network diagnostics [https://github.com/traviscross/mtr]
brew "natesales/repo/q" # a tiny dns client [https://github.com/natesales/q]
brew "netcat" # network util [https://netcat.sourceforge.net/]
brew "plow" # high-performance http benchmarking [https://github.com/six-ddc/plow]
brew "pop" # send email from your terminal (https://github.com/charmbracelet/pop)
brew "speedtest-cli", link: true # speedtest.net cli bandwidth test [https://github.com/sivel/speedtest-cli]
brew "vnstat" # network traffic monitor [https://github.com/vergoh/vnstat]
brew "wget" # internet file retreiver [https://www.gnu.org/software/wget/]
brew "yt-dlp", link: :overwrite # download all the videos [https://github.com/yt-dlp/yt-dlp]
brew "zrok" # resource sharing platform, vis-à-vis ngrok [https://zrok.io/]
### development tools
# build
#brew "bazel" # google build tool [https://bazel.build/]
brew "drone-cli" # cli drone.io client [https://drone.io]
brew "make" # direct complication [https://www.gnu.org/software/make/]
brew "travis" # cli travis-ci client [https://github.com/travis-ci/travis.rb/]
# diff tools
brew "colordiff" # colored diff [https://www.colordiff.org/]
brew "diff-so-fancy" # good-lookin' diffs [https://github.com/so-fancy/diff-so-fancy]
# docs
brew "glow" # render markdown in terminal [https://github.com/charmbracelet/glow]x
if OS.mac?
brew "hugo" # static site generator [https://gohugo.io/]
brew "mkdocs", link: true # project docs in markdown [https://www.mkdocs.org/]
brew "asciidoctor" # textfile formatter [https://asciidoc.org/]
end
# editors
brew "bed" # binary editor (in Go) [https://github.com/itchyny/bed]
brew "hexyl" # simple cli hex viewer (in Rust) [https://github.com/sharkdp/hexyl]
# filter tools (json/yaml/sql/binary)
brew "fx" # terminal json viewer [https://github.com/antonmedv/fx]
brew "htmlq" # jq for html [https://github.com/mgdm/htmlq]
brew "lemmeknow" # identify any file [https://github.com/swanandx/lemmeknow]
brew "jo" # json ouput in terminal [https://github.com/jpmens/jo]
brew "jq" # cli json processor [https://jqlang.github.io/jq/]
brew "sq" # jq for sql [https://github.com/neilotoole/sq]
brew "yq" # yaml/csv/xml/json processor [https://github.com/mikefarah/yq]
brew "yamllint" # yaml linter [https://github.com/adrienverge/yamllint]
brew "wader/tap/fq" # "jq for binary formats" [https://github.com/wader/fq]
# git
brew "act" # run github actions locally [https://github.com/nektos/act]
brew "bfg" # repo cleaner [https://rtyley.github.io/bfg-repo-cleaner/]
brew "gh" if Dir.exists?("~/Documents/code") # github cli [https://github.com/cli/cli]
brew "git" # distributed revision control [https://git-scm.com]
brew "git-cal" # git contribs calendar for terminal [https://github.com/k4rthik/git-cal]
brew "git-extras" # git utilities [https://github.com/tj/git-extras]
brew "git-flow" # git-flow branching [https://github.com/nvie/gitflow]
brew "git-lfs" # git-lfs [https://git-lfs.github.com/]
# golang
brew "go" # https://go.dev/
brew "golangci-lint" # https://golangci-lint.run/
brew "staticcheck" # https://staticcheck.io/
brew "tinygo" # https://tinygo.org/
brew "upx" if !Hardware::CPU.arm? # only bottled for x86_64
# java
brew "groovy" # [https://www.groovy-lang.org/]
brew "gradle" # [https://www.gradle.org/]
brew "openjdk"
# python (should always be installed)
if OS.mac?
brew "micropython" # python for microcontrollers [https://www.micropython.org/]
brew "pyenv", link: false # simple python version mgmt [https://github.com/pyenv/pyenv]
brew "pipenv", link: false # create virtenvs for projects [https://docs.pipenv.org/]
brew "pyenv-virtualenv", link: false
brew "python", link: false
end
# rpm build tools
brew "create-dmg" # build fancy DMGs [https://github.com/create-dmg/create-dmg]
if !Hardware::CPU.arm?
brew "rpm", link: :overwrite # 4.19+ now only bottled for x86_64 (>4.18.1 ventura required)
brew "rpm2cpio", link: :overwrite
end
# rust
brew "rust" # [https://www.rust-lang.org/]
brew "rustup-init" # [https://rust-lang.github.io/rustup/]
### linux utilities (https://bit.ly/2KLMXDp)
# archive utls
brew "cabextract" # extract files from ms cabinet files [https://www.cabextract.org.uk/]
brew "p7zip" # posix port of 7-zip [https://p7zip.sourceforge.net/]
brew "unar" # the unarchiver [https://theunarchiver.com/command-line]
brew "xz" # lossless compression, improved LZMA [https://tukaani.org/xz/]
# editors
brew "neovim" if OS.mac? # extensible vim-fork [https://neovim.io/]
brew "rmate", link: :overwrite # HOWTO: https://github.com/textmate/rmate
brew "vim" if OS.linux?
# file/filesystem
brew "bat" # cat with syntax highlighting [https://github.com/sharkdp/bat]
brew "cloc" # count lines of code [https://github.com/AlDanial/cloc/]
brew "diskus" # fast alt to 'du -sh' [https://github.com/sharkdp/diskus]
brew "duf" # a better df [https://github.com/muesli/duf]
brew "dua-cli" # view disk space tui (in rust) [https://github.com/Byron/dua-cli]
#brew "exa" # modern ls [https://github.com/ogham/exa/issues/1243] UNMAINTAINED UPSTREAM!
brew "eza" # modern ls (https://eza.rocks/) [https://github.com/eza-community/eza]
brew "fd" # find clone [https://github.com/sharkdp/fd]
brew "gdu" # view disk space tui (in go) [https://github.com/dundee/gdu]
brew "ripgrep" # blazing fast grep (https://github.com/BurntSushi/ripgrep)
brew "scc" # fast code counter [https://github.com/boyter/scc]
brew "tree"
# hardware
brew "lsusb"
brew "smartmontools"
# misc
brew "coreutils" # chown/chmod, du, cut, uniq, shred, etc.
brew "dos2unix"
brew "moreutils" # sponge, pee, parallel, etc.
brew "pv" # pipe viewer, monitor data through pipe [http://www.ivarch.com/programs/pv.shtml]
brew "tldr" # user-friendly man [https://tldr.sh/]
brew "viddy" # a modern watch replacement [https://github.com/sachaos/viddy]
brew "watch"
# multiplexers
brew "tmux" # https://github.com/tmux/tmux/wiki/Getting-Started (https://tmuxcheatsheet.com/)
# processes/resource mgmt
#brew "bpytop" # resource monitor [https://github.com/aristocratos/bpytop]
#brew "hacker1024/hacker1024/coretemp" # recommended for bpytop
brew "htop"
brew "pstree"
# shells
if OS.mac? && bv.split('.').first >= '4'
# only upgrade bash if it's been previously installed (stock version is ancient)
brew "bash"
brew "bash-completion"
if !sh.include? "bash"
# warn to chsh since running shell is not bash
puts("ATTN: Run chsh to change default shell!")
end
end
brew "fish" # shell for the 90s [https://github.com/fish-shell/fish-shell]
# shell lint
brew "shellcheck" # static analysis tool [https://github.com/koalaman/shellcheck]
brew "shfmt" # shell parser [https://github.com/mvdan/sh]
# shell recorders/share/snippets
brew "asciinema" # record shell [https://asciinema.org/]
brew "knqyf263/pet/pet" # cli snippet manager [https://github.com/knqyf263/pet]
brew "ttyd" # ttyd over web (required by vhs) [https://github.com/tsl0922/ttyd]
brew "vhs" # cli home video recorder [https://github.com/charmbracelet/vhs/]
### multimedia tools
brew "spotify-tui" # https://github.com/Rigellute/spotify-tui#connecting-to-spotifys-api
brew "ffmpeg" # record/edit video [https://ffmpeg.org/]
brew "jhead" # extract EXIF data [https://github.com/Matthias-Wandel/jhead]
brew "exiftool" # read/write EXIF data [https://exiftool.org]
brew "ghostscript" # required for imagemagick
brew "imagemagick"#, args: ["with-webp"]
### network services
if OS.linux?
brew "coredns", restart_service: true
brew "sdns", restart_service: true
end
### security tools
#brew "afl-fuzz" # DEPRECATED 9/17/22
brew "aircrack-ng" # next-gen auth cracker [https://aircrack-ng.org/]
brew "certbot" if OS.linux? # formerly letsencrypt [https://certbot.eff.org/]
brew "ffuf" # fast web fuzzer (in Go) [https://github.com/ffuf/ffuf]
brew "fzf" # cli fuzzy finder (in Go) [https://github.com/junegunn/fzf]
brew "gnupg"
brew "grype" # container vuln scanner [https://github.com/anchore/grype]
brew "hydra" # net logon cracker [https://github.com/vanhauser-thc/thc-hydra]
brew "john" # password cracker [https://www.openwall.com/john/]
brew "nmap" # port scanner [https://nmap.org/]
brew "rustscan" # a modern port scanner [https://github.com/RustScan/RustScan]
brew "socat" # bidirectional byte streams [http://www.dest-unreach.org/socat/]
brew "sslscan" # sslscan test suite [https://github.com/rbsec/sslscan]
brew "trivy" # kubernetes vuln/misconfiguration scanner [https://github.com/aquasecurity/trivy]
### stats
brew "archey4" # system info [https://github.com/HorlogeSkynet/archey4]
brew "gtop" # system monitor [https://github.com/aksakalli/gtop]
brew "hyperfine" # cli benchmarking tool [https://github.com/sharkdp/hyperfine]
brew "node_exporter", restart_service: true
### virtualization tools
if OS.mac?
brew "colima" # container runtimes [https://github.com/abiosoft/colima
brew "docker" # required by colima [https://www.docker.com/]
brew "lima" # linux virtual machines [https://github.com/lima-vm/lima] (https://lima-vm.io/docs/templates/)
end
brew "packer" # image builds [https://www.packer.io/]
brew "terraform" # automate infrastructure [https://www.terraform.io/]
brew "xhyve" if OS.mac? && !Hardware::CPU.arm?
###############################################################################
# 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/
# https://github.com/Homebrew/homebrew-cask/tree/master/Casks
#
# Pinning: https://apple.stackexchange.com/a/436413
#
###############################################################################
if OS.mac?
# specify a directory to install
cask_args appdir: "/Applications"#, require_sha: true
# BASE INSTALL
cask "balenaetcher"
cask "coconutbattery"
cask "daisydisk"
cask "expressions"
cask "firefox"#, greedy: true
cask "fork"
cask "garmin-express"
cask "google-chrome"
cask "goland"
cask "handbrake"
cask "intellij-idea"
cask "jetbrains-toolbox"
cask "little-snitch"
cask "malwarebytes" # subscription exp-2/25
cask "micro-snitch"
cask "microsoft-auto-update"
cask "microsoft-excel"
cask "microsoft-powerpoint"
cask "microsoft-remote-desktop"
cask "microsoft-word"
cask "mitmproxy", link: :overwrite
cask "obsidian"
cask "postman"
cask "protonvpn"
cask "smartgit"
cask "sqlpro-studio"
cask "spotify"
cask "textmate"
cask "the-unarchiver"
cask "thonny" # python ide for beginners [https://thonny.org/]
cask "transmit"
cask "versions"
if !Hardware::CPU.arm? # intel only as of 2/1/23
cask "virtualbox"
cask "virtualbox-extension-pack"
end
cask "visual-studio-code"
cask "vlc"
cask "vmware-fusion"
cask "vnc-viewer"
cask "warp"
cask "zoom"
# MY SPECIFIC VERSION CASK INSTALLS
# Supposedly pinning isn't recommended since it causes issue with auto-update
# (https://github.com/Homebrew/homebrew-cask/issues/49127). So these tasks will
# install a "locked" version via the older ruby formulae. If the date check
# evalutes to less than now, the Brewfile will abort with a message of which cask
# to update with it's "last" formula file. This way I can lock the casks to
# the versions for which I have licenses
# https://binarynights.com/
forklift_date = Date.new(2024,9,21)
if forklift_date < now
# TODO: update forklift version on 9/21/24 to latest (e.g. 4.1)
abort("ERROR: Your forklift cask commit hash must be updated!")
cask "https://raw.githubusercontent.com/Homebrew/homebrew-cask/COMMIT-HASH/Casks/f/forklift.rb"
else
cask "forklift"
end
# https://kaleidoscope.app/support
kaleidoscope_date = Date.new(2023,5,30)
if kaleidoscope_date < now
# install kaleidoscope@3.9,2176" since v4 moved to a subscription model
cask "https://raw.githubusercontent.com/Homebrew/homebrew-cask/37fbc0aa85273355e74fc52eb16606403c821aa9/Casks/kaleidoscope.rb"
else
cask "kaleidoscope"
end
# https://tableplus.com/
tableplus_date = Date.new(2024,2,15)
if tableplus_date < now
# TODO: update tableplus version on 2/15/24 to latest (5.9.0,538 on 2/24/24)
cask "https://raw.githubusercontent.com/Homebrew/homebrew-cask/13e91bd80e07f3d16a0a26f83af8b90d823e37aa/Casks/t/tableplus.rb"
else
cask "tableplus"
end
# MAIN FONTS (https://fonts.google.com/)
cask "font-anonymous-pro" # https://www.marksimonson.com/fonts/view/anonymous-pro
cask "font-bebas-neue" # https://fonts.adobe.com/fonts/bebas-neue
cask "font-courier-prime" # https://quoteunquoteapps.com/courierprime/
cask "font-fira-code" # https://github.com/tonsky/FiraCode
cask "font-ia-writer-duo" # https://github.com/iaolo/iA-Fonts/
cask "font-ia-writer-duospace" # https://ia.net/topics/in-search-of-the-perfect-writing-font
cask "font-ia-writer-mono" # https://github.com/iaolo/iA-Fonts/
cask "font-ia-writer-quattro" # https://ia.net/topics/a-typographic-christmas
cask "font-inconsolata" # https://levien.com/type/myfonts/inconsolata.html
cask "font-input" # https://input.djr.com/
cask "font-intel-one-mono" # https://github.com/intel/intel-one-mono/
cask "font-jetbrains-mono" # https://www.jetbrains.com/lp/mono/
cask "font-iosevka" # https://typeof.net/Iosevka/customizer
cask "font-liberation" # https://github.com/liberationfonts/liberation-fonts
cask "font-red-hat-mono" # https://github.com/RedHatOfficial/RedHatFont
cask "font-ubuntu-mono" # https://design.ubuntu.com/font
cask "font-victor-mono" # https://github.com/rubjo/victor-mono
# NERD FONTS (https://www.nerdfonts.com/)
cask "font-dejavu-sans-mono-nerd-font"
cask "font-inconsolata-go-nerd-font"
cask "font-jetbrains-mono-nerd-font"
# OPTIONAL (install as needed)
#cask "1password"
#cask "1password-cli"
#cask "aldente"
#cask "appcleaner"
#cask "burn"
#cask "burp-suite"
#cask "caffeine"
#cask "datagrip"
#cask "displays"
#cask "expandrive"
#cask "fleet"
#cask "github"
#cask "ghidra"
#cask "gpg-suite"
#cask "imazing"
#cask "insomnia"
#cask "intellij-idea-ce"
#cask "jetbrains-gateway"
#cask "jetbrains-space"
#cask "keybase"
#cask "ksdiff"
#cask "lens"
#cask "logseq"
#cask "makemkv"
#cask "mattermost"
#cask "microsoft-office" if !Dir.exists?("/Applications/Microsoft Word.app")
#cask "microsoft-teams"
#cask "ngrok"
#cask "obs"
#cask "protonmail-import-export"
#cask "pycharm-ce"
#cask "raspberry-pi-imager"
#cask "rustrover"
#cask "signal"
#cask "slack"
#cask "steam"
#cask "strongsync"
#cask "terminus"
#cask "tower"
#cask "transmission"
#cask "typora"
#cask "vagrant"
#cask "vagrant-manager"
#cask "virtualbuddy" if !Hardware::CPU.arm?
#cask "viscosity"
#cask "wireshark"
#cask "writerside"
end
###############################################################################
# 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 mas@example.com
#
###############################################################################
if OS.mac? && File.exists?("/opt/homebrew/bin/mas")
mas "booktracker", id: 1496543317
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
#mas "testflight", id: 899247664
mas "wattsconnected", id: 1639692859
end
###############################################################################
# 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 ####################
# * Fix flog tap and install it's not installing. Currently it fails with the following message;
# - Error: flog: wrong number of arguments (given 1, expected 0)
# - tap "mingrammer/flog"
# - brew "flog" # fake log generator [https://github.com/mingrammer/flog]
# *
# *
# *
##############################################
#!/usr/bin/env bash
#
# Author : Chad Mayfield (chad@chadmayfield.com)
# 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