杂项
在基于 Intel 的 Mac 上,您可以在启动时使用 Command-R 来重新安装最新安装的 macOS 的当前版本。
<img src="data:image/png;base64,******" />
Command Line Tools (CLT) for Xcode
xcode-select --install
Ubuntu 22.04 LTS 关闭 AppArmor 和 Uncomplicated Firewall
sudo systemctl stop apparmor.service
sudo systemctl disable apparmor.service
sudo ufw disable
Visual Studio Installer
# 安装详细信息
# 单个组件
Windows 10 SDK (10.0.20348.0)
MSVC v143 - VS 2022 C++ x64/x86 生成工具(最新)
使用 Python3 虚拟环境在线开发和离线部署
##################################################################
python3 -m venv .venv
source .venv/bin/activate
# python3 -m pip install -U pip setuptools
python3 -m pip freeze > requirements.txt
python3 -m pip download -r requirements.txt -d .packages
deactivate
rm -rf .venv
##################################################################
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt --no-index -f .packages
deactivate
rm -rf .packages
##################################################################
嵌入Python
# 将嵌入的发行版解压缩到应用程序安装的子目录中
7z x python-3.11.9-embed-amd64.zip -o*
del python-3.11.9-embed-amd64.zip
cd python-3.11.9-embed-amd64
# 将 python311._pth 文件的内容修改为如下所示
############################################
python311.zip
.
..
# Uncomment to run site.main() automatically
import site
############################################
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py --no-warn-script-location
del get-pip.py
cd ..
# Example (Windows): playwright
python-3.11.9-embed-amd64\python -m pip install -U playwright
set PLAYWRIGHT_BROWSERS_PATH=ms-playwright
python-3.11.9-embed-amd64\python -m playwright install chromium
rmdir /s /q ms-playwright\.links
python-3.11.9-embed-amd64\python -m playwright codegen
# Example (Linux): playwright
python3 -m pip install -U playwright
PLAYWRIGHT_BROWSERS_PATH=$PWD/ms-playwright python3 -m playwright install chromium
rm -rf ms-playwright/.links
Python3 Script Template
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import urllib3
try:
import simplejson as json
except ModuleNotFoundError as e:
import json
urllib3.disable_warnings(category=urllib3.exceptions.InsecureRequestWarning)
def main():
print('[+] Good')
print('[-] Bad')
print('[!] Information')
print('[~] Processing')
print('[?] Question')
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt as e:
sys.exit(0)