Posts

利用 upnpc 实现内网穿透

# 安装 yay -S miniupnpc # 列出当前配置 upnpc -l # 为指定端口添加转发 -r <指定端口> <协议> upnpc -r 8888 tcp # 转发到 WAN 的另一端口 -a <本机IP> <指定端口> <外部端口> <协议> upnpc -a 10.10.10.88 8000 8177 TCP # 删除指定配置 -d <外部端口> <协议> upnpc -d 8177 TCP
2021-03-31
1 min read

记一次 fastboot 拯救手机过程

升级氢OS beta3后 这充电声音搞得我整个人听力都不好了 于是在某个寂静的夜里 刷到某酷友提供的充电声文件路径 找过去把 charging.ogg 删了 结果就是 重启后无限系统界面FC Android 11到目前还没有可用的TWRP,猜到一些酷友到这里可能会建议9008,咳咳,在此记录一下不丢数据的拯救方法 法一 原理就是切换系统分区 回滚到 beta2 分区,先做到能开机一切都好说。 # 查看当前启动分区 输出的结果是当前 beta3 所在的分区 fastboot getvar current-slot # 切换到另一个(beta2)分区 如果上面查到a下面就搞成b fastboot set_active <a或者b> 知识链接(划掉): fastboot getvar all 可以查看所有变量 法二 法一尝试无果后 想到之前在XDA上看到过一种fastboot刷机包 原理就是通过fastboot线刷OTA解包后的所有分区 这里是system_ext出了问题 所以重刷 system 分区就好了。 # 如果已经尝试过法一 记得先切回 beta3 的分区 fastboot set_active <a或者b> # 搞个文件夹方便后续整理 mkdir rescue cd rescue # 某hub 上拉取 android OTA 解包工具 git clone https://github.com/vm03/payload_dumper # 解压下载好的 beta3 OTA包 7z x OnePlus7ProHydrogen_13.
2021-03-03
1 min read

搭配 rclone 使用加密备份工具 restic

常用命令 # 在rclone的OneIndex桶中创建restic初始化仓库 restic -r rclone:OneIndex:restic init # 备份指定目录至上述仓库 restic -r rclone:OneIndex:restic --verbose backup ~/radicale # 列出仓库中存在的快照 restic -r rclone:OneIndex:restic snapshots # 挂载远程仓库 restic -r rclone:OneIndex:restic mount /mnt/restic # 还原最新备份至指定目录 restic -r rclone:OneIndex:restic --verbose restore --target ~/radicale 定时备份 sudo vim /etc/crontab 7 */12 * * * root RESTIC_PASSWORD=<restic密码> restic -r rclone:OneIndex:restic bakcup ~/radicale restic 官方文档 配置式备份参考
2021-03-02
1 min read

从 Typecho 迁移至 Pelican

通过 phpMyAdmin 导出 json 格式的 tyecho_content 数据表 删除文件头部注释信息 执行脚本,生成pelican内容文件。 #!/usr/bin/python3 import time import json f = read('typecho_contents.json','r') j = json.load(f) f.close() for i in j: title = i['title'] slug = i['slug'] cid = i['cid'] date = time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(int(i['created']))) modified = time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(int(i['modified']))) text = i['text'].replace('<!--markdown-->','') if 'png' not in i['title'] and 'jpg' not in i['title']: otext = 'title:{title}\ndate:{date}\nmodified:{modified}\nslug:{slug}\n{text}'.format(title=title,date=date,modified=modified,slug=slug,text=text) ofile = open('./output/'+title+'.md','w') ofile.write(otext) ofile.close()
2021-03-01
1 min read

N卡在 KDE 桌面环境下使用x11vnc 远程连接导致混成器失效问题的临时解决方法

法一 渲染模式选择XRender 法二 在optimus-manager中启用双显卡混合/核显模式 法三 每次崩溃后可以尝试重启混成器进行恢复 qdbus org.kde.KWin /Compositor suspend qdbus org.kde.KWin /Compositor resume
2021-02-24
1 min read