Assigning TCP/IP Ports for In-House Application Use

Ports 0-1023 are the Well Known Ports and are assigned by IANA. These should only be used for the assigned protocols on public networks. Ports 1024-65535 used to be called Registered Port Numbers (see rfc1700) but are now split into two areas (see rfc6335). Ports 1024-49151 are the User Ports and are the ones to … Read more

Use adb over tcpip in Android Studio?

After some testing Android Studio already supports this. You just need perform the following ADB commands, and now you can see the logcat and even wirelessly load your application. No USB cable needed! From: http://developer.android.com/tools/help/adb.html#wireless $ adb tcpip 5555 restarting in TCP mode port: 5555 Finding out IP address of Android device prior to running … Read more

Difference between push and urgent flags in TCP

They are two vastly different mechanisms. ###PSH and the PUSH function When you send data, your TCP buffers it. So if you send a character it won’t send it immediately but wait to see if you’ve got more. But maybe you want it to go straight on the wire: this is where the PUSH function … Read more

Abuse cURL to communicate with Redis

When you want to use curl, you need REST over RESP, like webdis, tinywebdis or turbowebdis. See https://github.com/markuman/tinywebdis#turbowebdis-tinywebdis–cherrywebdis $ curl -w ‘\n’ http://127.0.0.1:8888/ping {“ping”:”PONG”} Without a REST interface for redis, you can use netcat for example. $ (printf “PING\r\n”;) | nc <redis-host> 6379 +PONG For password protected redis you can use netcat like this: $ … Read more

How to know TCP connection is closed in net package?

That thread “Best way to reliably detect that a TCP connection is closed”, using net.Conn for ‘c‘ (also seen in utils/ping.go or locale-backend/server.go or many other instances): one := make([]byte, 1) c.SetReadDeadline(time.Now()) if _, err := c.Read(one); err == io.EOF { l.Printf(logger.LevelDebug, “%s detected closed LAN connection”, id) c.Close() c = nil } else { … Read more

What is the cost of many TIME_WAIT on the server side?

Each socket in TIME_WAIT consumes some memory in the kernel, usually somewhat less than an ESTABLISHED socket yet still significant. A sufficiently large number could exhaust kernel memory, or at least degrade performance because that memory could be used for other purposes. TIME_WAIT sockets do not hold open file descriptors (assuming they have been closed … Read more

How to open port in Linux [closed]

The following configs works on Cent OS 6 or earlier As stated above first have to disable selinux. Step 1 nano /etc/sysconfig/selinux Make sure the file has this configurations SELINUX=disabled SELINUXTYPE=targeted Then restart the system Step 2 iptables -A INPUT -m state –state NEW -p tcp –dport 8080 -j ACCEPT Step 3 sudo service iptables … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)