How to install Homebrew on macOS

Homebrew is, in my opinion, an essential package manager for macOS. It greatly simplifies the process of installing and maintaining many different pieces of software. According to Homebrew’s website it “installs the stuff you need that Apple didn’t”.

To begin with, if you don’t already have them, install the Xcode Command Line Tools. Homebrew relies on Xcode Command Line Tools, which include compilers and other essential tools required for Homebrew to work. To install Xcode Command Line Tools, open Terminal in /Applications/Utilities/ and run the following command:

xcode-select --install

Click install and then agree to the license agreement.

Then to install Homebrew itself, run:

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

and let it install. After the installation is complete, you can run simply:

brew

to verify that it has been installed correctly.

How do you use Homebrew?

Some commands you can run are:

brew search

This searches for packages available for installation.

brew install

This installs a package.

brew upgrade

This upgrades a package.

brew update

This updates Homebrew itself.

brew uninstall

This uninstalls a package.

brew list

This lists installed packages.

How to fix the “Back Up Now” button greyed out issue in iTunes on macOS 10.13 High Sierra

Sometimes, for some reason, certain Mac applications will change a setting, turning off the ability to make a backup of your iPhone in iTunes. If your “Back Up Now” button is greyed out, this might be what has happened to you.

To see if this is the case, open Terminal in /Applications/Utilities/ and run:

defaults read com.apple.iTunes DeviceBackupsDisabled

If the response is 1 or TRUE, then this solution applies to you. To turn on the ablity to back up again, just run:

defaults write com.apple.iTunes DeviceBackupsDisabled 0

and the issue will be resolved.



How to fix the Time Machine backups not finishing problem on macOS High Sierra

There is a bug in macOS High Sierra (10.13) which prevents Time Machine backups from completing. If your backups aren’t finishing, then you might have this problem. To see if you do, open up Terminal in /Applications/Utilities/ and run this command

log show --style syslog --predicate 'senderImagePath contains[cd] "TimeMachine"' --info

If you see messages like this:

2018-01-26 13:31:35.269569+0100  localhost backupd[2082]: (TimeMachine) [com.apple.TimeMachine:TMLogError] Failed to unmount disk mounted at '/Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/Mac/2018-01-26-133135/MacintoshHD', error: {
    Action = Unmount;
    Target = "file:///Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/Mac/2018-01-24-164749/MacintoshHD";
}

2018-01-26 13:31:35.269970+0100  localhost backupd[2082]: (TimeMachine) [com.apple.TimeMachine:TMLogError] Failed to unmount snapshot: com.apple.TimeMachine.2018-01-24-164749 source: MacintoshHD
2018-01-26 13:31:36.322938+0100  localhost backupd[2082]: (TimeMachine) [com.apple.TimeMachine:TMLogInfo] Backup canceled.

Then it is likely that you have this problem.



To finish a backup, you have to temporarily disable Spotlight. To do this you must first disable SIP (System Integrity Protection). Restart your computer, and once it is booting hold +R to boot into recovery mode. Open the Terminal from “Utilities” in the menu bar and disable SIP through this command:

csrutil disable

Then reboot, and again open Terminal and run this command to disable Spotlight:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Complete

Barring other problems, you should be able to finish your backup after this. To enable Spotlight again, run this command:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

To enable SIP again, you can either reboot into recovery mode and run:

csrutil enable

or just reset your NVRAM. To reset your NVRAM hold +alt+P+R during boot.

How to run Mac applications in the background and hide them from the Dock

Go to the application in Finder, right-click it, and click “Show package contents”. Go inside the folder “Contents”, there you will find a file called info.plist, which is the file we are going to edit.

First make a backup in case you want to easily revert or if something goes wrong. If you have Xcode, open the file with Xcode, if not, open it with TextEdit. The reason I say TextEdit is because some plaintext editors cannot handle .plist files.



With Xcode

Hover the mouse over any key and click the plus to create a new key. Name it NSUIElement, and change the value to 1.

With TextEdit

Add:

<key>NSUIElement</key>
<string>1</string>

to the second last line, just before </dict> and </plist>

Save the file, and restart the application. It will now run in the background.

How to speed up Time Machine backups

Time Machine is a great tool for backing up your system, but sometimes it can be very slow, in fact by default Time Machine prevents itself from using to much of your processing power. You can turn this off by opening Terminal in /Applications/Utilities and running:

sudo sysctl debug.lowpri_throttle_enabled=0

This will prevent Time Machine from throttling itself. To turn on the throttling again, just run the same command with 1 instead of 0, like this:

sudo sysctl debug.lowpri_throttle_enabled=1

How to use custom thumbnails for Safari Top Sites (macOS 10.12 – 10.14)

First you have to disable thumbnail refreshment, to do that, open Terminal in /Applications/Utilities/ and run:

defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2

Then, go to ~/Library/Caches/com.apple.Safari/Webpage Previews.

If the user Library folder is hidden, you can access it by pressing Command + Shift + G (⌘⌃G) in Finder, pasting the path in the text field and clicking “Go”.

In that folder you will find jpeg files with 32 character names. Either edit those directly, or copy images to the folder and rename them to whatever the name the different websites’ thumbnails had.

Remember to keep a backup of the files, since they are stored in a cache folder which might be emptied by certain programs or upon installing a new system.