Beneficial stuff for the net

Host-based Ad-Blocker

Just add the contents of the following resource to your hosts1, 2-file:
https://hara.tc/HOSTS

1: In Windows the hosts-file should be found in the directory %WINDIR%\System32\drivers\etc\. — Since this file is normally write-protected, simplky copy it to the desktop and edit the copy. Afterwards copy it back to the original directory and approve the warnings.
2: In Linux the hosts-file should be found in the directory /etc/. — Since this file is normally write-protected, edit it with root-rights (e.g. using the sudo-command).

Send ed2k-links to Firefox

With the update to Version 4, all kinds of ed2k plugins stopped working with Firefox… Hence, own scripting is required.

Variant 1 (Windows)

Create a file ed2k.bat in your Firefox directory and copy the following content into it. Alternatively, you can download the file and edit it.

Variant 2 (Linux and Windows)

Should your Firefox support it (I don’t know why, but mostly this does not work), install the plugin “Redirector“ and create a new rule:
  • Example URL”: “ed2k://|file|Test.file|1234567|B5D4431E5C940BE04CB5365EAFEC1C48|h=UBGZJ5LQPLYUXQYQAUEBZOHO7HBT65ZT|/”
  • Include Pattern”: “ed2k://\|file\|([^/:@]*)\.([a-zA-Z0-9]{1,4})\|([0-9]{1,10})\|([a-fA-F0-9]{32})\|h=([a-zA-Z0-9]{32})\|/”
  • Redirect To”: “http://example.com:4711/?w=password&p=examplepassword&cat=0&c=ed2k%3A%2F%2F%7Cfile%7C$1.$2%7C$3%7C$4%7Ch%3D$5%7C%2F”
  • Check the checkbox “Escape matches

Redirector rules for Firefox/Waterfox

Utilising Redirector for Firefox/Waterfox one can dynamically rewrite URLs during they are called. Often, after clicking a Google result or Shortnews article, the then displayed advertisement sites do not load properly; hence, I can often not redirect to the page I actually want to load (e.g. for Shortnews the original source article). Therefore, I wrote a few Redirector rules in order to circumvent the advertisement sites. Of course, there are nicer addons for Firefox/Waterfox with the same or better functionality (e.g. blocking all advertisements), but Redirector rules are a nice means of training regular expressions. After installing the Redirector-Addon, simply right-click the R icon ans select “import” in the upper right.