使用 MongoDB Atlas 的时候经常出现连不上,报 Error: querySrv EREFUSED 错误的情况。解决方法是添加 DNS。

How to fix 'Error: querySrv EREFUSED' when connecting to MongoDB Atlas?

For some reason the dns server did not return srv records, changing the dns server to one that returns those records fixed the problem. (I used https://use.opendns.com/ to fix the it)

Mac OS X Go to System Preferences. Click on Network. Select the first connection in your list and click Advanced. Select the DNS tab and add 208.67.222.222 and 208.67.220.220 to the list of DNS servers. Click OK

heroku login 命令在调起浏览器登录后返回 "invilid ip address" 错误. 原因是开启了 MFA 多步验证, 解决方法是直接把 API Token 保存到 ~/.netrc 中。

IP Address Mismatch on signing into Heroku CLI

The accepted answer (run heroku login -i) doesn't work for accounts with MFA enabled. What I did instead was to reveal my account's API key and put it into ~/.netrc like so:

machine api.heroku.com login <MY_EMAIL> password <API_KEY> machine git.heroku.com login <MY_EMAIL> password <API_KEY>

And voila! I can now use the CLI. This worked for me with Google CloudShell.