MacOS - mwicat/personal GitHub Wiki

Window management hotkeys

brew install --cask rectangle

Hotkey automation

https://www.keyboardmaestro.com/main/

Create Linux bootable

https://ubuntu.com/tutorials/tutorial-create-a-usb-stick-on-macos#3-prepare-the-usb-stick

  • Launch Disk Utility from Applications>Utilities or Spotlight search
  • Insert your USB stick and observe the new device added to Disk Utility
  • Select the USB stick device (you may need to enable the option View>Show All Devices) and select Erase from the tool bar (or right-click menu)
  • Set the format to MS-DOS (FAT) and the scheme to GUID Partition Map
  • Check you’ve chosen the correct device and click Erase
  • Install etcher: https://www.balena.io/etcher/
  • You will need to restart or power-on the Mac with the USB stick inserted while the Option/alt (⌥) key is pressed.

Mount ext3

brew cask install osxfuse
brew install ext4fuse
diskutil list
sudo ext4fuse /dev/disk3s1 ~/tmp/MY_EXT_PARTITION -o allow_other

https://github.com/osxfuse/osxfuse/wiki/Mount-options#allow_other

Homebrew search

ICNS

brew install libicns
icns2png ../applet.icns -x
png2icns

Linux

apt-get install icnsutils

Get OSX version

sw_vers -productVersion

Application settings path

"$HOME/Library/Application Support"

Edit startup services

Open System Preferences.
Go to Users & Groups.
Choose your nickname on the left.
Choose Login items tab.
Check startup programs you want to remove.
Press the “–” sign below.
You're done.

List startup services

sudo launchctl list | grep -v apple | cut -d$'\t' -f3 | sort
ls -l /Library/LaunchAgents/ /Library/LaunchDaemons/

Load/unload service

cd /Library/LaunchDaemons
sudo launchctl unload com.focusrite.ControlServer.plist

Install homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew analytics off

.bashrc:

export HOMEBREW_NO_AUTO_UPDATE=1

Install python

brew install python@2

.bash_profile:

export PATH="/usr/local/opt/python@2/bin:$PATH"

Install XCode

xcode-select --install

Bootstrap

brew install ffmpeg gnu-sed parallel wine p7zip wget htop

Locate

sudo ln -s /usr/libexec/locate.updatedb /usr/local/bin/updatedb

Soundflower

brew install switchaudio-osx
SwitchAudioSource -t output -s 'Soundflower (2ch)'
SwitchAudioSource -t output -s 'Scarlett 2i4 USB'

Open terminal here

  1. System Preferences > Keyboard > Shortcuts > Services
  2. Enable New Terminal at Folder.

cluster ssh

brew install csshx

Disk usage

daisydisk.app

Apps

brew tap homebrew/cask
brew cask install meld

List installed packages

pkgutil --packages

Extract pkg

pkgutil --expand file.pkg out_dir

Instal pkg

sudo installer -pkg PSP_Nexcellence.pkg -target /

DHCP server

sudo vi /etc/bootpd.plist
<?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>bootp_enabled</key>
    <false/>
    <key>detect_other_dhcp_server</key>
    <integer>1</integer>
    <key>dhcp_enabled</key>
    <array>
        <string>en4</string>
    </array>
    <key>reply_threshold_seconds</key>
    <integer>0</integer>
    <key>Subnets</key>
    <array>
        <dict>
            <key>allocate</key>
            <true/>
            <key>lease_max</key>
            <integer>86400</integer>
            <key>lease_min</key>
            <integer>86400</integer>
            <key>name</key>
            <string>192.168.33</string>
            <key>net_address</key>
            <string>192.168.33.0</string>
            <key>net_mask</key>
            <string>255.255.255.0</string>
            <key>net_range</key>
            <array>
                <string>192.168.33.2</string>
                <string>192.168.33.254</string>
            </array>
        </dict>
    </array>
</dict>
</plist>
sudo /bin/launchctl load -w /System/Library/LaunchDaemons/bootps.plist

Network devices

list

networksetup -listallnetworkservices

assign static ip

networksetup -setmanual 'iPad USB' 192.168.33.1 255.255.255.0 192.168.33.1

Wine

brew tap homebrew/cask-versions
brew install --cask xquartz
brew install --cask --no-quarantine wine-devel

without brew

Java

Install Catalina

Install Mojave

Installer location:

  • /Applications/Install\ macOS\ Mojave.app/

Download link:

Installation instructions:

sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

Simply plug your created USB drive into an open USB port on your Mac. Power on the system, or restart it if it's already on. Immediately press and hold the Option (Alt) key on your keyboard when it starts booting. You should now see an option to select your USB drive as a startup disk.

Install macbook camera linux

https://gist.github.com/mwicat/870741e41a77eff83bf5e9bfa724f442

Generate dmg

npm install -g appdmg
appdmg spec.json dmgifle.dmg

Example: https://github.com/mwicat/BigRedRecorder/tree/master/installer/mac

⚠️ **GitHub.com Fallback** ⚠️