Hexo landscape 主题添加打赏功能

网上并没有适合于 Hexo 的默认主题 landscape 的打赏功能添加的相关分享。考虑到简洁性和一致性,我将打赏按钮和文章右下角的 Comments 按钮、 Share 按钮放在了一起。本文就介绍如何在 landscape 主题下添加打赏功能。

修改文章模板

修改 <hexo dir>/scaffolds/post.md 文件,在 --- 前添加一行 `` 。

修改文章布局

修改 <hexo dir>/themes/landscape/layout/_partial/article.ejs 文件,在 footer 内,post/tag 之前,添加 Reward 链接。部分代码修改后如下:

/themes/landscape/layout/_partial/article.ejs
1
2
3
4
<% if (post.reward){ %>
<a class="article-reward-link">Reward</a>
<% } %>
<%- partial('post/tag') %>

Read More

Ubuntu 安装在两块以 LUKS 加密的硬盘上

请注意!数据操作有风险,请备份并谨慎操作,仔细查看教程说明。

当前并没有有效简单的方法,能在 Ubuntu 的安装向导下使用两个加密硬盘安装系统(例如,固态硬盘挂载 /,机械硬盘挂载 /home)。故需要另外的方法来操作。

本文以 Ubuntu 18.04 为例,介绍如何把系统安装在两块硬盘,并启用加密。

安装系统

使用安装介质进行常规安装,选择 Erase disk and install Ubuntu,勾选 Encrypt the new Ubuntu installation for securityUse LVM with the new Ubuntu installation 两个复选框。在接下来的问询中,选择想挂载 / 的硬盘(可能是一块固态硬盘)。

准备

安装 gParted:

1
sudo apt install gparted

Read More

[OLD] 为 Debian 9 的 SSH 登录启用 Google Authenticator 两步验证

注意

本文的内容已经合并,失效,或已不具有参考价值,请查看给出的重定向链接。

15 秒后自动重定向至: Ubuntu (Debian) 服务器的初始化配置


本文介绍如何在 Debian 9 上启用对于 SSH 登录的两步验证,2FA 使用 Google Authenticator 。示例命令以 root 用户身份运行。


安装 Google Authenticator

运行命令:

1
2
apt update
apt install libpam-google-authenticator -y

为当前用户配置 Google Authenticator

运行:

1
google-authenticator

将出现一些问题:

1
Do you want authentication tokens to be time-based (y/n)

y

回答完此问题后,会出现二维码、Key,还有备用码,用手机的 Google Authenticator 扫描二维码或手动键入 Key,即可添加二步验证码,另外保存好备用码到一个安全的地方,以防手机丢失。

Read More

Mastodon