管理 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 资源,除了使用浏览器端的控制台(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 CLI 可以直接使用 aws
命令进行配置:
aws configure
或者,可以手动创建证书文件,文件默认位置是 ~/.aws/credentials
文件内容:
[default]
aws_access_key_id=YOUR_ACCESS_KEY
aws_secret_access_key=YOUR_SECRET_KEY
如果要设置默认地区(Regoin),示例:
举例:
from bs4 import BeautifulSoup
html="""<div>Hello<br>
<br> World!</div>""" # 示例HTML
soup = BeautifulSoup(html, 'html.parser')
elem = soup.select_one('div')
纯文本。
旧版。只是去除了 HTML tag,留下了空白字符,包括换行符。
新版。去除了 HTML tag 、换行、多余的空白字符。
print(elem.get_text())
# 输出:
'''
Hello
World!
'''
elem.stripped_strings
以迭代方式返回每个HTML tag 间的文本,但会过滤掉多余的空白字符。
发生环境:macOS V11.1 (Big Sur)
发生的问题:brew update
时报错,
Error:
homebrew-core is a shallow clone.
homebrew-cask is a shallow clone.
To `brew update`, first run:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
...
按照提示执行git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
,而往往等待很久后,还总是失败。
报错内容类似:
fatal: unable to access 'https://github.com/Homebrew/homebrew-core.git/': transfer closed with outstanding read data remaining
虚拟环境的文件夹放在哪合适?
习惯一:放在各项目的目录下
可以随项目一起移动。IDE的项目配置文件不用修改。
虚拟环境文件夹的名称建议统一,例如取名.env
。
1,执行 brew 命令时,卡在 Updating Homebrew...
这是在检查和更新 brew 自身无法连接到仓库源。
2,安装软件包时下载速度缓慢
同上。
先执行命令 brew doctor
,根据提示修复问题。
通常是由于国内网络问题导致,可以将 homebew 的仓库源改成国内镜像源来解决此问题。
参见 Homebrew 修改和复原仓库源
有时我们希望加密自己写的VBA代码,保护自己的劳动成功不被窃取。
对代码进行混淆虽然保护程度有限,但是一种容易实现和容易使用的方式。 尤其对于 Excel 宏来说不能编译,只能用源码。