OS X: Fixes Hints Tweaks and Tips

https://discussions.apple.com/thread/8031806

NOTE: To any user planning to purchase an Apple Mac computer and who doesn't plan on installing Linux on it, just stop. Buy a Windows 7 system instead because even though it is crap it is still a whole lot better than the stinking pile of shit that is OS X.

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

https://brew.sh

Telnet
brew install telnet

FTP
https://discussions.apple.com/thread/8095304

L2TP / IPsec VPN
https://www.hideipvpn.com/setup/howto-mac-os-x-l2tp-ipsec-vpn-setup-tutorial/

A Scanner In Yosemite
You can add a scanner to the list of devices in Printers & Scanners preferences.

If you’ve already set up a printer that includes a scanner, you may be able to use its scanner features without any additional work. Select the printer in the list at the left, then click Scan.


 * Before setting up your scanner, choose Apple menu > App Store, then click Updates to make sure OS X has the latest information about scanner software it can download from Apple.
 * If you have a multifunction AirPrint printer and scanner, no software is installed, so you don’t need to check for software updates.
 * Follow the instructions that came with the scanner to unpack it and connect it to your Mac.
 * Important:  Don’t install software that came with the scanner. OS X downloads the latest scanner software automatically.
 * Choose Apple menu > System Preferences, then click Printers & Scanners.
 * If you don’t see your scanner in the list at the left, click Add . If a pop-up menu appears, choose Add Printer or Scanner.
 * Select your scanner, then click Add.
 * If your scanner isn’t in the list, see the documentation that came with the scanner to find out how to scan with it.

Fast User Switching
Turn on Fast User Switching in the Accounts System Preferences. It's in the Login Options. (click the padlock to unlock settings)

Enable SSH
http://osxdaily.com/2011/09/30/remote-login-ssh-server-mac-os-x/

Read/Write To Ntfs Formatted Drives
Install software from here.

NOTE: On install NTFS-Free Yosemite you are required to run the following in the terminal:

Terminal:~$ sudo nvram boot-args="kext-dev-mode=1" sudo kextcache -system-prelinked-kernel sudo kextcache -system-caches

After the first command you will need to enter your password because of 'sudo' (super user do) this disables the security check. The other 2 commands just clear your cache of any old versions of this kernel extension to give you a fresh slate. After you install/reinstall you'll restart and things seem to be working. It is suspected that this will be broken in the next update because this uses the /System/ folder which apple will be phasing out 3d party use of that folder.

CUPS Web Interface
Terminal:~$ cupsctl WebInterface=yes

To access the web interface in a browser's address bar type either of the following:

http://localhost:631 your.ip.address.here:631

FileVault - Drive Encryption

 * Main Apple menu | System Preferences | Security & Privacy | FileVault (Tab)
 * Click on the Padlock icon

https://support.apple.com/en-us/HT204837

LogMeIn Remote Sound Driver
Go to Macintosh HD/system/library/extensions and move the file "logmeinsounddriver64.kext" to your Desktop, then restart your computer.

https://discussions.apple.com/thread/5614486

Journaling On A HFS+ Drive Using Linux
Terminal:~$ sudo apt-get install hfsplus hfsprogs sudo fsck.hfsplus /dev/sdXY sudo mount -o force /dev/sdX /your/mount/point sudo mount -o remount,rw,force /mount/point

See here, here, here, here

http://sourceforge.net/projects/linux-hfsplus/

https://packages.debian.org/sid/hfsprogs

https://help.ubuntu.com/community/hfsplus

http://askubuntu.com/questions/491171/how-to-make-sure-hfs-drive-is-writeable

http://askubuntu.com/questions/508339/problems-with-a-hfs-hdd-on-ubuntu-server-14-04

https://wiki.debian.org/MacBook

http://unix.stackexchange.com/questions/151649/usb-hdd-not-working-on-linux

Dashboard
The Dashboard is activated by pressing F12, however it is always running in the background hogging resources, so to permanently disable it undertake the following.

Terminal:~$ defaults write com.apple.dashboard mcx-disabled -boolean YES killall dock

To revert the behaviour run again changing YES for NO, followed by 'killall dock'.

User Profiles From Appearing On The Log In Screen
NOTE: Applies to Yosemite (10.10 and newer).

Terminal:~$ sudo dscl. create /Users/hideuser IsHidden 1

To revert the change:

Terminal:~$ sudo dscl. create /Users/hideuser IsHidden 0


 * Where 'hideuser' is the name of the profile to be hidden.
 * Reboot the system after either change to enable it.

This also hides the user from the Fast User Switching menu and login and logout menus.

The account can still be accessed through SSH, screen sharing, remote login and GUI login panels.

Thanks to OS X Daily.

Unable to Install System Update
Terminal

sudo -s softwareupdate -i -a

Reboot

Blank Samba Folders Or Cannot Connect To File Share
Finder > Go To Folder > cifs://ip.address.of.server

NOTE: This will not work, but then close that window and try your other shortcuts or shares again, they should now work.

Black Screen Of Death (on start up)
https://discussions.apple.com/thread/7051661?start=0&tstart=0

Thumbnail Previews Not Working In Finder
Open a terminal:

Method One:

qlmanage -r cache # reset cache

Method Two:

qlmanage -r # delete and rebuild cache

System Shutting Down Part Way Though Boot Up Sequence
https://support.apple.com/en-us/HT201295

https://support.apple.com/en-us/HT204063

https://support.apple.com/en-us/HT201262

Slow/Dropping Wi-Fi (Sierra)
If you are using macOS Sierra (either out-of-the-box or after upgrading) and you are experiencing slow Wi-Fi speeds or dropping connection, deleting the Wi-Fi preferences may help. Finder use the Go to Folder command (Command + Shift + G):


 * /Library/Preferences/SystemConfiguration/

Delete (after backing them up) the following files:


 * com.apple.airport.preferences.plist
 * com.apple.network.identification.plist
 * com.apple.wifi.message-tracer.plist
 * NetworkInterfaces.plist
 * preferences.plist

Reboot the Mac and if possible the modem or router.

Thanks to OSX Daily, more tips available.

Thunderbolt Adapter For Network Not Working
Delete all network connections, reboot and then re-add them.

Blank Samba Folders Or Cannot Connect To File Share
Finder > Go To Folder > cifs://ip.address.of.server

NOTE: This will not work, but then close that window and try your other shortcuts or shares again, they should now work.

Change the name of your macOS user account and home folder
https://support.apple.com/en-us/HT201548

Sound Output
System Preferences > Sound > Output

Screen Shot Format
Where jpg is the format you want, or substitute with bmp gif etc as required:

Terminal:~$ defaults write com.apple.screencapture type jpg

Logging out and in is required to activate the change.

Primary Host Name
The fully qualified hostname will look something like this: mymac.domain.com

In the following is replaced by the new name for the machine:

Terminal:~$ sudo scutil --set HostName dscacheutil -flushcache

Finally restart the machine.

Bonjour Host Name
Where is replaced by the new name for the machine:

Terminal:~$ sudo scutil --set LocalHostName dscacheutil -flushcache

Finally restart the machine.

Computer Name
Where is replaced by the new name for the machine:

Terminal:~$ sudo scutil --set ComputerName dscacheutil -flushcache

Finally restart the machine.

Recover Your Apple ID
https://iforgot.apple.com

Startup Key Combinations
https://support.apple.com/en-us/HT201255

Run Apple Hardware Diagnostics

 * Shut down > Power Off
 * Power On + D key

Start In To Safe Mode/Boot

 * Shut down the computer, if you laptop does not have a removable battery do this by holding the power button for 10 seconds
 * Give things time to settle, twenty to thirty seconds should do fine
 * Start the computer then hold down the shift key once the start up tone has played
 * Release the Shift key when the grey Apple logo and progress indicator appear
 * At the point where the screen goes dark and the cursor appears type the first letter of the username for your computer, then hit Enter, then type your password, then hit Enter.
 * At this point you should see the spinning beach ball and be in safe mode
 * To check you are in Safe Mode, go to About This Mac > System Report > Software > Boot Mode = Safe

Check Hard Drive Health with Disk Utility

 * Disk Utility > First Aid > Run > Yes to Lock

http://osxdaily.com/2012/05/24/check-hard-drive-health-mac-disk-utility/

Check Hard Drive Health with Command Line
sudo -s diskutil verifyVolume /

http://osxdaily.com/2014/01/27/verify-disk-command-line-mac-os-x/

Repair Hard Drive Problems with Command Line
sudo -s diskutil repairvolume /

http://osxdaily.com/2014/01/27/verify-disk-command-line-mac-os-x/

Check System Console Messages for Errors

 * Utilities > Console > Press the Info button

Reset the System Management Controller SMC
https://support.apple.com/en-us/HT201295

Reset the NVRAM
https://www.macworld.com/article/2881177/macs/how-to-reset-your-macs-nvram-pram-and-smc.html

Install/Reinstall OS
https://support.apple.com/en-us/HT201314

Boot From USB / Optical Drive
Hold down the Option (or as it is otherwise know by the rest of the world the ALT) key, then turn on and keep holding until the Startup Manager appears. You may need to wait a minute or so before the Startup Manager recognises and shows a disc in the optical drive.

Thanks to Apple Support

Create A Shortcut To A Server
Sidebar Shortcut


 * Make sure you are connected to the file server.
 * Display the folder you want to create a shortcut for.
 * Drag the folder from the Finder window contents section to the window's Sidebar.
 * Sidebar icons can be placed in any order you wish. When dragging the icon to the sidebar a blue line will indicate where the icon will be placed when you release the mouse.
 * To reconnect, simply click once on the icon.
 * Note: If you haven't already authenticated/logged into your computer, you will be prompted for your log in name and password.

Dock Shortcut


 * Make sure you are connected to the file server.
 * Display the folder you want to create a shortcut for.
 * Drag the folder from the Finder window contents section to Dock.
 * When placing items in the Dock, they need to be placed:
 * To the RIGHT of the divider line that separates applications from the Trash and other document and folder icons, if the Dock is on the bottom of the screen;
 * UNDER the divider line that separates applications from the Trash and other document and folder icons, if the Dock is on the left or right side of the screen;
 * When dragging the icon to the Dock a space will "open up" for the icon to indicate where the icon will be placed when you release the mouse.
 * To reconnect, simply click once on the icon.
 * Note: If you haven't already authenticated/logged into your computer, you will be prompted for your log in name and password.

Desktop Shortcut


 * Make sure you are connected to the file server.
 * Display the folder you want to create a shortcut for.
 * Drag the folder icon to your Desktop.
 * To reconnect, double click on the icon.
 * Note: If you haven't already authenticated/logged into your computer, you will be prompted for your log in name and password.

Become Root
sudo su

Find Application Files
mdfind -name [application name]

Network Interface IP Address
ifconfig | grep inet

Ping With Timestamp
ping host | perl -nle 'print scalar(localtime), " ", $_'

Thanks - https://stackoverflow.com/questions/10679807/how-do-i-timestamp-every-ping-result

Use Wireless Diagnostics (Sierra ?)

 * Choose Apple menu > System Preferences, then click Network.
 * Click “Assist Me,” click Diagnostics, then follow the on-screen instructions.

Or, if you are connected to the wireless network you are having issues with:


 * Quit all open programmes
 * Hold down the Option key, click the Wi-Fi status icon in the menu bar, then choose Open Wireless Diagnostics.
 * Enter your user name and password, click OK, then click Continue.
 * Follow the on-screen instructions to analyse the network connection.

Take A Screen Shot

 * Entire screen - CMD+Shift+3
 * Portion of screen - CMD+Shift+4 the cursor changes to cross hair click and drag over required area
 * Open window - CMD+Shift+4 then press space bar, move the mouse over the desired window and click once
 * Save to clipboard - CMD+CTRL+Shift+3 for the entire screen or CMD+CTRL+Shift+4 for an open window, once done you can then paste the image as require
 * Applications - Utilities - Grab a tool to do the job

Screen shot files (not sent to the clipboard) are saved to the desktop.

Thanks to Wikihow.com

Lock Screen By Keyboad Shortcut
Command+Option/Alt+Eject

Open An Un-cooperative File
For example if OS X is refusing to open what you know is a text file, open Finder and locate the file, open the program that will handle the text file. Then while hold down the 'Option (ALT)' and 'Cmd' key drag the file from Finder on to the program.

Burn An ISO File

 * 1) Insert a blank disc.
 * 2) Start Disk Utility (/Applications/Utilities/).
 * 3) File menu, choose 'Open Disk Image' then browse and select the ISO to be burned.
 * 4) In the volumes listing there will be an item representing the ISO file, select it.
 * 5) Click the 'Burn' button and follow the instructions.

Start In To Safe Mode/Boot

 * Shut down the computer, if you laptop does not have a removable battery do this by holding the power button for 10 seconds
 * Give things time to settle, twenty to thirty seconds should do fine
 * Start the computer then hold down the shift key once the start up tone has played
 * Release the Shift key when the grey Apple logo and progress indicator appear
 * At the point where the screen goes dark and the cursor appears type the first letter of the username for your computer, then hit Enter, then type your password, then hit Enter.
 * At this point you should see the spinning beach ball and be in safe mode
 * To check you are in Safe Mode, go to About This Mac > System Report > Software > Boot Mode = Safe

Install/Reinstall OS
https://support.apple.com/en-us/HT201314

Remove Or Change CoreStorage Partition
http://awesometoast.com/yosemite-core-storage-and-partition-woes/

Boot From USB / Optical Drive
Hold down the Option (or as it is otherwise know by the rest of the world the ALT) key, then turn on and keep holding until the Startup Manager appears. You may need to wait a minute or so before the Startup Manager recognises and shows a disc in the optical drive.

https://support.apple.com/en-gb/HT201663

https://support.apple.com/en-gb/HT202796

Create A Shortcut To A Server
Sidebar Shortcut


 * Make sure you are connected to the file server.
 * Display the folder you want to create a shortcut for.
 * Drag the folder from the Finder window contents section to the window's Sidebar.
 * Sidebar icons can be placed in any order you wish. When dragging the icon to the sidebar a blue line will indicate where the icon will be placed when you release the mouse.
 * To reconnect, simply click once on the icon.
 * Note: If you haven't already authenticated/logged into your computer, you will be prompted for your log in name and password.

Dock Shortcut


 * Make sure you are connected to the file server.
 * Display the folder you want to create a shortcut for.
 * Drag the folder from the Finder window contents section to Dock.
 * When placing items in the Dock, they need to be placed:
 * To the RIGHT of the divider line that separates applications from the Trash and other document and folder icons, if the Dock is on the bottom of the screen;
 * UNDER the divider line that separates applications from the Trash and other document and folder icons, if the Dock is on the left or right side of the screen;
 * When dragging the icon to the Dock a space will "open up" for the icon to indicate where the icon will be placed when you release the mouse.
 * To reconnect, simply click once on the icon.
 * Note: If you haven't already authenticated/logged into your computer, you will be prompted for your log in name and password.

Desktop Shortcut


 * Make sure you are connected to the file server.
 * Display the folder you want to create a shortcut for.
 * Drag the folder icon to your Desktop.
 * To reconnect, double click on the icon.
 * Note: If you haven't already authenticated/logged into your computer, you will be prompted for your log in name and password.

Make Hidden Items Icons Translucent
Terminal:~$ defaults write com.apple.Dock showhidden -bool YES

To revert the behaviour run again changing YES to NO

Prevent A User's Directory From Being Visible In Finder
NOTE: Applies to Yosemite (10.10 and newer).

Running the following command moves the home directory to /var, a hidden directory:

Terminal:~$ sudo mv /Users/hiddenuser /var/hideuser

The following command updates the user record of "hiddenuser" with the new home directory path in /var:

Terminal:~$ sudo dscl. -create /Users/hideuser NFSHomeDirectory /var/hiddenuser

The following command removes the Public Folder share point for the user with the long name "Hide User”:

Terminal:~$ sudo dscl. -delete "/SharePoints/Hide User Public Folder"


 * Where 'hideuser' is the name of the profile to be hidden.
 * Reboot the system after either change to enable it.

Browse Outside Of Your Own User Profile

 * Open Finder
 * Use the keyboard combination 'Shift+CMD+G' to open the 'Go to the folder:' window
 * Typing / in the box provided will take you to the root of the drive

Display Hidden Files
'''Method One  Terminal:~$''' defaults write com.apple.finder AppleShowAllFiles -bool YES

To revert the behaviour run again changing YES to NO

Method 2

http://ianlunn.co.uk/articles/quickly-showhide-hidden-files-mac-os-x-mavericks/

Display The File Path
Terminal:~$ defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

To revert the behaviour run again changing YES to NO

Search Foo
http://richardleggett.co.uk/blog/2008/12/07/improve_osx_searches/

http://www.mcelhearn.com/spotlights-secret-search-syntax/

http://www.macosxtips.co.uk/index_files/12-tips-for-finder-in-Mac-OS-X-Lion.php

HOWTO: Keyboard Shortcuts:

 * Delete = CMD+backspace
 * Spotlight = CMD+Spacebar
 * Hash key = Alt+3

Show Kernel Routing Table
sudo netstat -nr

Install Package
sudo installer -pkg Whatever.pkg -target /

CLI Aliases
Unlike Linux OS X does not provide a user with their own aliases file, so you will need first to create one.

Terminal:~$ nano .bash_profile

This will open a blank file, create your alias:

alias ll='ls -lah' alias la='ls -A' alias l='ls -CF' alias ping='ping -c3' alias pingg='ping -c3 www.google.co.uk' alias update='sudo softwareupdate -i -a' alias hg='history |grep'

CTRL+O to write to the file, press enter then CTRL+X to exit.

To load the new alias profile:

Terminal:~$ source ~/.bash_profile

To confirm the entries:

Terminal:~$ alias

This will then display all the aliases entered in the bash_profile file.

Dates
Terminal:~$ plus 3 weeks: date -v +3w minus 3 weeks: date -v -3w plus 3 weeks and 2 days: date -v +3w -v +2d

Location

 * Open Finder
 * Open Utilities folder, Terminal is inside.

Or

Spotlight >> Terminal

List All
Terminal:~$ ps -ax

This will list all the running processes, potentially two to three hundred of them.

Find Specific Process
Terminal:~$ ps -ax | grep ps -ax | grep Lightroom The returned result will show the process ID number (the first set of numbers after the original command) as well as the folder from which the programme was launched.

ps -ax | grep Lightroom 14530 ?? 0:42.18 /Applications/Lightroom.app/Contents/MacOS/Lightroom -psn_0_8108250 14947 ttys000 0:00.00 grep Lightroom

Stop A Process
Terminal:~$ kill 14530 or kill Lightroom

Thanks to Chris Writes.

System Updates
Find Updates

sudo softwareupdate --list

Install Specific Update

sudo softwareupdate -v -i iTunesXPatch-12.3.1

Download Not Install Specific Update

sudo softwareupdate -d iTunesXPatch-12.3.1

Cancel Update

sudo softwareupdate -e

Ignore Specific Software

sudo softwareupdate --ignore JavaForOSX

Update All Software

sudo softwareupdate -i -a -v

Turn on or off automatic background check

sudo softwareupdate --schedule on sudo softwareupdate --schedule off

Help

sudo softwareupdate -h

Thanks - http://www.cyberciti.biz/faq/apple-mac-os-x-update-softwareupdate-bash-shell-command/

Using
As with many other *nix systems in the terminal 'sudo' is used to do things as root.

Brother Inkjet Printer Duplex Mode
In your chosen application:


 * File | Print | Copies & Pages | Select the 'Layout' option
 * Under 'Two-Sided' select either 'Long-Edge binding' or 'Short-Edge binding' depending on the orientation of you paper

Follow the settings from there.

NOTE: The settings will not be retained between print jobs. There may be a way around this but I don't have a Mac to experiment on.

Email Mail Settings Lookup
https://www.apple.com/uk/support/mail-settings-lookup/

Software Compatibility Lookup
https://roaringapps.com/apps

Determining battery cycle count for Mac notebooks
https://support.apple.com/en-gb/HT201300

How to identify MacBook Pro models
https://support.apple.com/en-gb/HT201300

MacBook Pro: How to remove or install the battery
https://support.apple.com/en-us/HT3053

How to set up your Apple wireless mouse, keyboard, and trackpad
https://support.apple.com/en-us/HT201178

MacBook Pro Support
https://www.apple.com/support/macbookpro/

MacBook Pro (Early 2008 and Late 2008) - Technical Specifications
https://support.apple.com/kb/SP4?viewlocale=en_US&locale=en_US

Package Updates
Not all of the installed applications in OS X can be updated via the command line or by downloading the update manually.

The App Store for OS X 10.6.6 onwards was introduced in January 2011 and can be used to update packages such as iPhoto, iMovie etc.

Domain Environment
NoMAD AD for macOS


 * https://www.techrepublic.com/blog/apple-in-the-enterprise/integrate-macs-into-a-windows-active-directory-domain/
 * https://wiki.bath.ac.uk/display/bucsapple/Binding+an+OS+X+10.4+%28Tiger%29+to+Active+Directory
 * http://www.macworld.co.uk/how-to/mac-software/use-your-mac-on-windows-based-network-3594407/
 * http://www.ictknowledgebase.org.uk/fileadmin/ICT/pdf/Mac/Working_Together_Your_Apple_Mac_and_Microsoft_Windows.pdf
 * http://www.techworld.com/operating-systems/22-top-tools-for-professional-apple-mac-admins-3298690/
 * http://www.theregister.co.uk/2012/11/05/apple_in_enterprise/
 * http://www.markwilson.co.uk/blog/2008/02/using-active-directory-to-authenticate-users-on-a-mac-os-x-computer.htm

Links

 * http://lifehacker.com/the-best-hidden-settings-you-can-unlock-with-os-xs-ter-1476627111
 * http://lifehacker.com/5993772/tweak-the-dark-corners-of-your-operating-system-this-weekend
 * http://www.dummies.com/how-to/content/handy-keyboard-shortcuts-for-os-x-yosemite.html
 * http://guides.macrumors.com/Taking_Screenshots_in_Mac_OS_X
 * https://support.apple.com/en-gb/HT201361
 * http://superuser.com/questions/174297/how-can-i-get-an-address-bar-in-finder
 * https://support.apple.com/kb/PH18798?locale=en_GB
 * http://www.econtechnologies.com/chronosync/overview.html
 * https://discussions.apple.com/thread/6682199
 * www.postbox-inc.com
 * http://osxdaily.com/2014/10/24/speed-up-os-x-yosemite-mac/
 * http://machmachines.com/mac-slow-yosemite-update-fix/