hostname

Getting IP addresses for hostnames using nslookup in Powershell

我只是一个虾纸丫 提交于 2019-12-06 06:33:12
问题 I am new to Powershell scripting and I need to write one script. I have a list of server hostnames and I need to get IP addresses of those servers and write the results in a file. The hostnames are one column in Excel spreadsheet but I can format them into anything (csv, simple txt file with one hostname per line etc.). I would like to format the output the way there is a hostname of the server and its IP address per line (so there are multiple lines in case the server has more than one IP).

How to get the user set computer name using python in MacOS Sierra/High Sierra

人盡茶涼 提交于 2019-12-06 06:04:50
问题 The question below has partly been answered, see the Solution section below. So I'm posting this partly to help others and also since the solution I have hasn't really solved the problem yet. Question So, the question is why the hostname as given by the following techniques (using python's platform and socket libs) gives different host names depending on which router you are attached to and why its also different to the computer name and also local host name. This is very mac specific too by

WinHttp doesn't work when hostname doesn't contains www. (error 12029)

五迷三道 提交于 2019-12-06 05:06:42
I am testing this winhttp example from http://msdn.microsoft.com/en-us/library/aa384270%28v=vs.85%29.aspx DWORD dwSize = 0; DWORD dwDownloaded = 0; LPSTR pszOutBuffer; BOOL bResults = FALSE; HINTERNET hSession = NULL, hConnect = NULL, hRequest = NULL; // Use WinHttpOpen to obtain a session handle. hSession = WinHttpOpen( L"WinHTTP Example/1.0", WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0 ); // Specify an HTTP server. if( hSession ) hConnect = WinHttpConnect( hSession, L"www.microsoft.com", INTERNET_DEFAULT_HTTPS_PORT, 0 ); // Create an HTTP request

Regex match a hostname — not including the TLD

落爺英雄遲暮 提交于 2019-12-06 03:31:52
I need to match a host name--but don't want the tld: example.com =~ /regex/ => example sub.example.com =~ /regex/ => sub.example sub.sub.example.com =~ /regex/ => sub.sub.example Any help with the regex? Thanks. Assuming your string is correctly formatted and doesn't include things like protocol [i.e. http://] , you need all characters up to but not including the final .tld. So this is the simplest way to do this. The trick with regular expressions is not to overcomplicate things: .*(?=\.\w+) This basically says, give me all characters in the set that is followed by [for example] .xxx , which

How to get device type from MAC or IP address?

可紊 提交于 2019-12-06 03:07:12
I am making a Device Discovery windows application in C#. Is this possible to know the device type if I have MAC address or IP address? device type means either it is computer or router or mobile or any other device? Note: HostName entry is not useful for it because Host Name is defined by User. for example i may assign "Nokia N70" name to my computer. Thanks in anticipation. You can get the manufacturer from the MAC address. In order to get any more information you'd need to do a port scan to do a 'fingerprint' of the device in question. Application such as NMAP use this approach. Non-spoofed

Setting up WAMP to run on LAN, including mobile access, iPhone

本小妞迷上赌 提交于 2019-12-06 01:01:28
I'm developing a CodeIgniter app on Win 7, using WampServer v2.0 - I've edited my local HOSTS file so that I can access it here: ht_tp://testdomain/ instead of ht_tp://localhost/testdomain/ to help make it work the same locally as it does when deployed live, with a line like this: 127.0.0.1 testdomain This set up is working fine when I access the pages in browser on the same PC. Now I'm developing some new pages for mobile use, e.g. iPhone, and I want to be able to view my site directly on the iPhone. The phone is connected to the LAN, and I've opened up port 80 on the PC. I want to be able to

C# Dns.GetHostEntry doesn't return names of mobile devices connected to WiFi

主宰稳场 提交于 2019-12-05 20:33:41
I have a windows form application in C# and I'm trying to get the host name of all the clients that I have in a list. Given below is a code example by ra00l from this link: GetHostEntry is very slow (I have a similar code made but this one is cleaner) private delegate IPHostEntry GetHostEntryHandler(string ip); public string GetReverseDNS(string ip, int timeout) { try { GetHostEntryHandler callback = new GetHostEntryHandler(Dns.GetHostEntry); IAsyncResult result = callback.BeginInvoke(ip,null,null); if (result.AsyncWaitHandle.WaitOne(timeout, false)) { return callback.EndInvoke(result)

hostname in certificate didn't match:<>!=<> WSO2 APIM

孤者浪人 提交于 2019-12-05 18:02:35
I have a https endpoint and I need to access it from wso2 API manager. (uses 1.10).I already added the certificate files to "client-truststore.jks" file. But now it gives an error as follows. hostname in certificate didn't match:<ip>!=<entry name>. I have already updated the axis2.xml file as follows also. <parameter name="HostnameVerifier">AllowAll</parameter> How can I solve this issue with WSO2 APIManager to access this https backend service The CN of the certificate should match with the hostname of the URL. You get above error when they don't match. 来源: https://stackoverflow.com/questions

centos修改主机名整理(勿喷)

廉价感情. 提交于 2019-12-05 14:24:38
1.临时修改主机名 显示主机名: spark @ master :~$ hostname master 修改主机名: spark@ master :~$ sudo hostname hadoop spark @master :~$ hostname hadoop PS:以上的修改只是临时修改,重启后就恢复原样了。 2.永久修改主机名 redhat/centos上永久修改 [root @localhost ~]# cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=localhost.localdomain GATEWAY=192.168.10.1 修改network的HOSTNAME项。点前面是主机名,点后面是域名。没有点就是主机名。 [root @localhost ~]# vi /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=master 这个是永久修改,重启后生效。目前不知道怎么立即生效。 想立即生效,可以同时采用第一种方法。 还有一个修改是: /etc/hosts 127.0.0.1 localhost.localdomain 127.0.0.1后面的那一部分。 deb/ubuntu上修改 : hostname localhost

Full URLs in Rails logs

て烟熏妆下的殇ゞ 提交于 2019-12-05 13:03:11
Is it possible to get the full URLs in the logs of a Rails application? Currently I'm getting something like: Started GET "/" for 127.0.0.1 at 2011-08-27 13:13:10 +0200 but I need to get: Started GET "http://localhost:3000/" for 127.0.0.1 at 2011-08-27 13:13:10 +0200 because this is an app where the domains are important. As of Rails 3.2.12, instead of monkey-patching before_dispatch or call_app, there is now a method that receives the request and returns the Started GET "/session/new" for 127.0.0.1 at 2012-09-26 14:51:42 -0700 bit. So you can instead override that method in your own logger or