How to Edit Hosts file in Mac OS X El Capitan

The hosts file is used by your computer to map hostnames to IP addresses.

By adding or removing lines to your hosts file you can change where certain domains will point when you access them in a browser or using other software. You can block certain hosts names, like ad-serving/malicious hosts, or used for web development purposes, i.e. to redirect domains to local addresses.

This is an important file and one that is under the computer administrator’s control, so you’ll need an account with full privileges to make any changes.

Making a backup of the hosts file can be a good idea if you plan on making significant changes or just want to play around with modifications and see what happens.

Step 1: Launch Terminal, found in /Applications/Utilities/ or launched through Spotlight

Step 2: Type the following command at the prompt to backup hosts file to documents folder:

sudo cp /private/etc/hosts ~/Documents/hosts-backup

Step 3: Type the following command at the prompt to open hosts file:

 sudo nano /private/etc/hosts

Step 4: Enter the administrator password when requested, you will not see it typed on screen as usual with the command line

Step 5: Once the hosts file is loaded within nano, use the arrow keys to navigate to the bottom of the hosts file to make your modifications

Step 6: When finished, hit Control+O followed by ENTER/RETURN to save changes to /private/etc/hosts, then hit Control+X to exit out of nano

Step 7: Verify your hosts modifications. You may need to clear DNS cache first.

If you want to restore the modified hosts to the backup of the original file use this command:

sudo cp ~/Documents/hosts-backup /private/etc/hosts

All credit goes to for this article.

Macbook Pro Retina (Late 2013) won’t shut down, just restarts! OS X Yosemite

I’ve recently been messing around with our Macbook Pro Retina (late 2013) as it won’t shut down anymore! If you choose to shut it down it closes down then just reboots. The battery life in standby also sucks, it can be fully charged at 100%, shut the lid, come back in 12 hours and it’ll be at 84%. I can’t remember if the problem was around before I upgraded from OS X Mavericks to Yosemite. I spent time on the phone with Apple tech support and they couldn’t sort the problem so booked me in at the local Apple Store. I had tried things like resetting the PRAM, verify the disk, repair disk permissions, reset the system management controller (SMC), wiped the drive and performed a fresh install and none of it solved the problem. Totally sounds like a software problem to me. By the way I have bootcamp installed with a windows partition. Windows can shutdown and power off the machine fine.

Took it to the Apple store for a ‘Genius’ to take a look. A few hours later I returned and they told me the Macbook looked like it had a little water damage, it’ll cost about £900 to change the motherboard, is it insured?!

I told them i’ve never spilt anything on it (which I haven’t) and that if it was a motherboard problem then why will windows shut the machine down correctly, sounds like a software problem to me?

They agreed and went back into their workshop to do a wipe and reinstall (which I had already done). 20 mins later, out they came, said it was shutting down correctly but was very slow at booting up for some reason, this could be down to the ‘water damage’ and sent me on my way!

I have since gone back to OSX Mavericks 10.9.5 and the machine shuts down correctly, battery standby life looks like it is acceptable but it’s still very slow at booting up and coming out of sleep mode.

I have 1 day left on the AppleCare warranty and a machine i’m not happy with. Thanks apple.

UPDATE 19/08/2015: I’m currently using OS X 10.11 Beta of El Capitan and it runs like a dream! Close the lid, come back a few days later and it will still be at 100%! It shuts down correctly, boots up quickly, everything works fine, no problems. Moral of the story… Yosemite sucks!


Apple Mac Startup Options

Startup shortcuts

Use these key combinations to change how your computer starts up. Press and hold the key or combination of keys immediately after starting your Mac until the expected function occurs or appears. For example, press and hold the Option key during startup until the Startup Manager appears.

Key or key combination What it does
Option or Alt Display all startup volumes (Startup Manager)
Shift Start up in Safe Mode
C Start from bootable media (DVD, CD, USB thumb drive)
T Start up in Target disk mode
N Start from a NetBoot server
X Force OS X startup (when non-OS X startup volumes are available)
D Use Apple Hardware Test
Command-R Use OS X Recovery (OS X Lion or later)
Command-Option-R Use Internet Recovery on supported computers
Command-V Start up in Verbose Mode
Command-S Start up in Single User Mode
Command-Option-P-R Reset NVRAM
Hold down the Media Eject (?) key, F12 key, or mouse or trackpad button Eject removable discs

Sleep, shut down, and log out shortcuts

Use these key combinations after your Mac has started up to sleep, shut down, log out of, or restart your computer.

Key or key combination What it does
Power button Tap to power on. Once powered on, tap the power button to wake or sleep your Mac.
Hold down the power button for 1.5 seconds Show the restart / sleep / shut down dialog
Hold down the power button for 5 seconds Force the Mac to power off
Control-Power button Show the restart / sleep / shut down dialog
Command-Control-power button Force the Mac to restart
Command-Option-Power button Put the computer to sleep
Command-Control-Power button Quit all apps (after giving you a chance to save changes to open documents), then restart the computer
Command-Option-Control-Power button Quit all apps (after giving you a chance to save changes to open documents), then shut down the computer
Shift-Control-Power button Put all displays to sleep
Command-Shift-Q Log Out
Command-Shift-Option-Q Log Out immediately

Outlook 2010 signature button not working (64-bit)

I recently removed Office 2010 (32-bit) and installed the 64-bit version. This introduced the problem where my signatures in Outlook were no longer being added to emails.

I fully understand the process of creating signatures, how they work, where they are saved etc so off I went to File > Options > Mail > Signatures

My issue was that the “signature” button, when pressed, wouldn’t open the window with all the options for creating and editing signatures. Clicking it just did nothing!

After a bit of searching I found the following solution…

Use “regedit” to change the “(Default)” and “LocalServer32” values in each of the keys below to C:\Program Files\Microsoft Office\Office14\Outlook.exe




Once the keys have been changed, launch outlook and the signature button will work again allowing you to change your signature preferences.

Note: The above fix will also work for the 32-bit version of Outlook, just change the C:\Program Files\Microsoft Office\Office14\Outlook.exe to C:\Program Files (x86)\Microsoft Office\Office14\Outlook.exe


Bitlocker “Preparing Automatic Repair” at Startup Windows 8.1

We recently bought an Asus S400C notebook for a client that needed to be configured with Windows 8.1 and secured with Bitlocker. After upgrading from Windows 8 to 8.1 we ran in to the following problem…

PROBLEM: After enabling Bitlocker and booting with the encryption key on a USB key we can’t get into windows. It sticks at the boot screen saying “Preparing Automatic Repair”. If you remove the USB stick it goes straight to the bitlocker screen giving you the option to enter the recovery code or reboot.

SOLUTION: Go into the BIOS and disable the “FAST BOOT” option.



Create bootable USB drives from ISO’s

Create bootable USB drivesA while back I was looking for an easy way to create a bootable USB stick version of a Windows 7 disc that I had to install on a number of workstations that didn’t have CD-ROM drives. I found the following utility that can create USB installation media from bootable ISO’s.


“Rufus is an utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc. It can be especially useful for cases where:

  • you need to create USB installation media from bootable ISOs (Windows, Linux, UEFI, etc.)
  • you need to work on a system that doesn’t have an OS installed
  • you need to flash a BIOS or other firmware from DOS
  • you want to run a low-level utility

Despite its small size, Rufus provides everything you need!”

Google redirects to a fake flash player update on both pc and mobile.

Trying to get on google but keep getting a page saying flash needs updating which in turn tries to get you to download a virus / malware? Do you have a TP-Link modem / router? Chances are your router has been hacked!

A customer of ours had this problem the other day, tried to get to google and kept getting this message in the browser to update flash pro. They  ignored the antivirus software’s warning and went ahead and downloaded the so called update. PC now infected! Many hours later after a clean install (just to make sure) we gave the customer their PC back.

When they returned home, plugged in, turned on, same message again when trying google! Didn’t matter which browser they used, always the same. All other sites worked fine apart from google. I got them to try on their other pc and smartphone, same thing. So this made me think it must be some kind of routing issue with the router. Turns out that their TP-Link router is pretty easy to hack and had been.

Here’s a link to a video on how to hack the router in question

In short their routers DNS was changed from to This meant that when they try to get google the request was going to a dodgy server dishing out this fake flash player.

As yet I don’t think there is a firmware fix for this and a number of TP-Link routers may be affected. However you can protect yourself by blocking any external access to the router by enabling SPI which can be found under the Advanced Setup > Firewall section.

After more digging I found a few more people who have had this issue…

Malicious DNS

The Malicious DNS

Enable SPI to secure

Enable SPI to secure

MSSQL Maintenance cleanup task does not delete older files

If you are running Microsoft SQL Server 2008 R2 and find that your maintenance cleanup task is not deleting old files then it’s likely to be one of the following…

  1. Make sure you have the correct path specified and that it does not have a “\” on the end
  2. Make sure the file extension does not have a dot before it e.g.  “.bak” It should just read “bak”. You could also try *.* that would delete all files regardless of their file extension.