22/05/2015

[Windows Server 2012] Add role fails

When trying to add a role (eg ActiveDirectory) to a Windows Server 2012 machine, I found that it would try to enable the components, but it would always fail in the end saying that the machine needed a reboot. It doesn't matter how many reboots you do, it will still fail.

The reason was that these services had to be enabled before trying to add the new role:


  • Server
  • Workstation
  • Computer Browser
  • TCP/IP NetBIOS Helper

[Linux] Check remote port connection

It may happen that you're working on a server with a user that has very limited capabilities. Sometimes you have no access to telnet:

telnet host port

nmap:

nmap -A host -p port

curl - it will complain that it did not receive data, meaning that it connected successfully:

curl http://host:port

netcat:

nc host port

 or whatever other tool you like to use. So what to do? Well maybe, you have access to bash:

cat < /dev/tcp/host/port

but I find this method not very reliable. Instead you might have access to Python as well:

python
import socket
test_conn=socket.create_connection(('host',port))