IT notes

Prevent Mac to Sleep

To stop sleep entirely: sudo pmset -a disablesleep 1 To revert, allow sleep again: sudo pmset -a disablesleep 0 To display global power settings: pmset -g

osascript

In macOS, to find a path of an application, for example Chromium: $ osascript -e 'POSIX path of (path to application "Chromium")'

jamf

softwareupdate -l to see if there are macOS updates available. softwareupdate -ia to install all updates. sudo jamf policy to run all outstanding policies and updates for the apps, sudo jamf recon to update the inventory on the server.

OBJC_DISABLE_INITIALIZE_FORK_SAFETY

In macOS High Sierra if getting this: objc[55492]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. objc[55492]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug. Define: export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES This will fix temporally fix the problem and allow program to continue executing, more about this issue here: http://sealiesoftware.

Linux Mac Address

To get the MAC address from an interface in linux: cat /sys/class/net/eth1/address

dsymutil golang

Go executables broken in macOS 10.12.X When compiling and executing this may happen: $ zsh: killed ./main Temporary fix: $ ln -s /usr/bin/true /usr/local/bin/dsymutil

ipv6 off

Turn off IPv6 on mac First list interfaces: $ networksetup -listallnetworkservices An asterisk (*) denotes that a network service is disabled. Thunderbolt Ethernet Wi-Fi Bluetooth PAN Thunderbolt Bridge Next: $ networksetup -setv6off "Thunderbolt Ethernet" For Wi-Fi: $ networksetup -setv6off Wi-Fi

brew macos

Homebrew installs the stuff you need that Apple didn’t. For example to update python and avoid many SSL warnings: brew install python To use an updated version of git on mac use: brew install git --whitout-completion To update vim: brew install vim --with-override-system-vi Updating zsh: # check the zsh info brew info zsh # install zsh brew install zsh # add shell path sudo vim /etc/shells # add the following line into the very end of the file(/etc/shells) /usr/local/bin/zsh # change default shell chsh -s /usr/local/bin/zsh Install some extra packages in oneline: