摘要: C++算法模板 基础算法 排序 快速排序 void quickSort(int q[], int l, int r) { if (l >= r) return; int i = l - 1, j = r + 1, x = q[l + r >> 1]; while (i < j) { do i ++ 阅读全文
posted @ 2024-05-10 10:20 lightmon 阅读(1570) 评论(0) 推荐(2) 编辑
摘要: lnxrouter /home/light/Scripts/lnxrouter route.sh /home/light/Scripts/route.sh #!/bin/bash sudo /home/light/Scripts/lnxrouter -i enp2s0 -g 0 --daemon r 阅读全文
posted @ 2024-11-28 18:10 lightmon 阅读(18) 评论(0) 推荐(0) 编辑
摘要: cp 和 mv 命令的行为总结表 假设以下路径设置: 源路径:/nihao 或 /nihao/ /nihao 包含文件和子目录:file1, dir1/, file2 目标路径:/nima 或 /nima/ 表格 cp 命令行为 命令 目标路径存在? 最终路径结构 cp -r /nihao /nim 阅读全文
posted @ 2024-11-15 22:12 lightmon 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 安装resty.upload模块 opm install ledgetech/lua-resty-upload 新建/usr/local/openresty/nginx/lua/upload.lua 内容如下: local upload = require "resty.upload" local 阅读全文
posted @ 2024-11-11 11:36 lightmon 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 在安装pve的时候,系统默认分配给local的空间非常小,我们可以通过以下方法把local-lvm删除,并将其空间还给local。 注意! 在webui的pve节点的磁盘选项中找到LVM-Thin,删除data卷。 删除后此处为空。 接着打开终端执行以下命令: lvresize --extents 阅读全文
posted @ 2024-10-18 19:20 lightmon 阅读(1598) 评论(0) 推荐(0) 编辑
摘要: js文件中执行的exec命令出错 很可能是项目中使用了一些非html, css, js的源文件,比如用了Makefile来编译了cpp代码,或者执行的exec命令为cp dir/something.cpp之类的文件操作命令。 可以使用修改forge.config.js文件配置的方式,使得npm ru 阅读全文
posted @ 2024-10-10 23:42 lightmon 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 开机登录前自启动脚本服务 首先确定你的系统是否使用systemd来管理系统服务,在shell中输入systemctl命令来判断,有输出则为systemd系统。 进入/etc/systemd/system目录,创建myservice.service,其中myservice是你要自定义的服务名。 编辑m 阅读全文
posted @ 2024-10-10 16:05 lightmon 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 如果已经开启了Hypr-V, Windows虚拟机监控程序平台, 适用于Linux的Windows子系统, 虚拟机平台这四个Windows功能还是没能解决的话,大概率是bios中cpu虚拟化功能开启有问题或者Vmware等其他虚拟机程序与WSL产生了冲突。 其中前者可以在任务管理器中看到: 如果bi 阅读全文
posted @ 2024-10-01 18:18 lightmon 阅读(443) 评论(0) 推荐(0) 编辑
摘要: E. Prefix GCD 假设我们从一个空集合b开始,不断从a数组中选择一个元素添加到b集合的尾部,当把a数组的元素全部添加到b中后,得到的b即为所求的rearrange后的a。 结论1: 每次选择使得其和当前b中所有元素的最大公约数 阅读全文
posted @ 2024-09-27 20:41 lightmon 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 在/etc/default/grub中给GRUB_CMDLINE_LINUX_DEFAULT 添加参数: acpi_osi='!Windows 2012' 然后使用命令重新生成grub配置: grub-mkconfig -o /boot/grub/grub.cfg 重启即可 阅读全文
posted @ 2024-09-15 21:38 lightmon 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 很有可能你同时装了Hyprland和KDE plasma两种桌面环境,其中一个用pipewire作为音频管理器,另一个用pulseaudio作为音频管理器,这两者会发生冲突,导致奇怪的音频问题出现。 解决方案: 安装pipewire-pulse以替换掉pulseaudio, 解决音频管理器的冲突即可 阅读全文
posted @ 2024-09-14 00:23 lightmon 阅读(86) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示