News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

a local "hosts" file

Started by locche, July 04, 2010, 07:09:03 PM

Previous topic - Next topic

locche

Hiya
Just a general question: It would be nice to have a host file local to the individual user's account, configurable like the one in drivers\etc or something comparible. Anyone have a suggestion, experiences they care to share?

dedndave

you could easily employ a batch file to swap host files
i use one to temporarily "open" up the hosts file (i.e. replace it with the original one) for using Hulu   :P
that's because i have some of the advertisement sites blocked in HOSTS
if an ad won't load on Hulu, neither will the movie
when i am done with Hulu, i run the batch file again to "close" it

you could do something similar and put the batch files in the startup folder
there are other ways to accomplish this, of course, but you get the idea

locche

Thanks for the feedback dave. Nice idea w/the batch. Only I was considering the case, where a user w/restricted access can initiate a host file for the browser. Nothing dodgy here. The admin could arrange for windows or the browser ( if necessary ) to
look up this file instead of the host file. Hmm. Some script on this server keeps crashing Firefox 2. Cheers for the feedback

dedndave

i guess i still don't understand
if that script hangs FF2 for one user, i would think it would hang it for the other users, as well

i think there is a way to do what you are suggesting by using the group policy editor, though
it ends up being a registry entry that blocks a url, from what i remember

EDIT - with Firefox, you could also use the Adblock add-in
it can be used to block specific elements of a page from loading
you may have to poke around to find an older version of Adblock to use with Firefox 2 - i don't recall
i use the original "Adblock" with Firefox version 1.5.0.12
somewhere along the way, you had to move up to "Adblock Plus" for newer versions of Firefox
if you need the old one, let me know

GregL

The latest version of Firefox is 3.3.6.  You all need to upgrade.  :P

locche

Thanks. I've been using adblock for some time. The problem I have w/adblock- which I still use, is that it's always "updating". It's something I hate about Browsers in general, all the crp done behind your back. Try as I could the only way I found to close down fxfeeds - that script again - was w/the hosts file.  That's why I thought it would be nice to have say, a "local" file full of unwanted urls which you could "tell" windows to use in a jiff yet at the same time "remove" when you need trash access.   I like your idea, the only thing is I don't like using admin priv'd accounts. I have my 486 for that. But opera 4 has its quirks.  I also tried Opera 9, it's fast but like FF3, I don't "trust" it.  So ideally, we could have windows do the adblock for the user with limited priveledge in a flexible way.   Now that you mention it, I saw something w/restricting urls in - I think it was an old 98 book, could have been poledit. The solution however, should not lie with the application. Consider Foxit Reader for example. That lasted about 2 mins on my system. Update hungry and decides what you may or may not print. Thanks, Mom.  But I digress...  Cheers

Queue

I think Proxy Auto Configuration files can be set per user. If so, they can be used instead of a hosts fle, and they can be far more powerful than a hosts file (match URLs based on keywords and redirect them to 127.0.0.1, etc.).

Pretty much any browser from IE3 and newer supports proxy auto config files. Here's a really rough simple example to start you off:
function FindProxyForURL(url, host)
{
if (0
|| dnsDomainIs(host, ".cn")
|| dnsDomainIs(host, ".doubleclick.com")
|| dnsDomainIs(host, ".doubleclick.net")
|| shExpMatch(host, "205.180.85.*")
|| shExpMatch(host, "66.40.16.*")
|| (dnsDomainIs(host, ".overstock.com") && shExpMatch(url, "*/linkshare/*"))
|| (dnsDomainIs(host, ".amazonaws.com") && shExpMatch(url, "*/udm_img/mid*"))
|| dnsDomainIs(host, ".gator.com")
) {
return "PROXY 127.0.0.1:80";
}
else
{
return "DIRECT";
}
}

You'd save this as any arbitrary file name, let's say, proxy.pac (actual file name and extension don't matter). Then you'd go into your browser's settings and point the proxy auto config setting at the file. In IE6, you go to Tools, Internet Options, Connections, LAN Settings..., CHECK ''Use automatic configuration script'' and set the file like so: file://c:/windows/proxy.pac

Opera (from my experience) automatically picks up the PAC file assigned in IE for its own use. No clue if other browsers handle it automatically.

If you do use a PAC file for IE, you also need to go to Tools, Internet Options, Security, Local intranet, Sites.., and UNCHECK ''Include all sites that bypass the proxy server'' AND edit the following registry entry:
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings]
"EnableAutoProxyResultCache"=dword:00000000

I know, a little tedious to set up, but I think proxy auto config settings are entirely per user and are far more powerful than a hosts file.

Queue

mineiro

I think the old and eficient "proxomitron" help you in this journey. Not sure if it work in newer versions of windows.
Have an undocumented function called "exec".
regards.

locche

Now that's some helpful advice queue. Cheers :-) . I haven't used ie however, since a site told the OS to try and install Chinese Fonts. That was about the time of FF1, which needless to say didn't require any such fonts. Humorous guy. But a quick search +"firefox" +"proxy" +"hosts" found the relevant links. Zwar, an application based solution ( more work!) but nice. I will play about w/that. Proximotron does ring a bell, miniero, searchlores, perhaps. Thanks for the foodbrain.

dedndave

with regards to Adblock updating - turn that off   :P
in fact, i turn off automatic updates on every program i have

@Greg   :bg
i use Firefox 1.5.0.12 because it is fast and stable
and because it behaves the way it ought to with certain java scripts (using Sun Java 1.5.0.22)
if i update Firefox and Sun Java - they are bigger, slower, and don't work the way they should
when Firefox comes up with a version that works right, i MAY update - lol

i still use Adobe Acrobat 8.13
version 9's are bloated all to hell
but - man, they sure can put an advertisement on your machine more efficiently with 9   :bg

just because they come out with a new version of something doesn't mean i need or want it
XP is another example - i am very happy with XP MCE2005
in my opinion, it is the best 32-bit OS
that's because we've figured out how to make it do what we want
not to mention, there is probably more software that will run under XP than any other OS in the world
eventually, Windows 7 will overtake XP
by then, i expect to be too old to use a computer   :lol

another example: Yahoo Messenger version 10's
yahoo records all my internet history, whether messenger is running or not
then, when i open messenger and sign in - all that marketing info is uploaded to yahoo
of course, they sell the info and make money on it - i have no problem with them making money
i do have a problem with how deeply YM 10 installs itself on my machine
version 9's and earlier don't do this

all these companies are working hard to improve their profit margins
they are not working all that hard to provide more features or improve functionality

Queue

Quote from: locche on July 06, 2010, 02:42:26 AM
I haven't used ie however, since a site told the OS to try and install Chinese Fonts.
Just to be sure, you did understand that all browsers support proxy auto config files, right? I did give extra info for using one with IE, but they aren't exclusive to IE. I've only personally used them with IE and Opera, but they're a standardized feature of all major browsers.

Queue

locche

@queue, yes I did get that, thanks  I was indirectly sniping at iexplorer, that is to say, there are a number of quality sites, which, for whatever reason don't like the browser. I don't like those cookie.dat files, etc.. Pain in the arse to remove. 
@dedndave:  I do vaguely remember trying to shut them off, scanning about:cache and whatnot .  Whenever I start the browser - i use a blank page - the firewall reports whatever contacts the browser is trying to reach. Fxfeeds, adblock etc. Don't think I had any success w/the adblock. In general, I shut off all any automated updates. I hate them. But all that profiling, marketing, governments searching for lost tax revenue, etc.. it gets harder and harder. It reminds me of the vlc player, which is not bad. However: I remember after the install I put some video on, and it comes up with this sermon about respecting your privacy and never seeking the web without your consent. So I selected No, and a few seconds later the firewall reports it's attempting to access the web. Maybe a bug. Hmm.
I use Adobe Reader 5 and that suits my purpose.  My OS of choice remains 2000, no service packs. The only justification for an "upgrade" to XP would be if I were to use newer hardware. I do have XP Pro on one of the pcs. The console offers some improvements, like tasklist,-kill, and the multimedia library. But that's just me. XP is okay.  But that's it. When an OS jumps from
a 75mb to a 1.5gb install (xp to vista), from 32mg ram on a 486dx to a pIV w/2gb ram, that's pure vomit. But it isn't just Microsoft. Linux (the kernel) just gets more crap as well. They even put in some Google strain into it. Even little Minix has gone to pot ( from ver.2 (ran perfectly on the microchannel ps/2 laptop to ver 3 chokes the 64mgz P1) .
Basically a resource hungry web is forcing people to migrate. I mean, I had to trash a perfectly good RedHat 8 simply because Opera 4 on my 486 windows 3.1 was doing a better job depicting web sites than the browsers I had on the linux machine. I think one day we'll all regret ever having trashed the old machines.

dedndave

QuoteMy OS of choice remains 2000, no service packs

service packs and hotfixes (KB's) are a good thing
the problem is knowing which ones to install
there are more caveats than CPUID - lol

don't let the MS website automatically update your computer unless you want it to run like a slow dog
it installs several hotfixes at once (only one reboot) and isn't very careful about which order they are installed in
you would be better off to use autopatcher or something
autopatcher may install a few KB's you don't need, and you may not get all the ones you do need
but at least it puts them in some sensible order
and - you don't have to do 3 months of research to figure out which hotfixes apply to your machine

MichaelW

Doing without service packs may be OK if you're behind a firewall. Otherwise, connecting a system with known vulnerabilities to the Internet, even with a dialup, is just asking to get hammered.

eschew obfuscation

sinsi

Quotedon't let the MS website automatically update your computer unless you want it to run like a slow dog
You are joking right... :dazzled:
Light travels faster than sound, that's why some people seem bright until you hear them.