-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.json
1 lines (1 loc) · 123 KB
/
index.json
1
[{"categories":["键盘","日常"],"content":" 为什么要买这个键盘因为刷b站的时候看到一个Cmake入门视频,讲的不错,通俗易懂,当然关键不在此,主要是想知道up的键盘,看见评论区有和我一样想法的,随即买了这款键盘 虽然笔记本的薄膜键盘不错,敲起来速度很快,但还是想体验下机械键盘的手感 至于为什么选择这个颜色 当然是别的颜色都没货(划掉) ","date":"2024-02-17","objectID":"/posts/r98-keyboard/:1:0","tags":["键盘","日常"],"title":"RK-R98键盘开箱","uri":"/posts/r98-keyboard/"},{"categories":["键盘","日常"],"content":" 主要配置这里只列出了我买的,其他的自己上京东看吧 连接方式 有线/2.4G/蓝牙 键帽 PBT原厂拼色 轴体 烟雨轴/TTC钢铁轴 声音包 PORON棉/ixpe轴下垫/底棉/硅胶 PCBA 单键开槽 电池 7200MA锂电池 结构 Gasket结构(软弹型) 插拔 全键轴座插拔 卫星轴 R87卫星轴(升级款) 京东原价259,减了20 ","date":"2024-02-17","objectID":"/posts/r98-keyboard/:2:0","tags":["键盘","日常"],"title":"RK-R98键盘开箱","uri":"/posts/r98-keyboard/"},{"categories":["键盘","日常"],"content":" 轴体一共有四种轴可选,这次我选择了烟雨轴,声音听起来很不错,大键也没有弹簧音,一种麻将的感觉;比之前买的强多了 轴体 压力克数 触发行程 触底行程 纯净轴 42±5g 2.0±0.4mm 3,7±0.4mm 雪皇轴 45±10gf 2.0±0.4mm 3.4±0.4mm 烟雨轴PRO 40±10gf 2.0±0.4mm 3.4±0.4mm 钢铁轴PRO 41±10gf 1.4±0.4mm 3.8±0.3mm ","date":"2024-02-17","objectID":"/posts/r98-keyboard/:2:1","tags":["键盘","日常"],"title":"RK-R98键盘开箱","uri":"/posts/r98-keyboard/"},{"categories":["键盘","日常"],"content":" 实拍图文笔不好不会描述,直接上图 忽略我的墙 ","date":"2024-02-17","objectID":"/posts/r98-keyboard/:3:0","tags":["键盘","日常"],"title":"RK-R98键盘开箱","uri":"/posts/r98-keyboard/"},{"categories":["键盘","日常"],"content":" 兼容性实测在Arch下有线和2.4G能完美使用,蓝牙还没试,但应该也能用;我的内核版本是6.7.4-arch1-1 ","date":"2024-02-17","objectID":"/posts/r98-keyboard/:4:0","tags":["键盘","日常"],"title":"RK-R98键盘开箱","uri":"/posts/r98-keyboard/"},{"categories":["键盘","日常"],"content":" 物流不得不吐槽一下极兔的物流速度,虽然是春节,但也不用发个键盘都要走5天,从花都到钟村足足用了一天… 还好键盘是安全送到了 ","date":"2024-02-17","objectID":"/posts/r98-keyboard/:5:0","tags":["键盘","日常"],"title":"RK-R98键盘开箱","uri":"/posts/r98-keyboard/"},{"categories":["键盘","日常"],"content":" 一些题外话估计是中考前最后一篇文章了,等中考完再回来给大家更新 回老家四天没碰电脑,不知不觉就攒了90多个包,不得不说开了多线程的pacman很快 前几天想整理下文章目录,因为busuanzi和twikoo是和文章链接绑定的,导致阅读量和评论都没了,还好发现的及时😭 ","date":"2024-02-17","objectID":"/posts/r98-keyboard/:6:0","tags":["键盘","日常"],"title":"RK-R98键盘开箱","uri":"/posts/r98-keyboard/"},{"categories":["Go"],"content":"最近学Go的时候发现个好玩的库,可以识别图片中的人像,并且提供二进制发行版 ","date":"2024-01-31","objectID":"/posts/pigo-face/:0:0","tags":["Linux","Go"],"title":"Pigo实现控头大师","uri":"/posts/pigo-face/"},{"categories":["Go"],"content":" 使用从Releases处下载对应系统的二进制 下载facefinder ./pigo -in input.png -out out.png \u003c input/source.jpg -cf=/path/to/cascade 即可识别input.png,并输出output.png 官方演示图 可以看到准确率还是不错的 ","date":"2024-01-31","objectID":"/posts/pigo-face/:1:0","tags":["Linux","Go"],"title":"Pigo实现控头大师","uri":"/posts/pigo-face/"},{"categories":["Go"],"content":" 识别视频因为Pigo默认只能识别图片,想让它识别整个视频的话只能将视频切成图片进行逐一识别,毕竟视频也是图片组成的 ","date":"2024-01-31","objectID":"/posts/pigo-face/:2:0","tags":["Linux","Go"],"title":"Pigo实现控头大师","uri":"/posts/pigo-face/"},{"categories":["Go"],"content":" 下载视频B站不提供直接的视频下载方式,试了几个网站的下载工具发现要不就是不能用,要么分辨率太低,所以这里使用自带的缓存功能 到手机/storage/emulated/0/Android/data/com.bilibili.app.in/download/目录下,会发现一串以数字命名的文件夹,进入其子目录,会看到一个以数字命名的文件夹,和两个.xml,.json结尾的文件 进入数字文件夹,需要的两个文件出现了,audio.m4s为音频文件,video.m4s为视频文件,将音频拓展名重命名为*.mp3,视频为*.mp4,移动到任意剪辑软件能读取的目录 将两个文件导入剪辑软件,将视频和音频同步拖到对应轨道,导出即可 ","date":"2024-01-31","objectID":"/posts/pigo-face/:2:1","tags":["Linux","Go"],"title":"Pigo实现控头大师","uri":"/posts/pigo-face/"},{"categories":["Go"],"content":" 切割视频这里博主使用的工具是FFmpeg 最好创建一个专门的文件夹存放输出的图片 A complete, cross-platform solution to record, convert and stream audio and video. 使用ffmpeg -i lockHand.mp4 -r 24 ./lockHand/output%d.png 以每秒24张图片分解视频 -i: 指定分割的视频 -r: 设置帧率,默认为25 output%d.png中%d是占位符,ffmpeg将以1.2.3…的顺序命名输出文件 完成后,到lockHand目录下即可看到输出的图片 ","date":"2024-01-31","objectID":"/posts/pigo-face/:2:2","tags":["Linux","Go"],"title":"Pigo实现控头大师","uri":"/posts/pigo-face/"},{"categories":["Go"],"content":" 批量识别一个18秒,24帧的视频就需要432张图片,这么多图片难不成要我们手动一张张识别?估计得识别到地球爆炸;像我这么懒的人肯定不会这么做,我决定用一个脚本来替我完成这项艰巨的任务 #!/bin/bash for((i=1;i\u003c=422;i++)); do ./pigo -in ./lockHand/output$i.png -out ./outHand/out$i.png -cf ./facefinder echo \"处理次数:\"$i done 很简单的脚本,其中442为生成的源图片数量,./lockHand/output$i.png需要改为源图片文件文件夹,$i和%d差不多,产出目录同上 等待脚本完成,到./lockHand即可看到产出图片 ","date":"2024-01-31","objectID":"/posts/pigo-face/:2:3","tags":["Linux","Go"],"title":"Pigo实现控头大师","uri":"/posts/pigo-face/"},{"categories":["Go"],"content":" 合并视频同样使用FFmpeg ffmpeg -r 24 -f image2 -i ./outHand/out%d.png output.mp4 ##合成 参数代表的含义与分割视频一致 激动人心的时刻到了,点击output.mp4即可看到识别的红框 演示视频 ","date":"2024-01-31","objectID":"/posts/pigo-face/:2:4","tags":["Linux","Go"],"title":"Pigo实现控头大师","uri":"/posts/pigo-face/"},{"categories":["Linux","图床"],"content":"这几天一直在折腾内网穿透的事,原因很简单,服务器的ROM不够大,又没钱升级配置,又拍云的免费OSS不备案无法绑定域名,免费的内网穿透速率太小了,更别提还有流量限制 想了想貌似只能自己建一个了,刚好手里有吃灰的Orangepi Zeor3,买的时候配了张128G的TF卡,虽然速度一般,但对于我来说是绰绰有余了 ","date":"2024-01-22","objectID":"/posts/nat-traversal/:0:0","tags":["Linux","图床"],"title":"Frp自建内网穿透","uri":"/posts/nat-traversal/"},{"categories":["Linux","图床"],"content":" frp提到内网穿透,想到的肯定是大名顶顶的frp,目前在Github上已有76.3K starred 网上的很多文章大多是教你用基于frp的一键配置脚本,但试了几个发现都没用后决定自己尝试 ","date":"2024-01-22","objectID":"/posts/nat-traversal/:1:0","tags":["Linux","图床"],"title":"Frp自建内网穿透","uri":"/posts/nat-traversal/"},{"categories":["Linux","图床"],"content":" 安装\u0026使用frp的安装很简单,参照文档的教程 到Releases处下载适合的架构/系统的压缩包,解压到任意目录 使用./frps -c ./frps.toml启动服务端 使用./frpc -c ./frpc.toml启动客户端 ","date":"2024-01-22","objectID":"/posts/nat-traversal/:1:1","tags":["Linux","图床"],"title":"Frp自建内网穿透","uri":"/posts/nat-traversal/"},{"categories":["Linux","图床"],"content":" 使用 systemd 开机自启动如果断开ssh连接,frp服务也会断开;可以将它设置为开机自启 (如果尚未安装)使用apt install systemd 安装,其他发行版使用其包管理器即可 编辑/etc/systemd/system/frps.service创建frp服务配置,写入以下内容 [Unit] # 服务名称,可自定义 Description = frp server After = network.target syslog.target Wants = network.target [Service] Type = simple # 启动frps的命令,需修改为您的frps的安装路径 ExecStart = /path/to/frps -c /path/to/frps.toml [Install] WantedBy = multi-user.target 3.管理命令 # 启动frp sudo systemctl start frps # 停止frp sudo systemctl stop frps # 重启frp sudo systemctl restart frps # 查看frp状态 sudo systemctl status frps # 开机自启动 sudo systemctl enable frps 之后的frpc也是大同小异,只需要更改名字和位置即可 ","date":"2024-01-22","objectID":"/posts/nat-traversal/:1:2","tags":["Linux","图床"],"title":"Frp自建内网穿透","uri":"/posts/nat-traversal/"},{"categories":["Linux","图床"],"content":" 配置重点来了,frp有两个配置,一个frps.toml用于服务端,一个frpc.toml用于客户端 配置frps.toml bindPort = 7000 vhostHTTPPort = 7890 bindPort不用管,vhostHTTPPort为连接的端口,默认为8080,但端口被我的评论占用了,所以改成7890 如像我这样,配置完后可以通过http://www.yourdomain.com:7890访问 配置frpc.toml serverAddr = \"x.x.x.x\" serverPort = 7000 [[proxies]] name = \"image-hosting\" type = \"http\" localIP = \"192.168.xx.xxx\" localPort = 7890 customDomains = [\"www.example.com\"] serverAddr: 服务器IP name: 取一个好记的名字 type: 因为要搭建网站所以选择http localIP: 本机IP localPort: 内网服务部署端口 customDomains: 绑定的域名 PS: 原本还有一个remotePort = 6000配置,看到文档没有就删了,实测没有影响 将和 www.example.com 的域名 A 记录解析到服务器的 IP 地址x.x.x.x 访问www.example.com:7890即可访问内网机器上的7890服务 ","date":"2024-01-22","objectID":"/posts/nat-traversal/:1:3","tags":["Linux","图床"],"title":"Frp自建内网穿透","uri":"/posts/nat-traversal/"},{"categories":["Linux","图床"],"content":" Nginx配置不得不说Nginx真是好用,配置方便,功能强大; 配置完frp,接下来就是nginx 因为上面只进行了内网穿透,内网的机器还需要配置nginx来显示网站 还没有安装的在等什么,使用apt install nginx安装nginx 在etc/nginx/conf.d/文件夹内添加配置文件,文件名随意,以.conf作为拓展名 增添配置,以下为我的配置 server { listen 7890; server_name www.example.com; root /home/image-hosting; fancyindex on; fancyindex_exact_size off; fancyindex_localtime on; fancyindex_name_length 255; fancyindex_time_format \"%Y-%m-%d %H:%M:%S\"; location / { } } listen: 监听7890端口 server_name: 绑定的域名 root: 网站所在文件夹 以下配置开启文件引索,若无需求可以忽略 fancyindex on; fancyindex_exact_size on; fancyindex_localtime on; fancyindex_name_length 255; fancyindex_time_format \"%Y-%m-%d %H:%M:%S\"; 再一次尝试访问www.example.com:7890查看是否正常显示 去端口访问整天带端口访问太丑了,可以使用nginx的反向代理功能解决,原理就是在服务器上套层nginx,将www.example.com反向代理至www.example.com:7890 以下是我的配置 server { listen 80; server_name www.example.com; # 设置的域名 location / { proxy_pass http://www.example.com:7890; # 反向代理至8080端口 } } 配置完尝试使用www.example.com访问 ","date":"2024-01-22","objectID":"/posts/nat-traversal/:1:4","tags":["Linux","图床"],"title":"Frp自建内网穿透","uri":"/posts/nat-traversal/"},{"categories":["Linux","图床"],"content":" HTTPS虽然现在已经可以较为优雅地访问了,但因为缺少ssl证书,每次访问都给我警告 frp支持为本地 HTTP 服务启用 HTTPS,但需要自行下载证书到内网机器,而且无法使用像certbot这样的工具,所以我选择在服务器的Nginx配置证书 关于如何获取证书,我的上上篇文章已经讲的很清楚了,下面是我的配置 server { listen 80; server_name img.inuya.ltd; # 设置的域名 location / { proxy_pass http://img.inuya.ltd:7890; # 反向代理至7890端口 } } server { listen 443; server_name img.inuya.ltd; ssl_certificate /etc/letsencrypt/live/img.inuya.ltd/fullchain.pem; # 配置证书 ssl_certificate_key /etc/letsencrypt/live/img.inuya.ltd/privkey.pem; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; # 表示使用的加密套件的类型。 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # 表示使用的TLS协议的类型。 ssl_prefer_server_ciphers on; location / { proxy_pass http://img.inuya.ltd:7890; } } ","date":"2024-01-22","objectID":"/posts/nat-traversal/:1:5","tags":["Linux","图床"],"title":"Frp自建内网穿透","uri":"/posts/nat-traversal/"},{"categories":["Linux","图床"],"content":" 图床搞定了内网穿透,但怎么把图片显示出来呢,1P面板有个图床的docker镜像,用了下感觉很一般,不如自己建一个 因为没学过前端,所以只能边学边建,写出来的东西也是漏洞百出,但最起码能用了 ","date":"2024-01-22","objectID":"/posts/nat-traversal/:2:0","tags":["Linux","图床"],"title":"Frp自建内网穿透","uri":"/posts/nat-traversal/"},{"categories":["Linux","图床"],"content":" 文件引索原本是想写一个文件引索,看了几篇文章都是无从下手,偶然看到一篇关闭Apache默认文件引索功能的文章,想到Nginx是否也有这个功能,找了一下还真有,只不过需要手动开启 在内网机器的nginx配置中添加以下内容 server { listen 80; server_name 192.168.31.112; root /home/image-hosting; autoindex on; #启用或禁用目录列表输出 autoindex_format html; #设置目录列表的格式 autoindex_localtime on; #指定目录列表中的时间是否应以本地时区或 UTC 输出 autoindex_exact_size off; #是否应在目录列表中输出确切的文件大小 } 输入一个网站目录,看是否有类似界面 index预览 ","date":"2024-01-22","objectID":"/posts/nat-traversal/:2:1","tags":["Linux","图床"],"title":"Frp自建内网穿透","uri":"/posts/nat-traversal/"},{"categories":["Linux","图床"],"content":" 嵌入引索因索有了,但我不想手动一个个翻图片,于是将它嵌入到了我的主页 在代码中添加\u003ciframe\u003e标签即可嵌入一个网页,因为我想显示Images目录的引索,所以src中填入了images/ \u003cdiv class=\"div-pic\"\u003e \u003ciframe src=\"images/\" width=\"100%\" height=\"800px\" scrolling=\"auto\" framespacing=\"0\" allowfullscreen=\"true\"\u003e \u003c/iframe\u003e \u003c/div\u003e 就像这样 嵌入 如果想要更换嵌入的网站,只需要修改src=\"\" 里的内容为目标网址即可 美化引索但这样还有一个问题,默认的引索在网站的背景是透明的,导致看不清文件名,CSS添加的背景太亮了,又偶然看见一篇用第三方模块来美化的文章 使用fancyindex模块替代默认的引索,来达到美化的效果 apt install libnginx-mod-http-fancyindex安装模块 修改/创建/etc/nginx/conf.d/下的配置,添加以下内容以开启引索 server { listen 80; server_name 192.168.31.112; root /home/image-hosting; fancyindex on; fancyindex_exact_size off; fancyindex_localtime on; fancyindex_name_length 255; fancyindex_time_format \"%Y-%m-%d %H:%M:%S\"; location / { } } 返回网站,刷新即可看到新样式 fancyindex还有许多主题可选,如Nginx-Fancyindex-Theme和nginx-fancyindex-flat-theme 也可以用fancyindex加theme关键字在Guthub搜索其他主题 ","date":"2024-01-22","objectID":"/posts/nat-traversal/:2:2","tags":["Linux","图床"],"title":"Frp自建内网穿透","uri":"/posts/nat-traversal/"},{"categories":["Linux","图床"],"content":" 补充其实内网穿透这个想法很早就有了,但一直搁置到现在;未来可能还会把Twikoo评论也放到开发板上,还是要看评论的人多不多 最后祝大家玩得开心 参考 Module ngx_http_autoindex_module frp ","date":"2024-01-22","objectID":"/posts/nat-traversal/:3:0","tags":["Linux","图床"],"title":"Frp自建内网穿透","uri":"/posts/nat-traversal/"},{"categories":["Linux"],"content":"2024年的第一篇文章,祝大家新年快乐(虽然有点迟了) 这段时间重装了6次Arch,1次Debian Testing,几乎将主流桌面体验完了,血与泪的教训,wayland目前还不成熟,高分屏还得老老实实用x11 ","date":"2024-01-14","objectID":"/posts/arch-kde/:0:0","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" 起因逛B站时偶然看到了有人发Hyprland的配置,再看我的Kde瞬间就不香了 拿出我珍藏多年的Arch Live CD ,F12选择U盘启动,在经过一系列分区,生成fstab,引导后,成功来到了熟悉的tty界面,接下来照着B站的教程,开始安装Hyprland ","date":"2024-01-14","objectID":"/posts/arch-kde/:1:0","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" Hyprland Hyprland is a highly customizable dynamic tiling Wayland compositor that doesn’t sacrifice on its looks. Hyprland 是一款高度可定制的动态平铺 Wayland 合成器,不会牺牲其外观。 ","date":"2024-01-14","objectID":"/posts/arch-kde/:2:0","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" 安装 首先安装Wayland pacman -S xorg-xwayland qt5-wayland qt6-wayland glfw-wayland 安装Hyprland paru -S hyprland-bin 复制配置文件 mkdir -pv ~/.config/hypr sudo cp /usr/share/hyprland/hyprland.conf ~/.config/hypr/ Hyprland启动 通过编辑~/.bash_profile启动(不使用显示管理器) # 启动 wayland 桌面前设置一些环境变量 function set_wayland_env { cd ${HOME} # 设置语言环境为中文 export LANG=zh_CN.UTF-8 # 解决QT程序缩放问题 export QT_AUTO_SCREEN_SCALE_FACTOR=1 # QT使用wayland和gtk export QT_QPA_PLATFORM=\"wayland;xcb\" export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 # 使用qt5ct软件配置QT程序外观 export QT_QPA_PLATFORMTHEME=qt5ct # 一些游戏使用wayland export SDL_VIDEODRIVER=wayland # 解决java程序启动黑屏错误 export _JAVA_AWT_WM_NONEREPARENTING=1 # GTK后端为 wayland和x11,优先wayland export GDK_BACKEND=\"wayland,x11\" } # 命令行输入这个命令启动hyprland,可以自定义 function start_hyprland { set_wayland_env export XDG_SESSION_TYPE=wayland export XDG_SESSION_DESKTOP=Hyprland export XDG_CURRENT_DESKTOP=Hyprland # 启动 Hyprland程序 exec Hyprland } 重启或直接source ~/.bash_profile使配置生效,输入start_hyprland启动 ","date":"2024-01-14","objectID":"/posts/arch-kde/:2:1","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" 应用安装刚进入桌面,你会发现什么也没有,先装个终端和中文字体 sudo pacman -S kitty wqy-zenhei 使用快捷键Super+Q即可启动(Super键默认为WIN) 貌似一切都很完美,让我们装个QQ试逝 paru -S linuxqq 打开后你会发现字体变得很模糊,不止qq,其他程序在wayland缩放下的显示都不太好 ","date":"2024-01-14","objectID":"/posts/arch-kde/:2:2","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" Gnome GNOME originally an acronym for GNU Network Object Model Environment,is a free and open-source desktop environment for Linux and other Unix-like operating systems. GNOME是一个完全由自由软件组成的桌面环境。它的目标操作系统是Linux,但是大部分的BSD系统亦支持GNOME。 因为Hyprland的字体问题,我回到了一开始用的gnome;但因为使用wayland的原因,qq下的字体还是模糊,而且缩放有问题,200%会使字体和窗口过大,100%字又太小 gsettings set org.gnome.mutter experimental-features \"['scale-monitor-framebuffer']\" 使用此命令开启分数缩放 缩放是解决了,但字体的问题依旧,目前没找到完美的解决方案,只能用Tweaks工具调整字体大小 ","date":"2024-01-14","objectID":"/posts/arch-kde/:3:0","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" Cinnamon Cinnamon, forked from GNOME Shell, is the “shell” of Cinnamon. It provides the user interface such as panels, hot corners, menus etc. The ui is written in JavaScript, while its core libraries are written in C. Cinnamon是类Unix系统下的一个桌面环境。最初是GNOME Shell的一个派生版本,由Linux Mint开发,提供了相似于GNOME 2,易于使用的传统用户界面,从Cinnamon 2.0开始,成为独立的桌面环境。 一个由Mint开发的桌面,也是Linux Mint的默认桌面 Cinnamon不同于前两个,使用的是x11,所以基本没有字体和缩放问题,而且桌面和发生版都很适合新手,Debian系的包也比较多 但我不是很喜欢Cinnamon的设计,所以没有使用它 ","date":"2024-01-14","objectID":"/posts/arch-kde/:4:0","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" KDE Plasma Plasma is a graphical shell developed by KDE for Unix-like operating systems. Plasma is a standard desktop interface. KDE 是一套由 Plasma 桌面环境、一系列的库、框架(KDE Frameworks)和一些应用组成的软件项目。 目前在用的桌面,自定义程度很高,记录下配置过程 ","date":"2024-01-14","objectID":"/posts/arch-kde/:5:0","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" 汉化不完全表现为设置/文件管理器一半中文一半英文 编辑~/.config/plasma-localerc将LANG=h_CN改为LANG=zh_CN.UTF-8,重启后即可解决 ","date":"2024-01-14","objectID":"/posts/arch-kde/:5:1","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" 系统代理 手机代理设置-允许来自局域网连接,记录端口;在设置-网络设置-代理服务器中选择-使用手动指定的的代理服务器配置 手机任意终端su后使用ifconfig获取本机IP,填入代理设置 终端走代理 export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891 7890/7891为端口号,127.0.0.1为IP ","date":"2024-01-14","objectID":"/posts/arch-kde/:5:2","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" 常用应用 1. neovim使用nvimdots配置,另一选择NcChad LazyVim is a Neovim setup powered by 💤 lazy.nvim to make it easy to customize and extend your config. Rather than having to choose between starting from scratch or using a pre-made distro, LazyVim offers the best of both worlds - the flexibility to tweak your config as needed, along with the convenience of a pre-configured setup. 1.1 安装 1.1.1 依赖1 Neovim \u003e= 0.9.0 (needs to be built with LuaJIT) Git \u003e= 2.19.0 (for partial clones support) a Nerd Font (optional) a C compiler for nvim-treesitter. See here 1.1.2 安装 克隆配置 git clone https://github.com/LazyVim/starter ~/.config/nvim nvim启动! nvim 1.2 nvim下的复制粘贴sudo pacman -S xclip安装xclip后,使用v选中要复制的内容,y复制,p粘贴,d剪切 2. neofetch相信用过Linux的都听说过这个软件,它能显示系统Ascii art和硬件信息,可以通过修改~/.config/neofetch/config.conf进行配置 参考Kicamon的配置,进行了一些修改,用-代替图标 3. 网易云音乐写文章时没点音乐怎么行,目前Arch下我认为比较好的解决方法一是yesplaymusic,第二个就是go-musicfox 不过yesplaymusic尝试过三种登陆方式均无法登陆,遂只能使用go-musicfox go-musicfox是用Go写的又一款网易云音乐命令行客户端,支持UnblockNeteaseMusic、各种音质级别、lastfm、MPRIS、MacOS交互响应(睡眠暂停、蓝牙耳机连接断开响应、菜单栏控制等)… 使用pacman -S go-musicfox安装go-musicfox 输入musicfox进入tui 点击-我的歌单进行登陆 3.1 无法播放如果你很幸运,能直接播放,可以忽略这一步 sudo pacman -S pulseaudio-alsa libavtp 安装缺少的两个包就可以播放了 3.2 快捷键 按键 作用 ← h 左方向 → l 右方向 ↑ k 上方向 ↓ j 下方向 - 滚轮下 减小音量 = 滚轮上 增大音量 q 退出 Space (空格) 暂停/播放 更多快捷键请看README ","date":"2024-01-14","objectID":"/posts/arch-kde/:5:3","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" Bash这次安装我离开了Zsh,重新回到了Bash的怀抱,但默认的Prompt太丑了,只显示最后一级路径,于是抄参考Gentoo的.bashrc,重新配置了下 # /etc/bash/bashrc # # This file is sourced by all *interactive* bash shells on startup, # including some apparently interactive shells such as scp and rcp # that can't tolerate any output. So make sure this doesn't display # anything or bad things will happen! # Test for an interactive shell. There is no need to set anything # past this point for scp and rcp, and it's important to refrain from # outputting anything in those cases. if [[ $- != *i* ]]; then # Shell is non-interactive. Be done now! return fi # Bash won't get SIGWINCH if another process is in the foreground. # Enable checkwinsize so that bash will check the terminal size when # it regains control. #65623 # http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11) shopt -s checkwinsize # Disable completion when the input buffer is empty. i.e. Hitting tab # and waiting a long time for bash to expand all of $PATH. shopt -s no_empty_cmd_completion # Enable history appending instead of overwriting when exiting. #139609 shopt -s histappend # Save each command to the history file as it's executed. #517342 # This does mean sessions get interleaved when reading later on, but this # way the history is always up to date. History is not synced across live # sessions though; that is what `history -n` does. # Disabled by default due to concerns related to system recovery when $HOME # is under duress, or lives somewhere flaky (like NFS). Constantly syncing # the history will halt the shell prompt until it's finished. #PROMPT_COMMAND='history -a' # Change the window title of X terminals case ${TERM} in [aEkx]term* | rxvt* | gnome* | konsole* | interix | tmux*) PS1='\\[\\033]0;\\u@\\h:\\w\\007\\]' ;; screen*) PS1='\\[\\033_\\u@\\h:\\w\\033\\\\\\]' ;; *) unset PS1 ;; esac # Set colorful PS1 only on colorful terminals. # dircolors --print-database uses its own built-in database # instead of using /etc/DIR_COLORS. Try to use the external file # first to take advantage of user additions. # We run dircolors directly due to its changes in file syntax and # terminal name patching. use_color=false if type -P dircolors \u003e/dev/null; then # Enable colors for ls, etc. Prefer ~/.dir_colors #64489 LS_COLORS= if [[ -f ~/.dir_colors ]]; then eval \"$(dircolors -b ~/.dir_colors)\" elif [[ -f /etc/DIR_COLORS ]]; then eval \"$(dircolors -b /etc/DIR_COLORS)\" else eval \"$(dircolors -b)\" fi # Note: We always evaluate the LS_COLORS setting even when it's the # default. If it isn't set, then `ls` will only colorize by default # based on file attributes and ignore extensions (even the compiled # in defaults of dircolors). #583814 if [[ -n ${LS_COLORS:+set} ]]; then use_color=true else # Delete it if it's empty as it's useless in that case. unset LS_COLORS fi else # Some systems (e.g. BSD \u0026 embedded) don't typically come with # dircolors so we need to hardcode some terminals in here. case ${TERM} in [aEkx]term* | rxvt* | gnome* | konsole* | screen | tmux | cons25 | *color) use_color=true ;; esac fi if ${use_color}; then if [[ ${EUID} == 0 ]]; then PS1+='\\[\\033[01;31m\\]\\h\\[\\033[01;34m\\] \\w \\$\\[\\033[00m\\] ' else PS1+='\\[\\033[01;32m\\]\\u@\\h\\[\\033[01;34m\\] \\w \\$\\[\\033[00m\\] ' fi #BSD#@export CLICOLOR=1 alias ls='ls --color=auto' alias grep='grep --colour=auto' alias la='ls -A' alias ll='ls -alF' alias l='ls -CF' alias n='neofetch' else # show root@ when we don't have colors PS1+='\\u@\\h \\w \\$ ' fi for sh in /etc/bash/bashrc.d/*; do [[ -r ${sh} ]] \u0026\u0026 source \"${sh}\" done # Try to keep environment pollution down, EPA loves us. u 主要添加了别名,其他的可以自己修改 还有一个镰刀锤子配置也蛮好看的,但使用↑键查看历史命令时有Bug,不介意的可以用 PS1=\"\\e[1;32m\\w\\n\\e[1;33m☭ \\[$(tput sgr0)\\]\" 配置来源: https://www.zhihu.com/question/19803678/answer/1001803388 SDDM美化我们更换壁纸后一般连同SDDM的背景一起换了,但设置里的SDDM主题管理实在是难用,经常打不开更换界面,推荐直接到主题目录下更换 cd到需要配置的SDDM主题目录/usr/share/sddm/themes/ 进入主题文件夹,你会看见之前设置的背景(若有的话),和两个配置文件,分别是预设配置theme.conf和用户配置theme.conf.user 编辑用户配置theme.conf.user,找到background=100857791_p113767970.png这一行,可以看到目前我的背景为100857791_p113767970.png 将要设置的背景移入主题文件夹,将background=后的文件名改为要设置的文件名 重启即可 ","date":"2024-01-14","objectID":"/posts/arch-kde/:5:4","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" 内核编译Arch下的内核编译只需要安装两个包即可 sudo pacman -S bc inetutils # inetutils提供hostsname 到这里Arch的配置也基本完成了,我也可以睡个好觉了… 再插一嘴,uu们有好的图床或对象储存推荐吗,博客老没图片也不行,最好能便宜点 ","date":"2024-01-14","objectID":"/posts/arch-kde/:6:0","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["Linux"],"content":" 参考|引用 安装Hyprland的命令来源: https://blog.ticks.cc/posts/id/37hugsk/ 桌面介绍: https://en.wikipedia.org/ -\u003e https://wiki.archlinuxcn.org/wiki/KDE https://github.com/LazyVim/LazyVim?tab=readme-ov-file#%EF%B8%8F-requirements ↩︎ ","date":"2024-01-14","objectID":"/posts/arch-kde/:7:0","tags":["Linux","Kernel"],"title":"Arch下的Kde配置","uri":"/posts/arch-kde/"},{"categories":["日常"],"content":" 近况期中考刚考完,我也难得有时间静下心来写博客,虽然文笔不太好就是了 这个星期,广州跳过了秋天,直接来到了冬天,也可以说广州根本就没有春天和秋天 看了archlinux 简明指南的教程,在虚拟机试了一次后为我的物理机安装上了Arch,不得不说,aur是真的好使,很多包都能在上面找到 每日一滚 sudo pacman -Syu 最近半价买了一个月雨云的云服务器,学了下Nginx,把我的博客迁移到了上面 ","date":"2023-11-17","objectID":"/posts/winter/:1:0","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["日常"],"content":" Nginx原本想再水一篇,但想着也没什么好写的,就合并在一起 在你喜欢的目录创建用于存放博客的文件夹,将博客仓库git下来 server { listen 80; server_name test.inuya.ltd; root /home/blog; location / { } } 跟之前一样,在服务器/etc/nginx/conf.d目录下创建test.inuya.ltd.conf配置文件,写入以上内容,这里我用二级域名test.inuya.ltd演示 在域名提供商添加A类型解析,填入你的IP,使用http://test.inuya.ltd即可访问博客 ","date":"2023-11-17","objectID":"/posts/winter/:2:0","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["日常"],"content":" https配置完,会有一个问题,就是无法通过https访问,现在很多博客的友联已经不再添加没有https的博客了 ","date":"2023-11-17","objectID":"/posts/winter/:3:0","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["日常"],"content":" ssl证书阿里云现有免费的一年ssl证书可以申请 阿里云证书现只有三个月有效期,遂更换cerbot自动续费 在你的debian或基于debian的发行版上安装snap sudo apt install snapd 安装cerbot snap包 sudo snap install --classic certbot 准备 Certbot 命令 sudo ln -s /snap 获取证书,这里选择手动配置 sudo certbot certonly --nginx 测试下自动续费 sudo certbot renew --dry-run 证书应位于/etc/letsencrypt/live在Nginx中填入即可 其他发行版也可参考certbot instructions,选择对应的发行版即可 ","date":"2023-11-17","objectID":"/posts/winter/:3:1","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["日常"],"content":" 配置在原本的test.inuya.ltd.conf的配置中添加以下内容 server { listen 443 ssl; #配置HTTPS监听端口443。 server_name test.inuya.ltd; #将test.inuya.ltd换成证书绑定的域名 root html; index index.html index.htm; ssl_certificate cert/test.inuya.ltd.pem; #将test.inuya.ltd.pem换成自己的证书 ssl_certificate_key cert/test.inuya.ltd.key; #将test.inuya.ltd换成自己的证书密钥 ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #表示使用的加密套件的类型。 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #表示使用的TLS协议的类型。 ssl_prefer_server_ciphers on; location / { root /home/blog; #站点目录。 index index.html index.htm; } } 使用systemctl restart nginx重启Nginx,尝试带https访问网址 ","date":"2023-11-17","objectID":"/posts/winter/:3:2","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["日常"],"content":" 重定向如果想让所有的http访问都301重定向到https,可以在80端口的配置中添加一句return 301 https://$server_name$request_uri; 就像这样 server { listen 80; server_name test.inuya.ltd; return 301 https://$server_name$request_uri; root /home/blog; location / { } } ","date":"2023-11-17","objectID":"/posts/winter/:3:3","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["日常"],"content":" 主页域名只解析博客太浪费了,于是搭建了我的主页 修改自饭饭’s Homepage 2.0 主页: https://inuya.ltd ","date":"2023-11-17","objectID":"/posts/winter/:4:0","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["日常"],"content":" Twikoo评论都有服务器了,还用什么valine,早就听闻twikoo配置方便,今天一用,相见恨晚 我是用的是docker部署,docker run时加上--restart=always设置自启 部署完后访问http://\u003cip\u003e:8080,返回值如下 \"Twikoo 云函数运行正常,请参考 https://twikoo.js.org/frontend.html 完成前端的配置\" ","date":"2023-11-17","objectID":"/posts/winter/:5:0","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["日常"],"content":" Nginx反向代理因该是这么叫吧 部署到服务器后,发现评论系统被拦截了,因为博客是https,但评论只有http,所以被拦截 到域名服务商新建一条A记录解析,填入你的IP 在/etc/nginx/conf.d新建配置文件 server { listen 80; server_name twikoo.inuya.ltd; # 设置的域名 return 301 https://$server_name$request_uri; # 重定向至HTTPS location / { } } server { listen 443 ssl; server_name twikoo.inuya.ltd; ssl_certificate cert/twikoo.inuya.ltd.pem; # 配置证书 ssl_certificate_key cert/twikoo.inuya.ltd.key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; # 表示使用的加密套件的类型。 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # 表示使用的TLS协议的类型。 ssl_prefer_server_ciphers on; location / { proxy_pass http://localhost:8080; # 反向代理至8080端口 } } systemctl restart nginx重启Nginx,尝试使用域名访问 ","date":"2023-11-17","objectID":"/posts/winter/:6:0","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["日常"],"content":" CDN最近博客莫名延迟变高,甚至到了无法访问的地步,于是想着给博客套个CDN加速一下;正好雨云有免费的CDN可用 在雨云创建一个新的CDN,如购买了雨云的产品(云服务器/虚拟主机)可以免费使用。 创建完后复制生成的网址到域名注册商添加CNAME,这里为了方便直接使用*.inuya.ltd泛解析 ","date":"2023-11-17","objectID":"/posts/winter/:7:0","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["日常"],"content":" 题外话博客第一次有人主动申请友链,还是蛮激动的 如果有急事可以用inuya@foxmail.com联系我,因为是腾讯的邮箱所以可以微信提醒,回复的比较及时 ","date":"2023-11-17","objectID":"/posts/winter/:8:0","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["日常"],"content":" 参考 Nginx:Nginx添加SSL实现HTTPS访问 nginx开启ssl并把http重定向到https的两种方式 nuxt.js项目部署到linux服务器,并使用域名访问 个人服务器上部署博客评论系统:Twikoo Docker 容器设置自启动 Twikoo文档 Certbot 说明 ","date":"2023-11-17","objectID":"/posts/winter/:8:1","tags":["日常","Linux","nginx"],"title":"将你的博客部署到雨云","uri":"/posts/winter/"},{"categories":["hugo"],"content":"前几天,因为一个主题,我把博客从hexo换成hugo,也就是现在看到的 ","date":"2023-11-05","objectID":"/posts/hugo/:0:0","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 迁移hugo的操作比hexo要难,热门程度也不及hexo,所以遇到一些问题需要自己解决 ","date":"2023-11-05","objectID":"/posts/hugo/:1:0","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 安装 用sudo apt install git安装git 到All releases找到Linux下载go 用以下命令提取下载的archive rm -rf /usr/local/go \u0026\u0026 tar -C /usr/local -xzf go1.21.3.linux-amd64.tar.gz 编辑/etc/profile(系统范围安装),添加环境变量 export PATH=$PATH:/usr/local/go/bin 完成后使用source /etc/profile即可完成安装 使用sudo apt install snapd安装snap 使用sudo snap install dart-sass安装dart-sass 使用sudo snap install hugo安装hugo ","date":"2023-11-05","objectID":"/posts/hugo/:1:1","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 建站三连快速创建 hugo new site \u003csitename\u003e cd \u003csitename\u003e git init 这时候可以下载你喜欢的主题了,编辑hugo.toml,添加theme = \"themename\"指定主题 ","date":"2023-11-05","objectID":"/posts/hugo/:1:2","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 基础基础的指令和hexo差不多,不过原本的source变成了content,使用hexo server即可 如果提示由于本地 development 环境的限制, 评论系统 , CDN 和 fingerprint 不会在 development 环境下启用。,使用hugo server -e production更改环境即可 文章直接复制过来就能用,不过tags和categories的书写方式有点不同 tags: - tags1 - tegs2 categories: - catrgories1 - categories2 ","date":"2023-11-05","objectID":"/posts/hugo/:1:3","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 部署hexo的部署很简单,hexo g生成页面hexo d部署,同样需要ssh key,而hugo需要手动push到repo hugo # 生成页面 cd public git init # 初始化仓库 git remote add origin \u003crepo link\u003e git add . git commit -m \"提交说明\" git push -u origin master 这是访问域名,不出意外应该能看到你的博客 ","date":"2023-11-05","objectID":"/posts/hugo/:2:0","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 命令更新主题(FixIt) git submodule update --remote --merge ","date":"2023-11-05","objectID":"/posts/hugo/:3:0","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 阿里云服务器因为依然部署在Github Page,所以访问还是有点慢,于是我打开阿里云,想看看有什么便宜的服务器,突然看到免费试用三个月,这种好事怎么能错过 ","date":"2023-11-05","objectID":"/posts/hugo/:4:0","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 配置 2核2GB或者2核4GB 每月280元额度,3个月试用时长 这配置搭建博客可谓是绰绰有余 ","date":"2023-11-05","objectID":"/posts/hugo/:4:1","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 主页(导航页)域名目前只解析了博客,闲着也是闲着,不如建一个导航页 ","date":"2023-11-05","objectID":"/posts/hugo/:5:0","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 搭建使用了KZHomePage的主页,稍微配置下还是很好看的 将仓库git到你的服务器 git clone https://github.com/kaygb/KZHomePage.git 在喜欢的地方新建一个用于存放主页的文件夹 使用sudo apt install nginx安装Nginx 使用sudo systemctl enable nginx设置开机自启 启动Nginxsudo systemctl start nginx sudo systemctl status nginx查看Ngxin状态 访问域名/IP,若出现Welcome to Nginx即为成功 ","date":"2023-11-05","objectID":"/posts/hugo/:5:1","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 配置Nginx编写配置文件sudo nvim /etc/nginx/conf.d/yoursite.com.conf 写入以下配置 server { listen 80; server_name yoursite.com; root path-to-blog-name; location / { } } 80为监听端口,yoursite.com为你的域名,path-to-blog-name为存放主页文件夹的位置 完成后使用sudo systemctl restart nginx重启Ngixn服务,访问域名查看是否生效 之后就简单多了,修改index.html,可以看作者写的教程无需重新启动,刷新即可 ","date":"2023-11-05","objectID":"/posts/hugo/:5:2","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 博客博客和主页差不多,将Github上的仓库git clone下载,再创建一个文件夹用于存放,一个配置文件,端口改成你想要的,别太离谱即可 完成后设置域名解析,直接解析到你的IP,博客可以添加隐性url转发到你的域名+端口 ","date":"2023-11-05","objectID":"/posts/hugo/:5:3","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 总结因为没有备案,所以只能通过IP访问网站,不得不说,阿里云的服务器是真的贵,终于明白未成年不能备案的原因了 ","date":"2023-11-05","objectID":"/posts/hugo/:6:0","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":["hugo"],"content":" 参考 基于hugo搭建博客并部署 hugo博客部署到腾讯云轻量级服务器 HUGO ","date":"2023-11-05","objectID":"/posts/hugo/:7:0","tags":["hugo","nginx"],"title":"博客迁移至hugo","uri":"/posts/hugo/"},{"categories":null,"content":" 博客信息名称: Inuyasha 链接: https://blog.inuya.ltd 介绍: 相见时难别亦难,东风无力百花残 头像: https://blog.inuya.ltd/images/avator.jpg ","date":"2023-11-04","objectID":"/friends/:1:0","tags":null,"title":"朋友们","uri":"/friends/"},{"categories":null,"content":" 申请格式 - nickname: 博客名称 avatar: 头像 url: 链接 description: 简介 定期清理失效友链,链接更新请联系 先添加本站的优先通过 ","date":"2023-11-04","objectID":"/friends/:2:0","tags":null,"title":"朋友们","uri":"/friends/"},{"categories":["图床"],"content":" 题外话久违地打开了VScode写起了文章,不得不说,用VScode来写MarkDown是真的方便,装个插件就可以预览了 ","date":"2023-10-16","objectID":"/posts/upyun/:1:0","tags":["图床","又拍云"],"title":"Icarus主题下的配置","uri":"/posts/upyun/"},{"categories":["图床"],"content":" Icarus主题回到正题 因为Keep老出问题,于是,在几天前,我将主题更换为BUtterfly,可配置的选项非常多,整体美观度也非常不错;看似一切都很完美,那就没有这篇文章了 可是有一个缺点,就是加载的速度太慢了,除了必要的头像等,已经尽力让网站不出现图片,但首次加载仍需2~5秒的时间,如果刚好网不好,那就至少得8秒以上了。 其实早在几天前,我就开始申请又拍云联盟了,但因为网站访问时间太长,审核误认为无法访问给拒了 办法当然有,最好的方法就是换主题,前一段时候用的next主题就不错,黑白色调,除了图片其他的都不用怎么加载 于是我又换主题了,这次是有6K star的Icarus主题,整体看着也很不错,也没什么图片需要加载的 ","date":"2023-10-16","objectID":"/posts/upyun/:2:0","tags":["图床","又拍云"],"title":"Icarus主题下的配置","uri":"/posts/upyun/"},{"categories":["图床"],"content":" 又拍云联盟光换主题还不行,还得上魔法,因为我的博客部署在Github,所以访问比较慢,于是我打算给我的博客套个CDN CDN是什么 简单来说就是把我的文章分散在各个节点,如果你在广州,就可以直接访问广州CDN上的缓存资源,就不用跨越半个地球去Github的服务器上找了 你可能注意到了页脚处添加了本网站由又拍云提供CDN加速/云储存服务这是因为我加入了又拍云联盟;那么加入又拍云联盟又什么好处呢 免费获取每月 10GB 存储空间 + 15GB 流量 15GB流量对于我这种小型的博客完全够用了,而且10GB的云存储刚好可以用来作图床,这下所有的问题都解决了—–吗? ","date":"2023-10-16","objectID":"/posts/upyun/:3:0","tags":["图床","又拍云"],"title":"Icarus主题下的配置","uri":"/posts/upyun/"},{"categories":["图床"],"content":" 加入又拍云联盟想要白嫖首先得在网站的下方添加又拍云的标记和链接(本教程基于Icarus,可能不适用于您的主题) 首先找到~/hexo/themes/icarus/layout/common/footer.jsx其他主题的大概在这个目录或者上级目录layout中,用vim footer.jsx编辑它 仿照格式,添加上又拍云的文字 \u003ca href=\"https://www.upyun.com/?utm_source=lianmeng\u0026utm_medium=referral\" target=\"_blank\" rel=\"noopener\"\u003e本网站由\u003cimg src=\"/images/upyun.png\" alt=\"logo\" style={{width:'50px',height:'25px'}}/\u003e提供CDN加速/云储存服务\u003c/a\u003e 其中https://www.upyun.com/?utm_source=lianmeng\u0026utm_medium=referra为又拍云提供的链接,src=\"/images/upyun.png\"为logo的路径 ICP备案Icarus默认是没有ICP备案填写的配置的,我们可以仿照添加一个ICP 同样的文件,添加上 \u003ca href=\"https://icp.gov.moe/?keyword=20230439\" target=\"_blank\" rel=\"noreferrer noopener\"\u003e萌ICP备20230439号\u003c/a\u003e \u003cspan\u003e\u0026nbsp; || \u0026nbsp;\u003c/span\u003e 其中添加上\u003cspan\u003e\u0026nbsp; || \u0026nbsp;\u003c/span\u003e可于网站访问人数一同显示,中间用||隔开 完成后填写号信息点击申请,1-3个工作日内会回复,但我的域名没备案,所以CDN用不了,图床给的测试域名也不知道什么时候会失效 ","date":"2023-10-16","objectID":"/posts/upyun/:3:1","tags":["图床","又拍云"],"title":"Icarus主题下的配置","uri":"/posts/upyun/"},{"categories":["图床"],"content":" 又一题外话真的很喜欢写题外话 ","date":"2023-10-16","objectID":"/posts/upyun/:4:0","tags":["图床","又拍云"],"title":"Icarus主题下的配置","uri":"/posts/upyun/"},{"categories":["图床"],"content":" 友链Icarus的友链在侧边栏,这点和Next很像,同样的,一多就很难管理 我单独创建了一个友链页来展示我的朋友们(再插一嘴,空想笔记的站长去备案了,暂时访问不了) 用hexo new page link创建一个友链页面 原本想看下又没有好的解决方案,但找到的都没用,最后只能自己折腾一个了。 想要imaegoo大佬的友链页 在source/link/index.md填入以下内容生成一组(两个)友链 \u003cdiv class=\"columns\"\u003e \u003cdiv class=\"column is-half\"\u003e \u003cdiv class=\"box\"\u003e \u003ca target=\"_blank\" rel=\"noopener\" href=\"博客链接\"\u003e博客名称\u003c/a\u003e \u003cbr\u003e 博客简介 \u003c/p\u003e \u003c/div\u003e \u003c/div\u003e \u003cdiv class=\"column is-half\"\u003e \u003cdiv class=\"box\"\u003e \u003ca target=\"_blank\" rel=\"noopener\" href=\"博客链接\"\u003e博客名称\u003c/a\u003e \u003cbr\u003e 博客简介 \u003c/p\u003e \u003c/div\u003e \u003c/div\u003e \u003c/div\u003e 其中,每一个\u003cdiv class=\"column is-half\"\u003e就是一个友链,\u003cdiv class=\"columns\"\u003e范围内\u003cdiv class=\"column is-half\"\u003e的个数,就是一行显示的个数 作者这里写了两个,一行就显示两个友链,手机等屏幕较小的就显示一个 简介超出字数省略如果你的友链简介过长,就会出现一个友链占用过多空间导致布局不美观;在书写友链前添加以下css即可解决 \u003cstyle\u003e .box { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } \u003c/style\u003e ","date":"2023-10-16","objectID":"/posts/upyun/:4:1","tags":["图床","又拍云"],"title":"Icarus主题下的配置","uri":"/posts/upyun/"},{"categories":["图床"],"content":" 评论之前Keep用的是Giscus评论系统,感觉还不错,最重要的是有两条全站唯一的评论在 但Icarus不支持Giscus,需要手动修改comment.jsx 还是同样的~/hexo/themes/icarus/layout/common目录,找到comment.jsx 在\u003ch3 class=\"title is-5\"\u003e{__('article.comments')}\u003c/h3\u003e 和{(() =\u003e {中填入Giscus生成的代码 const logger = require('hexo-log')(); const { Component } = require('inferno'); const view = require('hexo-component-inferno/lib/core/view'); module.exports = class extends Component { render() { const { config, page, helper } = this.props; const { __ } = helper; const { comment } = config; if (!comment || typeof comment.type !== 'string') { return null; } return \u003cdiv class=\"card\"\u003e \u003cdiv class=\"card-content\"\u003e \u003ch3 class=\"title is-5\"\u003e{__('article.comments')}\u003c/h3\u003e + \u003cscript src=\"https://giscus.app/client.js\" + data-repo=\"[在此输入仓库]\" + data-repo-id=\"[在此输入仓库 ID]\" + data-category=\"[在此输入分类名]\" + data-category-id=\"[在此输入分类 ID]\" + data-mapping=\"pathname\" + data-strict=\"0\" + data-reactions-enabled=\"1\" + data-emit-metadata=\"0\" + data-input-position=\"bottom\" + data-theme=\"preferred_color_scheme\" + data-lang=\"zh-CN\" + crossorigin=\"anonymous\" + async\u003e + \u003c/script\u003e {(() =\u003e { try { let Comment = view.require('comment/' + comment.type); Comment = Comment.Cacheable ? Comment.Cacheable : Comment; return \u003cComment config={config} page={page} helper={helper} comment={comment} /\u003e; } catch (e) { logger.w(`Icarus cannot load comment \"${comment.type}\"`); return null; } })()} \u003c/div\u003e \u003c/div\u003e; } }; 添加完后,使用hexo s --debug本地预览,看是否出现评论框 这里又有一个问题,因为Icarus不支持Giscus,所以在_config.icarus.yml中,如果填入Giscus或者其他评论系统,生成界面和本地预览时都会出现warning,但不影响生成和预览 ","date":"2023-10-16","objectID":"/posts/upyun/:4:2","tags":["图床","又拍云"],"title":"Icarus主题下的配置","uri":"/posts/upyun/"},{"categories":["图床"],"content":" 添加Valine评论用了一天的Utterances,发现不登陆就看不到评论;反正评论也没了,不如选个更好的评论系统,最终选择了Valine 不用Waline的原因很简单,Vercel部署的时候提示我账号被锁了,懒得搞Gitlab,发邮件也没回我,无奈选用Valine 因为Icarus支持Valine,所以只需要填写配置即可,无需再修改comment.jsx LearnCloud 登陆或注册一个LearnCloud账号,进入控制台创建一个应用,随便取一个名字,选择开发版 找到设置/应用凭证,复制你的AppID和AppKey 转到主题配置文件_config.icarus.yml,在comment写入以下内容 comment: type: valine app_id: xxxxxxxxxxx-xxxxx app_key: xxxxxxxxxxxxxxxxxxxxxx placeholder: \"\" # 可选填 avatar: mm # 可选填 avatar_force: false # 可选填 meta: [\"nick\", \"mail\", \"link\"] # 可选填 page_size: 10 # 可选填 lang: zh-CN # 可选填 visitor: false # 可选填 highlight: true # 可选填 record_ip: false # 可选填 server_urls: # 可选填 emoji_cdn: # 可选填 emoji_maps: # 可选填 enable_qq: false # 可选填 required_fields: [] # 可选填 具体每个配置是什么意思请看Valine文档 坑1因为us.avoscloud.com域名失效,如果不填写serverURLs,就会导致net::ERR_CONNECTION_CLOSED这个错误 解决方法很简单,只需设置 server_urls: https://xxxxxxxx.api.lncldglobal.com # 把xxxxxxxx替换成你自己AppID的前8位字符 重新hexo三联即可评论 坑2 为履行合规责任,降低平台风险, LeanCloud 国际版共享域名将于 2022 年 8 月 1 日起不再向中国大陆的最终用户提供服务,国际版共享域名仅服务于海外用户。 因为这个原因,解决完坑1后国内用户如果要评论只能挂代理,国内网路也看不到别人的评论,需要我们绑定自己的域名 打开设置/域名绑定,输入你想绑定的二级域名 转到你购买域名的地方,添加一个CNAME解析,值为绑定时生成的值 等待DNS刷新,完成绑定 将上面的server_urls: 设置为绑定的域名 server_urls: https://xxxx.example.xxx 注意不要漏了https:// ","date":"2023-10-16","objectID":"/posts/upyun/:4:3","tags":["图床","又拍云"],"title":"Icarus主题下的配置","uri":"/posts/upyun/"},{"categories":["图床"],"content":" 参考 博客主题源码和配置文件 能否支持一下 giscus 评论 #1207 Icarus用户指南 - 用户评论插件 无法正常发送评论 #423 LeanCloud 更改用户条款后,Valine 在中国大陆不能评论的解决办法 Valine ","date":"2023-10-16","objectID":"/posts/upyun/:5:0","tags":["图床","又拍云"],"title":"Icarus主题下的配置","uri":"/posts/upyun/"},{"categories":["hexo"],"content":"最近比较忙,一方面刚开学,另一方面是因为butterfly加载速度太慢,转向next主题,很多东西需要重新配置;这篇文章与其说是教程,不如说是一篇记录 ","date":"2023-09-17","objectID":"/posts/next/:0:0","tags":["hexo"],"title":"Next主题进阶配置","uri":"/posts/next/"},{"categories":["hexo"],"content":" Next主题 🎉 Elegant and powerful theme for Hexo. 一个黑白为主色调的主题,很多人使用,却没有一个完整的中文教程;你能在Github上搜到三个next hexo-theme/hexo-theme-next theme-hexo/hexo-theme-next iissnan 我推荐使用第一个,也就是hexo-theme/hex-theme-next 因为讨论的人多,版本也是最新的 目前next还没有一个统一的教程,网上也有三篇不同的教程 Hexo-Next优点是支持中文,比较完善,缺点是没有官方内容多 Next使用文档同样支持中文,但是覆盖和内容没有上一个全 Next应该是官方文档,覆盖最全,但不支持中文 以上三个文档建议第一和第三混合看,第二个因为有点过时可以不看 ","date":"2023-09-17","objectID":"/posts/next/:1:0","tags":["hexo"],"title":"Next主题进阶配置","uri":"/posts/next/"},{"categories":["hexo"],"content":" 评论一个好的博客必定不能缺少评论系统,目前有许多解决方案可供选择,但我认为最方便,快捷的还是utterances utterances A lightweight comments widget built on GitHub issues. 以下以utt来代替utterances 作者尝试在butterfly主题中使用valine,但最终以失败告终,尝试gitalk同样因token被墙而失败,最后发现了这个宝藏评论系统 要使用utt,我们首先要创建一个仓库,必须要是公开的,然后我们需要安装 utterances app到我们的仓库 然后到了选择Blog Post ↔️ Issue Mapping 推荐Issue title contains page title 不容易混淆 最后编辑Next的_config.yml中的utterances utterances: enable: true #将false改为true repo: user-name/repo-name # 填入自己的仓库 # Available values: pathname | url | title | og:title issue_term: title #设置为title # Available values: github-light | github-dark | preferred-color-scheme | github-dark-orange | icy-dark | dark-blue | photon-dark | boxy-light theme: github-light 完成后,使用hexo s --debug本地预览博客,看是否出现评论框 ","date":"2023-09-17","objectID":"/posts/next/:1:1","tags":["hexo"],"title":"Next主题进阶配置","uri":"/posts/next/"},{"categories":["hexo"],"content":" 文章关闭评论设置完后默认会在所有page开启评论,如果想关闭分类或关于里的评论,可以在index.md中设定comments: false即可关闭 ","date":"2023-09-17","objectID":"/posts/next/:1:2","tags":["hexo"],"title":"Next主题进阶配置","uri":"/posts/next/"},{"categories":["hexo"],"content":" 友链Next主题自带的友链位于侧边栏,但人数一旦多起来便会拥挤不堪,于是参考浮生若梦的教程 在他的基础上删去了过期和推荐 大佬更新了配置,现在可以直接从yml读取配置 又更新了 之前要看 html 代码、改源代码,太麻烦了。 仿照 butterfly 的友链书写方式做成变量都从 yml 中读取了 首先在你Next文件夹/layout中创建一个名为links.njk的文件,写入以下内容 {##################} {### LINKS BLOCK ###} {##################} \u003cstyle\u003e @media (min-width: 768px) { .link-card { width: 50%; float: left; } } .link-card{ position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; box-sizing: border-box; } .link-user-list{ margin-bottom: 5px; border-radius: 3px; padding: 15px; display: block; box-shadow: 0 2px 6px rgba(0,0,0,.1); position: relative; } .link-user-list:hover{ background-color: #f6f8f8; text-decoration: none; } #link-container a{ border: none; } .user-avatar img{ border: 2px solid #fff; height: auto; vertical-align: middle; width: 100%; border-radius: 20%; max-width: 100%!important; margin: 0px !important; } .clearfix:after{ content: ' '; display: block; height: 0; clear: both; visibility: hidden; } .text-ellipsis{ display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size: 13px; } .user-message{ display: block; overflow: hidden; } .user-description{ color: #a0a0a0; } .user-avatar{ display: inline-block; width: 52px; height: auto; float: left !important; margin-right: 15px; position: relative; white-space: nowrap; } \u003c/style\u003e \u003cdiv id=\"link-container\"\u003e {% for link_config in site.data.links %} {% if link_config.class_name %} \u003ch2 id=\"{{ link_config.class_name }}\"\u003e \u003ca href=\"#{{ link_config.class_name }}\" class=\"headerlink\" title=\"{{ link_config.class_name }}\" data-pjax-state\u003e\u003c/a\u003e {{ link_config.class_name }} \u003c/h2\u003e {% else %} \u003chr\u003e {% endif %} \u003cdiv class=\"clearfix\"\u003e {% for link in link_config.link_list %} \u003cdiv class=\"link-card\"\u003e \u003ca href=\"{{ link.site }}\" target=\"_blank\" class=\"link-user-list\"\u003e \u003cspan class=\"user-avatar\"\u003e \u003cimg src=\"{{ link.avatar }}\" class=\"nofancybox\"\u003e \u003c/span\u003e \u003cspan class=\"user-message\"\u003e \u003cspan class=\"text-ellipsis\"\u003e{{ link.nickname }}\u003c/span\u003e \u003cspan class=\"user-description text-ellipsis\"\u003e{{ link.info }}\u003c/span\u003e \u003c/span\u003e \u003c/a\u003e \u003c/div\u003e {% endfor %} \u003c/div\u003e {% endfor %} \u003cdiv\u003e {{ page.content }} \u003c/div\u003e \u003c/div\u003e {######################} {### END LINKS BLOCK ###} {######################} 然后再打开Next文件夹/layout/page.njk ,在block title区域中的{{- __('title.schedule') + page_title_suffix }}后面添加上两行 {% block title %} {%- set page_title_suffix = ' | ' + title %} {%- if page.type === 'categories' and not page.title %} {{- __('title.category') + page_title_suffix }} {%- elif page.type === 'tags' and not page.title %} {{- __('title.tag') + page_title_suffix }} {%- elif page.type === 'schedule' and not page.title %} {{- __('title.schedule') + page_title_suffix }} + {%- elif page.type === 'links' and not page.title %} + {{- __('title.links') + page_title_suffix }} {%- else %} {{- page.title + page_title_suffix }} {%- endif %} {% endblock %} 接下来在下面的PAGE BODY中添加 {### PAGE BODY ###} {#################} \u003cdiv class=\"post-body{% if page.direction and page.direction.toLowerCase() === 'rtl' %} rtl{% endif %}\"\u003e {%- if page.type === 'tags' %} {%- include '_partials/page/tags.njk' -%} {% elif page.type === 'categories' %} {%- include '_partials/page/categories.njk' -%} {% elif page.type === 'schedule' %} {%- include '_partials/page/schedule.njk' -%} + {% elif page.type === 'links' %} + {%- include 'links.njk' -%} {% else %} {{ page.content }} {%- endif %} \u003c/div\u003e {#####################} {### END PAGE BODY ###} {#####################} 接下来和创建tags、about页一样,使用hexo new page links创建一个新页面,修改index.md添加申请信息和其他你想写在友链里的,设置type为links 最后在hexo/source/创建一个目录_data,里面再创建一个links.yml文件并填入以下内容 # 参数说明 # class_name 选填,可以理解为友链组的名字,如果不填则会在顶部生成一个分割线 # nickname 博客名称 # site 博客地址 # info 博客简介 # avatar 博客logo # 填写时注意缩进! - class_name: link_list: - nickname: site: info: avatar: - nickname: site: info: avatar: - class_name: link_list: - nickname: site: info: avatar: - nickname: site: info: avatar: 然后找到Menu区域,按照格式增加一个友链页面;完成后找到languages/zh-CN.yml,在Menu区域中添加友链的汉化 links: 友链 即可完成配置,以后想增加友链只需要在_config.yml中增添信息即可 ","date":"2023-09-17","objectID":"/posts/next/:1:3","tags":["hexo"],"title":"Next主题进阶配置","uri":"/posts/next/"},{"categories":["hexo"],"content":" 随笔有时我们可能想说点什么,但太短了成不了文章,于是我打算创建一个随笔页,专门记录短篇的文章 使用hexo new page essay创建一个随笔页 修改source/essay/index.md里的内容,修改标题并添加上type: essay 在主题配置文件中的Menu区域添加上随笔页 在languages/zh-CN.yml中添加友链的翻译即可 之后我们就可以在index.md中写文章了,但是看空想大佬的说说比我要好看,大佬没公布教程,我也没敢直接要,只能用折中的办法了 ","date":"2023-09-17","objectID":"/posts/next/:1:4","tags":["hexo"],"title":"Next主题进阶配置","uri":"/posts/next/"},{"categories":["hexo"],"content":" 域名绑定因为.xyz续费太贵,本身对这个域名也不是很满意,于是,一天前,我重新注册了一个新的域名inuya.ltd,并将他与我的博客绑定 要绑定域名,我们首先设置一个CNAME解析,将它指向原本的博客链接,再设置一个AAAA,通过ping username.github.io获取ipv6地址 然后在你博客的source目录创建一个名为CNAME的文件,填入你的域名 在你的设置中找到page/Custom domain,填入你的域名,点击save即可 设置完后使用原本的username.github.io会重定向到你的网站;尝试用你的域名访问,看能否访问成功 ","date":"2023-09-17","objectID":"/posts/next/:2:0","tags":["hexo"],"title":"Next主题进阶配置","uri":"/posts/next/"},{"categories":["hexo"],"content":" Google收录因为next的配置里带有收录的配置,所以我们只要选择HTML标记 将content=后面的内容复制到主题_config.yml中的google_site_verification: 然后再使用hexo clean \u0026\u0026 hexo g hexo d部署到Github即可完成验证,bing同理 ","date":"2023-09-17","objectID":"/posts/next/:3:0","tags":["hexo"],"title":"Next主题进阶配置","uri":"/posts/next/"},{"categories":["hexo"],"content":" 参考|引用 【Hexo】域名绑定篇 空想笔记 ","date":"2023-09-17","objectID":"/posts/next/:4:0","tags":["hexo"],"title":"Next主题进阶配置","uri":"/posts/next/"},{"categories":null,"content":" 相见时难别亦难,东风无力百花残","date":"2023-09-15","objectID":"/about/:1:0","tags":null,"title":"README","uri":"/about/"},{"categories":null,"content":" 博客信息框架:Hugo 主题:FixIt 若无特殊声明,本站均使用CC-BY-NC-SA许可协议 已部署至雨云服务器,访问速度应该比之前快 虽然最底下已经有了,但我还是要再写一遍 ","date":"2023-09-15","objectID":"/about/:2:0","tags":null,"title":"README","uri":"/about/"},{"categories":null,"content":" 个人简介姓名:Inuyasha 性别:当然是男 生日:5-28 双子座 爱好:喜欢刷机,唱跳rap(割割真癌粉),以及折腾一些好玩的;其他没什么很喜欢的,也没什么不喜欢的 ","date":"2023-09-15","objectID":"/about/:3:0","tags":null,"title":"README","uri":"/about/"},{"categories":null,"content":" 人格\u0026性格性格类型: 鉴赏家 (ISTP-T) 个性特征: 内向型 – 60%, 现实型 – 54%, 逻辑型 – 57%, 展望型 – 52%, 谨慎 – 60% ","date":"2023-09-15","objectID":"/about/:3:1","tags":null,"title":"README","uri":"/about/"},{"categories":null,"content":" 联系方式酷安: inuyasha_ Github: inuyasha-660 其他邮箱: admin@inuya.ltd(我的域名邮箱) 网易云:inuyasha-660 Twitter: inuyasha_660 就放这么多了,相信你可以找到我 ","date":"2023-09-15","objectID":"/about/:4:0","tags":null,"title":"README","uri":"/about/"},{"categories":["开发板"],"content":" 开启IPV6上一篇文章用开发板搭建了alist,mc服务器,但没有公网ip,只能局域网下访问,我当然不能忍,这篇文章讲述我如何获取公网ipv6和踩的一些坑 ","date":"2023-08-23","objectID":"/posts/ipv6/:1:0","tags":["ipv6"],"title":"家庭网络优化","uri":"/posts/ipv6/"},{"categories":["开发板"],"content":" 光猫配置首先进入光猫的后台,我的猫是华为的老东西了,用普通的账号root密码admin进是能进去,但是很多设置只能看,改不了,于是我查遍bing,终于找到了适合我的超级管理员密码,大家可以试试 账号:telecomadmin 密码:admintelecom 输入密码进入后台,找到wan设置,把路由器的wan改为桥接,并把ipv4改为ipv4/ipv6如果是灰色的不能更改,请按下面的步骤设置,以chrome为例 在不能点击的ipv4设置上右键,点击检查,查看时候有disable属性,如果有的话,对准属性右键,点击edit attribute删除disable,不需要关闭,直接点击ipv4就应该能设置了需要注意的是,如果用普通账号登陆,比如上面的root,你是无法设置开启ipv6的,即使删去disable,点击应用后仍然是ipv4 ","date":"2023-08-23","objectID":"/posts/ipv6/:1:1","tags":["ipv6"],"title":"家庭网络优化","uri":"/posts/ipv6/"},{"categories":["开发板"],"content":" 路由器开启ipv6光猫设置完成了,现在你应该是没网的状态,别慌,登陆路由器后台,以小米路由器为例,点击常用设置-上网设置,开启ipv6,上网方式选择native,然后在上网设置里选择PPoE拨号上网,输入你的宽带帐号密码 这时候可能有小伙伴问,如果忘了怎么办呢?没关系,这里有两种解决办法 以移动为例,关注微信公众号中国移动10086,直接找人工客户,把你办宽带用的电话给他,叫他帮你查 也可以用手机登陆小米路由器后台,点击右下角宽带账号信息即可查看 输入正确的帐号密码,这下应该能成功连上网了,等一会,你会发现后台出现了ipv6的地址,访问ipv6测试如果成绩是10/10那么说明你就成功了(如果不行的话重启路由器和光猫试试) ","date":"2023-08-23","objectID":"/posts/ipv6/:1:2","tags":["ipv6"],"title":"家庭网络优化","uri":"/posts/ipv6/"},{"categories":["开发板"],"content":" 关闭防火墙得到公网ipv6之后,可能会有小伙伴发现在局域网内可以通过ipv6访问,但使用流量就不行,很大原因是你路由器有ipv6防火墙,拒绝外网访问,我们需要关闭才能从流量访问, 因为低端的小米路由器默认是没有关闭防火墙的开关的,所以我们需要ssh连接路由器进行手动配置 温馨提示:此教程可能不适用于较新的路由器,作者用的是红米AC2100 首先登陆你路由器的后台,然后查看地址栏,找到stok=xxxxxxxx把=到/中间的复制下来 浏览器输入以下内容 \u003c stok \u003e换成你上面复制的内容,如果输出{“code”:0}那就是成功 http://192.168.31.1/cgi-bin/luci/;stok=\u003cSTOK\u003e/api/misystem/set_config_iotdev?bssid=Xiaomi\u0026user_id=longdike\u0026ssid=-h%3B%20nvram%20set%20ssh_en%3D1%3B%20nvram%20commit%3B%20sed%20-i%20's%2Fchannel%3D.*%2Fchannel%3D%5C%22debug%5C%22%2Fg'%20%2Fetc%2Finit.d%2Fdropbear%3B%20%2Fetc%2Finit.d%2Fdropbear%20start%3B 浏览器进入,同样,\u003c STOK \u003e换成自己stok http://192.168.31.1/cgi-bin/luci/;stok=\u003cSTOK\u003e/api/misystem/set_config_iotdev?bssid=Xiaomi\u0026user_id=longdike\u0026ssid=-h%3B%20echo%20-e%20'admin%5Cnadmin'%20%7C%20passwd%20root%3B 完成后,使用ssh root@192.168.31.1连接路由器,密码为admin 看到大大的ARE U ok就代表成功了 因为openssh7.0以后的版本不再支持ssh-dss(DSA)算法,所以可能会报错,尝试使用以下命令连接 ssh -oHostKeyAlgorithms=+ssh-rsa root@192.168.31.1 连上以后就好办了,使用vi /etc/config/firewall修改配置文件,修改config defaults改为 config defaults option syn_flood '0' option input 'ACCEPT' option output 'ACCEPT' option forward 'ACCEPT' option drop_invalid '0' option disable_ipv6 '0' 最后重启防火墙 /etc/init.d/firewall restart ","date":"2023-08-23","objectID":"/posts/ipv6/:2:0","tags":["ipv6"],"title":"家庭网络优化","uri":"/posts/ipv6/"},{"categories":["开发板"],"content":" 拓展因为运营商分配的大都是动态ipv6,顾名思义,就是ip过一段时间就会变,你也不想玩着玩着突然服务器没了吧 ","date":"2023-08-23","objectID":"/posts/ipv6/:3:0","tags":["ipv6"],"title":"家庭网络优化","uri":"/posts/ipv6/"},{"categories":["开发板"],"content":" 域名购买要解决上述问题,只需要有一个域名进行ddns解析即可 我们可以到阿里云购买域名(这里需要注意的是,请尽量不要购买.xyz的域名,因为续费真的很贵 支付宝登陆阿里云 搜索域名,输入你喜欢的域名,选择后缀,这里有钱的直接上.com,没钱的随便选个便宜的,但是一定要看续费,除非你只用一年 点击右上角购物车购买,买前需要创建一个信息模板和需要实名认证,未成年也能注册 买完后点击右上角AccessKey,创建一个key,一定不要分享给别人,最好把csv下载下来 在域名控制台-域名解析中,点击添加记录,记录类型设置为AAAA当然你有公网ipv4也可以多添加一个A类型的 ","date":"2023-08-23","objectID":"/posts/ipv6/:3:1","tags":["ipv6"],"title":"家庭网络优化","uri":"/posts/ipv6/"},{"categories":["开发板"],"content":" DDNS-GO 简单好用的DDNS。自动更新域名解析到公网IP(支持阿里云、腾讯云、Dnspod、Cloudflare、Callback、华为云、百度云、Porkbun、GoDaddy、Google Domain) 到了这一步,你应该得到了一个属于你的域名,恭喜你,这时候可以设置ddns动态解析了了 我用的是ddns-go,在github上面就能找到 下载适合自己架构和系统的压缩包,解压到你喜欢的位置,使用sudo ./ddns-go -s install安装ddns-go 在浏览器输入http://127.0.0.1:9876/登陆后台(如果像我一样,使用ssh远程控制开发板,输入开发板的ip:9876/也可以进入后台) DNS服务商选择自己注册域名的服务商 AccessKeyID和secret是上面创建的,有的服务商没有id着一个选项 获取ip的方式接口或网卡都行 Domains填入自己的域名和二级域名 点击save保存即可完成配置 之后尝试用域名+网站端口访问网站,ssh也可以使用username@域名访问,流量访问也要试下 Enjoy ","date":"2023-08-23","objectID":"/posts/ipv6/:3:2","tags":["ipv6"],"title":"家庭网络优化","uri":"/posts/ipv6/"},{"categories":["开发板"],"content":" 后记不知道是设置问题还是光猫太老了,ipv6过一段时间就会实效,需要手动重启光猫和机顶盒 ","date":"2023-08-23","objectID":"/posts/ipv6/:4:0","tags":["ipv6"],"title":"家庭网络优化","uri":"/posts/ipv6/"},{"categories":["开发板"],"content":" 参考|部分引用https://blog.csdn.net/skyxc233/article/details/107284478 https://zhuanlan.zhihu.com/p/260531160 https://zhidao.baidu.com/question/201179930957973045/answer/3652646687.html https://github.com/jeessy2/ddns-go ","date":"2023-08-23","objectID":"/posts/ipv6/:5:0","tags":["ipv6"],"title":"家庭网络优化","uri":"/posts/ipv6/"},{"categories":["Linux"],"content":"安装完linux要干什么? 当然是美化一下终端啦 ","date":"2023-08-19","objectID":"/posts/shell/:0:0","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" FIsh fish is a smart and user-friendly command line shell for Linux, macOS, and the rest of the family. 我接触到的第一个shell,自带语法高亮和自动补全这两项神器,如果你不嫌弃默认的主题的话,fish可以说是开箱即用 ","date":"2023-08-19","objectID":"/posts/shell/:1:0","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" 安装ubuntu环境下,使用apt命令进行安装 sudo apt install fish 安装完成后直接输入fish即可进入,默认会有一段欢迎语,如果不喜欢,可以用fish -c \"set -U fish_greeting\"来关闭 如果想要设置为默认的shell,则需使用chsh -s $(which fish)进行设置 ","date":"2023-08-19","objectID":"/posts/shell/:1:1","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" 主题安装完成后当然要再装一个主题除非你喜欢默认 这里我们使用oh-my-fish来安装主题 curl -L github.com/oh-my-fish/oh-my-fish/raw/master/bin/install | fish omf help 完成后输入omf,在fish下,如果命令是绿色的,那就是安装成功了,否则检查是否安装成功 输入omf theme即可查看能够安装的主题,以fox主题为例,下列是omf的使用方法 omf theme #列出主题 omf install fox #安装fox主题 omf theme fox #更换fox主题 omf doctor #自检 omf destroy #卸载 omf update #更新 如需安装更多主题请看小贝塔,里面把所有的主题样式都展示出来 ","date":"2023-08-19","objectID":"/posts/shell/:1:2","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" 别名fish自带了la也就是ls -A的别名,能更方便我们查看 ","date":"2023-08-19","objectID":"/posts/shell/:1:3","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" Zsh Zsh is a shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of bash, ksh, and tcsh were incorporated into zsh; many original features were added. zsh对于bash的兼容性要好很多,相对的,想要配置zsh对比fish也要难 ","date":"2023-08-19","objectID":"/posts/shell/:2:0","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" 安装同样,使用apt命令安装 sudo apt install zsh 不同的是,zsh安装下一次启动终端时会弹出配置界面,使用和数字键选择即可完成配置 ","date":"2023-08-19","objectID":"/posts/shell/:2:1","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" 主题因为omz会拖慢zsh的速度,所以我们不选用omz来配置 这里以p10k主题为例;需要注意的是,因为p10k使用一部分的emoji图标,所以要想完美的显示最好安装nerd字体 不想安装或已经安装完成的小伙伴可以跳过这一步 依据github上的文档,下载这四个字体文件,并分别双击安装,然后在终端的首选项里选择nerd字体即可 MesloLGS NF Regular.ttf MesloLGS NF Bold.ttf MesloLGS NF 斜体.ttf MesloLGS NF Bold Italic.ttf 安装完字体就可以正式开始安装p10k主题 git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ~/powerlevel10k echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' \u003e\u003e~/.zshrc 使用以上命令即可完成安装 使用exec zsh重新启动zsh,完成后即可看到p10k的配置界面,按照提示,完成配置即可 ","date":"2023-08-19","objectID":"/posts/shell/:2:2","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" 插件因为zsh默认没有语法高亮和自动补全,所以需要两个插件来实现 语法高亮使用zsh-syntax-highlighting这个插件来实现高亮 git clone https://github.com/zsh-users/zsh-syntax-highlighting.git echo \"source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\" \u003e\u003e ${ZDOTDIR:-$HOME}/.zshrc 使用以上两条命令安装插件 source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 开启插件 自动补全使用[zsh-autosuggestions](git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions )这一个插件实现 git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions 可能有细心的小伙伴发现,对语法高亮,自动补全貌似少了一条命令,因为自动补全没有将插件echo到.zshrc配置文件中,会导致重启终端后不启动插件,需要手动执行source命令开启,而语法高亮因为echo到.zshrc中,所以会跟着zsh一同启动 我们可以手动添加一条命令到.zshrc echo \"source ${(q-)PWD}~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh\" \u003e\u003e ${ZDOTDIR:-$HOME}/.zshrc # ~/ 插件文件夹 / 插件.zsh \u003e\u003e\u003e写入到.zshrc 修改完成后执行 source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh 多重启几次终端,查看是否开启自动补全,如果重启没有自动补全,则需要检查上面的echo命令的路径是否是你插件的位置 ","date":"2023-08-19","objectID":"/posts/shell/:2:3","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" 别名zsh默认是没有带任何别名的,我们要去.zshrc中自行配置,zsh的配置文件在/home/username/.zshrc alias la='ls -A' alias ll='ls -alF' alias l='ls -CF' 即可设置别名,也可以仿照上面的格式自定义 ","date":"2023-08-19","objectID":"/posts/shell/:2:4","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" Bash This is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and the C shell (csh) 这是debian和众多发行版默认的shell,也是作者正在用的shell 用回zsh了,p10k真香 因为zsh和fish对bash的不兼容,使我在打包AnyKernel3的时候需要手动添加一行命令到.zshrc,以我的性格肯定不能忍,于是我就想有没有一种既对bash兼容性好,又方便易用的解决方案 ","date":"2023-08-19","objectID":"/posts/shell/:3:0","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" 语法因为脚本大多用的解释器都是bash,所以学习了下bash的语法 脚本解释器 #!/bin/bash 变量 a=1 b=2 c=$(($a+$b)) echo $c 输出结果为3 环境变量 使用export命令 export ABC=/usr/local/abc #重启终端后失效 逻辑运算 \u0026\u0026与运算,需要同时为True ||或运算,其中一个为True if语句 if [ 条件 ];then command ... fi #以fi结尾 for语句 for arg in [list];do command1 command2 ... done 不要忘了do前的; while语句 while [ condition ];do command1 command2 ... done until循环 until condition;do # 条件为false则进入循环 command1 command2 ... done 函数 使用function定义一个函数 function func_name(){ command1 command2 ... [return value] } 可直接使用函数名调用函数,例如 function helloworld(){ echo \"Hello World\" } helloworld 将在屏幕输出HelloWorld sed命令 作用是找到并替换文本,如 sed -i \"s/world/hugo/g\" helloworld.sh #将helloworld.sh中的world全部替换成hugo ","date":"2023-08-19","objectID":"/posts/shell/:3:1","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" Starship 这是一个以兼容性优先,使用Rust编写,高度自定义的命令的提示符 它可以用于各种shell,包括常见的Bash/zsh/fish等,所以基本不存在兼容性问题,又能得到美丽的终端 自带自动补全和语法高亮 需要shell支持,开箱即用,安装简单,对小白极其友好 ","date":"2023-08-19","objectID":"/posts/shell/:3:2","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" 安装starship的安装十分简单,只需要执行 curl -sS https://starship.rs/install.sh | sh 即可完成安装,之后你需要在.bashrc里开启starship 在.bashrc的最后,添加以下内容 eval \"$(starship init bash)\" 重启终端,即可看到starship的默认样式 ","date":"2023-08-19","objectID":"/posts/shell/:3:3","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" 进阶如果不满意默认的主题,可以使用以下命令创建配置 mkdir -p ~/.config \u0026\u0026 touch ~/.config/starship.toml 修改配置请看 https://starship.rs/config/ 预设里还能找到别人的主题配置 ","date":"2023-08-19","objectID":"/posts/shell/:3:4","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" PS1在用了一段时间的starship后,可能会有小伙伴发现,打开多文件的文件夹会比较卡顿,路径有时会折叠 于是我果断卸载,改用最简单粗暴的方式,直接修改PS1变量 PS1的含义太多了,这里就不全列出来 \\u 用户名 \\n 换行 \\w 绝对路径 \\W 路径的最后一个文件夹 \\t 24小时制时间 \\T 12小时制 $ root用户为#,普通$ \\h 主题名 \\d 日期 你也可以设置颜色 30m 黑色 31m 红色 32m 绿色 33m 黄色 34m 蓝色 更多变量和颜色请看 官方文档 CSDN 除此之外,还可以使用一些其他的符号和文字美化,例如 \u003e /~/abc/./+等都可以,也可以使用表情 我现在用的是CSDN里找的ParrotOS风格 PS1='\\[\\033[0;31m\\]\\342\\224\\214\\342\\224\\200$([[ $? != 0 ]] \u0026\u0026 echo \"[\\[\\033[0;31m\\]\\342\\234\\227\\[\\033[0;37m\\]]\\342\\224\\200\")[\\[\\033[0;39m\\]\\u\\[\\033[01;33m\\]@\\[\\033[01;96m\\]\\h\\[\\033[0;31m\\]]\\342\\224\\200[\\[\\033[0;32m\\]\\w\\[\\033[0;31m\\]]\\n\\[\\033[0;31m\\]\\342\\224\\224\\342\\224\\200\\342\\224\\200\\342\\225\\274 \\[\\033[0m\\]\\[\\e[01;33m\\]\\$ \\[\\e[0m\\]' ps1来自csdn@Jiuh-star,侵联删 因为$和命令贴的太近,于是在 $和\"[\\e[0m]]“中间加了一个空格 ","date":"2023-08-19","objectID":"/posts/shell/:3:5","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["Linux"],"content":" 参考一文掌握shell脚本的基本语法 ","date":"2023-08-19","objectID":"/posts/shell/:4:0","tags":["Linux"],"title":"Linux下的各种shell","uri":"/posts/shell/"},{"categories":["hexo"],"content":" 介绍hexo是什么 Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用 Markdown(或其他标记语言)解析文章,在几秒内,即可利用靓丽的主题生成静态网页。 fluid是什么 Fluid 是基于 Hexo 的一款 Material Design 风格的主题 ","date":"2023-08-12","objectID":"/posts/hexo/:1:0","tags":["hexo"],"title":"hexo建立个人博客并部署到GitHub","uri":"/posts/hexo/"},{"categories":["hexo"],"content":" 开始推荐搭配官方文档一起看 本教程基于Linux环境,作者用的是Debian12,window环境请搜索别的教程 使用以下命令安装git sudo apt-get install git-core 安装Node.js 下载并导入 Nodesource GPG 密钥 sudo apt-get update sudo apt-get install -y ca-certificates curl gnupg sudo mkdir -p /etc/apt/keyrings curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg 创建 deb 存储库 NODE_MAJOR可以根据需要的版本进行更改 NODE_MAJOR=21 echo \"deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main\" | sudo tee /etc/apt/sources.list.d/nodesource.list 更新并安装 sudo apt-get update sudo apt-get install nodejs -y 安装hexo npm install -g hexo-cli 安装完成后选择一个目录新建所需文件,作者这里用hexo文件夹 hexo init \u003cfolder\u003e #新建所选目录 cd \u003cfolder\u003e npm install ","date":"2023-08-12","objectID":"/posts/hexo/:2:0","tags":["hexo"],"title":"hexo建立个人博客并部署到GitHub","uri":"/posts/hexo/"},{"categories":["hexo"],"content":" 主题到这里基本的安装已经完成,作者安装fluid主题,当然,别的也可以 到fluid下载最新的source code.tar.gz 使用tar -zxvf xxxxx.tar.gz解压 然后将解压完的文件重命名为fliud 将它移动到第四步你设定的目录下的themes文件夹 修改hexo根目录下的_config.yml文件,设定主题 theme: fluid language: zh-CN 根据主题的教程,这时候我们需要创建一个关于页 hexo new page about 创建后修改/source/about/index.md的内容,添加layout属性 --- title: 你的标题 layout: about --- #下面写正文 其他的请看用户手册,就不细说了 配置好主题后我们生成一个本地的预览网页 hexo s 输入http://localhost:4000就能看到生成的预览,注意只能本机访问 默认的文章是hello world,你可以使用hexo n \"标题\"来新建博客,包括初始的hello world ,都在source/_posts目录,如果想删掉文章,直接用rm命令就行 ","date":"2023-08-12","objectID":"/posts/hexo/:2:1","tags":["hexo"],"title":"hexo建立个人博客并部署到GitHub","uri":"/posts/hexo/"},{"categories":["hexo"],"content":" 目录介绍 source/_posts 存放文章 public 生成的html themes 存放主题 _config.yml 配置文件,主题文件夹里的是主题的配置文件 ","date":"2023-08-12","objectID":"/posts/hexo/:2:2","tags":["hexo"],"title":"hexo建立个人博客并部署到GitHub","uri":"/posts/hexo/"},{"categories":["hexo"],"content":" 部署到Github因为本地启动之能我们自己看,要想让别人也看到就要部署到GitHub或者绑定域名 其他托管网站也行,比如gitee,只是方法有点不同,这里用GitHub 确保你安装了git执行以下命令配置git git config --global user.name \"你的Github用户名\" #冒号不用删 git config --global user.email \"你的Github邮箱\" 配置完后开始生成密钥 ssh-keygen -t rsa -C \"你的Github邮箱\" 默认三个全回车就行,完成后会生成id_rsa.pub cat ~/.ssh/id_rsa.pub #查看密钥 复制ssh开头的输出,打开GitHub,找到settings-SSH and GPG Keys 选择add new名字随便取,在ssh里填入你刚刚复制的内容,点击添加 执行以下命令,会询问你是否连接,输入yes后如果有Hi xxx! You’ve successfully authenticated…就代表连接成功 ssh -T git@github.com 再去创建一个名为用户名.github.io的仓库,选项默认就行 回到hexo,vim编辑_config.yml文件,修改deploy deploy: type: git repo: git@github.com:你的用户名/你的用户名.github.io.git branch: master 修改完后用以下命令生成并部署到GitHub hexo clean #清理缓存 hexo g #生成静态网页 hexo d #部署到GitHub 完成后再浏览器里访问用户名.github.io如果没有404,那就成功了 如果出现extends includes/layout.pug block content include includes/recent-posts.pug include includes/partial,可以尝试安装 npm install --save hexo-renderer-jade hexo-generator-feed hexo-generator-sitemap hexo-browsersync hexo-generator-archive ","date":"2023-08-12","objectID":"/posts/hexo/:3:0","tags":["hexo"],"title":"hexo建立个人博客并部署到GitHub","uri":"/posts/hexo/"},{"categories":["hexo"],"content":" 基础写作开始写文章前需要设定几个参数,我这里列举几个比较常用的 --- title: #你的标题 date: #写作日期 tags: #标签 categories: #分类 updated: #更新日期 --- 如果想添加多个tags,可以用[tags1,tags2,tags3]来设定 ","date":"2023-08-12","objectID":"/posts/hexo/:4:0","tags":["hexo"],"title":"hexo建立个人博客并部署到GitHub","uri":"/posts/hexo/"},{"categories":["hexo"],"content":" 迁移至新电脑如果换电脑或重装系统,只需保留 _config.yml #配置文件 themes #主题文件夹 _config.\u003cthemename\u003e.yml #如果有 package.json #插件列表 package-lock.json source #文章 scaffolds db.json 将文件移入hexo文件夹,使用npm install安装插件 ","date":"2023-08-12","objectID":"/posts/hexo/:5:0","tags":["hexo"],"title":"hexo建立个人博客并部署到GitHub","uri":"/posts/hexo/"},{"categories":["hexo"],"content":" 参考2022【保姆级教程】含泪搭建hexo博客 hexo文档 CSDN-大数据梦想家 ","date":"2023-08-12","objectID":"/posts/hexo/:6:0","tags":["hexo"],"title":"hexo建立个人博客并部署到GitHub","uri":"/posts/hexo/"},{"categories":["代理"],"content":"clash仓库已删除,如没有备份的可以在我的alist上下载 ","date":"2023-08-11","objectID":"/posts/clash/:0:0","tags":["代理","Linux"],"title":"Clash-For-Linux","uri":"/posts/clash/"},{"categories":["代理"],"content":" 下载clash从Github下载clash 因为最新的c17没有arm64的版本,所以选用c16,下载好gz包,用以下命令解压 gunzip clash-linux-arm64-vxxx.gz ","date":"2023-08-11","objectID":"/posts/clash/:1:0","tags":["代理","Linux"],"title":"Clash-For-Linux","uri":"/posts/clash/"},{"categories":["代理"],"content":" 创建文件夹为clash创建一个文件夹 mkdir -p clash 将clash移入 mv clash-linux-arm64-vxxx.gz clash 重命名 cd clash mv clash-linux-arm64-vxxxx clash ","date":"2023-08-11","objectID":"/posts/clash/:1:1","tags":["代理","Linux"],"title":"Clash-For-Linux","uri":"/posts/clash/"},{"categories":["代理"],"content":" 配置下载下载自己订阅的配置 wget -O config.yaml \"xxxxxxxxxxxxxxxxxxxxxxxxxx\" ","date":"2023-08-11","objectID":"/posts/clash/:1:2","tags":["代理","Linux"],"title":"Clash-For-Linux","uri":"/posts/clash/"},{"categories":["代理"],"content":" clash 启动赋予二进制文件执行权限并执行clash chmod +x clash ./clash -d . 不要漏了那一点(.) ","date":"2023-08-11","objectID":"/posts/clash/:2:0","tags":["代理","Linux"],"title":"Clash-For-Linux","uri":"/posts/clash/"},{"categories":["代理"],"content":" web配置clash访问Clash Dashboard即可进入clash配置 去你购买的代理网站,应该会说明端口号和host host就是自己的ip,端口就是代理端口 host:xxx.xxx.xx.xx 端口xxxx host可以去路由器后台,找到自己的ip就是host ","date":"2023-08-11","objectID":"/posts/clash/:2:1","tags":["代理","Linux"],"title":"Clash-For-Linux","uri":"/posts/clash/"},{"categories":["代理"],"content":" 无配置文件有一些坑爹代理不提供配置文件怎么办呢 在手机上用任意方法导入配置 点击配置旁的三个点,选择编辑/浏览文件 找到配置文件.yaml点击导出 将导出的配置文件.yaml.txt更名为config.yaml,放在clash文件夹内 使用./clash -d .开启clash,会自动下载所需文件 ","date":"2023-08-11","objectID":"/posts/clash/:3:0","tags":["代理","Linux"],"title":"Clash-For-Linux","uri":"/posts/clash/"},{"categories":["代理"],"content":" 系统代理在配置完clash之后,我们要让终端走代理,因为没有图形化界面,所以用命令开启 export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891 ‘7891’换成自己的端口,完成后测试curl -L github.com如果有一大堆输出就成功了 ","date":"2023-08-11","objectID":"/posts/clash/:4:0","tags":["代理","Linux"],"title":"Clash-For-Linux","uri":"/posts/clash/"},{"categories":["代理"],"content":" 图形化界面上面的方法是在没有桌面的时候,下面介绍另一种图形化的操作 首先上github下载fclash选择自己的架构,以debian作为示范 sudo apt install ~/下载/cn.kingtous.fclash-1.4.1-x86_64.deb 使用命令安装fclash,接下来你就可以图形化配置clash ","date":"2023-08-11","objectID":"/posts/clash/:5:0","tags":["代理","Linux"],"title":"Clash-For-Linux","uri":"/posts/clash/"},{"categories":["hexo"],"content":"博客目前已被bing和google收录,bing的点击率比google要多,我们的网站真是蒸蒸日上 ","date":"2023-08-11","objectID":"/posts/google.bing/:0:0","tags":["hexo"],"title":"google/bing收录","uri":"/posts/google.bing/"},{"categories":["hexo"],"content":" Bing 来到必应网站管理员工具 ,用你喜欢的方式登录 然后点击添加网站,验证的话作者选择的是下载xml文件,Google也可以用相同的方法 将下载的xml文件直接拖动到mobaxterm,就可以通过网络传输,也可以使用scp命令,不过scp适合两台Linux主机之间互传文件,所以我们还需要安装wsl来配置Linux环境,这里就不细说了,下面是scp命令传输文件的方式 scp xxxxxx.xml xxxx@ip:/home/xxxx/ #其中第一个xxxx要换成你需要传的文件名,第二个换成被传主机的用户名,ip就不用说了,:后面就是你要传到的路径 将bing的xml文件放在hexo的source目录下 使用以下命令生成并部署到GitHub hexo clean #清理缓存 hexo g #生成 hexo d #部署 完成后等一会就可以点击验证,确认没问题就可以进入管理界面 ","date":"2023-08-11","objectID":"/posts/google.bing/:1:0","tags":["hexo"],"title":"google/bing收录","uri":"/posts/google.bing/"},{"categories":["hexo"],"content":" 网站地图这里最好添加一个网站地图,能提高爬虫率和加快收录 npm install hexo-generator-sitemap --save #安装 hexo clean hexo g hexo d 在添加到bing之前最好先测试下,在你的博客地址后添加/sitemap.xml并访问,比如 https://xxxxxx.github.io/sitemap.xml 如果不是404,有输出结果那就是成功了,接下来只需要将它添加到bing的网站地图即可 ","date":"2023-08-11","objectID":"/posts/google.bing/:2:0","tags":["hexo"],"title":"google/bing收录","uri":"/posts/google.bing/"},{"categories":["hexo"],"content":" GoogleGoogle和bing差不多,但比bing多一步,而且还要挂代理,稍微麻烦了些 同样的,访问Google Search Console使用你的谷歌账户登录 选择网址前缀,下载Google的html文件,跟bing一样,也是放在soure文件夹,不过是文件按不一样罢了,但是部署到GitHub之前需要加多一条命令,这里引用javahiker的解释 hexo会将source目录下的文件googlexxxx.html打包到public目录.这个过程中googlexxxx.html的内容被hexo修改了,如果直接部署到我们的网站,google那边会验证不通过。而打包的过程中是不会修改source下的googlexxxx.html文件的,所以可以通过命令行将未被修改的文件googlexxxx.html拷贝过去。这样就能通过google的验证了。 hexo clean hexo g cp source/googlexxxxxx.html public/ #直接复制到public目录 hexo d 完成后等一会点击验证即可成功 ","date":"2023-08-11","objectID":"/posts/google.bing/:3:0","tags":["hexo"],"title":"google/bing收录","uri":"/posts/google.bing/"},{"categories":["hexo"],"content":" 永久链接如果我们修改文章的标题或是创建时间,引索过的网页就会404,需要重新爬网,解决办法就是创建永久链接 我们使用hexo-abbrlink这个插件来实现 npm install hexo-abbrlink --save #安装插件 安装完成后修改hexo根目录下的_config.yml配置文件 # URL ## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project' url: http://xxxxx.github.io #自己的网址 permalink: :year-:month-:day/:abbrlink.html #链接形式 abbrlink: alg: crc32 #算法 rep: hex #进制 permalink_defaults: pretty_urls: trailing_index: true # Set to false to remove trailing 'index.html' from permalinks trailing_html: true # Set to false to remove trailing '.html' from permalinks 链接形式:hexo默认的形式是year/:month/:day/:title/,我这里改为year-:month-:day/:abbrlink.html 比如https://inuyasha-660.github.io/2023-08-11/21353.html也就是这篇文章的链接 ","date":"2023-08-11","objectID":"/posts/google.bing/:4:0","tags":["hexo"],"title":"google/bing收录","uri":"/posts/google.bing/"},{"categories":["开发板"],"content":" 基础配置 CPU 全志H618高性能四核Cortex-A53处理器 1.5GHz GPU Mali G31 MP2 RAM 1GB/1.5GB/2GB/4GB LPDDR4 储存 16MB SPI Flash 板载WiFi+蓝牙 WiFi5和蓝牙5.0 网络 10M/100M/1000M以太网接口 音频输入、输出 13Pin扩展端口支持2路输出1路输入 视频输出 Micro HDMI支持4K@60fps USB USB 2.0 x 3(需搭配扩展版) SD卡接口 Micro SD 电源输入 5V3A,Type-c接口 拓展接口 26Pin GPIO接口 \u0026\u0026 13Pin GPIO接口 因为原本买它是用来搭建mc服务器的,所以ram选择4g版 ","date":"2023-08-10","objectID":"/posts/orangepi/:1:0","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 安装系统开发版出场带一个微型的linxu,因为板载储存只有16m,所以仅供测试使用,我们需要刷入一个新的系统 ","date":"2023-08-10","objectID":"/posts/orangepi/:2:0","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 格式化我用的是京东京造麒麟128g的sd卡,第一次直接用balena写入镜像,插入能识别到卡但还是默认的微型Linux,所以改sd card formatter格式化之后再用win32写入,工具再官网即可下载,系统镜像也可在此下载(万恶的百度网盘) BTW,买完后最好还是看一遍用户手册,写的还是比较详细的,能帮助快速入门 ","date":"2023-08-10","objectID":"/posts/orangepi/:2:1","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 刷入直接将写入系统的的sd卡怼到卡槽,重启就完事了 ","date":"2023-08-10","objectID":"/posts/orangepi/:2:2","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 登陆因为没有屏幕,所以我们需要使用ssh来远程控制,先接上网线,注意,网线的另一头要接到路由器上 登陆路由器后台,找到orangepi3,查看设备ip,使用ssh root@ip登陆 如果在用windows的话可以使用mobaxterm进行图形化登陆 如果登不上后台,可以使用ifconfig获取网络信息 使用sudo pacman -S net-tools nmap安装所需包 执行命令后找到inet 192.168.xx.xxx这一行 使用nmap 192.168.xx.0/24扫描局域网下的设备 找到类似Nmap scan report for orangepizero3 (192.168.xx.xxx)就是香橙派的IP,ssh连接即可 ","date":"2023-08-10","objectID":"/posts/orangepi/:2:3","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 系统配置和普通的linxu一样,我们首先进行换源,作者选择清华源,系统debian,其他的例如ubuntu也可以在镜像站找到 因为debian普通用户默认不再sudo组的,所以我们直接以root用户登陆 apt install vim 使用vim /etc/apt/sources.lis修改,将源改为清华大学源 :wq保存并退出修改 软件自带了python、zsh我们这里安装一个neofetch来砍下系统是否为debian apt install neofetch 让我们来n以下 neofetch 有圈圈似的图案就说明Debian已经成功刷入了,如果图案是企鹅的话就说明我们还在默认的微型Linux ","date":"2023-08-10","objectID":"/posts/orangepi/:3:0","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 美化因为自带了zsh,所以不需要额外安装,使用zsh即可切换 使用chsh -s $(which zsh)即可设置默认shell ","date":"2023-08-10","objectID":"/posts/orangepi/:4:0","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 主题选用p10k主题,教程来自官方如果慢的话可以克隆gitee镜像 ","date":"2023-08-10","objectID":"/posts/orangepi/:4:1","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 插件插件依然选用语法高亮和自动补全 这里要补充下,因为自动补全少了将插件添加到.zshrc文件这一步,所以导致每次关闭终端再打开就需要重新加载插件,只需要执行这下面的命令就可以将自动补全添加到zsh配置 echo \"source ${(q-)PWD}/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh\" \u003e\u003e ${ZDOTDIR:-$HOME}/.zshrc 如果报错了那请检查自动补全下载到哪个文件夹,然后把.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh替换成自己插件目录里的zsh-autosuggestions.zsh文件的路径 ${(q-)PWD}/指向当前目录,请在${(q-)PWD}/的后面填写当前目录下插件的位置 ","date":"2023-08-10","objectID":"/posts/orangepi/:4:2","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 时区设置因为开发板默认是UTC时间,也就是标准时间+0000,所以导致和东八区相差8小时 这里参考CSDN的文章,是我测试唯一有用的一篇 使用date -R查看时间 虽然tzselect看上去很像一个设定时区的命令,但是它仅仅只是告诉你该怎么写TZ变量,比如北京时间就是Asia/Shanghai对于想更改时间的小伙伴没什么用 正确的做法是修改TZ变量,使用export TZ= 'Asia/Shanghai'命令设置时间 但是直接修改叉掉终端后又会变回原本的时间,我们需要修改/etc/profile文件来永久设定系统时间 sudo vim /etc/profile export TZ='Asia/Shanghai' #复制 :wq #退出 这样即使重新登录也还是北京时间 ","date":"2023-08-10","objectID":"/posts/orangepi/:5:0","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" Docker docker是一个用Go语言实现的开源项目,可以让我们方便的创建和使用容器 在安装宝塔面板前,先安装docker 因为开发版自带安装脚本,所以具体步骤请以用户手册为准 enable_docker.sh 使用以上命令安装,完成后测试一下 docker run hello-world 如果有输出hello from docker那就是成功了 ","date":"2023-08-10","objectID":"/posts/orangepi/:6:0","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 宝塔面板安装完debian后,为了方便管理,选择安装宝塔面板 教程来自用户文档 首先我们扩容tmp分区,使用命令查看/tmp分区大小,如果是2G,那就不需要扩容,如果小于2G,执行以下命令扩容 df -h | grep \"/tmp\" #查看分区大小 sudo sed -i 's/nosuid/\u0026,size=2G/' /etc/fstab #扩容 完成后sudo reboot重启下 使用sudo install_bt_panel.sh安装宝塔面板,需要的时间比较久,作者用了35分钟 安装完成后,会打印面板地址,如果你有公网ip,那么两个都可以,如果没有还是老老实实用内网地址 进去后会提示安装套件,不知道为什么作者需要从源码编译安装,太耗时间了所以没装完 ","date":"2023-08-10","objectID":"/posts/orangepi/:7:0","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" Minecraft开服这也是我买开发板的主要用途,首先查看能安装的Openjdk版本 sudo apt search openjdk 我安装的版本是openjdk-17-jdk具体以你的输出为准 sudo apt install openjdk-17-jdk #安装 接下来安装MCSmanager面板 什么是MCSmanager呢? 分布式,稳定可靠,开箱即用,高扩展性,支持 Minecraft 和其他少数游戏的控制面板 参考官方文档,使用以下命令安装 wget -qO- https://gitee.com/mcsmanager/script/raw/master/setup_cn.sh | bash 基础命令 # 先启动面板守护进程。 # 这是用于进程控制,终端管理的服务进程。 systemctl start mcsm-daemon.service # 再启动面板 Web 服务。 # 这是用来实现支持网页访问和用户管理的服务。 systemctl start mcsm-web.service # 重启面板命令 systemctl restart mcsm-daemon.service systemctl restart mcsm-web.service # 停止面板命令 systemctl stop mcsm-web.service systemctl stop mcsm-daemon.service 启动面板后浏览器输入\u003cIP\u003e:23333进入面板,如果进不去的话去宝塔面板找到安装-添加端口规则,填入23333端口即可 mcs面板实例打不开也可以用此方法 ","date":"2023-08-10","objectID":"/posts/orangepi/:8:0","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" AList买开发板还有一个目的就是为了搭建一个个人nas,这里以在docker内安装alist为例 为了方便管理,我们先安装一个docker管理器,直接在宝塔的应用商城内搜索即可 使用命令安装Alist docker run -d --restart=always -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name=\"alist\" xhofe/alist:latest 安装完成后使用docker exec -it alist ./alist admin set NEW_PASSWORD设定密码,NEW_PASSWORD改为你要设置的密码 浏览器输入http://\u003cip\u003e:5244进入alist,账号默认为admin ","date":"2023-08-10","objectID":"/posts/orangepi/:9:0","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" alist挂载阿里云 刷新令牌 前往 https://alist.nn.ci/tool/aliyundrive/request.html ,点击login in,登陆自己的账号即可生成令牌 Oauth令牌链接 由于原api https://api.nn.ci被sni阻断,导致国内无法连接,所以要添加新的api https://api-cf.nn.ci/alist/ali_open/token #二选一 https://api.xhofe.top/alist/ali_open/token 云盘类型 这里一定要选对,如果错了会导致加载不了,登录阿里云盘手机端4.9.0以上的版本就可以看到。如果不确定可以两个都试试 ","date":"2023-08-10","objectID":"/posts/orangepi/:9:1","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 更改密码如果像我一样忘了密码,可以用 docker exec -it alist ./alist admin set NEW_PASSWORD 重新设置一个密码,NEW_PASSWORD为你的密码 ","date":"2023-08-10","objectID":"/posts/orangepi/:9:2","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 挂载本地 将要挂载的文件/文件夹移至alist容器内 docker cp /home/image-hosting 200adb99680d:/orangepi/web # 200adb99680d - 容器ID # /home/image-hosting - 以东的文件夹或目录 # /orangepi/web - 目标目录 完成后在后台添加/orangepi即可挂载文件/文件夹 ","date":"2023-08-10","objectID":"/posts/orangepi/:9:3","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["开发板"],"content":" 结尾开发板还有许多好玩的东西,比如刷openwrt作软路由,刷android tv作机顶盒等,这里只是列举除了一部分 ","date":"2023-08-10","objectID":"/posts/orangepi/:10:0","tags":["Linux","开发板"],"title":"香橙派zero3","uri":"/posts/orangepi/"},{"categories":["Kernel"],"content":" 环境搭建搭建编译所需的环境 ","date":"2023-08-05","objectID":"/posts/kernelsu/:1:0","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 系统安装教程基于ubuntu,你可以选择实机安装或者使用wsl2,如何安装请看使用 WSL 在 Windows 上安装 Linux 注:wsl下的文件传输需将文件移动到挂载点/mnt/c ","date":"2023-08-05","objectID":"/posts/kernelsu/:1:1","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 编译环境使用以下命令安装所需软件包 sudo apt install -y bc bison build-essential curl flex g++-multilib gcc-multilib \\ git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev \\ lib32z1-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev \\ libssl-dev libxml2 libxml2-utils lzop pngcrush schedtool \\ squashfs-tools xsltproc zip zlib1g-dev unzip ","date":"2023-08-05","objectID":"/posts/kernelsu/:1:2","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 系统代理如果你的设备能够直连Github,并且速度还不错,那你可以忽视这一步 我们使用clash作为代理工具 Linux请看我的另一篇文章Clash-For-Linux Windows 下载Clash-For-Windows(已存档) 都有图形化操作界面了还要我教? 使用以下命令设置终端代理 export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891 ","date":"2023-08-05","objectID":"/posts/kernelsu/:1:3","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 源码下载现在开始下载所需的内核源码和工具,我们最好创建一个工作目录 mkdir -p kernel \u0026\u0026 cd kernel #创建并进入工作目录 mkdir -p toolchains #工具链目录 mkdir -p source #内核源码目录 ","date":"2023-08-05","objectID":"/posts/kernelsu/:2:0","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 内核源码如果你是小米用户,你可以试着下官方的源码,不过官方的源码可能不能成功编译,而且年久失修,大部分新机都没有公布源码,所以还是建议使用类原生的源码 官方源码仓库 https://github.com/MiCode/Xiaomi_Kernel_OpenSource 如果要下载的话请使用 git 命令 git clone --depth=1 https://github.com/MiCode/Xiaomi_Kernel_OpenSource -b cannon-r-oss cannon-r-oss是作者的手机代号,需将cannon-r-oss换成自己源码的分支 类原生的话就简单多了,点击仓库右上角的code,把HTTPS的链接复制下来 git clone xxxxxxxxxxxx.git # xxxxxxxx.git换成自己的链接 ","date":"2023-08-05","objectID":"/posts/kernelsu/:2:1","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 添加KernelSU只需使用 curl -LSs \"https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh\" | bash - 即可将KernelSU添加到内核源码树 然后需要编辑你的配置文件,通常在arch/arm64/configs/,较新的机型也可能在arch/arm64/configs/vendor/ 进入文件夹,找到类似设备代号_defconfig的文件,比如我的代号是cannon,配置文件就是cannon_defconfig 使用vim编辑配置文件,用ESC+/进入查找,在/后面输入你要找的内容,例如/KPROBES 如果没有开启相关的配置,需要手动添加 CONFIG_KPROBES=y CONFIG_HAVE_KPROBES=y CONFIG_KPROBE_EVENTS=y ","date":"2023-08-05","objectID":"/posts/kernelsu/:2:2","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 工具链下载作者使用zys-clang12和gcc4.9进行编译 因为zyc-clang需要下载压缩包并解压,所以我们先使用git下载gcc git clone https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_arm_arm-linux-androideabi-4.9.git 浏览器访问 https://github.com/ZyCromerZ/Clang/releases/download/12.0.1-20230207-release/Clang-12.0.1-20230207.tar.gz 下载zyc-clang 下载完成后用tar -zxvf xxxx.tar.gz解压 如果觉得目录太常不方便的话,可以用mv命令重命名文件夹 mv \u003c原名称\u003e \u003c你想改的名称\u003e ","date":"2023-08-05","objectID":"/posts/kernelsu/:2:3","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 编译脚本一般我们会用一个编译脚本设置环境变量、配置文件等 我的脚本是抄参考别人教程 vim build.sh #创建编译脚本 写入以下内容 #!/bin/bash starttime=`date +'%Y-%m-%d %H:%M:%S'` export ARCH=arm64 export SUBARCH=arm64 make O=out cannon_defconfig make -j8 O=out \\ NM=~/kernel/toolchains/clang-12/bin/llvm-nm \\ OBJCOPY=~/kernel/toolchains/clang-12/bin/llvm-objcopy \\ LD=~/kernel/toolchains/clang-12/bin/ld.lld \\ CROSS_COMPILE=~/kernel/toolchains/clang-12/bin/aarch64-linux-gnu- \\ CROSS_COMPILE_ARM32=~/kernel/toolchains/gcc-arm-4.9/bin/arm-linux-androideabi- \\ CC=~/kernel/toolchains/clang-12/bin/clang \\ AR=~/kernel/toolchains/clang-12/bin/llvm-ar \\ OBJDUMP=~/kernel/toolchains/clang-12/bin/llvm-objdump \\ STRIP=~/kernel/toolchains/clang-12/bin/llvm-strip 2\u003e\u00261 | tee error.log endtime=`date +'%Y-%m-%d %H:%M:%S'` start_seconds=$(date --date=\" $starttime\" +%s); end_seconds=$(date --date=\"$endtime\" +%s); echo Start: $starttime. echo End: $endtime. echo \"Build Time: \"$((end_seconds-start_seconds))\"s.\" 需要注意的是,cannon_defconfig配置文件的路径已经在arch/arm64/configs/ 假设你的配置文件是arch/arm64/configs/example_defconfig那你只需要填写example_defconfig即可 但如果你的配置文件位于arch/arm64/configs/vendor/example_defconfig则需要填写vendor/example_defconfig ","date":"2023-08-05","objectID":"/posts/kernelsu/:3:0","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 开始编译用chmod +x build.sh添加执行权限,./build.sh执行编译脚本,产出在out/arch/arm64/boot目录 ","date":"2023-08-05","objectID":"/posts/kernelsu/:4:0","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 打包内核能来到这一步,你应该能成功编译出内核,恭喜你,接下来我们需要将它打包成boot或内核刷入 ","date":"2023-08-05","objectID":"/posts/kernelsu/:5:0","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" AnyKernel3项目地址:https://github.com/osm0sis/AnyKernel3 用git下载AnyKernel3 git clone https://github.com/osm0sis/AnyKernel3.git 你需要把产出的Image放到AnyKernel3的根目录,然后编辑anykernel.sh 需要改的是以下几点 kernel.string=KernelSU-cannon-inuyasha #内核名称 do.devicecheck=1 #设备检测,为0时关闭 do.modules=0 do.systemless=1 do.cleanup=1 do.cleanuponabort=0 device.name1=cannon #设备代号,可以设置多个 device.name2=cannong device.name3= device.name4= supported.versions= supported.patchlevels= supported.vendorpatchlevels= block=auto; is_slot_device=auto; ramdisk_compression=auto; patch_vbmeta_flag=auto; 配置完后使用zip -r9 UPDATE-AnyKernel3.zip * -x .git README.md *placeholder即可打包内核 如果使用zsh,可能会报错not matches found,只需要在.zshrc中添加 setopt no_nomatch 然后再source ~/.zshrc即可解决 ","date":"2023-08-05","objectID":"/posts/kernelsu/:5:1","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" MagiskBoot如果你不喜欢用anykernel3,你也可以提取原版的boot.img使用编译出来的image替换原厂kernel 首先到Magisk下载magisk.apk,重命名为.zip并解压 把解压后的Magisk-v26.1/lib/arm64-v8a/libmagiskboot.so文件,用 adb push 到手机 adb push Magisk-v26.1/lib/arm64-v8a/libmagiskboot.so /data/local/tmp/magiskboot Magisk-v26.1需要改成下载的版本号 按照上面的方法把提取的boot.img和编译出的Image都push到手机 用adb shell进入adb,然后进入手机/data/local/tmp/目录,赋予magiskboot可执行权限chmod +x magiskboot 执行./magiskboot unpack boot.img解包boot.img得到kernel文件 用Image替换kernelmv -f Image kernel 最后执行./magiskboot repack boot.img命令重新打包boot.img,得到new-boot.img,备份原厂boot后在fastboot中刷入即 ","date":"2023-08-05","objectID":"/posts/kernelsu/:5:2","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 拓展如果kprobe不正常工作,就会出现无限重启,不开机,替换boot后仍显示不支持等错误,接下来我们将手动修改源码集成ksu 首先让我们验证是否为kprobe的问题, 首先用vim打开KernelSU/kernel/ksu.c 找到ksu_enable_sucompat() 和 ksu_enable_ksud()这两行,使用//注释掉 // ksu_enable_sucompat(); // ksu_enable_ksud() 就像这样 重新编译你的内核,看能否开机,如果能正常开机就是kprobe的问题,如果还是不能开机,检查你的源码是否适用你的系统 ","date":"2023-08-05","objectID":"/posts/kernelsu/:6:0","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 修改内核源码 使用这条命添加KSU curl -LSs \"https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh\" | bash - 因为要改的比较多,推荐去看官方文档,写的比较详细 ","date":"2023-08-05","objectID":"/posts/kernelsu/:6:1","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" BugReport如果手动集成还是失败,你可以去Github提供一个BugReport给作者,在管理其设置,发送日志即可发送错误日志 ","date":"2023-08-05","objectID":"/posts/kernelsu/:6:2","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["Kernel"],"content":" 参考|部分引用如何为非 GKI 内核集成 KernelSU 红米K40内核KernelSU编译 手机端编译安卓内核 ","date":"2023-08-05","objectID":"/posts/kernelsu/:7:0","tags":["Linux","Kernel"],"title":"KernelSU内核编译","uri":"/posts/kernelsu/"},{"categories":["终端"],"content":" 介绍 Termux 是一款Android 终端模拟器和 Linux 环境应用程序,无需 root 或设置即可直接运行。自动安装最小的基本系统 - 使用 APT 包管理器可以使用其他包。 ","date":"2023-08-05","objectID":"/posts/termux/:1:0","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 安装你可以在Github和F-Droid找到安装包 但我并不推荐你安装github或play商店上的termux,因为一些拓展程序是分版本的,你在github上下的用不了f-droid商店上的拓展,而play商店上的拓展是要花钱的,所以我推荐都在F-Droid上下载 ","date":"2023-08-05","objectID":"/posts/termux/:2:0","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 基础配置和普通的linux一样,第一步是换源,这里我推荐清华大学的termux源,速度还是不错的 使用pkg install vim安装vim vim修改$PREFIX/etc/apt/sources.list,删除原来的源,复制清华源里的内容 pkg update pkg upgrade 更新一下 这里推荐一个软件neofetch,能打印硬件和系统信息到终端 pkg install neofetch #安装 neofetch ","date":"2023-08-05","objectID":"/posts/termux/:3:0","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 快捷键修改默认的两排快捷键可能满足不了我们,我们可以编译~/.termux/termux.properties来修改 extra-keys = [ \\ ['ESC','-','/','HOME','UP','END','PGUP','ENTER'], \\ ['QUOTE','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN','BKSP'] \\] 这时我自己的配置 具体可以参考这个表格修改 CTRL 组合键 DEL 删除 UP 上键 QUPTE 双引号 LEFT 左键 RIGHT 右键 DOWN 下健 ENTER 回车 ECS 退出 PGUP 上翻页 PGDN 下翻页 每个按键只能出现一次,一些其他按键如\" |也能添加 ","date":"2023-08-05","objectID":"/posts/termux/:3:1","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 美化我主要使用zsh来美化终端,首先安装zsh pkg install zsh 设置默认shell chsh -s zsh ","date":"2023-08-05","objectID":"/posts/termux/:4:0","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 插件和普通linxu一样,我主要zsh-syntax-highlighting和zsh-autosuggestions这两个插件 具体请看我的另一篇文章Linux终端美化 ","date":"2023-08-05","objectID":"/posts/termux/:4:1","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 终端配色因为作者是从Github上下载安装的termux,用不了F-Droid上的拓展,而play商店上的还要花钱,所以我使用termux-style作为替代 使用以下命令下载并安装termux-style git clone https://github.com/adi1090x/termux-style cd termux-style ./install 安装完后使用termux-style即可进入设置界面,里面可以选字体和背景颜色 ","date":"2023-08-05","objectID":"/posts/termux/:4:2","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 启动语修改如果我们觉得默认的启动语不好看,可以修改$PREFIX/etc/motd来自定义启动语 可以用字符画生成器生成一个Termux _______ |__ __| | | ___ _ __ _ __ ___ _ ___ __ | |/ _ \\ '__| '_ ` _ \\| | | \\ \\/ / | | __/ | | | | | | | |_| |\u003e \u003c |_|\\___|_| |_| |_| |_|\\__,_/_/\\_\\ ","date":"2023-08-05","objectID":"/posts/termux/:4:3","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 开发termux支持的开发环境很多,选择自己需要的即可 Termux自带python,所以不用安装 ","date":"2023-08-05","objectID":"/posts/termux/:5:0","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 编辑器一个好的编辑器能提供舒服的开发环境,作者用的是vim,使用pkg install vim即可安装 想要配置vim,首先新建配置文件vim ~/.vimrc,作者只开启了语法高亮和行号显示 set nu syntax on ","date":"2023-08-05","objectID":"/posts/termux/:5:1","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 远程连接我主要拿termux作为终端远程连接开发版和电脑 ","date":"2023-08-05","objectID":"/posts/termux/:6:0","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 准备 linux主机,域名和公网ipv6 linux主机,公网ipv4 先说第一种,我们需要购买一个域名,开启ipv6,使用dns和ddns动态解析域名到本级ipv6地址,即可使用 ssh root@\u003c域名\u003e 远程连接linux主机 第二种就简单多了,如果你有一个公网ipv4,你可以直接使用ssh root@\u003cip\u003e进行连接 ","date":"2023-08-05","objectID":"/posts/termux/:6:1","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"},{"categories":["终端"],"content":" 参考Termux 高级终端安装使用配置教程 ","date":"2023-08-05","objectID":"/posts/termux/:7:0","tags":["Linux"],"title":"手机终端termux","uri":"/posts/termux/"}]