Adblock Filters and Other Code
Coral Content Distribution Network

Found out about the Coral CDN from G's site. Thought a bit about it and then wrote some Javascript.

Basically want to redirect users that can access the Coral CDN to use the Coral CDN, and not affect those that can't.

So wrote a little 'coralize' script, linked to it through the CDN ( on my About page, and let it fly.

Updated script to be:

var host = location.hostname
var path = location.pathname
var port = location.port

if (port != "8090")
  if (port != "80" && port != "")
    host += "." + port;
  host += "";
  port = 8090;
  window.location = "http://" + host + ":" + port + path;

This version handles web sites that don't serve from port 80. Will update the site shortly.

Detecting Adblock

Moved this on to it's own page, it's the whole:

if (window._AdblockFiltered)
    alert("You are using Adblock to block ads")

Try it here.

Figured Out!

Have been thinking for ages about how to go directly from one base (like hex) to another base (like binary) without an intermediary base. The common intermediary is base 10, at least when you're not going from common, easy ones like 16 to 2.

Like if you were to go from 6 to 7.

The trick is to express the target base in the origin base. So if you're converting from base 6, you're converting to 11base6.

You don't know the relief!

Bandwidth Limiting with iptables and tc

First off, completely unrelated, but here's the best quick Regex primer ever.

The apartment that I live at these days only has dialup internet access. A bit slow sometimes, but very cheap and unlimited downloads. Problem is, when Limewire manages to get a good connection, everyone else suffers.

Anyways, found a great bandwidth limiting with tc and iptables doc over here, and made a few modifications.

Not much on the tc script side of things, but since we only want to affect gnutella traffic (underlying protocol for Limewire), the iptables rules were modified to look for the two most popular ports that my Limewire was binding to:

$IPTABLES -t mangle -A FORWARD -p udp -m multiport --ports 6346,6348 -j MARK --set-mark 4
$IPTABLES -t mangle -A FORWARD -p tcp -m multiport --ports 6346,6348 -j MARK --set-mark 4

Pretty useful.

New Default Filters

The 0.5.6+ builds now contain a few modifications to the filterset that was initially included. This is the current filterset. Let me know of any irritating initial false positives.
mcm_ham Variant Default Filters

Default filter set for the most recent build:
MSN Ad Blocking

Recently "updated" to MSN Messenger 7. Got tired of ads in there. Here's what you want to do.

  1. Get rid of tabs by adding the "DisableTabs" Dword in "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger". It should have a value of "1".

  2. Get rid of ads by blocking access to "", iptables does it nicely with:
    iptables t nat -I POSTROUTING -d "" -p tcp -dport 80 -j DROP
    You could also modify your hosts file.


XPI Installer Script

Conditions added, based on the the Mozilla docs.

function install (aEvent)
var supported = /Mozilla/.test(navigator.appCodeName) && /Netscape/.test(navigator.appName);
if (!supported)
  if (!confirm ("Unable to begin installation.\nYour web browser is not supported.\nTry Anyway?"))
    return false;
  };if (!InstallTrigger.updateEnabled())
  if (!confirm ("Unable to begin installation.\nSoftware updates are disabled.\n Try Anyway?"))
    return false;
  };  {
  var params =
    "Adblock Ghastly Whitelist Hack":
      toString: function () { return this.URL; }
    InstallTrigger.install(params);    return false;
April 28 2005

Here's what's going on in my blocking these days.