Why is Windows not reading my hosts file? [closed] - windows

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
Improve this question
I'm having a hard time geting Windows to take into account a new entry in my hosts file.
I tried adding this line:
199.229.249.151 models.db
To the hosts file found here:
c:\windows\system32\drivers\etc\hosts
When I save the file and try to reach the host with a browser, I'm getting a "host not found" error. I tried setting the "read-only" file attribute to the hosts file -- same result. I tried flushing the DNS cache, but nothing changes.
It seems Windows is not reading my modified hosts file at all, or at least, not taking in account my new entry.
What am I forgetting? What else could I try?
Are there specific requirements or rules to follow to ensure that Windows can always properly detect a change to the hosts file, read and parse its contents, and immediately take into account changes when using a browser or ping to test via the command-line?

I ran into same issue and after checking lot of things, the issue ended up being the line endings, I had change the line endings to Windows format and it worked.

I ran into this problem once, The problem is Windows ignored the host file and I fixed it by:
Copy the hosts file from C:\Windows\System32\drivers\etc to somewhere like Desktop
Remove the hosts file there
Copy the copied hosts file back to C:\Windows\System32\drivers\etc
I don't know why but it's fixed.

Automatic proxy server configuration scripts override the hosts file. To disable the automatic configuration script:
Press Windows key and type Configure proxy server
Click LAN settings
Uncheck Use automatic configuration script

Try ping localhost.
if it works, then something wrong with ip or your entry. If it does not, hosts file is bad. Pay attention where it goes. It might try ipv6. That still means that hosts file is broken.
Remove everything from it and leave only your entry or localhost. Single line only, nothing else at all! Not even line breaks. Just stash it aside somewhere until problem is resolved.
If it works, then there's an entry that breaks things. Try converting line endings to windows format, might help. Usually it's white space that messes with things because it's hard to notice.

Open Notepad > Start Open Notepad > Open as administrator.
Save it at some location as ANSI hosts file (Not .txt extension, select all files and name it as hosts)
Copy all the hosts files entries and save it.
Finally copy the hosts file copied at the desired location say : C:\tempfolder\hosts to c:windows\system32\drivers\etc folder.

I encounter the same issue, and find my host is unicode, after change it to ANSI, the issue is fixed

Related

Is it possible to set up a Vagrant sync folder with variable host/source directory, possibly from config file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 months ago.
The community reviewed whether to reopen this question 8 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I'm trying to set up a Vagrantfile that will mount a code base on the developer's machine. The place the developer puts the codebase on their machine could be anywhere they like based on how they like to organize their machine. If I offer up this Vagrantfile to set up a small development and test environment that closely resembles production, I'd like them to be able to set the location of their code without having to edit the Vagrantfile (leaving it unchanged in source control).
Is there a way to make the Vagrantfile look somewhere else for a value to use as the host directory path for a sync folder?
I tried asking on the HashiCorp forum (might require login) yesterday, but haven't gotten a response yet and it seems like a low traffic site. I'll keep checking there in case a solid answer comes back, but I'm hoping someone here has dealt with this before. Thank you for any help.
You can customize additional synced folders with an additional line of code in the Vagrantfile described here:
config.vm.synced_folder '<host_path>', '<guest_path>'
This solves the problem of additional customized synced folders. However, you also stated you desired to customize this per user based on a config file. You can accomplish this with basic Ruby. We will assume the config file is YAML like:
# config.yaml
---
host_path: '/path/on/host'
guest_path: '/path/on/guest'
Then we can read in the file with normal Ruby and utilize its key-value pairs as per normal. This assumes the file is in the same directory as where vagrant commands are being executed; otherwise the code will need to be customized further:
require 'yaml'
paths = YAML.load_file('config.yaml')
config.vm.synced_folder paths['host_path'], paths['guest_path']
The code can also be easily modified for different config file formats.

You require permission from "Myself" to delete folder - how to fix [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm trying to delete a folder as an administrator, but I get the message "You require permission from UserAdam to delete folder". The problem is, I am logged on as UserAdam! I've tried changing the owner to Administrator to no avail also.
I ran into the same problem: tried to delete a folder (as admin), but got an error message "You need permissions from MYCOMPUTER\Admin ..." Somehow this worked:
I just went into the folder and deleted everything inside. Now when I try to delete the folder, it works fine.
Not sure why, but it seems like you found a similar solution. However, there's no need to use FileAssassin, just simply highlight the folder contents and delete like normal.
I had the same problem, and I found a fairly simple fix that hasn't been mentioned yet and probably has the best chance of working.
Simply give full access to "Everyone" in the file's properties, then delete it right after.
To change the file's access, as administrator: open the context menu and go Properties -> Security -> Advanced. This should bring up a new window that lists multiple users and their access to the file/folder, specifically Everyone. Select Everyone and click edit. In the following menu, select Full Control, then click OK.
The file should now be accessible to everyone- including you- allowing it to be deleted.
This worked for me:
Open command prompt as administrator
Execute rd /S /Q "P:\Ath\To\Directory"
I got no error and my folder was succesfully deleted.
To add some additional detail, in the case of needing permission from yourself, It's likely that you currently have an application that is using a file/ has a lock on that folder/files inside that will throw an error.
Closing relevant applications may remedy this, if not a restart will clear all the file locks which might free it.
If neither of those things work then the ACL permissions on the folder are probably malformed and corrupted somehow
If you have the project open in Visual Studios, close out of it and then delete the file.
Had this problem today and didnt see this answer anywhere
One important "fix" for this issue which must be mentioned:
Try rebooting your machine first!
In some cases this is capable of fixing user control issues, where a file belongs to the current user, yet the current user is unable to change access or remove the file, due to "Access denied".
I think its a bug or something. When the file is in use (It's open in sublime text or maybe some other text editors) it won't say file in use. Instead, it will say you don't have permission. If you don't know what it's open in, logout and it should be deletable. (At least that's what happened to me)
If you tried changing the permissions to 'everyone' for the folder through the security tab and it still asks for "myself"'s permission, then there must be files or folders inside this folder whose permissions need to be changed too. I just found out this, changed the permissions and now happily deleted the troublesome folder.
I had the same issue and I had to enable inheritance.

Automatic FTP deploy: is there any automatic / programmable tool available? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I need this
Watch a dir content
When dir content change
delete a specific ftp folder
upload all dir content to the same ftp folder
I'm totally unaware of best way to accomplish this task.
I'm looking for suggestions / ideas.... gulp? grunt? node? nope :) ?
Actually I know no build tools. So before try/fault with every single options I ask you for suggestions.
EDIT: Please take note that I'm asking for a Continuos Deployment tool able to watch for file changes and to upload to FTP.
I cannot choose to change FTP ... I'd only change job
What you need is a Continuous Deployment solution. FTP is not necessarily what needs to be done. You haven't mentioned a technology stack, but if you were (for example) working in Visual Studio, you can easily setup continuous deployment to an app service through Azure integrations. That way, whenever you have the project open in VS, if you make code changes and save them they are uploaded to your app.
You can read about app service CD on Azure here
There are, of course, many different continuous deployment solutions available to you. This was a specific example I'm a little more well versed with. Here is a list of other solutions, each with their own sets of functionality. If you do your research, I'm sure you'll find what you need (rather than write a script to do the directory monitoring and FTP for you)
The user case you have described is unique, thus you will not find an already build solution where you can simple run it and be done. You will need to create your own.
Watch directory.
This can be translated into "your code needs to be aware of file upload". This can be achieved via "notification" being pushed onto your code or your code pulls "notification" on its own.
Sadly, push from FTP Server will not work, as (to my knowledge) no FTP Server supports a push notification on file upload. To understand what I mean here, think of SVN post-commit hook.
The easiest to make pull is to tail FTP Log and look for STOR command, match your watch directory (via regexp) and on match execute bash/PHP or any other script to make step (2). Step (2) is a handful of ftp client commands.
For PHP:
Remove directory: http://ee1.php.net/manual/en/function.ftp-rmdir.php
Upload a file (in comments there are recursive examples to upload directory and
it's content): http://ee.php.net/manual/en/function.ftp-put.php

Filezilla removes line breaks on php files [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I stop Filezilla changing my linebreaks?
For some reason Filezilla sometimes removes line breaks on my php files making the code appear on a single line giving me a bunch of errors when I upload my projects, I was looking around and changed my transfer type to Binary but I still have the same issues, downloaded CuteFTP as well but same problem.
Does anyone know what can I do to fix this?
Thanks in advance!
EDIT: Now that I check, when I upload the files to my hosting they look in one line as well, but it doesn't give me any errors, the problem is when I upload to my clients host, could it be some configuration on the hosting or something?
change the "Transfer" to "Binary" (Do not keep it as a "Auto"). Restart Filezilla and upload files as it is.
Well, I managed to solve my problem, I dont exactly know how I just deleted the folder, uploaded as ASCII again, changed to Binari, restarted Filezilla, deleted the files again, and re-upload it as Binari again. For some reason it works now, maybe you have to restart Filezilla to apply the changes correctly.
Sounds like it may not be the FTP that is entirely the issue. If you're saving these files using the wrong encoding, this undesired result can be achieved. What program are you saving these files in?
If you have a file on the server in question that is formatted properly, download it with the FTP programs, then upload it without re-saving it. Check the downloaded copies and the uploaded copies to see if the issue is still occurring.

How do I make TortoiseSVN ignore empty directories that have been removed from the repo? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 14 years ago.
Improve this question
I've got some directories that have been moved or renamed. The Linux command line SVN client ignores these directories. The TortoiseSVN plugin for Explorer shows them. If I delete them and update, they come back.
All of the file movement and deletion has been done using the Linux SVN CLI tools. When doing an 'svn update' or even a fresh 'svn co' on a Linux system, these empty directories are not shown.
When doing a fresh checkout using TortoiseSVN, the empty directories are created, even though they don't exist in the HEAD revision anymore.
How can I make them go away?
Sounds like a client problem. Unless I'm misreading you, your SVN manipulations were correctly done.
Several options:
your client is set to get the wrong revision
you client is somehow running into a cache of some sort (are you running SVN over port 80?)
someone has something fancy set up on the server like 2 repos mirroring each other but badly.
Only the first one seems likely to me. What I'd do is figure out what URL the linux side is using and do a fresh checkout on the Windows side with that to a new location and specifically check to make sure the revision is set to head. If that doesn't work, I don't known what the issue could be. If it does, it limits the problems a lot.
p.s., just had a thought, failing the above try a revert to the head revision. I don't think it will work but...
I ended up deleting the directories in the Windows working copy and now the directories are gone. No idea why that was necessary.
Closing question...

Resources