#network Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
Bash Check If Port Is Open
Several ways to probe a remote port: nc (most portable), bash's /dev/tcp pseudo-device (zero deps), or curl. Pick by what's available.
Bash Wait For Service With Timeout
Block until a TCP port accepts connections, with a deadline. Used everywhere in docker-compose entrypoints — wait for the DB to be ready before running the app.
Bash SSH to Multiple Hosts in Parallel
Run the same command on a fleet of hosts. Three patterns: serial loop (simplest), GNU parallel (fastest), pssh (purpose-built).
Bash Get Public IP Address
Several free services return your public IP as plain text. Useful when scripts running behind NAT need to know what address the outside world sees.
Bash DNS Lookup (dig / host / getent)
Three options depending on what's installed: dig is most flexible, host is concise, getent uses the system's resolver and respects /etc/hosts.
PHP Find Open TCP Port
Probe whether a remote host:port accepts connections, with a configurable timeout. Useful for quick health checks in deploy scripts.
Bash List Listening Ports
`ss` is the modern netstat — faster, more readable, ships everywhere. Show only listening TCP ports with their owning process.