这是从listview中取消阻止任何网站的一些代码,但现在我想要取消阻止之前被阻止的网站.我怎样才能做到这一点?
String path = @"C:\Windows\System32\drivers\etc\hosts";
StreamWriter sw = new StreamWriter(path, true);
String sitetoblock = "\n 127.0.0.1 http://"+listView1.SelectedItems[0].Text+"";
sw.Write(sitetoblock);
sw.Close();
MessageBox.Show(listView1.SelectedItems[0].Text " blocked");
Run Code Online (Sandbox Code Playgroud) 我尝试使用以下程序运行程序:
~/mpich3/bin/mpirun --hostfile hosts_8_12.txt python simulation.py
Run Code Online (Sandbox Code Playgroud)
但是我得到这个错误:
[mpiexec@pomegranate] HYDU_process_mfile_token (utils/args/args.c:296): token slots not supported at this time
[mpiexec@pomegranate] HYDU_parse_hostfile (utils/args/args.c:343): unable to process token
[mpiexec@pomegranate] mfile_fn (ui/mpich/utils.c:336): error parsing hostfile
[mpiexec@pomegranate] match_arg (utils/args/args.c:152): match handler returned error
[mpiexec@pomegranate] HYDU_parse_array (utils/args/args.c:174): argument matching returned error
[mpiexec@pomegranate] parse_args (ui/mpich/utils.c:1596): error parsing input array
[mpiexec@pomegranate] HYD_uii_mpx_get_parameters (ui/mpich/utils.c:1648): unable to parse user arguments
[mpiexec@pomegranate] main (ui/mpich/mpiexec.c:153): error parsing parameters
Run Code Online (Sandbox Code Playgroud)
这是我的主机文件:
c00 slots=12
c01 slots=12
c02 slots=12
c03 slots=12
c04 slots=12
c05 slots=12
c06 slots=12 …Run Code Online (Sandbox Code Playgroud) 今天我开始在 Windows 上使用 MAMP PRO,它现在处于 alpha 阶段。但我试图让动态 DNS 工作,这似乎对我不起作用。
每次启动 MAMP PRO 时,都会出现以下错误:
MAMP PRO has detected that access to hosts file is blocked. MAMP PRO needs access to hosts file to work properly. It is probably blocked with Antivirus program or restricted user privillages. Please close MAMP PRO, set your Antivirus program or user privillages (so that access to hosts file is writable) and start MAMP PRO again.
Run Code Online (Sandbox Code Playgroud)
我确实尝试关闭我的防病毒软件,并且我确实为我机器上的每个用户设置了可写、可执行、可读等权限。
我还尝试以管理员身份运行 MAMP PRO。
任何想法和/或建议?
谢谢!
我正在使用Windows 7 Pro并希望在本地运行我的Web项目,但该URL www.localhost.com不起作用.
如果使用http://127.0.0.1:2710/default.aspx它有效.我检查了C:\Windows\System32\Drivers\Etc\hosts文件夹中的主机文件.如果我删除行:
# 127.0.0.1 localhost
# ::1 localhost
Run Code Online (Sandbox Code Playgroud)
没有什么变化.如何让www.localhost.com在我的机器上运行?
我每天都:
这里唯一的共同点是互联网连接所有这些主机:工作站和服务器.我可以在我的工作站上保持所有配置文件同步,并且可以在所有配置文件上运行X服务器.运行emacs的正确方法是什么?我不想牺牲任何功能.
在我的理想世界中,我可以在远程主机上键入"emacs foo.txt",并通过X转发发生一些魔术,以在我的工作站现有的emacs会话中显示该文件.
无解决方案
如果您对我的问题没有肯定的答案,请不要只是猜测.谢谢.
关于New Relic API,请参阅https://github.com/newrelic/newrelic_api,我想知道主机和实例之间的区别是什么。
基本上,我知道什么是应用程序,什么是服务器(显然)。我假设实例是应用程序的实例,即,如果我的应用程序在Heroku上运行,则每个实例将对应于一个运行我的应用程序的dyno。但是,什么是主机?主机和实例之间有什么区别?
谢谢,
-比利
更新
感谢您的回答!
因此,如果我理解正确,通常情况下,应用程序和实例之间的映射是1-to-n,即每个应用程序可以有1个或多个实例。同样,实例和主机之间的映射是n到m,即每个实例最多可以在一个主机上运行(在任何给定时间),但是实例分布在可用主机之间。同样,主机在服务器之间分布(例如,一对多)。是吗 (很抱歉,这听起来像是我说的是很明显的话,但是我对他们在New Relic上使用的术语不熟悉)
如果以上正确,如何从API获取实例-主机和主机-服务器映射?我可以看到如何获取应用程序-实例和应用程序-主机,但是其他两个呢?
再次感谢您的帮助!
在服务器上设置本地网站.该网站test.skien.kommune.no映射到127.0.0.1该站点在IIS中配置,我添加了一个绑定.一切都工作了一个星期,但今天我突然收到此错误消息:
The following error was encountered while trying to retrieve the URL: http://test.skien.kommune.no/
Unable to determine IP address from host name "test.skien.kommune.no"
The DNS server returned:
Name Error: The domain name does not exist.
This means that the cache was not able to resolve the hostname presented in the URL. Check if the address is correct.
Your cache administrator is webmaster.
Run Code Online (Sandbox Code Playgroud)
hosts文件已配置 '127.0.0.1 test.skien.kommune.no'
为什么不在主机文件中使用本地dns-mapping?
我正在尝试在VM上安装本地群集.当我打开Cloudera Manager时,有时主机运行状况检查显示为失败,错误消息基本上显示"DNS解析失败".有时HDFS服务显示为失败.我想在其他途径上有一些想法进行故障排除.我很确定使用hosts文件或DNS的某些东西很简单.我的操作系统是Ubuntu.
到目前为止,我已经编辑/ etc/hosts以获得运行ifconfig时获得的确切ipv4地址
10.2.0.15 michael-VirtualBox
Run Code Online (Sandbox Code Playgroud)
我删除了条目
127.0.0.1 localhost
我也重新启动了网络服务.我执行了命令
"python -c "import socket; print socket.getfqdn(); print socket.gethostbyname(socket.getfqdn())""
我回来了
127.0.0.1
localhost
我有以下 Ansible 主机文件:
# Contains the host mappings
[master]
m1.my-host.com ansible_host=192.168.0.100
[node]
n1.my-host.com ansible_host=192.168.0.102
n2.my-host.com ansible_host=192.168.0.103
[k3s_cluster:children]
master
node
[all:vars]
ansible_python_interpreter=/usr/bin/python3
Run Code Online (Sandbox Code Playgroud)
在我的剧本中,我说我需要像这样的有序执行:
---
- name: Setup hostname, users and groups
hosts: all
order: sorted
gather_facts: true
remote_user: myuser
become: yes
roles:
- {role: common, tags: ['host', 'system']}
Run Code Online (Sandbox Code Playgroud)
但当我运行它时,我看到以下内容:
TASK [Gathering Facts] **********************************************************************************************************************************************************************************************
ok: [n1.my-host.com]
ok: [n2.my-host.com]
ok: [m1.my-host.com]
Run Code Online (Sandbox Code Playgroud)
我宁愿期望它是 m1、n1,然后是 n2。是否知道为什么不遵守排序顺序?
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
Run Code Online (Sandbox Code Playgroud)
这是我的/ etc/hosts文件,但是ping的确无法解决,无法解决localhost.
当我添加时,它的工作就像ping gonjay一样
127.0.0.1 gonjay
Run Code Online (Sandbox Code Playgroud)
到我的主机文件.