Wake Me Up When September Ends.

A wanderer capable of grasping the beauty of the grass, with a heart full of ancient charm, and a fondness for playful wit. Those who understand my words are knowledgeable individuals; those who decipher my code truly comprehend the essence. I am a wandering code swordsman, carrying my skills and riding freely through the digital world.

由于更换新电脑,需要生成新的密钥去免密登陆服务器,小记一下流程,免得下次还得搜索一下相关教程。

密钥登录的过程

SSH 密钥登录分为以下的步骤。

  1. 客户端通过ssh-keygen生成自己的公钥和私钥。
  2. 手动将客户端的公钥放入远程服务器的指定位置。
  3. 客户端向服务器发起 SSH 登录的请求。
  4. 服务器收到用户 SSH 登录的请求,发送一些随机数据给用户,要求用户证明自己的身份。
  5. 客户端收到服务器发来的数据,使用私钥对数据进行签名,然后再发还给服务器。
  6. 服务器收到客户端发来的加密签名后,使用对应的公钥解密。若解密后数据一致,则允许用户登录。

校验过程时序图

25dd3fc40a001c3002872d39865e4baa

阅读全文 »

snap-store自身更新

目前开发的笔记本使用的是ubuntu22.04.1 版本,默认内置snap商店无法完成自身更新,所以小记一下解决办法。

解决办法如下:

# root  账号无需加上sudo
sudo killall snap-store

sudo snap refresh snap-store
阅读全文 »

carbon.now.sh 可以让你的文本代码转换成图片,并可以随时分享出去!

const pluckDeep = key => obj => key.split('.').reduce((accum, key) => accum[key], obj)

const compose = (...fns) => res => fns.reduce((accum, next) => next(accum), res)

const unfold = (f, seed) => {
  const go = (f, seed, acc) => {
    const res = f(seed)
    return res ? go(f, res[1], acc.concat([res[0]])) : acc
  }

caniuse.com 是一个查找JavaScript|Css一些关键字或新特性,在浏览器兼容性的网站。避免我们编写code的时候使用新的特性,但是使用者的电脑浏览器版本不兼容一些问题。