Given the nature of the modern web, it seems like many
sites drown visitors with adverts, tracking scripts, etc
etc. Of course, Oddity his quite vulnerable to all this.
Raziel suggested using the "hosts" file in AmigaOS to
sidetrack all those scripts. He also found a site where
they maintain hosts files that will block those web
denizens:
https://github.com/StevenBlack/hostsRaziel, that smart guy (!!), also came up with a WGet
command line to download the hosts file to your Amiga.
Here's how I hacked all that into my Amiga...
First, get the latest WGet from OSDepot and put it in your
C: dir so you can do the downloading:
http://os4depot.net/index.php?functio ... utility/misc/wget-bin.lhaThen make a copy of your original hosts file, just in case
you want to access all the spammers and web spies (aka
FaceCult) from time to time:
copy DEVS:Internet/hosts DEVS:Internet/hosts.orig
Next, add these lines to your S:network-startup after the
line with "AddNetInterface":
-------------------------
; download & install latest clean host names file
wget -q --no-check-certificate https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn-social/hosts -Odevs:Internet/hosts.clean
if WARN
RequestChoice "Error" "Failed to download clean hosts file" "Bugger!" type warning
else
set hostsSize `FILESIZE devs:internet/hosts format "%l"`
if $hostsSize GT 20000 VAL
;echo "clean hosts file in use"
c:copy devs:Internet/hosts.clean devs:Internet/hosts clone
endif
unset hostsSize
endif
-------------------------
What those lines will do is download the latest & greatest
"clean" hosts file to your Amiga every time you boot up.
Furthermore, they will check to see if you are using the
"clean" file at time and make sure the new version is in
use.
Finally, I set up another little CLI script to toggle my
Amiga between these two hosts files. Just open Notepad and
save these lines to a file ("ToggleCleanHostsFile.cli"?):
-------------------------
set hostsSize `FILESIZE devs:internet/hosts format "%l"`
if $hostsSize GT 20000 VAL
; clean in use
set userPick `requestchoice "ToggleHostFile" "Clean hosts file in use" "OK, leave it|Copy in Original" TIMEOUTSECS 5`
if $userPick eq 0
c:copy devs:Internet/hosts.orig devs:Internet/hosts clone
rx "address RINGHIO 'RINGHIO APP=TOGGLEHOSTS TITLE=Toggle_hosts: Orig hosts file installed'"
endif
else
; orig in use
set userPick `requestchoice "ToggleHostFile" "Original hosts file in use" "OK, leave it|Copy in Clean" TIMEOUTSECS 5`
if $userPick eq 0
c:copy devs:Internet/hosts.clean devs:Internet/hosts clone
rx "address RINGHIO 'RINGHIO APP=TOGGLEHOSTS TITLE=Toggle_hosts: Clean hosts file installed'"
endif
endif
unset hostsSize
unset userPick
-------------------------
Then you just go into and WBInfo on this CLI script file
and set these things to make it run with a double-click or
from AmiDock:
"Script" bit = checked
"Default Tool" = C:Execute
"Start from:" = Shell
"Prompt for input:" = not checked
Then you can drag'n'drop this icon into AmiDock and you
have a simple way to check which host file you're running
and to switch it with one click.
Just to give you a sense for what difference I found this
change makes, here are some times for fully (almost)
loading a webpage:
http://www.autoblog.com/news/?icid=autoblog|news|latest original hosts file = 22.5 secs
clean hosts file = 11.7 secs
"Almost" = without blocking the spammer hosts, there are
often sockets that constantly appear to be left open -
watching whether you're seeing the adverts?
One other little fringe benefit with this hack: when you
quit Oddity, you run into far fewer DSI's and "child
process unresponsive" messages.
Have fun,
PJS