What directory did you save the script in? Home, I'm guessing, and also guessing that's not in your PATH.
If you put it in ~/bin it will get found. (After you start a new shell - one of the bash initialisation scripts add ~/bin to your path if it exists.)
Announcement
Collapse
No announcement yet.
Script to automate building an adblocking hosts file
Collapse
This topic is closed.
X
This is a sticky topic.
X
X
-
Just created SR's script and ran it and replaced my /etc/hosts file accordingly. Rebooted. Browsing does indeed seem more responsive - snappier. Cool.
Note: I at least, could not execute the script by just typing gethosts. Kept getting "gethosts: command not found". Executing it with
Code:./gethosts
- Top
- Bottom
Leave a comment:
-
Nope. I plan to add the extra functionality discussed here: KDialog and an easy-on-off mechanism at least. A relatively simple tailoring mechanism like what you described earlier shouldn't be too difficult, either.
Alas, it's easy to get distracted! I have some air travel coming up, and Alaska Air has wi-fi on all planes now, so perhaps I can put those five hours on SEA-DCA to good use, eh?
- Top
- Bottom
Leave a comment:
-
Have you updated this one lately?
GG's intergalactic hitchhiking not withstanding of course...
...don't forget your towel Jerry!
- Top
- Bottom
Leave a comment:
-
Originally posted by GreyGeek View Post(I hadn't noticed that "two hour" thing last November...)
- Top
- Bottom
Leave a comment:
-
Ya, I'll get over it. Just a small case of brain envy!
(I hadn't noticed that "two hour" thing last November...)
- Top
- Bottom
Leave a comment:
-
Originally posted by SteveRiley View Post....
So I've spent the last couple hours teaching myself bash scripts and especially the handy little sed utility. ...
Tell me again what planet you are from .... I forgot!
Thanks for the fish!!! I'm going to eat it!
- Top
- Bottom
Leave a comment:
-
Jeez, I was not aware that adblock+ was eating so much RAM... thanks for the script Steve. +1
- Top
- Bottom
Leave a comment:
-
Re: Script to automate building an adblocking hosts file
In my case - I'm using multiple host files tailored to the user and creating a login-time host file based on individual users. I use a base file called hosts.local and then each user has .hosts.bad in their home. At log in the .local file is added to the .bad file as /etc/hosts.
The nice thing about moblock is being able to turn it off when needed. The above method makes it more difficult. However, I like that it doesn't use ram or cpu time.
- Top
- Bottom
Leave a comment:
-
Re: Script to automate building an adblocking hosts file
I forgot to include the link to the Kdialog Tutorial
Last edited by Snowhog; Jun 12, 2013, 12:06 AM.
- Top
- Bottom
Leave a comment:
-
Re: Script to automate building an adblocking hosts file
Originally posted by GreyGeekPerhaps a kdialog gui and also include the option totemporarily disable the blocking hosts file (sudo mv, then sudo mv back)
- Top
- Bottom
Leave a comment:
-
Script to automate building an adblocking hosts file
Originally posted by SteveRiley....
Besides the VM integration, is there anything else you'd like to see?
What you have is, for most people, pretty inclusive. It is for me, anyway.
Perhaps a kdialog gui and also include the option totemporarily disable the blocking hosts file (sudo mv, then sudo mv back)
Code:Usage: kdialog [Qt-options] [KDE-options] [options] [arg] KDialog can be used to show nice dialog boxes from shell scripts Generic options: --help Show help about options --help-qt Show Qt specific options --help-kde Show KDE specific options --help-all Show all options --author Show author information -v, --version Show version information --license Show license information -- End of options Options: --yesno <text> Question message box with yes/no buttons --yesnocancel <text> Question message box with yes/no/cancel buttons --warningyesno <text> Warning message box with yes/no buttons --warningcontinuecancel <text> Warning message box with continue/cancel buttons --warningyesnocancel <text> Warning message box with yes/no/cancel buttons --sorry <text> 'Sorry' message box --error <text> 'Error' message box --msgbox <text> Message Box dialog --inputbox <text> <init> Input Box dialog --password <text> Password dialog --textbox <file> [width] [height] Text Box dialog --textinputbox <text> <init> [width] [height] Text Input Box dialog --combobox <text> item [item] [item] ... ComboBox dialog --menu <text> [tag item] [tag item] ... Menu dialog --checklist <text> [tag item status] ... Check List dialog --radiolist <text> [tag item status] ... Radio List dialog --passivepopup <text> <timeout> Passive Popup --getopenfilename [startDir] [filter] File dialog to open an existing file --getsavefilename [startDir] [filter] File dialog to save a file --getexistingdirectory [startDir] File dialog to select an existing directory --getopenurl [startDir] [filter] File dialog to open an existing URL --getsaveurl [startDir] [filter] File dialog to save a URL --geticon [group] [context] Icon chooser dialog --progressbar <text> [totalsteps] Progress bar dialog, returns a D-Bus reference for communication --getcolor Color dialog to select a color --title <text> Dialog title --default <text> Default entry to use for combobox, menu and color --multiple Allows the --getopenurl and --getopenfilename options to return multiple files --separate-output Return list items on separate lines (for checklist option and file open with --multiple) --print-winid Outputs the winId of each dialog --dontagain <file:entry> Config file and option name for saving the "do-not-show/ask-again" state --slider <text> [minvalue] [maxvalue] [step] Slider dialog box, returns selected value --calendar <text> Calendar dialog box, returns selected date --attach <winid> Makes the dialog transient for an X app specified by winid Arguments: arg Arguments - depending on main option
- Top
- Bottom
Leave a comment:
-
Script to automate building an adblocking hosts file
Originally posted by oshunluvrI found an app called MoBlock which I've just begun playing with. Cross-platform and auto-updating and uses Blue Tack's hosts list or any others you want to config
And, alas, Bluetack is having some problems staying afloat...
Originally posted by oshunluvrAs far as Steve's tool - Add different settings for different users. As in: allow the adults to see 18+ sites, but the kids can't, everyone get ad-blocking, and Mom (for some strange reason) can't log into any shopping sites...<chuckle>
- Top
- Bottom
Leave a comment:
-
Script to automate building an adblocking hosts file
Not to crap on Steve's parade, I found an app called MoBlock which I've just begun playing with. Cross-platform and auto-updating and uses Blue Tack's hosts list or any others you want to config. Worth looking at.
As far as Steve's tool - Add different settings for different users. As in: allow the adults to see 18+ sites, but the kids can't, everyone get ad-blocking, and Mom (for some strange reason) can't log into any shopping sites...<chuckle>
- Top
- Bottom
Leave a comment:
Leave a comment: