距离上一篇介绍该主题的文章已经过去了接近三年,Clash 作为网关的透明代理 中间使用到的方案其实多次变更,例如使用了很长一段时间 的 shellclash,这个方案胜在省心,可以直接在支持的 路由器上部署,但是内核更新缓慢,作者对配置加了很多自定义设置,虽然出发点是为了方便大部分小白用户,但是 严重降低了自定义的能力。而且默认的一些设定大概率会导致 DNS 泄漏问题,关于这个话题可以参考 不良林的相关视频。这是不可接受的,因此前段时间又回归到使用 PVE 上虚拟机的方案。
简单摸索了一下最新方案发现 redir-host 模式已经被 Clash 官方放弃,不建议再使用。 TProxy 模式当然
没啥问题,但是毕竟得自己处理 iptables 规则。在没有性能瓶颈的情况下,更推荐使用 tun 模式,可以自动
处理路由等问题。下面简单介绍一下相关配置。
首先,在网关机器上打开 ipv4 转发, echo net.ipv4.ip_forward=1 >> /etc/sysctl.conf && sysctl -p
其次 Clash 配置文件头部添加如下
tun:
enable: true
stack: system # or gvisor
#dns-hijack:
# - any:53
# - tcp://any:53
auto-route: true
auto-detect-interface: true
dns:
enable: true
ipv6: false
listen: 0.0.0.0:53
enhanced-mode: fake-ip # redir-host or fake-ip
fake-ip-range: 198.18.0.1/16 # Fake IP addresses pool CIDR
use-hosts: true # lookup hosts and return IP record
nameserver:
- 114.114.114.114
最后在局域网的 DHCP 服务器设置网关为该机器 IP 即可,也可以手动在希望走代理机器的网关设置未该机器 IP。
当年从随手记迁移到桌面记账方式(Excel/GnuCash/Beancount)后,确实有一段时间的不适应。 后来实在没有找到好用的移动端记账 APP,同时也适应了桌面记账,遂被驯化认为不需要在移动场景 记账。Costflow 出来之后没有第一时间尝试的原因也在于此,使用一段时间基于 costflow 语法 的 Telegram 机器人之后,发现经常是想要的账户没有配置,导致使用频率并不高。
前段时间的某一天突然意识到,为什么要提前配置账户信息呢?账户信息全部都在账本文件中,直接 查询账本文件不就可以避免冷启动的问题么。遂自己开坑写了一个新的记账机器人 beancount-bot。
使用一月有余,今天完善了一下相关功能,更新了文档和使用例子。下面是几点简要说明:
在这里分享给大家,希望可以节省一点记账/对账的时间,有兴趣的欢迎尝试。
A few days ago I received a new type of spam email. Basically they create a GitHub repo and then spam everyone they want in the issues by @ them. Of course this gets banned after being reported. I do not do anything because I think someone else will do the reporting work.
Days later, when I log in to GitHub, I notice that there is a dot in the notification box, which means that there are unread notifications. So I tried to mark all notifications as read. The problem is that the spam notifications refuse to be deleted. Why is that? After checking I found that the spam repo has been deleted, maybe by GitHub. I tried everything in the Wed UI but failed.
I am not busy that day, so I decided to create a ticket in GitHub support, which is
Days ago I received a spam email subjected as Re: [kl-heisenberg/AI-hiring] Initial commit (a1a534d).
Somebody use this method to send ad emails. I just ignored it.
Today when I go to my notification box https://github.com/notifications?query=is%3Aunread
There is an annoying item shows this repo, but without any content (you deleted this user).
In the end, I can not clear the notification box.
See this image of my notification box: https://imgur.com/a/qRgBDcq
You can see the screenshot at https://imgur.com/a/qRgBDcq.
3 days later I got the solution. Why so long? Github claims they are busy lol. Maybe Microsoft needs to do something right :)
The solution worked like a charm, I attach it below.
Note: following paragraphs are from GitHub Support.
Thank you for reaching out to GitHub Support. Apologies for the late response and I am sorry you are having trouble with your inbox notifications. We have had a few reports of this bug and our engineers are looking into it. I’ve informed our engineers regarding your report as well. It’s very useful for us to have more data points, so thank you for submitting this to us!
In the meantime, you can try the curl command below, it will mark all of your notifications as read, clear the notification indicator, and with any luck, take care of that phantom notification for you. Note that the 1-0 of 1 message may still persist after the curl command is run; our engineers are looking into this as well.
A few things I’d like to note:
curl -H "Authorization: bearer $TOKEN" -X PUT -H "Accept: application/vnd.github.v3+json" https://api.github.com/notifications -d '{"last_read_at":"2023-01-25T19:42:00"}'
You can also export the current date and time in bash by running:
export now=$(date +%Y-%m-%dT%H:%M:%SZ)
Then you can use the date and time variable in the curl command as follows:
curl -H "Authorization: bearer $TOKEN" -X PUT -H "Accept: application/vnd.github.v3+json" https://api.github.com/notifications -d '{"last_read_at":"'"$now"'"}'
For your reference, here is the documentation for the Notifications REST API endpoint.