Response

Response

Comments from the reviewer

评审员指出,在回应2中,作者提到“实际上,无论是细胞表面还是凸包,在计算机上我们处理的都是它们的离散点。”评审员接着解释,有限点集的凸包是多面体(有界多面体),其边界是非光滑的。此外,手稿中写道:“凸包为进一步分析提供了两个重要信息:包含整个细胞表面的最小凸多面体…”,因此在这一点上作者和评审员似乎是一致的。

作者在回应中继续说:“换句话说,我们可以理解这些离散点是其真实连续光滑函数上的采样值。”评审员提出假设,将M和N(细胞表面和其凸包的真实边界)视为光滑流形。然后,他们将计算机上找到的离散点的凸包边界称为Q。这不是一个光滑流形。因此,即使可以将第3.1、3.3和3.4节的理论直接应用于M和N,但不能应用于Q。换句话说,Q只是N的多面体近似。任何近似都伴随着近似误差和其他在手稿中被忽视的问题。评审员建议在手稿中添加有关这个问题的评论。

此外,评审员指出,先前章节的理论和第3.6节中描述的实现之间存在明显差距。顺便说一下,第3.6节非常简短,且在算法1的子程序中隐藏了许多重要的实现细节。也许这就是为什么作者不得不在回应3和4中向评审员解释这些细节。但这些细节应该包含在手稿中!

Response to the comments

谢谢评审员的建议!的确,在进行实际计算时候,细胞表面是离散点构成的三角网格,而凸包是由这些离散点构成的多面体,所以理论分析部分不能直接用于实际计算。我们决定通过remark 3.1来解释这个问题,因为虽然实际参与计算的细胞表面和凸包都不是光滑流形,但是他们却是真实的细胞表面流形和凸包流形的近似。再根据映射的连续性,我们可以得到实际计算中的细胞表面和凸包的近似误差。我们在remark 3.1中给出了这个误差的上界。

Denote the cateogry of $3$-dimensional manifolds as $\mathcal{M}$, and the convex-hull morphism $f$ is defined as
$$
\begin{aligned}
f: \mathcal{M} &\rightarrow \mathcal{M} \
M &\mapsto N
\end{aligned}
$$ where $N$ is the convex hull of $M$. Then $f$ is a smooth morphism/diffeomorphism.

Consider the discrete approximation of any $M \in \mathcal{M}$, denoted as $P$. Regardless how $d$ is concretely define, as far as $d$ is a distance on $\mathcal{M}$, then given a manifold $M$, $\forall \epsilon > 0$, there exists a $g_\theta$ such that $d(M, g_\theta(M)) < \epsilon$, where $g_\theta$ is the discrete approximation and $\theta$ is the parameter of the discrete approximation.

Now suppose that the surface of a cell is a smooth manifold $M$ and its convex hull is a smooth manifold $N$. Let $P$ be the discrete surface of the cell and $Q$ be the discrete convex hull of the cell.

$\forall \epsilon_1 > 0$, $\exists \theta > 0$, such that $d(M, P) < \epsilon_1$, where $P = g_\theta(M)$ and $g_\theta$ is the discrete approximation of $M$.

And denote the discrete approximation of $N$ as $Q’ = g_{\theta}(N)$, then also for the given $\epsilon_2 > 0$, there exists an $\delta > 0$, such that $d(N, Q’) < \epsilon_2$. As far as $\epsilon_1 < \delta$, then $d(M, P) < \epsilon_1 < \delta$, and $d(N, Q’) < \epsilon_2$. Then we have $d(P, Q’) < \epsilon_2$.

And for the other way, since $Q = f(P)$, then $d(Q, Q’) < \epsilon_3$

$$
\begin{aligned}

SO(3)

SO(3)

Quaternion

Quaternion basics

Denote the space of quaternions by $\mathbb{H}$, which is a 4-dimensional vector space over $\mathbb{R}$ with basis ${\mathbf{1}, \mathbf{i}, \mathbf{j}, \mathbf{k}}$.

$$
q = \left(\begin{matrix} a + id & -b-ic \ b-ic & a-id \end{matrix}\right) = a \mathbf{1} + b \mathbf{i} + c \mathbf{j} + d \mathbf{k}
$$

$$
\det q = a^2 + b^2 + c^2 + d^2 = |q|^2
$$

$$
\bar{q} = a \mathbf{1} - b \mathbf{i} - c \mathbf{j} - d \mathbf{k}
|q|^2 = q \bar{q} = \bar{q} q
$$

Quaternion and rotation

Pure quaternion

$$
p = b \mathbf{i} + c \mathbf{j} + d \mathbf{k} \in \mathbb{R}^3
$$

$$
uv = -u \cdot v + u \times v
$$

Unit quaternion

$$
q = \cos \frac{\theta}{2} + \sin \frac{\theta}{2} \mathbf{u} \in \mathbb{S}^3
$$

whose norm is 1

$$
\begin{align}
q \bar{q} &= (\cos \frac{\theta}{2} + \sin \frac{\theta}{2} \mathbf{u})(\cos \frac{\theta}{2} - \sin \frac{\theta}{2} \mathbf{u}) \
&= \cos^2 \frac{\theta}{2} - \sin^2 \frac{\theta}{2} \mathbf{u}^2 \
&= \cos^2 \frac{\theta}{2} + \sin^2 \frac{\theta}{2} \mathbf{u} \cdot \mathbf{u} \
&= 1
\end{align}
$$

where $\mathbf{u}$ is a unit vector.

$$
\begin{align}
q^{-1} &= \bar{q}/|q|^2 \
&= \cos \frac{\theta}{2} - \sin \frac{\theta}{2} \mathbf{u} \
&= \bar{q}
\end{align}
$$

Rotation by conjugation

$$
\begin{align*}
t: \mathbb{R}^3 &\to \mathbb{R}^3 \
u &\mapsto v=t^{-1} u t
\end{align*}
$$

where $t \in \mathbb{S}^3 \subset \mathbb{H}$.

Thus a coresponding is induced

$$
\begin{align*}
T: \mathbb{S}^3 &\to \mathrm{SO}(3) \
t &\mapsto T_t(\cdot ) = t^{-1} (\cdot) t
\end{align*}
$$

where $T(t)$ is a rotation matrix.

Notice that $T_t = T_{-t}$, and

$$
\begin{align*}
T: \mathbb{S}^3 \ \mathrm{mod} \ {\pm 1} &\to \mathrm{SO}(3) \
{\pm t} &\mapsto T_t(\cdot ) = t^{-1} (\cdot) t
\end{align*}
$$

is a isomorphism.

In short,

$$
\mathrm{SO}(3) \cong \mathbb{S}^3 \ \mathrm{mod} \ {\pm 1} \cong \mathbb{R}\mathbb{P}^3
$$

SO(3) is simple

Conjugation can move any vector to any other vector.

Maximal torus

$ \mathbb{T}^1 $ is a maximal torus of $ \mathrm{SO}(3) $.

Since torus has deep connection with diagonalization, maximal torus is also seen as a invariant subspace.

How to Install and Configure Samba on CentOS 7

How to Install and Configure Samba on CentOS 7

如何在 CentOS 7 上安装和配置 Samba

https://linuxize.com/post/how-to-install-and-configure-samba-on-centos-7/
Posted  Feb 27, 2019 发布于 2019 年 2 月 27 日

9 min read

Install and Configure Samba on CentOS 7

Samba is a free and open-source re-implementation of the SMB/CIFS network file sharing protocol that allows end users to access files, printers, and other shared resources.
Samba 是 SMB/CIFS 网络文件共享协议的免费开源重新实现,允许最终用户访问文件、打印机和其他共享资源。

In this tutorial, we will show how to install Samba on CentOS 7 and configure it as a standalone server to provide file sharing across different operating systems over a network.
在本教程中,我们将展示如何在 CentOS 7 上安装 Samba 并将其配置为独立服务器,以通过网络在不同操作系统之间提供文件共享。

We’ll create the following Samba shares and users.
我们将创建以下 Samba 共享和用户。

Users: 用户:

  • sadmin - An administrative user with read and write access to all shares.
    sadmin - 对所有共享拥有读写权限的管理用户。
  • josh - A regular user with its own private file share.
    josh - 拥有自己的私人文件共享的普通用户。

Shares: 分享:

  • users - This share will be accessible with read/write permissions by all users.
    用户 - 所有用户都可以通过读/写权限访问此共享。
  • josh - This share will be accessible with read/write permissions only by users josh and sadmin.
    josh - 只有用户 josh 和 sadmin 才能通过读/写权限访问此共享。

The file shares will be accessible from all devices on your network. Later in the tutorial, we will also provide detailed instructions on how to connect to the Samba server from Linux, Windows and macOS clients.
文件共享可以从网络上的所有设备访问。在本教程的后面,我们还将提供有关如何从 Linux、Windows 和 macOS 客户端连接到 Samba 服务器的详细说明。

Prerequisites  先决条件

Before you begin, make sure you are logged in to your CentOS 7 system as a user with sudo privileges .
在开始之前,请确保您以具有 sudo 权限的用户身份登录到 CentOS 7 系统。

Installing Samba on CentOS

在 CentOS 上安装 Samba

Samba is available from the standard CentOS repositories. To install it on your CentOS system run the following command:
Samba 可从标准 CentOS 存储库中获取。要将其安装在 CentOS 系统上,请运行以下命令:

1
sudo yum install samba samba-client

Once the installation is completed, start the Samba services and enable them to start automatically on system boot:
安装完成后,启动 Samba 服务并使其在系统启动时自动启动:

1
sudo systemctl start smb.service
1
sudo systemctl enable smb.service

The smbd service provides file sharing and printing services and listens on TCP ports 139 and 445. The nmbd service provides NetBIOS over IP naming services to clients and listens on UDP port 137.
smbd 服务提供文件共享和打印服务,并侦听 TCP 端口 139 和 445。 nmbd 服务向客户端提供 NetBIOS over IP 命名服务,并侦听 UDP 端口 137。

Configuring Firewall  配置防火墙

Now that Samba is installed and running on your CentOS machine, you’ll need to configure your firewall and open the necessary ports. To do so, run the following commands:
现在 Samba 已安装并在 CentOS 计算机上运行,​​您需要配置防火墙并打开必要的端口。为此,请运行以下命令:

1
firewall-cmd --permanent --zone=public --add-service=samba

Creating Samba Users and Directory Structure

创建 Samba 用户和目录结构

For easier maintainability and flexibility instead of using the standard home directories (/home/user) all Samba directories and data will be located in the /samba directory.
为了更容易维护和灵活性,所有 Samba 目录和数据都将位于 /samba 目录中,而不是使用标准主目录 ( /home/user )。

Start by creating the /samba directory:
首先创建 /samba 目录:

1
sudo mkdir /samba

Create a new group named sambashare. Later we will add all Samba users to this group.
创建一个名为 sambashare 的新组。稍后我们会将所有 Samba 用户添加到该组中。

1
sudo groupadd sambashare 

Set the /samba directory group ownership to sambashare:
将 /samba 目录组所有权设置为 sambashare :

1
sudo chgrp sambashare /samba

Samba uses Linux users and group permission system but it has its own authentication mechanism separate from the standard Linux authentication. We will create the users using the standard Linux useradd tool and then set the user password with the smbpasswd utility.
Samba 使用 Linux 用户和组权限系统,但它有自己的身份验证机制,与标准 Linux 身份验证分开。我们将使用标准 Linux useradd 工具创建用户,然后使用 smbpasswd 实用程序设置用户密码。

As we mentioned in the introduction, we’ll create a regular user that will have access to its private file share and one administrative account with read and write access to all shares on the Samba server.
正如我们在简介中提到的,我们将创建一个有权访问其私有文件共享的普通用户和一个对 Samba 服务器上的所有共享具有读写访问权限的管理帐户。

Creating Samba Users  创建 Samba 用户

To create a new user named josh, use the following command:
要创建名为 josh 的新用户,请使用以下命令:

1
sudo useradd -M -d /samba/josh -s /usr/sbin/nologin -G sambashare josh

The useradd options have the following meanings:
useradd 选项的含义如下:

  • -M -do not create the user’s home directory. We’ll manually create this directory.
    -M - 不创建用户的主目录。我们将手动创建此目录。
  • -d /samba/josh - set the user’s home directory to /samba/josh.
    -d /samba/josh - 将用户的主目录设置为 /samba/josh 。
  • -s /usr/sbin/nologin - disable shell access for this user.
    -s /usr/sbin/nologin - 禁用该用户的 shell 访问。
  • -G sambashare - add the user to the sambashare group.
    -G sambashare - 将用户添加到 sambashare 组。

Create the user’s home directory and set the directory ownership to user josh and group sambashare:
创建用户的主目录并将目录所有权设置为用户 josh 和组 sambashare :

1
sudo mkdir /samba/josh

The following command will add the setgid bit to the /samba/josh directory so the newly created files in this directory will inherit the group of the parent directory. This way, no matter which user creates a new file, the file will have group-owner of sambashare. For example, if you don’t set the directory’s permissions to 2770 and the sadmin user creates a new file the user josh will not be able to read/write to this file.
以下命令将向 /samba/josh 目录添加 setgid 位,以便该目录中新创建的文件将继承父目录的组。这样,无论哪个用户创建新文件,该文件的组所有者都是 sambashare 。例如,如果您未将目录的权限设置为 2770 并且 sadmin 用户创建了一个新文件,则用户 josh 将无法读取/写入该文件。

1
sudo chmod 2770 /samba/josh

Add the josh user account to the Samba database by setting the user password:
通过设置用户密码将 josh 用户帐户添加到Samba数据库:

1
sudo smbpasswd -a josh

You will be prompted to enter and confirm the user password.
系统将提示您输入并确认用户密码。

1
2
3
New SMB password:
Retype new SMB password:
Added user josh.

Once the password is set, enable the Samba account by typing:
设置密码后,输入以下命令启用 Samba 帐户:

1
sudo smbpasswd -e josh
1
Enabled user josh.

To create another user repeat the same process as when creating the user josh.
要创建另一个用户,请重复与创建用户 josh 时相同的过程。

Next, let’s create a user and group sadmin. All members of this group will have administrative permissions. Later if you want to grant administrative permissions to another user simply add that user to the sadmin group .
接下来,让我们创建一个用户和组 sadmin 。该组的所有成员都将拥有管理权限。稍后,如果您想向其他用户授予管理权限,只需将该用户添加到 sadmin 组即可。

Create the administrative user by typing:
通过键入以下内容创建管理用户:

1
sudo useradd -M -d /samba/users -s /usr/sbin/nologin -G sambashare sadmin

The command above will also create a group sadmin and add the user to both sadmin and sambashare groups.
上面的命令还将创建一个组 sadmin 并将用户添加到 sadmin 和 sambashare 组中。

Set a password and enable the user:
设置密码并启用用户:

1
sudo smbpasswd -a sadmin

Next, create the Users share directory:
接下来,创建 Users 共享目录:

1
sudo mkdir /samba/users

Set the directory ownership to user sadmin and group sambashare:
将目录所有权设置为用户 sadmin 和组 sambashare :

1
sudo chown sadmin:sambashare /samba/users

This directory will be accessible by all authenticated users. The following command configures write/read access to members of the sambashare group in the /samba/users directory:
所有经过身份验证的用户都可以访问此目录。以下命令配置对 /samba/users 目录中 sambashare 组成员的写/读访问权限:

1
sudo chmod 2770 /samba/users

Configuring Samba Shares

配置 Samba 共享

Open the Samba configuration file and append the sections:
打开 Samba 配置文件并附加以下部分:

1
sudo nano /etc/samba/smb.conf

/etc/samba/smb.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[users]
path = /samba/users
browseable = yes
read only = no
force create mode = 0660
force directory mode = 2770
valid users = @sambashare @sadmin

[josh]
path = /samba/josh
browseable = no
read only = no
force create mode = 0660
force directory mode = 2770
valid users = josh @sadmin

Copy

The options have the following meanings:
选项含义如下:

  • [users] and [josh] - The names of the shares that you will use when logging in.
    [users] 和 [josh] - 登录时将使用的共享名称。
  • path - The path to the share.
    path - 共享的路径。
  • browseable - Whether the share should be listed in the available shares list. By setting to no other users will not be able to see the share.
    browseable - 共享是否应列在可用共享列表中。通过设置为 no ,其他用户将无法看到共享。
  • read only - Whether the users specified in the valid users list are able to write to this share.
    read only - valid users 列表中指定的用户是否能够写入此共享。
  • force create mode - Sets the permissions for the newly created files in this share.
    force create mode - 设置此共享中新创建的文件的权限。
  • force directory mode - Sets the permissions for the newly created directories in this share.
    force directory mode - 设置此共享中新创建的目录的权限。
  • valid users - A list of users and groups that are allowed to access the share. Groups are prefixed with the @ symbol.
    valid users - 允许访问共享的用户和组的列表。组以 @ 符号为前缀。

For more information about available options see the Samba configuration file documentation page.
有关可用选项的更多信息,请参阅 Samba 配置文件文档页面。

Once done, restart the Samba services with:
完成后,使用以下命令重新启动 Samba 服务:

1
sudo systemctl restart smb.service

In the following sections, we will show you how to connect to a Samba share from Linux, macOS and Windows clients.
在以下部分中,我们将向您展示如何从 Linux、macOS 和 Windows 客户端连接到 Samba 共享。

Connecting to a Samba Share from Linux

从 Linux 连接到 Samba 共享

Linux users can access the samba share from the command line, using the file manager or mount the Samba share.
Linux 用户可以使用文件管理器从命令行访问 samba 共享或挂载 Samba 共享。

Using the smbclient client

使用 smbclient 客户端

smbclient is a tool that allows you to access Samba from the command line. The smbclient package is not pre-installed on most Linux distros so you will need to install it with your distribution package manager.
smbclient 是一个允许您从命令行访问 Samba 的工具。大多数 Linux 发行版上都没有预安装 smbclient 软件包,因此您需要使用发行版软件包管理器来安装它。

To install smbclient on Ubuntu and Debian run:
要在 Ubuntu 和 Debian 上安装 smbclient ,请运行:

1
sudo apt install smbclient

To install smbclient on CentOS and Fedora run:
要在 CentOS 和 Fedora 上安装 smbclient ,请运行:

1
sudo yum install samba-client

The syntax to access a Samba share is as follows:
访问Samba共享的语法如下:

1
mbclient //samba_hostname_or_server_ip/share_name -U username

For example to connect to a share named josh on a Samba server with IP address 192.168.121.118 as user josh you would run:
例如,要以用户 josh 身份连接到 IP 地址为 192.168.121.118 的 Samba 服务器上名为 josh 的共享,您可以运行:

1
smbclient //192.168.121.118/josh -U josh

You will be prompted to enter the user password.
系统将提示您输入用户密码。

1
Enter WORKGROUP\josh's password:

Once you enter the password you will be logged into the Samba command line interface.
输入密码后,您将登录到 Samba 命令行界面。

1
2
Try "help" to get a list of possible commands.
smb: \>

Mounting the Samba share

挂载 Samba 共享

To mount a Samba share on Linux first you need to install the cifs-utils package.
要在 Linux 上挂载 Samba 共享,您首先需要安装 cifs-utils 软件包。

On Ubuntu and Debian run:
在 Ubuntu 和 Debian 上运行:

1
sudo apt install cifs-utils

On CentOS and Fedora run:
在 CentOS 和 Fedora 上运行:

1
sudo yum install cifs-utils

Next, create a mount point:
接下来,创建一个挂载点:

1
sudo mkdir /mnt/smbmount

Mount the share using the following command:
使用以下命令挂载共享:

1
sudo mount -t cifs -o username=username //samba_hostname_or_server_ip/sharename /mnt/smbmount

For example to mount a share named josh on a Samba server with IP address 192.168.121.118 as user josh to the /mnt/smbmount mount point you would run:
例如,要将 IP 地址为 192.168.121.118 的 Samba 服务器上名为 josh 的共享作为用户 josh 挂载到 /mnt/smbmount 挂载点,您可以跑步:

1
sudo mount -t cifs -o username=josh //192.168.121.118/josh /mnt/smbmount

You will be prompted to enter the user password.
系统将提示您输入用户密码。

1
Password for josh@//192.168.121.118/josh:  ********

Using GUI  使用图形用户界面

Files, the default file manager in Gnome has a built-in option to access Samba shares.
文件,Gnome 中的默认文件管理器有一个内置选项来访问 Samba 共享。

  1. Open Files and click on “Other Locations” in the sidebar.
    打开文件并单击侧栏中的“其他位置”。

  2. In “Connect to Server”, enter the address of the Samba share in the following format smb://samba_hostname_or_server_ip/sharename.
    在“连接到服务器”中,按以下格式输入 Samba 共享的地址 smb://samba_hostname_or_server_ip/sharename 。

  3. Click “Connect” and the following screen will appear:
    单击“连接”,将出现以下屏幕:

    Gnome Samba Login

  4. Select “Registered User”, enter the Samba username and password and click “Connect”.
    选择“注册用户”,输入Samba用户名和密码,然后单击“连接”。

  5. The files on the Samba server will be shown.
    将显示 Samba 服务器上的文件。

    Gnome Samba Files

Connecting to a Samba Share from macOS

从 macOS 连接到 Samba 共享

In macOS, you can access the Samba Shares either from the command line or using the default macOS file manager Finder. The following steps show how to access the share using Finder.
在 macOS 中,您可以从命令行或使用默认的 macOS 文件管理器 Finder 访问 Samba 共享。以下步骤显示如何使用 Finder 访问共享。

  1. Open “Finder”, select “Go” and click “Connect To”.
    打开“Finder”,选择“前往”并单击“连接到”。

  2. In “Connect To”, enter the address of the Samba share in the following format smb://samba_hostname_or_server_ip/sharename.
    在“连接到”中,按以下格式输入 Samba 共享的地址 smb://samba_hostname_or_server_ip/sharename 。

    macOS Samba Connect

  3. Click “Connect” and the following screen will appear:
    单击“连接”,将出现以下屏幕:

    macOS Samba Login

  4. Select “Registered User”, enter the Samba username and password and click “Connect”.
    选择“注册用户”,输入Samba用户名和密码,然后单击“连接”。

  5. The files on the Samba server will be shown.
    将显示 Samba 服务器上的文件。

    macOS Samba Files

Connecting to a Samba Share from Windows

从 Windows 连接到 Samba 共享

Windows users also have an option to connect to the Samba share from both command line and GUI. The steps below show how to access the share using the Windows File Explorer.
Windows 用户还可以选择从命令行和 GUI 连接到 Samba 共享。以下步骤显示如何使用 Windows 文件资源管理器访问共享。

  1. Open up File Explorer and in the left pane right-click on “This PC”.
    打开文件资源管理器,然后在左侧窗格中右键单击“此电脑”。

  2. Select “Choose a custom network location” and then click “Next”.
    选择“选择自定义网络位置”,然后单击“下一步”。

  3. In “Internet or network address”, enter the address of the Samba share in the following format \\samba_hostname_or_server_ip\sharename.
    在“Internet 或网络地址”中,按以下格式输入 Samba 共享的地址 \\samba_hostname_or_server_ip\sharename 。

    Windows Samba Connect

  4. Click “Next” and you will be prompted to enter the login credentials as shown below:
    单击“下一步”,系统将提示您输入登录凭据,如下所示:

    Windows Samba Connect

  5. In the next window, you can type a custom name for the network location. The default one will be picked up by the Samba server.
    在下一个窗口中,您可以为网络位置键入自定义名称。 Samba 服务器将采用默认值。

    Windows Samba Name

  6. Click “Next” to move to the last screen of the connection setup wizard.
    单击“下一步”移至连接设置向导的最后一个屏幕。

  7. Click “Finish” and the files on the Samba server will be shown.
    单击“完成”,将显示 Samba 服务器上的文件。

    Windows Samba Files

Conclusion  结论

In this tutorial, you have learned how to install a Samba server on CentOS 7 and create different types of shared and users. We have also shown you how to connect to the Samba server from Linux, macOS and Windows devices.
在本教程中,您学习了如何在 CentOS 7 上安装 Samba 服务器并创建不同类型的共享和用户。我们还向您展示了如何从 Linux、macOS 和 Windows 设备连接到 Samba 服务器。

SidecarPatcher

SidecarPatcher

Youtube Tutorial

Enables Sidecar on old Mac and iPad for macOS 10.15

Sidecar is disabled on these devices by Apple: iMac13,1, iMac13,2, iMac13,3, iMac14,1, iMac14,2, iMac14,3, iMac14,4, iMac15,1, iMac16,1, iMac16,2, MacBook8,1, MacBookAir5,1, MacBookAir5,2, MacBookAir6,1, MacBookAir6,2, MacBookAir7,1, MacBookAir7,2, MacBookPro9,1, MacBookPro9,2, MacBookPro10,1, MacBookPro10,2, MacBookPro11,1, MacBookPro11,2, MacBookPro11,3, MacBookPro11,4, MacBookPro11,5, MacBookPro12,1, Macmini6,1, Macmini6,2, Macmini7,1, MacPro5,1, MacPro6,1

and iPad: iPad4,1, iPad4,2, iPad4,3, iPad4,4, iPad4,5, iPad4,6, iPad4,7, iPad4,8, iPad4,9, iPad5,1, iPad5,2, iPad5,3, iPad5,4, iPad6,11, iPad6,12

You can type this in Terminal to get the model identifier of your Mac: sysctl hw.model.

You can get the model identifier of your iPad by using this app: Mactracker (iOS App Store)

This script disables this blacklist in macOS. This does NOT patch the iPadOS root system, jailbreaking is not required.

This is a command line script. If you want GUI application, try free-sidecar by ben-z.

Tested on macOS 10.15~10.15.4. Doesn’t work with macOS 11.0.

How to patch

It is very unstable. There are many known issues. Read Issues. Please use this at your own risk.

  1. Backup /System/Library/PrivateFrameworks/SidecarCore.framework folder. This script doesn’t provide original system file.

  2. Install the latest version of Command Line Tools from Apple Developer website.

  • Requires Apple Developer Account, you can use a free-tier developer account.
  1. Disable System Integrity Protection. How to turn off System Integrity Protection on your Mac. After disabling System Integrity Protection, reboot into normal macOS.
  • To check SIP is disabled: csrutil status
  1. Open Terminal application and clone this repository by running this command: git clone https://github.com/pookjw/SidecarPatcher

  2. Run main.swift: sudo swift SidecarPatcher/main.swift

  • You will need to enter your macOS password.

  • Ignore warnings. If you encounter error and you don’t know how to fix, upload a log to Issue. (I can’t reply all issues because I don’t know all.)

  • About xcrun error and crashing many apps after rebooting: #4

How to revert

Simplest Method (1)

Reinstall your macOS using macOS Combo Update. You can download macOS Combo Update from here. For example, if you’re using macOS Catalina 10.15.4, download macOS Catalina 10.15.4 Combo Update. It won’t erase your data and it will just reinstall the system.

Simplest Method (2)

Reinstall your macOS using Install macOS Catalina.app. Install it without erasing your disk it won’t erase your data and it will just reinstall the system.

Using your backup

  1. Disable System Integrity Protection. How to turn off System Integrity Protection on your Mac.

To check SIP is disabled: csrutil status

  1. Run sudo mount -uw / command.

  2. Copy the original SidecarCore folder: sudo cp /path/to/original /System/Library/PrivateFrameworks/SidecarCore.framework

  • Make sure you put the right path for SidecarCore /path/to/original.
  1. Set permission as 755: sudo chmod -R 755 /System/Library/PrivateFrameworks/SidecarCore.framework

  2. Reboot. If you want to enable System Integrity Protection again, you can do so now. (Testing #54)

Timeshift

Timeshift

Problems

  1. Clicking on icon can not prompt the password input window;
  2. gtk error

Try

Same problem here. Ubuntu 22.04.
这里同样的问题。乌班图22.04。
Fixed by downgrading to 3.2.3.
通过降级至 3.2.3 修复。
Removed timeshift and rsync via apt.
通过 apt 删除了时移和 rsync。
Then: 然后:
sudo apt-get install rsync=3.2.3-8ubuntu3
Put rsync on hold:
暂停 rsync:
sudo apt-mark hold rsync

Reinstall timeshift via apt.
通过 apt 重新安装 timeshift。

https://github.com/linuxmint/timeshift/issues/152

Order

On the basis that timeshift uses rsync under the hood, it’s important to note that,
基于时移在底层使用 rsync 的基础上,需要注意的是,

  1. the paths in a filter file such as the one you show are relative to the root of the transfer
    过滤器文件中的路径(例如您显示的路径)相对于传输的根目录
  2. the include/exclude operations work from the top down with the first match being applied.
    包含/排除操作从上到下进行,并应用第一个匹配项。

If you are transferring from /home/nils then all the paths in the filter file start there - even if they begin with /. On the other hand, if you are using timeshift to backup from / then the paths should be correct.
如果您从 /home/nils 传输,则过滤器文件中的所有路径都从那里开始 - 即使它们以 / 开头。另一方面,如果您使用时移从 / 进行备份,则路径应该是正确的。

Note that the first line tells rsync (timeshift) to include everything under /home/nils. Any later pattern under /home/nils - such as /home/nils/Dropbox/ - will never be matched. Change the order to exclude files and directories before you specify a broader set for inclusion.
请注意,第一行告诉 rsync (时移)包含 /home/nils 下的所有内容。 /home/nils 下的任何后续模式 - 例如 /home/nils/Dropbox/ - 将永远不会匹配。在指定更广泛的包含集之前,更改排除文件和目录的顺序。

Consequently you need to reorder your example like this:
因此,您需要像这样重新排序您的示例:

1
2
3
- /home/nils/Dropbox/***
+ /home/nils/***
+ /root/**

仅控制台

一些常用的内核文本模式参数:

  • text - 纯文本模式
  • systemd.unit=multi-user.target - 以多用户命令行模式启动
  • emergency - 紧急救援模式
  • single - 单用户模式
  • nomodeset - 不设置视频模式

以上参数可以组合使用,修改后需要重启系统才会生效。

如果要恢复图形界面,则需要删除这些参数后再重启。

Vim

Vim

  • dt<CR> : delete till <CR>
  • df<CR>: delete till (include) <CR>
  • m : mark a position
  • ' : go to the marked position

Assume the compatibility matrix is $A_{ij}$.

Step 1: Compute horizontal projection $P_i(i) = \sum_{j} A_{ij}$

Step 2: Find $i_{max}$ for which $P_i(i_{max})$ is maximum among all i values

Step 3: Form $A_1(i, j) = |A_{ij} - A_{i_{max}j}|$

Step 4: Compute horizontal projection P_{1i}(i) = Sum_{all j} A1(i, j)

Step 5: Find i values for which P_{1i}(i) is significantly smaller than P_i(i)

Step 6: Form A2(i, j) with only i values from Step 5

Step 7: Compute vertical projection P_j(j) = Sum_{all i} A2(i, j)

Step 8: Find j values for which P_j(j) is large

Step 9: {i values from Step 5} x { j values from Step 8} forms a co-cluster

Step 10: Remove rows and columns from Step 9, and repeat Steps 1 - 9 for more co-clusters

Markov 链基本定理

Markov 链基本定理

当状态$i$是非周期的正常返状态, 则

$$
\lim_{n \to \infty} P_{ii}^{(n)} = \frac{1}{\mu_i}.
$$

Notation:

  • $P_{ij}^{(n)}$: 从状态$i$出发, $n$步后到达状态$j$的概率.
  • $\mu_i$: 状态$i$的平均重返时间.
  • 非周期: $d(i) = 1$.
  • 正常返: $f_{ii} = \sum_{n=1}^\infty f_{ii}^{(n)} = 1$.

Proof.

原函数 形式矩母函数
$f_{ii}^{(n)}$ $F_i(t) = \sum_{n=0}^\infty f_{ii}^{(n)} e^{nt}$
$P_{ii}^{(n)}$ $P_i(t) = \sum_{n=0}^\infty P_{ii}^{(n)} e^{nt}$

首先将$P_{ii}^{(n)}$ 分解成若$k$时刻首次返回状态$i$ $(k \leq n)$ 的条件概率求和
$$
P_{ii}^{(n)} = \sum_{k=1}^n f_{ii}^{(k)} P_{ii}^{(n-k)}.
$$


$$
\begin{aligned}
P_i(t) &= \sum_{n=0}^\infty \sum_{k=1}^n f_{ii}^{(k)} P_{ii}^{(n-k)} e^{kt} e^{(n-k)t} \
&= P_{ii}^{(0)} + \sum_{n=1}^\infty \sum_{k=1}^n f_{ii}^{(k)} P_{ii}^{(n-k)} e^{kt} e^{(n-k)t} \
&= P_{ii}^{(0)} + \sum_{k=1}^\infty f_{ii}^{(k)} e^{kt} \sum_{n=k}^\infty P_{ii}^{(n-k)} e^{(n-k)t} \
&= 1 + P_i(t) F_i(t).
\end{aligned}
$$

所以
$$
P_i(t) = \frac{1}{1 - F_i(t)}
$$

$$
\mu_i = \sum_{n=1}^\infty n f_{ii}^{(n)} = F_i’(0) \
P_i(t)/e^{kt} = \sum_{n=0}^\infty P_{ii}^{(n)} e^{(n-k)t}

biblatex usage

biblatex usage

Example file

1
2
3
4
5
6
7
8
\documentclass{article}
\usepackage[backend=biber,style=numeric]{biblatex}
\bibliography{biblatex_usage}

\begin{document}
Some text \autocite{ref1}.
\printbibliography
\end{document}

See gpt.tex for the full example.

Example compile command

1
2
3
4
pdflatex gpt.tex
biber gpt
pdflatex gpt.tex
pdflatex gpt.tex

Recipe has been made in settings of VS Code.

Example bibliography file

1
2
3
4
5
6
7
8
9
10
11
@article{ref1,
author = {Author, A.},
year = {2001},
title = {Title},
journal = {Journal},
volume = {1},
number = {1},
pages = {1--2},
doi = {10.1000/182},
url = {https://www.example.com/},
}