You are not logged in.
ondoho wrote:edit: i added "google.com" to the blacklist with hostsblock-urlchecker, and now the black.list looks like this:
adwords.google.comgoogle.com www.google.com
:-(
That is odd...I blocked google.com via hostsblock-urlcheck, too, but I can't reproduce this issue.
it has happened again.
adwords.google.comdomainnamesales.com
sports.bwin.com
bwin.com
g.doubleclick.net
mightydeals.com
da-ads.com
it seems that it only happens on the first/second entry?
Offline
gaenserich wrote:ondoho wrote:edit: i added "google.com" to the blacklist with hostsblock-urlchecker, and now the black.list looks like this:
adwords.google.comgoogle.com www.google.com
:-(
That is odd...I blocked google.com via hostsblock-urlcheck, too, but I can't reproduce this issue.
it has happened again.
adwords.google.comdomainnamesales.com sports.bwin.com bwin.com g.doubleclick.net mightydeals.com da-ads.com
it seems that it only happens on the first/second entry?
I have no idea on this one. The revelent line of code for this would be in hostsblock-urlcheck's "check" function, at the line
echo "$@" >> "$blacklist"
(where the url quoted in the previous stdout line "Blocking (url)" is appended to the black.list file.) It would be highly irregular behavior if this line caused additions to black.list anywhere but at the very bottom of the file.
When you used hostsblock-urlcheck to block the specific url, what did it say? Could you copy and past what came out on the command line and then the resulting black.list file?
Check out hostsblock for system-wide ad- and malware-blocking.
Offline
WonderWoofy wrote:In regard to the use of dhclient in general... I have a feeling that Network Manager might ignore the dhclient.conf though
i'm using neither networkmanager not dhclient. should i?
Nah, not if you don't want to. That part was more directed to the thread in general, as I didn't want to have a whole new post to put that last little part.
Edit: ...and I don't want to use pppd because it seems like a real PITA, and normal non-point-to-point networking just seems much simpler.
Last edited by WonderWoofy (2013-11-02 20:07:23)
Offline
gaenserich, the urlcheck script doesn't output anything special:
─$ sudo hostsblock-urlcheck domainnamesales.com
Verifying that the given page is blocked or unblocked
NOT BLOCKED: 'domainnamesales.com' Block? [y/N] y
Blocking domainnamesales.com
Page domain verified. Scan the whole page for other domains for (un)blocking? [y/N] y
Whole-page scan completed.
i have a little wrapper shell script for it, maybe that's what's causing it - but i really don't think so. i reinstalled the hostsblock package but both times it seems to be only the first entry. i can't reproduce it. i'm using urxvt. anyhow here's the script:
#!/bin/bash -u
while true
do
read -p "Enter URL to be checked: " x
sudo hostsblock-urlcheck "$x"
while true
do
read -p "Check some more [y/N]? " y
case $y in
y) break
;;
n|'') exit 0
;;
*) continue
;;
esac
done
done
exit 1
@wonderwoofy:
...and I don't want to use pppd because it seems like a real PITA, and normal non-point-to-point networking just seems much simpler.
so what are the choices since i'm using mobile broadband only (3G)?
Last edited by ondoho (2013-11-02 21:17:34)
Offline
No, I'm not saying you're not stuck with pppd. If you are using a mobile broadband connection, there is a good chance that is your only choice. I'm just saying that I would prefer to ever have to use it.
If I need to attach to the interwebs on my computer when I am out an about, I use my phone to make a wireless hotspot, which is basically the same as connecting to a home modem, as the phone handles whatever authorization is necessary for the connection.
In any case, this is a bit OT for this thread.
Offline
@ondoho: Hopefully we can get more reports of this error. Perhaps it might have something to do with my usage of sed in hostsblock-urlcheck, i.e. the syntax I use with the delete line functions (like the line sed -i "/$@/d" "$blacklist") somehow modifies other lines in the whitelist and blacklist in unintentional ways. That seems unlikely, too, but more likely than your wrapper being defective. Unless there is some sort of behavior with quotations or sed invocation that none of us are familiar with that is causing this, I have really no idea what is causing this without more data points.
As an interim work around, you could modify the respective files by hand.
I have no opinion on pppd...never used it, even when I was on dialup a million years ago (thank god). When I have to tether to a 3G/4G connection, I do what WonderWoofy does and just use my phone as a wireless hotspot...much easier. But if pppd works (ostensively) for you, don't fix what isn't broken!
Check out hostsblock for system-wide ad- and malware-blocking.
Offline
Can someone paste me content od /etc/hostsblock/hosts.head ?
I accidentally deleted it.
Offline
You can't redownload the sources and see for yourself?
In any case, this file is just a backup of your /etc/hosts file and is meant to be used when hostsblock is set to modify your /etc/hosts instead of /etc/hosts.block. It will apply whatever is in the /etc/hostsblock/hosts.head to the head of the newly made file. Of course this is clearly explained on the hostsblock page.
Offline
If you used the stock hosts.head file that came packaged in hostsblock, then you can just reinstall hostsblock and pacman will replace your non-existent hosts.head file with the one it has packaged (and will provide .pacnew files for all the configuration files you still have). If you put something specific into your own hosts.head file, there is nothing we can really do to help you...it's typically not a good idea to delete any file from /etc/ without first backing said file up.
Check out hostsblock for system-wide ad- and malware-blocking.
Offline
Awesome app: thank you. Migrated all of my machines across to hostsblock/kwakd and I am loving the white space.
Offline
Awesome app: thank you. Migrated all of my machines across to hostsblock/kwakd and I am loving the white space.
Good to hear! Feel free to provide any other hacks or modifications you've used!
Check out hostsblock for system-wide ad- and malware-blocking.
Offline
Stumbled on this thanks to Jason Ryan's write up.
THANK YOU !
Ben
Offline
I read JWR's post as well, and like the others on his blog, I enjoyed it. But I want to comment on his lack of dnsmasq use. Initially I set that up so that the gigantic list would be loaded into RAM and thus be a bit faster. But what I really think the true advantage to using dnsmasq has been for me, is the fact that it allows me to use a file other than /etc/hosts and therefore turn the blocking on and off at will.
There probably is a slight speed increase by having the list loaded by dnsmasq, but like JWR, I honestly don't think that it makes enough of a difference to really do it for the speed alone on a personal machine. But if you want to learn a bit about dnsmasq, or have the ability to turn the blocking on and off, then it is a great thing to have set up.
Offline
Thanks for letting me know about JWR...his blog's added to my feedly list now. It's kinda crazy to see your own name mentioned by someoe other than yourself.
On ArchLinux, I haven't been able to tell the difference either. I run hostsblock on my server (which acts as a proxy) without dnsmasq and on my laptop with dnsmasq. The only time I have noticed a significant difference was when I tried to run hostsblock on my wife's MacBook, where the default built-in dns handler quickly eats up so much memory when subjected to a huge /etc/hosts file that it almost instantly swaps out and becomes usable. From those experiences, I decided to play it safe and use dnsmasq where I can spare the RAM.
Check out hostsblock for system-wide ad- and malware-blocking.
Offline
I don't get the verbose output appeared in screenshots. And hostsblock --help does not help.
Thanks,
Xan.
Owning one OpenRC (artoo way) and other three systemd machines
Offline
I don't get the verbose output appeared in screenshots. And hostsblock --help does not help.
Thanks,
Xan.
Check out the rc.conf file under "/etc/hostsblock/rc.conf", which has more documentation. Moreover, in rc.conf is the default parameter 'logfile="/var/log/hostsblock.log"', which redirects the verbose output of hostsblock to the stated file. If you change it to 'logfile="0"', it should display the verbose output to stdout.
Check out hostsblock for system-wide ad- and malware-blocking.
Offline
Mmm. Thanks. But it's possible to have *both* enabled? I see the logs but occasionally I run manually.
Owning one OpenRC (artoo way) and other three systemd machines
Offline
Mmm. Thanks. But it's possible to have *both* enabled? I see the logs but occasionally I run manually.
If you use tee(1) with the output to stdout option, you can manually do both, or run "tail -f" on your logfile whenever you manually run hostsblock. For instance, when I debug hostsblock, I often use the following command line sequence:
hostsblock & tail -f /var/log/hostsblock.log
Check out hostsblock for system-wide ad- and malware-blocking.
Offline
Recently stumbled upon this thread after migrating to UZBL and needing an adblock solution.
Was a cinch to setup, easily customizable, and if there is a performance hit I'm having a hard time perceiving it.
Nice work!!!
"A problem well stated is a problem half solved." - Charles Franklin Kettering
Offline
Recently stumbled upon this thread after migrating to UZBL and needing an adblock solution.
Was a cinch to setup, easily customizable, and if there is a performance hit I'm having a hard time perceiving it.
Nice work!!!
I'm glad you find it useful! Do note that it is not a perfect solution. Unlike Adblock* it can't catch the text ads in Gmail, for instance, since those adds come from the same domain as Gmail itself (and thus blocking them would block Gmail as well!). Perhaps with the new NPTables coming into the kernel, there could be a way to make use the same sort of regex parsing that Adblock uses to be able to create permit the same sort of flexibility at an OS-wide level (swoon!). In the meanwhile, though, please do keep using hostsblock and let us know about any bugs or patches you might have.
Check out hostsblock for system-wide ad- and malware-blocking.
Offline
Great script, I'm just surprised that none ever tried to use an alternative logfile path (or logging to stdout). The script just sets some defaults, redirects the output into default logfile path and THEN loads the config file...
Offline
Great script, I'm just surprised that none ever tried to use an alternative logfile path (or logging to stdout). The script just sets some defaults, redirects the output into default logfile path and THEN loads the config file...
This is somewhat by design, albeit I'm not sure I appreciate the logic behind it anymore. At one point I might have had issues with how the config file was formatted and sourced and wanted to make sure errors from that sourcing got dumped to where I wanted them. I'll put a re-ordering of these events in my TODO (which I hope someday I will get to), or feel free to submit a patch here or via github.
Check out hostsblock for system-wide ad- and malware-blocking.
Offline
lahwaacz wrote:Great script, I'm just surprised that none ever tried to use an alternative logfile path (or logging to stdout). The script just sets some defaults, redirects the output into default logfile path and THEN loads the config file...
This is somewhat by design, albeit I'm not sure I appreciate the logic behind it anymore. At one point I might have had issues with how the config file was formatted and sourced and wanted to make sure errors from that sourcing got dumped to where I wanted them. I'll put a re-ordering of these events in my TODO (which I hope someday I will get to), or feel free to submit a patch here or via github.
I might submit a patch after my exams, hopefully next week... The point is that with systemd it's quite common to have logging into stdout and let journald manage the output, so the script might be a little simpler.
Offline
gaenserich wrote:lahwaacz wrote:Great script, I'm just surprised that none ever tried to use an alternative logfile path (or logging to stdout). The script just sets some defaults, redirects the output into default logfile path and THEN loads the config file...
This is somewhat by design, albeit I'm not sure I appreciate the logic behind it anymore. At one point I might have had issues with how the config file was formatted and sourced and wanted to make sure errors from that sourcing got dumped to where I wanted them. I'll put a re-ordering of these events in my TODO (which I hope someday I will get to), or feel free to submit a patch here or via github.
I might submit a patch after my exams, hopefully next week... The point is that with systemd it's quite common to have logging into stdout and let journald manage the output, so the script might be a little simpler.
Good! I've been meaning to get around to including my systemd service file for hostsblock for some time, two, but haven't yet.
Check out hostsblock for system-wide ad- and malware-blocking.
Offline
I am pretty sure that this has been asked before, but at the moment my searching skills are not good enough to come up with any results. I was wondering what the differences are between hostsblock and hosts-update? I'm very unfamiliar with all this stuff so please bear with me here. The way I see it, hostsblock has the same functionality as hosts-update but a little more to it, such as the hostsblock-urlcheck script.
Am I right in assuming this?
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline