# Prerequisites: `doctl`, `curl` and `jq`
# See https://www.digitalocean.com/community/tutorials/how-to-use-doctl-the-official-digitalocean-command-line-client
# In this particular case, we are going to open the port 22 for ssh connection.
MY_IP=$(curl --silent ifconfig.io/ip) && doctl compute firewall add-rules $(doctl compute firewall list --output=json | jq -r '.[].id') --inbound-rules "protocol:tcp,ports:22,address:${MY_IP}/32"