• Stars
    star
    1,455
  • Rank 32,325 (Top 0.7 %)
  • Language
    Shell
  • License
    GNU General Publi...
  • Created over 3 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OSX Optimizer: Optimize MacOS - Shell scripts to speed up your mac boot time, accelerate loading, and prevent unnecessary throttling.

OSX-Optimizer

OSX Optimizer: Optimize MacOS - Shell scripts to speed up your mac boot time, accelerate loading, and prevent unnecessary throttling.

macOS can be heavily modified using the defaults command. In fact, almost every option is accessible via defaults.

A great way to see what ticking and unticking a box in the Settings App is by using:

defaults read > defaults.pre.txt

# *make a change in Settings*

defaults read > defaults.post.txt

diff defaults.pre.txt defaults.post.txt

OSX Optimizations

Below you will find extremely good optimizers, particularly for virtual machines.

Some of the commands are dangerous from a remote access perspective, but they will greatly optimize your VM.

Skip the GUI login screen (at your own risk!)

defaults write com.apple.loginwindow autoLoginUser -bool true

User accounts and root/administrator have different defaults

Disable spotlight indexing on macOS to heavily speed up Virtual Instances.

# massively increase virtualized macOS by disabling spotlight.
sudo mdutil -i off -a

# since you can't use spotlight to find apps, you can renable with
# sudo mdutil -i on -a

Enable performance mode

Turn on performance mode to dedicate additional system resources for server applications.

Details: https://support.apple.com/en-us/HT202528

# check if enabled (should contain `serverperfmode=1`)
nvram boot-args

# turn on
sudo nvram boot-args="serverperfmode=1 $(nvram boot-args 2>/dev/null | cut -f 2-)"

# turn off
sudo nvram boot-args="$(nvram boot-args 2>/dev/null | sed -e $'s/boot-args\t//;s/serverperfmode=1//')"

Disable heavy login screen wallpaper

sudo defaults write /Library/Preferences/com.apple.loginwindow DesktopPicture ""

Reduce Motion & Transparency

defaults write com.apple.Accessibility DifferentiateWithoutColor -int 1
defaults write com.apple.Accessibility ReduceMotionEnabled -int 1
defaults write com.apple.universalaccess reduceMotion -int 1
defaults write com.apple.universalaccess reduceTransparency -int 1
defaults write com.apple.Accessibility ReduceMotionEnabled -int 1

Enable multi-sessions

sudo /usr/bin/defaults write .GlobalPreferences MultipleSessionsEnabled -bool TRUE

defaults write "Apple Global Domain" MultipleSessionsEnabled -bool true

Disable updates (at your own risk!)

This will prevent macOS from downloading huge updates, filling up your disk space.

Disabling updates heavily speeds up virtualized macOS because the qcow2 image does not grow out of proportion.

# as roots
sudo su
defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool false
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool false
defaults write com.apple.commerce AutoUpdate -bool false
defaults write com.apple.commerce AutoUpdateRestartRequired -bool false
defaults write com.apple.SoftwareUpdate ConfigDataInstall -int 0
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 0
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 0
defaults write com.apple.SoftwareUpdate AutomaticDownload -int 0

Enable osascript over SSH automatically without sshd-keygen warning and full disk access

defaults write com.apple.universalaccessAuthWarning /System/Applications/Utilities/Terminal.app -bool true
defaults write com.apple.universalaccessAuthWarning /usr/libexec -bool true
defaults write com.apple.universalaccessAuthWarning /usr/libexec/sshd-keygen-wrapper -bool true
defaults write com.apple.universalaccessAuthWarning com.apple.Messages -bool true
defaults write com.apple.universalaccessAuthWarning com.apple.Terminal -bool true

Disable screen locking

defaults write com.apple.loginwindow DisableScreenLock -bool true

Show a lighter username/password prompt instead of a list of all the users

defaults write /Library/Preferences/com.apple.loginwindow.plist SHOWFULLNAME -bool true
defaults write com.apple.loginwindow AllowList -string '*'

Disable saving the application state on shutdown

This speeds up boot as the session state (currently opened apps) are not running when you reboot.

This may be slower for you depending on what you are doing.

defaults write com.apple.loginwindow TALLogoutSavesState -bool false

Enable AnyDesk automatically

defaults write com.apple.universalaccessAuthWarning "/Applications/AnyDesk.app" -bool true
defaults write com.apple.universalaccessAuthWarning "/Applications/AnyDesk.app/Contents/MacOS/AnyDesk" -bool true
defaults write com.apple.universalaccessAuthWarning "3::/Applications" -bool true
defaults write com.apple.universalaccessAuthWarning "3::/Applications/AnyDesk.app" -bool true
defaults write com.apple.universalaccessAuthWarning "com.philandro.anydesk" -bool true

Enable remote access (at your own risk!)

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \
    -activate \
    -configure \
    -access \
    -off \
    -restart \
    -agent \
    -privs \
    -all \
    -allowAccessFor -allUsers

EXTREMELY INSECURE METHODS (at your own risk!)

These macOS optimizations should only be used in CI/CD, behind a VPN, and with no external connectivity.

This is not a warning, it is absolutely essential, or anyone can just SSH into the remote mac.

If you do any of the below commands on a remote server, you will

Disable passwords globally

  • Everyone is now root
  • No need to type passwords
  • SSH login just hit enter for password

As root:

sudo su
# nuke pam
for PAM_FILE in /etc/pam.d/*; do
    sed -i -e s/required/optional/g "${PAM_FILE}"
    sed -i -e s/sufficient/optional/g "${PAM_FILE}"
done

sudo killall Finder || true sudo killall Dock || true sudo killall mds

Make everyone a sudoer

cd /Users
# add everyone to sudoers and import the control center plist
for REAL_NAME in *; do
    echo "${REAL_NAME}"
    tee "/etc/sudoers.d/${REAL_NAME}" <<< "${REAL_NAME}     ALL=(ALL)       NOPASSWD: ALL"
    # sudo -u "${REAL_NAME}" defaults write -globalDomain NSUserKeyEquivalents  -dict-add "Save as PDF\\U2026" "@\$p";
    sudo -u "${REAL_NAME}" sudo mdutil -i off -a
    # sudo -u "${REAL_NAME}" defaults import com.apple.controlcenter /tmp/com.apple.controlcenter.plist
    # sudo -u "${REAL_NAME}" defaults write "/Users/${REAL_NAME}/Library/Preferences/.GlobalPreferences MultipleSessionEnabled" -bool 'YES'
    # sudo -u mdutil -i off -a
    # sudo dscl . -create "/Users/${REAL_NAME}" UserShell "${USERSHELL}"
    sudo -u "${REAL_NAME}" "whoami"
done
#############################3

Disable apps from going to sleep at all

This command will prevent applications from sleeping, completely in the background.

You can verify this using the top command and an App should never go into sleeping state.

This increases RAM usage, but means your apps, like Xcode, will spring into action.

sudo -u "${REAL_NAME}" sudo defaults write NSGlobalDomain NSAppSleepDisabled -bool YES

More Repositories

1

Docker-OSX

Run macOS VM in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X Security Research! Docker mac Containers.
Shell
31,005
star
2

osx-serial-generator

Mac Serial Generator - Generate complete sets of Serial Numbers for OSX-KVM, Docker-OSX and of course, OpenCore.
Shell
1,456
star
3

dock-droid

Docker Android - Run QEMU Android in a Docker! X11 Forwarding! CI/CD for Android!
Dockerfile
1,052
star
4

Docker-eyeOS

Run iPhone (xnu-arm64) in a Docker container! Supports KVM + iOS kernel debugging (GDB)! Run xnu-qemu-arm64 in Docker! Works on ANY device.
Shell
702
star
5

no-sandbox

No Sandbox - Applications That Run Chromium and Chrome Without The Sandbox. TL;DR exploits in these browser based applications are already sandboxed escaped: https://no-sandbox.io/
179
star
6

droid-native

Next Generation Android x86 Desktop - Anbox, Lineage, WayDroid, BlissOS, Dock-Droid
Shell
132
star
7

security

Collection of CVEs from Sick Codes, or collaborations on https://sick.codes security research & advisories.
Shell
70
star
8

Droid-NDK-Extractor

Android NDK Extractor - Extract ARM native bridge libndk translation libraries for use in any Android derivative.
Shell
46
star
9

adb-download-all

ADB Download All Files - A dirty shell script to adb pull all readable files using adb pull & base64
Shell
26
star
10

anbox-modules-dkms

anbox-modules-dkms for kernel - resurrected aur.archlinux.org/anbox-modules-dkms for ongoing maintaining. Next Generation Box Modules DKMS (ngbox). WayDroid, Anbox Halium, Droid Native, Dock Droid + BlissOS!
Shell
24
star
11

xdotool-gui

GUI for command-line X11 automation tool
Python
20
star
12

bulk-whois

Magical Bulk Whois (No CAPTCHA!) 🪄🪄🪄🪄🪄🚀🚀🚀🚀🚀
Shell
14
star
13

Docker-iOS

Run iPhone (iOS) in a Docker container! Supports KVM + kernel debugging! Run xnu-qemu-arm64 in Docker! Works on ANY device.
12
star
14

aur

Sick Codes AUR Packages
Shell
8
star
15

sickcodes

Sick Codes Projects - Security Researcher | Freelance Developer | Open Source
7
star
16

arduino-dark-theme

A very dark arduino theme for late night night board building
Shell
7
star
17

qnx-modules

QNX FileSystem Kernel Modules (qnx-modules-dkms)
C
6
star
18

autodiscover

PGP Signed Statement of Intent Regarding autodiscover.TLD
5
star
19

pgp

Sick Codes Public PGP Key
3
star
20

linux-binderash

Linux Binderash - Arch Linux Kernel Builds for ashmem & binder(fs) builds for the AUR.
Shell
1
star
21

linux-git

AUR linux-git: mainline bleeding edge Kernel Builds for Arch Linux https://aur.archlinux.org/pkgbase/linux-git
Shell
1
star