Python 字典排序
Sort a dictionary by value
依据字典的值进行排序
AWS Lambda 程序中获取当前函数所在地区
Node.js
let region = process.env.AWS_REGION
Python
公共 DNS 服务器地址
Public DNS
几大公共DNS服务器的IP地址
| 提供商 | 主 DNS | 辅 DNS |
|---|---|---|
| Cloudflare | 1.1.1.1 | 1.0.0.1 |
| 8.8.8.8 | 8.8.4.4 | |
| 阿里云 | 223.5.5.5 | 223.6.6.6 |
| Control D | 76.76.2.0 | 76.76.10.0 |
| Cisco OpenDNS | 208.67.222.222 | 208.67.220.220 |
Mixin 如何查询网络上资产的ID、符号等信息
如何获得资产ID(asset id)、货币符号(symbol)等等信息?
由于Mixin Network 中有多条区块链的总计上千种资产,大多数一般也用不到。获取部分常用的,或者查询某个具体的资产即可。
Python 计算 MD5 散列值
def get_md5_string(content)->str:
"""
- content: bytes or string
"""
m = hashlib.md5()
if type(content) == bytes:
m.update(content)
elif type(content) == str:
m.update(content.encode())
else:
return None
return m.hexdigest()进程与线程
AWS CLI 命令行工具
管理 AWS 资源,除了使用浏览器端的控制台(console)。也可以使用命令行。
官方文档入口: https://docs.aws.amazon.com/cli/latest/reference/
安装
目前已经是 AWSCLI V2稳定版(2021-04)
如果之前安装过 AWSCLI V1,先完成卸载掉。参考:Installing, updating, and uninstalling the AWS CLI version 1
AWS 在本地配置AWS资源访问授权
如果本地安装了 AWS CLI 可以直接使用 aws 命令进行配置:aws configure
或者,可以手动创建证书文件,文件默认位置是 ~/.aws/credentials
文件内容: