Blocking adverts in Mac OS X

Posted: June 22nd, 2011 | Author: | Filed under: Internet, Mac | No Comments »

All banner adverts come from web servers. But a Mac running OS X is a perfectly capable web server in its own right. This article describes how to tell your Mac to look for  adverts on itself, rather than wasting time and bandwidth connecting to adverts.

Due to OS X’s web serving capability, it is perfectly possible to redirect your browser into looking for ad servers’ IP addresses locally.

Of course, looking for them locally means that it won’t find what it’s looking for, and will draw a blank.


This requires a bit of Terminal work, and an admin account.

The first thing to do is edit your ‘hosts’ file. This is the file that explains to your web server any custom URL resolution that you might require. The TCP/IP protocol reserves the address ‘’ for the machine that you’re on, so this is what we’ll exploit. We’ll use the pico editing program for this.

First, fire up

Then type in:

sudo pico /etc/hosts

You’ll be prompted for your password. Then the pico editor will open, displaying something like this:

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
## localhost broadcasthost
::1 localhost

Using your cursor keys, get down to the bottom of this. Now we’re going to insert a list of most known ad servers. Highlight the below list, then copy and paste it below what’s above: AdSubstract adsubstract

Now, notice what they’ve all got in common? That’s right, they all start with This is telling your browser that instead of looking for these ad servers via the internet, it should look for them on your machine.
You’re going to have to quit pico now and save this, so hit ctrl-o to save, then ctrl-x to quit.

OK, this is all well and good, but what exactly is your browser going to look for on your machine? It doesn’t know, and nor does your Mac, yet. If you run this as it is, you’ll just get pages full of “Error, page not found” which are potentially just as annoying as the ads.
Solution? Make a blank page. Fire up your favourite text editor (BBEdit, TextEdit, or suchlike), make a new document, and TYPE NOTHING INTO IT.

Now save this as “missing.html” into your server directory. Make sure there’s no other extensions applied to that, like ‘.txt’, or ‘.rtf’. Your server directory is your_harddrive/Library/WebServer/Documents

Now, just one step left. We need to tell the Apache web server what to do when it comes across an advert but is instructed to look locally. We need to edit its configuration file so that it displays our newly created “missing.html”.

Back to Terminal.

Fire up Terminal, and type

sudo pico /etc/httpd/httpd.conf

Again, you’ll be asked for your admin password. So type it in.

We need to find the bit relating to how Apache will deal with local requests specified by the hosts file we just pasted loads of lines into. It’s a big file, so let’s do a search. Hit ctrl-W for “where is”, and type ‘local redirects’. Provided you haven’t got some weirdo super-customised httpd file, this should drop you straight to the line saying:

# 2) local redirects

Underneath this is what we have to change. Whatever it says after ‘ErrorDocument 404’, change it so that it looks like this:

ErrorDocument 404 /missing.html

Notice something missing? That’s right, make sure you take the # off the beginning of the line.

That’s us done here, so let’s save and exit. Remember? ctrl-o to save, then ctrl-x to exit.

OK, there’s one last step. We have to restart Apache to make it recognise the changes we’ve made.
So open System Preferences, choose Sharing, turn off Web Sharing, then turn it on again.

And that’s it. For future reference: It’s almost impossible to maintain an exhaustive list of ad servers; they change all the time. But if you find one that’s getting through, do let me know. I’ll add it to the list. ASAP.

Facebook Privacy

Posted: June 22nd, 2011 | Author: | Filed under: Facebook, Internet | No Comments »

Here’s a fantastic guide to keeping your Facebook account private and secure, in spite of Facebook trying to break your settings every few minutes.

The Always Up-to-Date Guide to Managing Your Facebook Privacy

From lifehacker.

It turns out I was right

Posted: April 14th, 2011 | Author: | Filed under: Internet, Music, Spotify | No Comments »

Spotify today published, on their UK blog, an outline of where their service is going. You can read the article here.

Spotify, as a free service, is basically over.

Here are the salient points;

As of May 1st, any user who signed up to the free service on or before November 1st 2010 will be able to play each track for free up to a total of 5 times. Users who signed up after the beginning of November will see these changes applied 6 months after the time they set up their Spotify account.

Additionally, total listening time for free users will be limited to 10 hours per month after the first 6 months. That’s equivalent to around 200 tracks or 20 albums.

It would appear that the harsh financial realities are biting. Spotify are now heavily pushing users towards the subscription model, and putting the brakes on free service. But can this last? Already Spotify are hamstrung by the fact that their territories are limited, and that they have failed to broker arrangements with the not just lucrative but essential North American market.

Rumours abound that Apple’s colossal new data centre is geared towards iTunes subscriptions. If and when they flick that switch, Spotify’s going to be dead in the water.

Still no word on what they’re paying the artists, though…

The future of the music industry isn’t Spotify

Posted: March 31st, 2011 | Author: | Filed under: Internet, Music, Spotify | No Comments »

Spotify’s great, isn’t it? Unlimited access to all the music in the world. Sounds perfect. As a consumer, yes it does. But what about the artists?

There’s growing unrest about Spotify’s attitude to paying artists. The Guardian, in this article, highlights the problems that the bodies representing artists have with the service. In the article, they raise the example of Lady Gaga, who, the association claims, received a mere $167 for a million plays of her hit single.

This is an apocryphal story, because as the article states, Spotify don’t really do transparency. If you go to their website and try to discover what their payment structure is, or what their corporate structure is, you’ll be referred to someone or something else.

I’m a musician, and music I’ve made is available on the iTunes store, and, and Spotify. For the latter two, it’s easy to find out what you’ll be paid. in particular make it painless. Small, independent artists like my band can sign up as their own label, and then get simple information from their Artist Royalty Page.

iTunes and Spotify are more similar, in that they don’t deal directly with independent artists, but rather with “aggregators” – companies with whom you can sign up and then get your music onto various services like iTunes, Spotify, Napster, eMusic, etc.

I’ve been a client of one of these aggregators – Tunecore for a few years. My last band used them to get our albums onto iTunes et al. It was great. We paid Tunecore a fixed rate, and in advance knew exactly what to expect – what we’d get from an iTunes sale, from a Rhapsody stream. Now Tunecore can get you onto Spotify too, but the best information they can give you is “Spotify has deals with necessary rightsholders in all of its launch countries. Together with them, Spotify has agreed upon a royalty based on how frequently your music is played. For detailed information, please contact your record label or your collecting society”.

Well, I am the record label, so I contacted myself, but I didn’t know. And who is my collecting society? We’re not PRS or MCPS registered yet. Why is this information not freely and transparently available?

It has been reported that the major labels have all taken stakes in Spotify. The cynic in me thinks that this is an investment on their parts – an investment in their future profitability. By not having to deal with the expense of physical product, margin is automatically up. But by paying the artists peanuts too…