2024-06-01
编程与技术
00

简介

我的 Ubuntu 使用一键安装脚本安装 code-server 时,提示安装成功,但运行时报错:

sh
Failed to enable unit: Unit file code-server.service does not exist.

详细过程

执行一键安装脚本

运行指令:

sh
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run

运行后显示:

bash
Ubuntu 24.04 LTS Installing v4.89.1 of the amd64 deb package from GitHub. + mkdir -p ~/.cache/code-server + curl -#fL -o ~/.cache/code-server/code-server_4.89.1_amd64.deb.incomplete -C - https://github.com/coder/code-server/releases/download/v4.89.1/code-server_4.89.1_amd64.deb + mv ~/.cache/code-server/code-server_4.89.1_amd64.deb.incomplete ~/.cache/code-server/code-server_4.89.1_amd64.deb + sudo dpkg -i ~/.cache/code-server/code-server_4.89.1_amd64.deb deb package has been installed. To have systemd start code-server now and restart on boot: sudo systemctl enable --now code-server@$USER Or, if you don't want/need a background service you can run: code-server Deploy code-server for your team with Coder: https://github.com/coder/coder

可以看到提示信息让运行 sudo systemctl enable --now code-server@$USER 启动 code-server ,但运行时会报错:

sh
# 运行 sudo systemctl enable --now code-server@$USER # 报错 Failed to enable unit: Unit file [email protected] does not exist. # 运行 sudo systemctl enable --now code-server # 报错 Failed to enable unit: Unit file code-server.service does not exist.
2024-05-31
编程与技术
00

开启开发者模式

  1. 打开手机的设置,找到【关于本机】
  2. 在关于本机中找到系统版本信息(不同手机系统有不同的点击位置,但总能找到)
  3. 连续点击5次版本号,出现提示开发者模式,则表示开启成功

USB调试

打开开发者模式后,手机设置中会多出【开发者选项】的设置项,一般在【辅助功能】或【其他设置】中,具体系统有所不同。

在【开发者选项】打开【USB调试】选项即可。

2024-05-27
欢乐时光
00

金手指

本文用于记录 Windows 模拟玩 FC 游戏时,免于坐牢使用的一些 “金手指”。

我使用的模拟器是:VirtuaNES

我爱玩的游戏有:

  1. 松鼠大战2
  2. 雪人兄弟
  3. 魂斗罗2
  4. 迷你乐一通 (Tiny Toon Adventures)
  5. 影子传说

有什么推荐游戏欢迎评论!

2024-05-25
编程与技术
00

简介

当某些sql因为不知名原因堵塞时,为了不影响后台服务运行,想要给sql增加执行时间限制,超时后就抛异常,保证后台线程不会因为sql堵塞而堵塞。

yml全局配置

使用该方法单数据源可以,多数据源时会失效。

在项目的 yaml配置中增加如下配置:

yaml
mybatis: configuration: default-statement-timeout: 1 # 单位秒
2024-05-25
编程与技术
00

简介

在很久很久以前,自己没事写的一个小练习。

封装了一个普扑克实体和一副牌,然后封装了一些方法,如:洗牌、抽牌等等。

使用的Java原生代码,没有任何第三方库,如果你想玩扑克,可以自行拷贝代码测试。