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 fix the macOS High Sierra root pass security bug with one Terminal command

A bug that lets anyone log in as the root user has been discovered in macOS High Sierra. To fix this, you have to change or set the root password, which you can do with an easy Terminal command. Open Terminal in /Applications/Utilities and run:

sudo passwd -u root

First type your admin password, to run the program as root. The Terminal will output Changing password for root. Type the password you want and press enter, then retype it and press enter again.

How to speed up Time Machine backups on macOS 10.12 Sierra

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

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.

How to enable the startup chime on newer Macs

The classic startup chime has been disabled on newer macs, Late 2016 and on, but it’s not gone and it’s possible to enable it again. Another new feature is automatic boot-up when the lid is opened, which can also be disabled.

To return to the old settings, you have to open Terminal in /Applications/Utilities/ and run two commands.

Here is the command for enabling the startup sound again:

nvram BootAudio=%01

And here is the command for disabling auto-boot:

nvram AutoBoot=%00

After running this, you will have returned to the old settings, however, it is not a permanent change. It is stored in the NVRAM which might be reset every once in a while. There is a solution if you want this to be permanent.

First, open Script Editor in /Applications/Utilities/ and paste this into the document:

do shell script "nvram BootAudio=%01" with administrator privileges
do shell script "nvram AutoBoot=%00" with administrator privileges

Save it as an application wherever you like. Then open System Preferences, search for “Login Items”, open the panel, click the plus under the list of startup applications, navigate to the application that you just created and select it.

Every time you login, the application will automatically launch, enable the startup sound and disable auto-boot, but it will prompt you for your password every time you login. If you want to fix this, you have to edit the /etc/sudoers file. Do not open the file directly, instead run sudo visudo in Terminal. Then add this to the end of the file:

username ALL= NOPASSWD: /usr/sbin/nvram BootAudio=%01
username ALL= NOPASSWD: /usr/sbin/nvram AutoBoot=%00

This will enable you to run these two commands without having to type in your password. Every time you login, the application will automatically launch, enable the startup sound and disable auto-boot.

How to show hidden files on macOS 10.12 Sierra

There are thousands of hidden files on your mac, usually they are hidden because they shouldn’t be meddled with, but there are many cases where you want access those files, especially as a programmer. You might want to edit a .htaccess file or access your user library folder that has been hidden in macOS since OS X 10.7 Lion.

To show all hidden files, open Terminal in /Applications/Utilities/ and run:

defaults write com.apple.finder AppleShowAllFiles 1

and then restart Finder by running:

killall Finder

To hide all hidden files, you run the same command, except change the 1 to a 0, like this:

defaults write com.apple.finder AppleShowAllFiles 0

Here’s a useful function I made, it will check if hidden files are hidden/unhidden, and will unhide/hide them depending on which state they are in. You can add this to your .bash_profile in your user folder, and run it at any time by running the command hiddenfiles.

hiddenfiles () { if [[ $(defaults read com.apple.finder AppleShowAllFiles) == "0" ]]; then defaults write com.apple.finder AppleShowAllFiles 1; else defaults write com.apple.finder AppleShowAllFiles 0; fi && killall Finder ; }

You can also hide or unhide individual files. To unhide your user Library folder for example, run:

sudo chflags nohidden ~/Library

To hide it again, run the same command except change nohidden to hidden, like this:

sudo chflags hidden ~/Library

How to install Homebrew on macOS 10.12 Sierra

Homebrew is, in my opinion, an essential package manager for macOS. According to Homebrew’s website it “installs the stuff you need that Apple didn’t”.

Before installing Homebrew, you have to get Xcode from the App Store.
After you have downloaded Xcode, open the “Terminal” app in /Applications/Utilities/, and run:

xcode-select --install

to install the Xcode command line tools.

Xcode Command Line Installation

Then, run:

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

And let Homebrew install.

How do you use Homebrew?

Some commands you can run are:
brew search [TEXT|/REGEX/]
brew (info|home|options) [FORMULA...]
brew install FORMULA...
brew update
brew upgrade [FORMULA...]
brew uninstall FORMULA...
brew list [FORMULA...]