There are two mistakes one can make along the road to truth...not going all the way, and not starting.
--Prince Gautama Siddharta
#ubuntuforums web interface
I tried that it didn't work. Tried it again and loaded dostounix (I think it was) as well and got it to work, but I have a few other questions as well.
How often should this script be run to update the hosts (weekly, monthly) or is it a one time deal?
Theres some conflicting posts in this thread about changing the host address to 0.0.0.0 instead of leaving them as 127.0.0.1 (or what ever standard is), some clairification on this? Safe to do? Evolution and other mail programs still work?
Any other reccomended hosts lists to add?
Thank you for your help and the info.
OK, glad you got it working.
It is the same list as is used for AdblockPlus.
Update, up to you. I think the list itself is updated either daily or almost daily. I personally update it (when I use a hosts file) every few months, sooner if I start seeing ads.
On a desktop you could use either 0.0.0.0 or 127.0.0.1 , on a server (which I would not advise) you should probably use 127.0.0.1.
You can use either, easy enough to switch if you have a problem.
Alternates to a host file would include a proxy (privoxy) or using adblock extensions with your browser.
There are two mistakes one can make along the road to truth...not going all the way, and not starting.
--Prince Gautama Siddharta
#ubuntuforums web interface
You say "when u use a hosts file" why would you ever need to do that, and how would you do that? Isn't the bennifit of using 0.0.0.0 faster site loading. Some recomended reading on using a proxy (its a totally new idea to me so I know nothing about it). I think what I meant by alternatives is additions to the host file such as know hijack sites and what not.
A hosts file is one option, other options include using a proxy (priviox / squid) and a third is extensions on browsers.
Each has advantages and disadvantages.
The disadvantage of a hosts file is that you need to manually keep the list up to date and you would have to keep it up to date on each desktop.
The disadvantage of browser extensions is that they apply to a single browser for a single user. The advantage is that these lists are typically more up to date and easier to customize per user.
For multiple users on a lan a proxy makes more sense, but it takes a bit more knowledge to set up and not all users may need the same content filtering.
You will have to decide for yourself what makes the most sense.
The
There are two mistakes one can make along the road to truth...not going all the way, and not starting.
--Prince Gautama Siddharta
#ubuntuforums web interface
I had to log in just to thank you for this. I work in IT and never even knew about this.(never got deep into the internet\web part of IT)....What's got me so happy is I often work off of a broadband card when I'm out and about. I hate the freezing,especially any video(youtube,etc.) but just accepted it....until today. It's like i just went from a modem 54k to a DSL connection. THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!
I need some help with this post I'm still finding my way around the terminal. The part I'm having trouble with is the mark A and mark B. How is this done, to mark certain lines, if possible a more detailed step by step? What directory, proper syntax to mark, or is that something that needs to be done with a text editor (the marking) to the hosts file it's self?
I'll try to explain this but explaining 'vi' commands is, shall we say, a bit problematic, mainly because there are two modes and the commands only work in one of the two modes but there is no visual clue what mode you're in. Also, most of us have 'finger memory' ... which means the commands are embedded in our finger muscles - so - actually 'explaining' the steps is problematic. Those of you who know vi well know what I mean by that; if you don't know vi well, you won't really understand why that is the case. You'll learn.
Lastly, it takes VASTLY more time to explain than the two or three keystrokes take to do ... so it' 'seems' confusing ... but it's really simple.
First off, once in vi, you MUST clearly get yourself in the command mode by using the ESCAPE key religiously! (Hit it once, hit it twice, and, for good effect, if you're uncertain, hit it thrice!). You only need to hit it once, but, I need to underscore the point that you must be in the right mode.
Also, you must be using a vi editor. There are lots of them. Vi, vim, Gvim, etc. (all will have 'vi' in the name somewhere). Or, just open up a terminal window and type:
Once you have an empty file "foo" open, import the hosts file:Code:vi /tmp/foo
The ":r" means to "read in" the file which follows "/etc/hosts".Code:ESCAPE:r/etc/hosts
Now, with your "j" key, move down (use the "k" key to move up).
At some point, hit "mx" (that will mark that spot as an "x"). Then use your "j" and "k" key again to go to a different spot and then hit "my". Now you've marked a spot as a 'y').
At this point, do whatever you want between those two spots, e.g., to sort:
:'x,'y!sort
Which, interpreted, is:
: = command
'x = from x
'y = to y
!sort = run the sort command
If things don't seem to work, hit the escape key a few times (and stay away from the 'i' key while doing commands.
Hope this helps.
Rock
Last edited by rocksockdoc; April 25th, 2011 at 01:45 AM.
Firstly Thank you for the help, slowly but surely I'm learning
I got it to work but a few more details I'd like. What is vi I guess I mean in contrast to an editor like gedit?
When I do a "mx" should a physical mark be made on the document (e.g. an x) something to note you did it?
Are there any other navigation keys other than j and k, as that could take a very long time to get to the bottlom of a large hosts file?
Save and exit, how do I do it?
I think thats it for now, again thank you for the help.
Bookmarks