让服务器不向 relay 发布 bot 的消息很简单 https://pastebin.ubuntu.com/p/D4jkcP8FZp/
#小森林 服务器状态监控~
Zabbix + Grafana
目前只做了 Elasticsearch 监控,还想做 Sidekiq 监控,但是 Zabbix 上配置比较繁琐,想直接换成 Prometheus,我再研究一下
https://status.2heng.xin/d/DW-yYJ7Mk/mastodon-server-monitor?orgId=1&refresh=10s&theme=dark
@group meow?
#Linux技巧 阻止ssh自动断开(重发)
cd /etc/ssh
grep ClientAlive sshd_config
cp sshd_config sshd_config.bak
sed -i "s/#ClientAliveInterval 0/ClientAliveInterval 60/g" sshd_config
sed -i "s/#ClientAliveCountMax 3/ClientAliveCountMax 3/g" sshd_config
grep ClientAlive sshd_config
diff sshd_config sshd_config.bak
service sshd reload
再补上一条@literalkernel:
sed -i '/^PasswordAuthentication/c PasswordAuthentication yes' ${SSHD_CONFIG}
#Linux技巧 nohup的使用(重发)
$ nohup my_command > my.log 2>&1 &
$ echo $! > save_pid.txt
#Linux技巧 fg命令(Re-enter interactive mode after Ctrl-z)
fg [jobspec]
Resume jobspec in the foreground, and make
it the current job. If jobspec is not
present, the shell’s notion of the current
job is used. The return value is that of
the command placed into the foreground, or
failure if run when job control is dis-
abled or, when run with job control
enabled, if jobspec does not specify a
valid job or jobspec specifies a job that
was started without job control.
#Linux技巧 端口占用查找
netstat -ntulp |grep 443
自建实例的同学,请务必添加如下两个定时任务,推荐在每天早晨低峰时段运行
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --days=14
清理缓存的外站媒体文件,和
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove-orphans
清理未关联任何 toot 的“无主”媒体文件
另外推荐配合以下任务食用
RAILS_ENV=production /home/mastodon/live/bin/tootctl statuses remove
清理没有同本站任何用户产生关联的 toot 本身(比如跨站轴上收到的、没有本站用户转发/评论/收藏过的消息)
各命令参数请参考 -h 和官方文档按实际情况调整:https://docs.joinmastodon.org/admin/tootctl/
您的钱包会感谢我的╮( ̄▽ ̄")╭
#Linux技巧 nohup的使用
$ nohup my_command > my.log 2>&1 &
$ echo $! > save_pid.txt
#小森林 可以艾特推特用户了(伪)@[email protected]
Chinese 🇨🇳 / Dictatorial Admin / Mastodon Code Contributor / 摸鱼技术布道师
Steam: https://steamcommunity.com/id/MashiroBest
Epic: https://store.epicgames.com/en-US/u/d211c824cbd94aaeba898db6bb823ff7
原批交流群:966322309