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.

目前开发的笔记本使用的是ubuntu22.04.1 桌面版本,docker-desktop 正好有桌面版本,所以安装桌面版本比较合适。这边小记一下如何清除已有老旧docker,注意这里是完全清除老旧docker,原来的image和容器都会被清理!

步骤如下

1.删除某软件及其安装时自动安装的所有包

sudo apt-get autoremove docker docker-ce docker-engine docker.io containerd runc

2.删除无用的相关的配置文件

dpkg -l | grep docker
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P 
阅读全文 »

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

密钥登录的过程

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
  }