Maximum length of the textual representation of an IPv6 address?

45 characters. You might expect an address to be 0000:0000:0000:0000:0000:0000:0000:0000 8 * 4 + 7 = 39 8 groups of 4 digits with 7 : between them. But if you have an IPv4-mapped IPv6 address, the last two groups can be written in base 10 separated by ., eg. [::ffff:192.168.100.228]. Written out fully: 0000:0000:0000:0000:0000:ffff:192.168.100.228 (6 … Read more

How to get client’s IP address using JavaScript?

I would use a web service that can return JSON (along with jQuery to make things simpler). Below are all the active free IP lookup services I could find and the information they return. If you know of others, then please add a comment and I’ll update this answer. Abstract let apiKey = ‘1be9a6884abd4c3ea143b59ca317c6b2’; $.getJSON(‘https://ipgeolocation.abstractapi.com/v1/?api_key=’ … Read more

How to get a Docker container’s IP address from the host

The –format option of inspect comes to the rescue. Modern Docker client syntax is: docker inspect -f ‘{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ container_name_or_id Old Docker client syntax is: docker inspect –format ‘{{ .NetworkSettings.IPAddress }}’ container_name_or_id These commands will return the Docker container’s IP address. As mentioned in the comments: if you are on Windows, use double quotes ” instead … Read more

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