Saturday 24 January 2015

Using my Mac Mini as an adblock proxy for my iPad

I really like my iPad. It's a wonderful tool for browsing the web, browsing media, reading stuff and controlling my home theatre PCs, whilst laying on the sofa or in bed. There's just one catch: No adblock, at least under Safari.

Now I don't know about you, but there's only so many "one weird tip" or "Ellen scandal" ads that I can cope with before going completely postal. The straw for me came in the form of a "vdopia" popup autoplaying video ad on mac rumours, which was not only incredibly irritating but also broke the mac rumours site.

In any case, I was desperate to find a way to browse the net on my iPad without having my eyes constantly burned out by incredibly obnoxious ads. I tried a couple of replacement browsers, but found they were even more obnoxious than the ads they blocked. The solution for me came in the form of privoxy, which is an adblocking proxy server.

This is where the new mac Mini comes in. The latest model (as well as having a huge 2TB hard drive for my media and super fast processor and video) draws a piddling 7W of mains power when idle, and are totally silent. I've had PCs that used more power than that when they were switched off. It's the perfect media server, and also the perfect proxy server.

So here's the secret sauce for getting privoxy running on new Macs running OS X Yosemite. It's based on instructions at Andrew Watters' blog with extensions to allow access from other machines on your local network (i.e. the iPads) and also to work around some Yosemite launchd weirdness:

1. Your mac needs to have a static IP address, so other machines on your network know where it is. I like to use my router to allocate IP addresses, so I set up a binding in there to ensure my mini always comes up at the same IP, but is still able to run DHCP. In my case, I run ifconfig from the terminal, and copy the mac address from the active interface, then paste that into the "DHCP reservations" field for my router using airport utility. I gave it a fixed IP of 10.0.1.101, which is easy to remember.

Note this isn't an address you can get to from the outside internet, as the router is still doing NAT. It's just for machines local to your router. Alas your eyes will still cop the obnoxious ads when you're away from your home network, but for me 90% of my net browsing is done at home, so this is good enough.

2. Now install Xcode from Apple. This is the apple software development suite, and includes compilers etc, which we'll use for compiling privoxy from source.

2a. You'll also need autoconf. The version linked to in Andrew's blog didn't work with the latest version of Xcode/os x, so I just found the newest version. From the terminal:

  • curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
  • tar -xzf autoconf-2.69.tar.gz
  • cd autoconf-2.68
  • ./configure
  • make
  • sudo make install
I found I had to run it again from ./configure a second time because a fresh install of Xcode doesn't work until you've agreed to licence terms, which only come up when you make.

3. Add a user for privoxy, and associate them with a freshly created privoxy group.

4. Download the privoxy source, and install it:

  • cd ~/Downloads
  • tar -xzf privoxy-3.0.22-stable-src.tar
  • cd privoxy-3.0.22-stable-src
  • autoheader
  • autoconf
  • ./configure
  • make
  • sudo make install
5. Edit privoxy's config file:

  • sudo pico /usr/local/etc/privoxy/config
If you don't like pico, use whatever editor you prefer.

While you're in there, you need to change enable-remote-toggle to 1, enable-edit-actions to 1, and insert your IP address in place of the loopback at listen-address. Detailed instructions are on Andrew's blog

6. After much stuffing about, I worked out that launchd under Yosemite doesn't run the daemon when you use the RunAtLoad key. I found "KeepAlive" worked, and is more in keeping with what you want the OS to do with a daemon like this. So when you set up /Library/LaunchDaemon/org.privoxy.plist, substitute "KeepAlive" for "RunAtLoad"

7. Reboot to get the daemon running, and edit the proxy server setting on your iPad (settings->wifi) to manual, and enter the IP address of your mac, with port 8118.

Done!

Thanks Andrew, you're a champ!

Sunday 4 January 2015

Almost done planking

With just the bow end of the top plank to do, I figured it'd be nice to show my "look ma, no screws" method of planking. It relies on the fact that the Navigator has reasonably narrow planks (hey, that what gives her such lovely lines), as I have to be able to get a clamp over the top of the plank with a bit of wood placed in such a way that it puts roughly equal pressure on the stringers on each side of the plank.

Anyway, pictures. First here's a close up of a clamp in place. If you look closely on the stringer side, you'll see a simple length of wood spanning the stringers:

Here's a view of the inside (complete with sleeping cat) showing the temporary braces. These are just held in by the clamp pressure. I've got to be careful not to get any goop on them, or else they're rather hard to get out afterwards (ask me how I know this!).

This picture is probably more illustrative, but has the disadvantage of not showing my cat sleeping on the forward thwart:

I took all these clamped up photos while test-fitting, before mixing up epoxy. When I've got a batch of epoxy going, I keep the camera well away. That stuff sticks to anything.

Anyway, it's getting to the point where it looks like it might even float. Here's the stern section, with the cockpit seats all buttoned up and all the planking done. I resisted the urge to paint out the inside of the cockpit seats. I gave it a thorough coating of epoxy and left it at that.

For the join between the aft and midships section of the top plank I elected to do a scarf rather than a butt-join. This is purely cosmetic - this join isn't hidden behind seats so I don't want an ugly lump of wood showing.

Up front you can see where the final plank piece goes. I moved the midships-bow join for the third plank one frame forward from plan - this hides it forward of bulkhead 2. I haven't done anything to hide the join for the midships-bow section of the top plank (just aft of bulkhead 4), as that's where I'll be putting the chainplates for tying the shrouds off to, and a double thickness of ply there will reinforce things nicely.

This is the view I get now when I walk into the garage. I get a lot of pleasure from seeing this every day.