Tech > MacOSXTips

Mac OS X Tips

Installation Details

grep OSInstaller /private/var/log/install.log will give details of installation actions, including Time Machine restore operations.

less /System/Library/CoreServices/SystemVersion.plist will show the version of the installed operating system.

General

To have apps re-open their windows next time they're run (or more accurately, stop them being automatically closed on quitting)...

In macOS 10.12 Siera: System Preferences > General > Close windows when quitting an app and clear the checkbox.

https://stackoverflow.com/questions/18932534/xcode-5-how-to-enable-reopen-last-projects-windows

Time Machine

When Time Machine backups are being performed to a Synology Diskstation NAS, the backups are accessible as files under /Volumes/Time Machine Backups/Backups.backupdb/. Use sudo -i in a terminal to become root to view the files.

Disable Startup Sound/Chime

  1. Mute the sound before shutdown, and un-mute after startup or;

  2. Press and hold the mute key immediately after pressing the power button to start your iMac.

-- Frank Dean - 29 Jun 2017

View Hidden Files in Finder

$ defaults write com.apple.finder AppleShowAllFiles Yes

Relaunch Finder by holding the options key and right-clicking the Finder icon in the launch bar and selecting the Relaunch option.

Hide them again:

$ defaults write com.apple.finder AppleShowAllFiles No

Disable Help Window Always On Top

$ defaults write com.apple.helpviewer DevMode -bool true

Close and re-open any help windows

Enable always-on-top again:

$ defaults write com.apple.helpviewer DevMode -bool false

View Saved iMessage Chats

This note applies to macOS 10.12.5 (Sierra)

  1. Open ~/Library folder by clicking on the Go menu item in the Folder application. Hold down the options key to reveal the Library option and then select it.

  2. Navigate to ~/Library/Containers/com.apple.iChat/Data/Library/Messages/Archive

  3. Locate the recipient in one of the sub-folders named by date.

  4. Open the file with the ichat file extension by choosing the Open option from the context menu or by double-clicking it.

  5. The conversation will be loaded in a separate window in the Messages application and also in the Messages window.

  6. Optionally, close the separate conversation window.

Ref: https://apple.stackexchange.com/questions/173640/how-to-re-open-a-conversation

Git

Install by running the git command from a terminal. When given the option, install Xcode.

Emacs

A non-GUI version of Emacs is installed in recent versions of Mac OS X.

The most recent GUI version can be installed from MacPorts.

$ sudo port install emacs-app

https://www.emacswiki.org/emacs/EmacsForMacOS

Emacs add-ons

The following add-ons can be installed from MacPorts:

  • magit
  • markdown-mode.el

Pandoc

Pandoc can be installed form MacPorts:

$ sudo port install pandoc

If you also want to use Pandoc to create PDF documents, install TeX Live:

$ sudo port install texlive

Python

Where multiple versions of Python have been installed, a specific version can be specified with:

$ sudo port select --set python python27

QLandkarte GT

  • Install XQuartz
  • Install MacPorts
  • sudo port install gdal +poppler
  • sudo port install qlandkartegt

coreutils

Installing coreutils from MacPorts (see InstallingMacPorts) installs the coreutils binaries prefixed with a 'g'. E.g. use gshred for shred.

http://superuser.com/questions/617515/using-shred-from-the-command-line

Platypus

A developer tool to create native Mac OS X applications for interpreted scripts, e.g. Perl, Ruby and Python.

http://sveinbjorn.org/platypus

Installing OpenJDK

See MacOSXOpenJDK.

Installing Oracle JRE

The JRE (8u111) does not create symlinks or binaries for java on the path. Oracle recommend installing the full JDK to use the Java command line tools.

See When I try to use java from the command line, why doesn't it work?

Uninstalling Java Runtimes

See https://www.java.com/en/download/help/mac_uninstall_java.xml

  1. Remove the Java Applet Plugin folder:

    $ sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/
  2. Remove the symbolic link for the system preferences Java control panel

    $ sudo rm -f /Library/PreferencePanes/JavaControlPanel.prefPane
  3. For each user:

    $ rm -rf ~/Library/Application\ Support/Java/

    and/or

    $ rm -rf ~/Library/Application\ Support/Oracle/Java/

To uninstall JDKs, remove them from under /Library/Java/JavaVirtualMachines.

-- Frank Dean - 11 Jan 2017

Setting JAVA_HOME

See the man page for java_home which includes examples under the USAGE section at the end.

-- Frank Dean - 11 Jan 2017

Remote Debugging Javascript on iPad

See iOSTips.

Application Defaults

See man defaults

As an example, to see all the defaults for GnuCash (version 2.6.13):

$ defaults read org.gnucash.Gnucash

to remove entries, e.g. a most recently used (MRU) file from the history:

$ defaults delete org.gnucash.Gnucash "/org/gnucash/history/file4"

to see the updated interval (in seconds) for Google Update Agent:

$ defaults read com.google.Keystone.Agent checkInterval
18000

to change the update interval (in seconds) to every 24 hours (60 * 60 * 24):

$ defaults write com.google.Keystone.Agent checkInterval 86400

X11/XQuartz

Language

Add the following to .profile using one of the character encodings shown when running locale -a:

export LC_ALL=en_GB.UTF-8
export LANG=en_GB.UTF-8

Make sure .profile (and .bashrc) are read for a bash shell. Add the following to .bash_profile:

if [ -r ~/.bashrc ]; then . ~/.bashrc; fi
if [ -r ~/.profile ]; then . ~/.profile; fi

-- Frank Dean - 30 Mar 2017

Miscellaneous

  • macOS-Fortress - Kernel-level, OS-level, and client-level security for macOS

-- Frank Dean - 30 Jun 2016

Related Topics: AppleMaciBook, InstallingKitlistMacOSX, InstallingMacPorts, iOSTips, MacKeyboardTips, MacOSXOpenJDK, PostgreSQLMacOsX, VncTips