/images/avatar.png

搭建Time Machine 服务器 (转载)

本文转载自:https://zhuanlan.zhihu.com/p/31088141 本文的内容分为: Time Machine 是什么? 自建Time Machine 服务器的理由 硬件的选择 软件的部署 Mac 备份到Time Machine 服务器 从Time Machine 服务器恢复Mac Time Machine 是什么? Time Machine是macOS中一个非常强大的功能,Time Machine能够保留: 本地快照(只要空间允许) 过去24小时的每小时备份 过去一个月的每日备份 过去所有月份的每周备份 Time Machine的备份是增量备份,只会备份自上次备份以来有变动的文件,因此备份速度很快,占用的空间也不多。如果Time Machine 占满了磁盘空间,最早的备份会被自动删除。 引用知友 @Xing 在OS X 中的 Time Machine 真的有用吗?中的回答: 只要使用Time Machine备份过,即使原来的Mac在Windows双系统下渲染片子时突然蓝屏被你一气之下砸坏或者在麦当劳吃晚饭时被人连电脑包顺走,你也只需走进Apple Store,买一台新Mac,回家连上Time Capsule或者插上含有备份的硬盘,按住option开机进入recovery分区,选择从Time Machine中恢复。开机后打开迁移助手Migration Assistant,选择从Time Machine备份中恢复。等你小憩醒来,将会看到一台和之前一模一样的Mac,不仅是图库音乐库昨晚看过的美剧进度,包括所有设置、开机启动项浏览器历史都是完全一致的。 当然上面只是Time Machine顺滑体验的一部分,Time Machine可以带你回到每一个有记录的节点,例如你有一个project几个月前 从零开始做,在Time Machine中可以演绎整个project文件夹内的变化,同时可以把某个时间任何文件揪出来。这感觉就像你有一麻袋后悔药,想怎么来就怎么来。 使用Time Machine,你既可以回到过去某个时刻,提取某个文件在当时的版本;也可以在电脑异常崩溃后直接全盘恢复到过去某个时刻的状态。 自建Time Machine 服务器的理由 Time Machine的使用方法有三种: 使用一块外置的USB移动硬盘,要求文件系统是HFS+。 使用苹果的AirPort网络设备,通过有线网络/无线网络的方式备份到Airport的硬盘上。 使用Mac mini,安装「macOS Server」使之成为AFP协议传输的文件服务器,Time Machine备份到文件服务器上。 方法1. 外置的USB移动硬盘需要总是挂在Mac上占用一个USB接口,对于有移动需求的MacBook要经常插拔,我经常会忘记弹出直接拔,或者忘记去停下备份中的Time Machine直接拔,长此以往容易造成硬盘的损坏。 方法2. 中可选的Airport设备有两款,分别是AirPort Extreme和AirPort Time Capsule (2TB/3TB),除了售价高昂之外,性能孱弱,功能单一,最新款发布于2013年,产品线已经多年没有更新。

lc10. Regular Expression Matching

Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where: '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire input string (not partial). Example 1: 1 2 3 Input: s = "aa", p = "a" Output: false Explanation: "a" does not match the entire string "aa". Example 2: 1 2 3 Input: s = "aa", p = "a*" Output: true Explanation: '*' means zero or more of the preceding element, 'a'.

lc31. Next Permutation

A permutation of an array of integers is an arrangement of its members into a sequence or linear order. For example, for arr = [1,2,3], the following are considered permutations of arr: [1,2,3], [1,3,2], [3,1,2], [2,3,1]. The next permutation of an array of integers is the next lexicographically greater permutation of its integer. More formally, if all the permutations of the array are sorted in one container according to their lexicographical order, then the next permutation of that array is the permutation that follows it in the sorted container.