hostname

puppet node hostname

。_饼干妹妹 提交于 2019-12-02 23:39:14
I'm using puppet to configure servers. I want to print current machine (node) name in *.erb template. There is hostname variable, but this holds puppetmaster hostname. Is there any good reference/list regarding to this topic? Michal Bryxí Seems like I have miss-looked somewhere. I can get(print) node-hostname simply by invoking following code in *.erb template: <%= @hostname %> Edit: As of Puppet 3, using local variables (i.e. hostname is deprecated; Puppet 4 will remove support for them entirely. The recommended way is to use instance variables (prefixed with @ . So in this case, @hostname .

Java: Common way to validate and convert “host:port” to InetSocketAddress?

99封情书 提交于 2019-12-02 23:36:24
What is the common way in Java to validate and convert a string of the form host:port into an instance of InetSocketAddress ? It would be nice if following criteria were met: No address lookups; Working for IPv4, IPv6, and "string" hostnames; (For IPv4 it's ip:port , for IPv6 it's [ip]:port , right? Is there some RFC which defines all these schemes?) Preferable without parsing the string by hand. (I'm thinking about all those special cases, when someone think he knows all valid forms of socket addresses, but forgets about "that special case" which leads to unexpected results.) java.is.for

Kill background process when another process ends in Linux

纵饮孤独 提交于 2019-12-02 17:49:17
问题 I have a little question and I hope someone can help me because I can not find a proper solution. I want to resolve a hostname; while waiting for the result, I'd like to print a notification if it takes more than 30 seconds with shell script commands, preferably built-ins or ubiquitous system commands. I have a background process that sleeps and then prints a message; while sleeping, the process runs ping , but I can't figure out how to kill the background process after the ping finishes and

Can we set easy-to-remember hostnames for EC2 instances?

跟風遠走 提交于 2019-12-02 15:39:49
I'm running a couple of standard Fedora instances on EC2. I feel the public hostnames of the instances assigned by Amazon are too weird and hard to remember. I'd like to change them to something short (like red/blue/green/etc). Is there any draw back in doing this? And how do I set it up such that it persists after reboots? Thanks. Before you get started, try running hostname and hostname --fqdn and take note of what the responses are. You can edit /etc/hostname and set a hostname, which will stick around after rebooting. You can force the hostname to be "reloaded" by using hostname -F /etc

how to find host name from IP with out login to the host

雨燕双飞 提交于 2019-12-02 13:59:56
i need to find the host name of a UNIX host whose IP is known with out login to that UNIX host Use nslookup nslookup 208.77.188.166 ... Non-authoritative answer: 166.188.77.208.in-addr.arpa name = www.example.com. You can do a reverse DNS lookup with host , too. Just give it the IP address as an argument: $ host 192.168.0.10 server10 has address 192.168.0.10 King Thrushbeard Another NS lookup utility that can be used for reversed lookup is dig with the -x option: $ dig -x 72.51.34.34 ; <<>> DiG 9.9.2-P1 <<>> -x 72.51.34.34 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY,

Python socket.gethostbyname_ex() multithread fails

爷,独闯天下 提交于 2019-12-02 13:51:48
问题 I programmed a script that should resolve multiple hostnames into ip addresses using Multithreading. However, it fails and freezes at some random point. How can this be solved? num_threads = 100 conn = pymysql.connect(host='xx.xx.xx.xx', unix_socket='/tmp/mysql.sock', user='user', passwd='pw', db='database') cur = conn.cursor() def mexec(befehl): cur = conn.cursor() cur.execute(befehl) websites = ['facebook.com','facebook.org' ... ... ... ...] \#10.000 websites in array queue = Queue() def

Kill background process when another process ends in Linux

时光怂恿深爱的人放手 提交于 2019-12-02 10:34:28
I have a little question and I hope someone can help me because I can not find a proper solution. I want to resolve a hostname; while waiting for the result, I'd like to print a notification if it takes more than 30 seconds with shell script commands, preferably built-ins or ubiquitous system commands. I have a background process that sleeps and then prints a message; while sleeping, the process runs ping , but I can't figure out how to kill the background process after the ping finishes and the message keeps printing even if the ping ends prior to the 30 second time limit since this is part

Netty SSL hostname verification support

谁都会走 提交于 2019-12-02 05:53:20
From what I can tell, there is no 'flag' or config setting I can use to enable SSL hostname verification in Netty. Examples I've seen add custom implementations using the ChannelFuture returned by SslHandler.handshake(): ChannelFuture handshakeFuture = sslHandler.handshake(); handshakeFuture.addListener(new ChannelFutureListener() { public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { // get peer certs, verify CN (or SAN extension, or..?) against requested domain ... I just want to make sure I'm on the right track here, and that I'm not missing a way

Hostname not resolving to local IP address

懵懂的女人 提交于 2019-12-01 22:50:08
I am running a Windows 8 VM inside of vmware Fusion. It runs inside a Mac running OSX 10.10 (Yosemite). The VM has a computer name of "Proud". When I ping the VM from within itself, i.e. ping -a 192.168.0.138 I get a response like: Pinging Proud [192.168.0.138] with 32 bytes of data: Reply from 192.168.0.138: bytes=32 time<1ms TTL=128 However whenever I ping Proud from Yosemite, i.e. ping Proud I get a response like: PING proud (199.101.28.130): 56 data bytes 64 bytes from 199.101.28.130: icmp_seq=0 ttl=46 time=418.646 ms The VM is using bridged networking. Why does Proud resolve to that IP

Nginx reverse proxy, only allow connection from hostname not ip

ε祈祈猫儿з 提交于 2019-12-01 22:08:23
问题 Is it possible to allow only users typing in xxxxxx.com (fictive), so they should make a DNS-lookup and connect. And block users who uses my public ip to connect ? Configuration: server { listen 80; return 301 https://$host$request_uri; } server { listen 443; server_name xxxxxxx.com; ssl_certificate /etc/nginx/ssl/server.crt; ssl_certificate_key /etc/nginx/ssl/server.key; ssl on; ssl_session_cache builtin:1000 shared:SSL:10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!eNULL