OneDrive 个人保管库离线备份(PC)

来自自己的需求,以及我在 reddit 上的回复

  1. Unlock the vault when you are online.
  2. Open disk management tool (Press Win+R and enter ‘diskmgmt.msc’ without the quotes). You should see a partition called ‘OneDrive Personal Vault’.
  3. Assign a drive letter to OneDrive Personal Vault. See https://docs.microsoft.com/en-us/windows-server/storage/disk-management/change-a-drive-letter. I will assume that the letter is O in the following steps.
  4. Start command line prompt as administrator.
  5. Run the command ‘manage-bde -protectors -add O: -pw’ (change O to the letter assigned in Step 3). This allows unlocking the partition in the vhdx file with a password. For more options, run ‘manage-bde -protectors -add -?’ and read the output message.
  6. When you need to unlock the vault offline later, open C:\OneDriveTemp, find the vhdx file that contains the vault and unlock the partition inside with the password set in Step 5. When unlocking the vault online as usual, be sure NOT to mount the vhdx file, or you will encounter an error message when unlocking.

Important note: this method is not officially supported. Make a backup before performing these steps.

Epub 阅读器简单评测

为了阅读一些排版精良的和排版糟糕的 epub,我试了一圈各种 epub 阅读器,结果并没有完全满意的。下面就我关心的几个方面展开评测,评测内容既有主观内容也有客观内容。

评测项目说明

  • 【注音】形如“写作 A(读作 B)”的格式支持。A 表示完全支持。
  • 【注释】形如注释内容的格式支持。A 表示完全支持。
  • 【CSS】对各种 CSS 样式的支持程度。对于排版优秀的书籍,CSS 支持良好时才能得到最佳的阅读体验。? 表示我没有仔细测试。
  • 【排版】是否可以调整段首缩进、行距、段间距、页边距、字体样式、颜色等等。对于排版糟糕的书籍,该项能调整的范围越大才能得到更好的阅读体验。
  • 【其他】不属于上述范围的部分。

Windows

Calibre (5.14.0)

  • 【注音】A
  • 【注释】A
  • 【CSS】B?
  • 【排版】A。可调整边距、颜色。可用户自定义字体。由于支持用户样式表,实质上支持一切排版调整。
  • 【其他】支持大量其他电子书格式。初次打开一本书时较慢。

总评:A。

Microsoft Edge (44.18362.267.0)

  • 【注音】A
  • 【注释】A
  • 【CSS】A
  • 【排版】C。可在预定义的几种字体中选择。可调整颜色。不可调整行距、边距、段首缩进等。
  • 【其他】排版性能低下,容易卡顿;在 Chromium 版本推出之后,Edge 应该就不再支持 epub 了,且用且珍惜;不支持 Windows 8.1 及以前的版本。

总评:A。虽然调整排版的支持不佳,但是在 PC 环境下,排版的支持并没有那么重要。

iOS

Apple Books (iOS 12)

  • 【注音】A
  • 【注释】A
  • 【CSS】A,但阅读器设置的字体常常会覆盖 CSS 中设置的字体。
  • 【排版】C。可在预定义的几种字体中选择。可调整颜色。不可调整行距、边距、段首缩进等。
  • 【其他】如果 epub 文件的语言元数据设置错误,那么可选择的字体会变成从对应的字体中选择,可能会非常难看;支持有声读物。

总评:A-。如果遇到制作糟糕的电子书,用 Apple Books 可能会很难受。

Kybook 3 (v0.7.8)

  • 【注音】C
  • 【注释】A
  • 【CSS】B?
  • 【排版】A。可使用自定义的字体,可调整颜色、行距、边距、段首缩进等。支持自定义样式表,实质上支持一切排版调整。
  • 【其他】不知为什么,登录功能无法使用,但这个和阅读没什么关系;支持大量其他电子书格式;不支持竖排(会变成横排)。

总评:A-。制作糟糕的电子书首选这个。

多看阅读 (5.5.0)

  • 【注音】A
  • 【注释】B(通过私有样式支持)
  • 【CSS】C
  • 【排版】B。可在预定义的几种字体中选择,但都不怎么好看。可调整颜色、行距、边距、段首缩进等。
  • 【其他】与 iOS 版本不同,Android 版本支持自定义字体;不支持竖排(文字会消失?);支持语音朗读。

总评:B。如果书籍专为多看阅读优化,那么可以使用。看日文书基本没法用(字体难看,而且不支持竖排)。

Marvin (3.1.2)

  • 【注音】A
  • 【注释】C
  • 【CSS】?
  • 【排版】B。可在预定义的几种字体中选择,但其中没有中文字体。可调整颜色、行距、边距、段首缩进等。

总评:B-。没有中文字体,不建议使用。阅读英文电子书可以考虑一用。

BookWalker (5.1.2)

虽然能看 epub,但中文支持非常糟糕,不予评测。

Android

因为我自己不用安卓,所以以下内容都是从其他人口中得知。

多看阅读

与 iOS 版基本一致,但支持了自定义字体。

静读天下

  • 【注音】A
  • 【注释】A
  • 【CSS】C
  • 【排版】?

掌阅

无评测

Lithium

无评测

总结

对于制作精美的 epub 电子书,建议按照发布者的推荐来选择阅读器。如果发布者没有推荐,建议使用 Microsoft Edge (Windows) / Apple Books (iOS) / 多看阅读 (Android)。

对于排版糟糕的 epub 电子书,建议使用 Calibre (Windows) / Kybook 3 (iOS) / 多看阅读、静读天下 (Android)。

关于我自己制作的电子书,不会用到过于精致的排版,但往往会使用注音和注释等功能。因此,建议使用 Microsoft Edge、Calibre(Windows)/ Apple Books (iOS) / 静读天下 (Android)。

用 ruby 实现简单的并行处理
num_threads = 4

arg_list = ["foo", "bar"] # and probably more
Thread.abort_on_exception = true

queue = arg_list.each_with_object(Queue.new) { |f, q| q << f }

threads = Array.new(num_threads) do
  Thread.new do
    until queue.empty?
      arg = queue.shift
      do_something_with(arg)
    end
  end
end

threads.each(&:join)