Planet DebugUself

November 14, 2021

zoom.quiet

如何安定进入 M1maxMBP

background

13年入的 MBP 坑, 当时 17吋 顶配, 在 MACAO 实体店拿的; 16年初突然不可用, (后来检查才发现, 是长期使用功率不匹配的电源才反复导致主板出问题) 急忙去 MACAO 新授权店拿了 13吋高配(i7,4核,16G内存,512G硬盘); 因为是主力开发/日常用机, 就没敢一直升级系统, 10.X 系列一直用下来;

到今年下半年, 明显撑不住了:

  • OBS 录制 720P 以上视频, 撑不住10分钟就崩溃
  • 腾讯会议本地录制, 30分钟的内容要转换20分钟
  • ffmpeg 进行视频处理, 几乎都是 0.42 倍率在进行
  • docker 容器一启动就要等待3分钟

如此种种已经开始干挠日常工作/学习/创作/…

怎么办? 磕金/升级呗…

忍了一年…

去年 M1 芯片 Air 一出来就想买的, 但是, 大家都说 M1 还不成熟, 各种软件都要等待兼容…

就忍着, 一直到10月, 一下子有了 M1pre/max, 性能又翻倍了, 立即入手: 14吋, M1max 10核, 64G 内存, 1T 硬盘;

等了快三周, 终于到手, 如何开始安定迁入?

goal

最短, 最平滑, 进入, 折腾最少

日常依赖其实并不多主要就几块儿:

  • 终端相关:
    • iTerm2 为界面
    • bash v4.4.12 配合 bash_it 定制日常环境
    • PyENV 管理多种 Python 运行时
      • conda 管理 Leo 安装运行时
    • RVM 管理多种 Ruby 运行时
    • NVM 管理多种 Node 运行时
    • ASDF 管理多种 Elixir 运行时
    • …以及各种 AliYun/Heroku/AWS/…依赖CLI 管理工具
    • 特别是 HomeBrew, 管理了超过200种 UNIX 实用工具
  • 浏览器相关:
    • WaterFox 安装使用传统 Firefox 插件, 以便查阅积累超过15年, 30+万网页的本地资源库 ~ 基于 Scrapbook 收集管理, 但是 Firefox 56.0 版本之后不再支持原有插件体系, 只能迁移到 水狐 继续
    • Vivaldi 进行日常工作管理, 因为内置 树状标签管理 又兼容 Chrome 扩展而且没有 Google 广告
    • Brave 进行日常探索学习, 也兼容 Chrome 扩展
    • Edge 进行日常资源管理, 比如团队仓库/公众号/云资源/…兼容部分 Chrome 扩展
    • Chrome 进行日常 Google 系工具使用, 核心就是 gmail
    • Chromium 进行日常系统测试, 专门用以走查 web 系统功能
    • 以上浏览器都需要关键拓展来确保日常最基础可用:
      • SwitchyOmega ~ 快速代理切换工具, 以便使用不同网络来访问有关资源
      • The Great Suspender Original ~ 自动将不活跃标签内存回收
      • Create Link ~ 快速形成 Markdown 格式网地址文本
      • Choosy ~ 快速将网址丢入其它浏览器/应用中加载
    • …以及部分终端中无头浏览器辅助进行爬虫开发
  • 开发相关:
    • XCode ~ 获得基本编译支持
    • Sublime Text 3 ~ 获得快速编辑支持
    • VScode ~ 获得综合开发支持
    • DBeaver ~ 获得数据库管理界面
    • Docker+VirtualBox ~ 虚拟主机支持
    • …以及其它42+以上开发支持工具
  • 媒体相关:
    • IINA+VLC 看视频
    • GIMP+Inkscape 进行图片处理
    • screenflow 进行视频编辑
    • …以及其它42+以上媒体处理工具
  • 系统相关:
    • muCommander ~ 日常双窗口资源管理, 通过快捷键提高文件管理效率, JAVA 实现可运行在所有系统中, 当年从 WindowsNT 平台开始就习惯了有关操作
    • Display Menu ~ 快速调节不同显示器分辨率
    • Lunar+Flux ~ 快速调节所有显示器亮度/对比度/…
    • aText ~ 快速管理自定义常用短语
    • iPic ~ 快速上传图片到图床, 获得 markdown 格式图片引用文本
    • Spectacle ~ 窗口布局快捷键支持工具, 可以高效安排多窗口排列
    • Bartender ~ 从2就开始付费使用, 现在已经到 v4, 可以将 menu bar 中应用图标管理, 折叠到子菜单中…
    • Caffeine ~ 便捷激活 mac 系统不休眠
    • …以及其它42+以上系统增强工具
  • 办公相关:
    • iWork ~ mac 味儿 Office
    • OpenOffice ~ linux 味儿 Office
    • WPS ~ 国产味儿 office
    • XMind+Freemind ~ 思维导图支持
    • yED+PlantUML ~ 流程图/架构图/… UML 味图谱支持
    • Axure+蓝湖 ~ 产品设计支持
    • 微信/企业微信/QQ/Lark/zoom.us/Slack/… ~ 工作协同用工具栈
    • …以及其它42+以上团队协作支持工具

以及所有涉及正版软件的许可证升级/配置/采购/…

还有以往形成各种工程簇, 在本地不同目录入口中, 形成的对应快速软链接

quickly

以上所有, 都人工进行重新配置的话, 目测至少得一个月, 才能陆续到位, 毕竟是以往多年尝试/配置/选择的成果;

如何简洁完成呢?

(周5收到, 周1 就应该全面完成迁移, 以便投入日常工作)

快速尝试了几个姿势:

  • 人工配置, 光是安装 iTemer2 进行基本配置:
    • 字体
    • 颜色
    • …etc, 就用了一小时
    • 那么多常用工具逐一配置到可用, 绝对无法简单完成
  • Time Machine ~ 常规推荐操作:
    • 以往专门配置了个 1T SSD 移动硬盘来进行备份
    • 先用 4小时, 完成最新一次备份, 涉及40G 数据的更新
    • 然后, 使用 迁移助理 ~ 死活无法发现这个非法 时间机器 ?
    • 也可能, 用 10.X 系统备份的数据, 无法识别为 12.X 系统兼容时间备份
  • rsync ~ 之前从 Windows -> Linux -> MAC 的异种系统迁移过程中立过大功
    • 用1小时, 将所有工作数据备份到另外移动硬盘中
    • 再开始尝试同步时, 想到这只能完成数据迁移, 最耗时的应用配置并没有涉及…
  • 冷静一下, 搜索官方文档, 才发现:
    • 将内容迁移到一台新的 Mac 上 - Apple 支持 (中国)
    • 迁移助理 这一实用工具有三种迁移姿势:
      • 从另一台 Mac 或是 Time Machine 备份中转送数据
      • 从一个 Window 机器获得数据
      • 发送数据到另一台 Mac
    • 老rMBP 保有所有正常使用环境和应用, 新 M1MBP 是目标机
    • 都打开 迁移助理
      • 老rMBP 选择 To another Mac
      • M1MBP 选择 From a Mac
      • 并明确对传送的帐号如何处理, 俺选择->创建新帐号
      • 然后点 继续 完成安全配对后, 即开始 点对点 传输
      • 当然, 要先确保在同一个网络中
    • 看起来可行, 开始:

80万文件

嗯嗯嗯…嘦10小时等一晩上就好,

果然:

༄ sudo du -hs *

111M    Shared
265G    zoomq
4.2G    zoomquiet

༄ who i am

zoomq    ttys004      2021-11-14 18:58

手工尝试时, 创建用户是 zoomquiet 仅仅完成 iCloud 主要数据同步, 而 zoomq 是从 linux 时代, 使用超过 15 年的帐号,

经过一夜自动转送, 合理同步了超过 450G 数据:

450+G

进入系统后发现, 基本所有习惯操作都可用, 只有少数几个要对应配置:

  • 关键的 WaterFox 无法打开 Scrapbook 收集的本地网页, 以及控制界面
    • 搜索后, 尝试安装对应 Waterfox Classic 2021.10 版本
    • 替代原先使用的 Waterfox Classic 2019.12
    • 只是, 专门为 M1 芯片开发的 Waterfox.G4.0.2.1.ARM 却也已经放弃了 FireFox 经典 XUL 扩展体系, 无法安装 Scrapbook 插件
  • Python 经常崩溃, 搜索后, 手工重建有关 openssl 两个核心模块的链接即可修复
  • HomeBrew 要对应升级, 发现有大量失败, 要求先升级 XCode
    • 正常升级
    • 并:
      • $ sudo xcode-select —install
      • $ sudo xcodebuild -license accept
    • 再来, 也就都流畅完成了

12G

甚至于, 原先在 老 rMBP 每次安装要编译半小时的 ffmpeg 也无缝自动完成升级:

10核 ffmpeg

这一下子就有 10核降重任 感觉了 ;-)

murmur

记要关键增补指令过程…

homebrew

$ 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

These commands may take a few minutes to run due to the large size of the repositories. 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

remote: Enumerating objects: 346864, done.
remote: Counting objects: 100% (346859/346859), done.
remote: Compressing objects: 100% (151509/151509), done.
remote: Total 338208 (delta 196986), reused 324905 (delta 183898), pack-reused 0
接收对象中: 100% (338208/338208), 93.70 MiB | 5.90 MiB/s, 完成.
处理 delta : 100% (196986/196986), 完成 7813 个本地对象.
来自 github.com:Homebrew/homebrew-core
   ef5c358418d..5c8ec008df4  master     -> origin/master

༄ git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch —unshallow

remote: Enumerating objects: 28649, done.
remote: Counting objects: 100% (25990/25990), done.
remote: Compressing objects: 100% (8663/8663), done.
remote: Total 20358 (delta 14980), reused 17036 (delta 11692), pack-reused 0
接收对象中: 100% (20358/20358), 6.42 MiB | 6.31 MiB/s, 完成.
处理 delta : 100% (14980/14980), 完成 1655 个本地对象.
来自 github.com:Homebrew/homebrew-cask
   6faccf1ee4..134f0d09b2  master     -> origin/master

根据 brew doctor 诊断建议, 进行依赖安装时:

༄ brew install aom assimp bdw-gc brotli c-ares dav1d dbus double-conversion frei0r giflib guile jemalloc leptonica libarchive libb2 libbluray libev libproxy libpthread-stubs libsamplerate libsndfile libsodium libsoxr libvidstab libx11 libxau libxcb libxdmcp libxext libxrender luajit-openresty lz4 mpdecimal mujs nghttp2 opencore-amr openjdk openjdk@8 openjpeg opusfile pybind11 rav1e rubberband speex srt tesseract uchardet vapoursynth xorgproto zeromq zimg zstd

有大量报错:

Error: python@3.9: the bottle needs the Apple Command Line Tools to be installed.
  You can install them, if desired, with:
    xcode-select --install

You can try to install from source with:
  brew install --build-from-source python@3.9
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.

...

Error: gcc: the bottle needs the Apple Command Line Tools to be installed.
  You can install them, if desired, with:
    xcode-select --install

You can try to install from source with:
  brew install --build-from-source gcc
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.
Error: gcc: the bottle needs the Apple Command Line Tools to be installed.
  You can install them, if desired, with:
    xcode-select --install

You can try to install from source with:
  brew install --build-from-source gcc
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.

完成 XCode 升级后再来, 就一切顺利了 ;-)

以及推荐:

exelban/stats: macOS system monitor in your menu bar

免费监察一堆传感器数值: stats

timekeeping

  • 1.0h 尝试手工恢复
  • 1.0h 尝试 timemechine 恢复
  • 0.5h 探索其它可能
  • 1.0h 尝试 迁移助手
  • 8.0h 点对点 传输 450+G 数据+应用
  • 1.0h 尝试恢复 WaterFox 职能
  • 1.5h 尝试恢复关键工具许可证
  • 1.0h 尝试解决 Python 问题
  • 1.5h 记要/发布

终于基本可用

refer.

logging

  • 211114 找到办法, 快速完成迁移
  • 211113 init.

by Zoom.Quiet at November 14, 2021 03:53 PM

November 11, 2021

蠎周刊

PyCoder 498

和 Guido 一起讨论加速 Python

原文: PyCoder's Weekly - Issue #498

pycoder

  • 211111 Zoom.Quiet(大妈) 用时 13 分钟 完成快译
  • 211111 Zoom.Quiet(大妈) 用时 37 分钟 完成格式转抄.

Interesting read about the strange world of Python, as used by big investment banks: “Bank Python implementations are effectively proprietary forks of the entire Python ecosystem which are in use at many (but not all) of the biggest investment banks.”

“Python 3.9.8 got released this week! At this point in the 3.9 lifecycle this should be a relatively uneventful release. Instead, it took us a few days of work to get it out of the door. I still managed to squeeze in 51 closed PRs and even organized a meeting between the core developers and Daan Leijen, the author of mimalloc.”

Follow along this step-by-step project to create a to-do application for your command line using Python and Typer. While you build this app, you’ll learn the basics of Typer, a modern and versatile library for building command-line interfaces (CLI).

(是也乎:

Typer Typer ~ CLI 版 FastAPI, 值得享用.

)

“The PSF launched its end-of-the-year fundraiser. There are two ways to donate: 1. donate directly to the PSF or 2. purchase a discounted PyCharm license, with all proceeds going to the PSF. Contributing to the PSF financially helps sustain programs that support the larger Python community.”


探讨/吐糟

Discussions

(是也乎:

这对面试非常重要哪...

)

(是也乎:

差之毫厘,失之千里...

)


文章/教程/嗯哼

Articles, Tutorials and Talks

Are you getting the most out of the Django framework? It’s a powerful web framework if you’re not interested in reinventing the wheel. Django includes a useful template system with inheritance for composing reusable HTML. This week on the show, Real Python author Christopher Trudeau shares his Django tips and tricks.

(是也乎:

podcast

)

In this project-based tutorial, you’ll build a content aggregator from scratch with Python and Django. Using custom management commands, feedparser, and django-apscheduler, you’ll set up an app to periodically parse RSS feeds for Python podcasts and display the latest episodes to your users.

(是也乎:

Aggregator

用 Django 构造一个节目发布网站.

)

“This episode is the first of several that dive into some of the active efforts to increase the speed of Python while maintaining compatibility with existing code and packages. Who better to help kick this off than Guido van Rossum and Mark Shannon?”

(是也乎:

Guido

Links from the show

Guido van Rossum: @gvanrossum

Faster Python Plan: github.com/faster-cpython

The “Shannon Plan”: github.com/markshannon

Watch this episode on YouTube: youtube.com

Episode transcripts: Episode #339 Making Python Faster with Guido and Mark - [Talk Python To Me Podcast]

)

In this course, you’ll learn how to create scatter plots in Python, which are a key part of many data visualization applications. You’ll get an introduction to plt.scatter(), a versatile function in the Matplotlib module for creating scatter plots.

(是也乎:

scatter

)

A new kind of cyber threat has come to light recently: software supply chain attacks. While rare, they have massive impacts. This article describes the most common attacks in the Python ecosystem and gives hints on how to prevent them.

(是也乎:

高端话题, 一般还是确保链路上都是靠谱开源项目就好, 这也是为什么 Django 越来越大的原因吧

)

With this Understand Django article, you’ll learn about commands. Commands are the way to execute scripts that interact with your Django app. Learn about built-in commands and how to build your own.

(是也乎:

值得是个系列了, 关键看目标领域任务, 理解到什么程度足够就怼.

)

A high-level overview of managing dependencies in a Python project, why there’s more than one way to do it and what are the tradeoffs between them.

(是也乎:

好东西就是要自推荐;

这种依赖, 没有充足理由 -> 嫑动

)

“This document explains possible ways to misuse Unicode to write Python programs that appear to do something else than they actually do.”


好物/妙品/...

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

pyheat

赞哪, Openresty 那种运行时 火焰图 的进一步优化:

直接对应使用代码行的用时分析了...

)

(是也乎:

angle

面向郎读编程?

这种将自然英文自动转化为 JS 的开发语言, 毫无使用场景哪, 即便是常用语法可读了, 可真正调用的各种框架可都是不可读函式名呢...

)

(是也乎:

加速计划成果之一?

)

(是也乎:

cog

所以, Python 是万能胶水

)

(是也乎:

Django 当年也是号称敏捷的, 现在要工具来加速部署了...

)


📆🐍 活动/大会

Events, MeetUp 真的是全球线下活动组织中心

(是也乎:

向前编码的女性?

)


DAMA

❤️ Happy Pythonic ;-(大妈私人无责任播报)

(是也乎:

老司机开新坑, 时隔10年, 沈游侠再次开声, 值得关注:

Bilibili

)


PS:

PPS:

不觉中蟒周刊快译已经到了第9个年头

去年开始有小伙伴加入承担 pythonisa 周刊的翻译, 从来没提醒过, 可就这么默默坚持下来了...

问为什么:

[皱眉]每周新闻资讯 怎么能错过 
看看有什么新东西 
当有新的发现时:
    what f**k 还能这样玩? 还有这东西?
    每周开彩蛋[吃瓜]

无法同意更多... 很多社区贡献看起来辛苦, 其实受益最多的, 就是主动承担者也.


好文笔,感叹号年度配额: 2/3

投稿/反馈邮箱:

(邮件列表地址, 当成正常邮件发送邮件就好, 不用注册, 不用翻越...)


ZoomQuiet/大妈

就是四处 是也乎,( ̄▽ ̄) 的那个大妈:

私自嗯哼: ZoomQuiet (订阅号: ZoomQuiet42)
公开课程: 蟒营 (订阅号: Mainium)
历史吐糟: Chaos42 (订阅号 PythoniCamp)

as 创始组织者:
    PyChina (订阅号: PyChinaOrg)
    本地社区: 
        GDG珠海 (订阅号: GDG-ZhuHai)
        TFUG珠海 (订阅号: ZH_TFUG)

by Pythoneerm at November 11, 2021 03:18 AM