Skip to content

Instantly share code, notes, and snippets.

@theodric
Last active November 5, 2023 00:09
Show Gist options
  • Save theodric/7a1890c0bc06c6bf5419c12b52c1fd0e to your computer and use it in GitHub Desktop.
Save theodric/7a1890c0bc06c6bf5419c12b52c1fd0e to your computer and use it in GitHub Desktop.
New Mac setup
## I hope you've already turned off SIP in Recovery. If not, here's how:
# 1. Boot to recovery
# 2. Open Terminal
# 3. Type csrutil disable and press enter
# 4. Type reboot (or exit and reboot normally)
sudo spctl --master-disable
sudo defaults write /Library/Preferences/com.apple.security GKAutoRearm -bool NO
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true; killall Finder
#Install Homebrew
##Ruby installer deprecated#/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
#brew tap mistydemeo/formulae ##unfortunately all the mistydemeo stuff is currently broken 2021-12-27
##now in MacPorts#brew tap mvp/uhubctl https://github.com/mvp/uhubctl
brew tap ctdk/ctdk
brew tap jichu4n/palm-os
#git -C "$(brew --repo homebrew/core)" fetch --unshallow
#2020-11-28 python2 is no longer available
##2020-12-09 staticly-compiled (x86_64) ffmpeg since openjdk dependency presently breaks on homebrew aarch64 https://evermeet.cx/ffmpeg/
#Mikrotik WinBox wrapped
brew install --cask nrlquaker-winbox
##download and install MacPorts https://www.macports.org/install.php
open https://www.macports.org/install.php
##download and install fink
open https://github.com/fink/scripts/releases/latest
#basic needs
yes | port install bash coreutils-devel coreutils-uutils findutils-devel gnutar gsed gawk grep git htop tmux wget sudo
#brew install bash coreutils findutils gnu-tar gnu-sed gawk grep git htop tmux wget
#nice-to-have
############ Note that there is no generic python3 metapackage in MacPorts, so you need to check which one must be installed and specify it directly below
yes | port install python310 py310-pip gnutls gindent getopt binutils watch viddy nmap unar autoconf automake bsdmake openssh nano cowsay wakeonlan iperf3 binwalk clamav yt-dlp sshuttle mosh hackrf translate-shell
brew install iperf rsc_2fa btop
#sudo ln -s /opt/local/bin/gtelnet /opt/local/bin/telnet
##do you want cloudflared? Then install this
brew install cloudflare/cloudflare/cloudflared
##special stuff
fink install telnet
#brew install python3 gnutls gnu-indent gnu-getopt binutils telnet watch nmap unar autoconf automake bsdmake openssh nano cowsay wakeonlan iperf iperf3 binwalk rsc_2fa
#take it or leave it
yes | port install mutt xz p7zip lynx links automake ripgrep ripgrep-all uhubctl neofetch youtube-dl ffmpeg mpv mplayer
brew install adoptopenjdk aview fortune
#brew install aview xz p7zip lynx links automake ripgrep rga uhubctl neofetch java ncdu fortune
##2022-02-25 ncdu will not build/install from either brew or ports
fink install ncdu
##various FTP clients
yes | port install ncftp cmdftp cftp lftp
## Palm OS stuff
yes | port install pilrc pilot-link
brew install palm-os-sdk prc-tools
brew install ctdk/ctdk/bsdgames-osx
pip3 install pycp
#problematic on out-of-support macOS versions:
## clamav has problems with protobuf dependency - use MacPorts instead of Homebrew
##add these to ssh_config e.g. /opt/local/etc/ssh/ssh_config
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,[email protected]
# KexAlgorithms diffie-hellman-group1-sha1,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
# HostKeyAlgorithms ssh-dss,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
##srm formula seems to be broken as of 2022-02-21
#brew install khell/homebrew-srm/srm
open https://sourceforge.net/projects/srm/files/1.2.15/srm-1.2.15.tar.gz/download?use_mirror=netcologne
cd ~/Desktop; wget https://github.com/XQuartz/XQuartz/releases/download/XQuartz-2.8.1/XQuartz-2.8.1.dmg && open ~/Desktop/XQuartz-2.8.1.dmg
##if you don't use the next line, NFS will suck all kinds of ass, forever
sudo echo "nfs.client.mount.options = intr,locallocks,nfc,rsize=32768,wsize=32768" >> /etc/nfs.conf
echo 'include "/opt/local/share/nano/*.nanorc"' >> ~/.nanorc
sudo echo 'include "/opt/local/share/nano/*.nanorc"' >> /var/root/.nanorc ##this is to enable syntax highlighting with homebrew nano under 'sudo nano' invocation
##homebrew version#sudo echo 'include "/usr/local/share/nano/*.nanorc"' >> /var/root/.nanorc ##this is to enable syntax highlighting with homebrew nano under 'sudo nano' invocation
#brew install gopher pygopherd ##unfortunately all the mistydemeo stuff is currently broken 2021-12-27
#brew install mosaic-ck ##unfortunately all the mistydemeo stuff is currently broken 2021-12-27
#brew install --HEAD tesseract mistydemeo/formulae/badpng ##unfortunately all the mistydemeo stuff is currently broken 2021-12-27
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.spindump.plist
sudo mv /System/Library/LaunchDaemons/com.apple.spindump.plist /System/Library/LaunchDaemons/com.apple.spindump.plist.bak
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.tailspind.plist
sudo mv /System/Library/LaunchDaemons/com.apple.tailspind.plist /System/Library/LaunchDaemons/com.apple.tailspind.plist.bak
##set persistent route per Ethernet adapter
open https://apple.stackexchange.com/questions/307221/add-a-permanent-static-route-in-high-sierra
#git clone https://github.com/jaseg/lolcat && cd ./lolcat && make install
#menu bar color setter https://github.com/igorkulman/ChangeMenuBarColor.git
#alias menu1='ChangeMenuBarColor Gradient "#FF00FF" "#0000FF"'
#alias menu2='ChangeMenuBarColor Gradient "#0000FF" "#FF00FF"'
## TODO
# disable a bunch of shit (DANGER) https://gist.github.com/digitup/eeb52eb0118addb0d8c77a1606c4bada
# more shit https://www.linkedin.com/pulse/turning-os-x-1011-el-capitan-speed-deamon-patrick-mullins/
# maybe even more https://macperformanceguide.com/blog/2017/20170110_1000-macOS-bloatWare.html
# install XCode, XQuartz, XScreensaver, MacPorts, iTerm, https://member.ipmu.jp/yuji.tachikawa/MenuMetersElCapitan/, Chrome, Firefox, Backup and Sync, ownCloud, PopClip, BetterSnapTool, BeardedSpice, TotalFinder, Little Snitch, Bartender, QuickBoot, Mouse Acceleration Preference Pane, The Unarchiver, TextMate, MagicPrefs, PowerMate, SpacePilot Pro, Spotify, Smoothmouse (<10.12), switchDiskSizeBase
## 2020-11-27:
# More apps to install:
# Mac Media Key Forwarder (stop iTunes hijacking every media keypress) https://github.com/milgra/macmediakeyforwarder
# Mos (kinetic scroll for cheap mice) https://mos.caldis.me/
# clamavd - See https://gist.github.com/Uchean/4fdc875e557014c3a34e
### I found that I needed to do dscl . -list /Users UniqueID|grep 82 to find the username and then make it the owner of the directory like this
### sudo chown -Rv _clamav /usr/local/Cellar/clamav/0.103.0/share/clamav
# RightZoom (make the zoom button zoom again) https://formulae.brew.sh/cask/rightzoom
# Lunar (control displayport monitor backlight) (now partly paid) https://lunar.fyi/
# MonitorControl (control DisplayPort monitor backlight, even on aarch64 Macs, plus gamma workarounds; free) https://github.com/MonitorControl/MonitorControl/releases/
# f.lux (control monitor color temperature - NOTE: not compatible with gamma-tweaking apps like the above two - forced to use macOS Night Shit) https://justgetflux.com/
# WeatherBug (weather in menubar) https://apps.apple.com/us/app/weatherbug-weather-forecasts-and-alerts/id1059074180?mt=12
# PopClip (copypastepopup) https://apps.apple.com/us/app/popclip/id445189367?mt=12
# BetterSnapTool (window management keymappings) https://apps.apple.com/us/app/bettersnaptool/id417375580?mt=12
# SensibleSideButtons (make mouse buttons 4-5 be useful again https://sensible-side-buttons.archagon.net/ )
# TimeMachineEditor to change backup interval https://tclementdev.com/timemachineeditor/
# CPU history (CPU status meter in dock - partly working) https://github.com/theodric/cpu-history
# Memory Monitor (RAM consumption status in dock) - https://www.bernhard-baehr.de/memory_monitor_1.2.6.dmg
# in profile:
## fortune 5% bobross 15% zizek 15% jennyholzer 10% alexjones 20% pcok 30% minilinux 5% randomquotes | cowthink -f cowfart | lolcat -r -v 0.9 -h 0.4
# explode dircolors.tar into /etc/dircolors
# install /etc/hosts, /etc/profile, $HOME/.bashrc, $HOME/.ssh/*, fortunes, cowthink cowfart file
# install Dracula theme: git clone https://github.com/dracula/iterm.git
# install IRIX trash sounds and Pingu bell (incl. convert IRIX sounds from .aifc to .aiff)
# Noots and IRIX sounds to /System/Library/Sounds/
# Clone and run this repo, https://github.com/theodric/IRIX-noises-macOS
# or do it manually:
# /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/finder/empty\ trash.aif
# with 01.rm.aiff
# /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/dock/drag\ to\ trash.aif
# with 19.bong.aiff
# /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/dock/poof\ item\ off\ dock.aif
# with ss10.aiff
# /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/system/Volume\ Mount.aif
# with 13.high.chink.aiff
# install Fortune-OSX https://github.com/theodric/Fortune-OSX.git
#
# For Mac Pro 1,1/2,1, change /Library/Preferences/SystemConfiguration/com.apple.Boot.plist as follows to prevent random wake from sleep:
# <?xml version="1.0" encoding="UTF-8"?>
# <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
# <plist version="1.0">
# <dict>
# <key>Kernel Flags</key>
# <string>-v darkwake=0</string>
# </dict>
# </plist>
## get rid of all the stupid UI animations
# opening and closing windows and popovers
#defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
#defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn't work
#defaults write -g NSWindowResizeTime -float 0.001
# opening and closing Quick Look windows
#defaults write -g QLPanelAnimationDuration -float 0
# rubberband scrolling (doesn't affect web views)
#defaults write -g NSScrollViewRubberbanding -bool false
# resizing windows before and after showing the version browser
# also disabled by NSWindowResizeTime -float 0.001
#defaults write -g NSDocumentRevisionsWindowTransformAnimation -bool false
# showing a toolbar or menu bar in full screen
#defaults write -g NSToolbarFullScreenAnimationDuration -float 0
# scrolling column views
#defaults write -g NSBrowserColumnAnimationSpeedMultiplier -float 0
# showing the Dock
#defaults write com.apple.dock autohide-time-modifier -float 0
#defaults write com.apple.dock autohide-delay -float 0
# showing and hiding Mission Control, command+numbers
#defaults write com.apple.dock expose-animation-duration -float 0
# showing and hiding Launchpad
#defaults write com.apple.dock springboard-show-duration -float 0
#defaults write com.apple.dock springboard-hide-duration -float 0
###other stuff
#Disable scroll wheel zoom in Firefox
#This is probably an annoyance for all those that use keyboard CTRL commands (like, CTRL-C and CTRL-V) and accidentally keep hitting CTRL + mouse scroll wheel, which zooms in and out, or enlarges and decreases text size in your browser...
#
#Here's how to disable that in Firefox:
#
#In your address bar, type in
#about:config
#
#search for
#mousewheel.with_control.action
#
#Set value to: 0
##good firefox themes:
# https://addons.mozilla.org/en-US/firefox/addon/just-play-it-cool-boy/
##get old versions of macOS
# https://github.com/corpnewt/gibMacOS
##OpenCore setup
# https://dortania.github.io/OpenCore-Install-Guide/installer-guide/mac-install.html#downloading-macos-modern-os
##AutoRaise to enable a sort of focus-follows-mouse functionality in macOS
# https://github.com/sbmpost/AutoRaise
##See also
# https://github.com/kylef/chunkwm
# https://github.com/koekeishiya/yabai
# https://stackoverflow.com/questions/98310/focus-follows-mouse-plus-auto-raise-on-mac-os-x
#fine-grained access to higher resolutions:
# https://github.com/theodric/RDM
# (https://github.com/avibrazil/RDM)
# 1a. clone forked theodric repo, and use as-is, then
## OR
# 1b. clone parent repo, change Makefile to delete ARCH setting, then
# 2. make
# 3a. run RDM.app
## OR
# 3b. use SetResX
# 4a. SetResX --scale 1.0
# 4b. SetResX --width 2048 --height 1280
# now you are in high-res non-scaled mode without font-doubling
##ARM64 VM STUFF
##ACVM
#https://github.com/ubenmackin/ACVM/releases/
##vmcli
#https://github.com/gyf304/vmcli
#brew tap koekeishiya/formulae
#brew install yabai
#mkdir -p ~/.config/yabai/
#printf 'yabai -m config focus_follows_mouse autofocus' >> ~/.config/yabai/yabairc
#brew services start yabai
#
#install stylus in Firefox
#install qbittorrent theme https://github.com/iFelix18/Dark-qBittorrent-WebUI
# MonitorControl permits control of external monitor brightness on Apple Silicon macs-- apparently not by relying on gamma adjustments or hardware workarounds
# https://github.com/MonitorControl/MonitorControl
## colorfulSidebarX is a MacForge plugin that brings back sidebar color on macOS
## https://github.com/w0lfschild/colorfulSidebar
# 1. Download & install MacForge: https://www.macenhance.com/macforge (really needed?)
# 2. Clone repo
# 3. mkdir -p /Library/Application Support/MacEnhance/Plugins
# 4. chmod -R 7777 /Library/Application Support/MacEnhance/Plugins
# 5. Open project in Xcode
# 6. Setup signing profile
# 7. Build project
# 8. Copy build product on to desktop
# 9. Start MacForge
# 10. Drag-drop build product onto MacForge to install
# 11. Works on my machine, macOS 11.6.7 x86_64 2022-06-28
##Dynamic wallpapers
# https://dynamicwallpaper.club/gallery
# /System/Library/Desktop Pictures
# mkdir /Library/Desktop\ Pictures
# Put shit there
# tear apart HEIC files here https://strukturag.github.io/libheif/
# MacDown - markdown editor https://macdown.uranusjr.com/
# Boop - text transformation (spOngECASE geNeRaTOR) https://github.com/IvanMathy/Boop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment