2024年8月

server 内添加配置:

# 获取本地时间
if ( $time_local ~ "^(\d+)\/(\w+)\/(\d+):(\d+):(\d+):(\d+) \+(\d+)" ) {
  set $hour $4;
}

# 指定时间黑名单,如果为指定时间,返回500
if ( $hour ~ 22|23|00|01|02|03|04|05 ) {
  return 500;
}

这样就实现了晚上 10点~凌晨5点之间无法访问,6点以后才能正常访问。

- 阅读剩余部分 -

最近 iCloud 用的比较多,同步电脑和手机文件还是不错的。但是有一个事情很不爽,就是 iCloud 会自动删除本地的文件,每次要用的时候都要等待云端下载。

2024-08-13T04:45:51.png

虽说可以节省本地的空间,但我也不差这么点啊,而且 iCloud 下载速度挺慢的(可能是在贵州的原因?),所以我想关闭这个功能。

解决方案

- 阅读剩余部分 -

闲置了一年多的 mac mini 重新用起来,发现 nginx 挂了。

执行 brew services 报错:

$ brew services
Error: uninitialized constant Homebrew::Service
/opt/homebrew/Library/Homebrew/formula.rb:1267:in `service'
/opt/homebrew/Library/Homebrew/formula.rb:1238:in `plist_name'
/opt/homebrew/Library/Homebrew/formula.rb:1250:in `launchd_service_path'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formula_wrapper.rb:58:in `service_file'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formula_wrapper.rb:92:in `plist?'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formulae.rb:12:in `select'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formulae.rb:12:in `available_services'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/formulae.rb:17:in `services_list'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/lib/service/commands/list.rb:13:in `run'
/opt/homebrew/Library/Taps/homebrew/homebrew-services/cmd/services.rb:102:in `services'
/opt/homebrew/Library/Homebrew/brew.rb:97:in `public_send'
/opt/homebrew/Library/Homebrew/brew.rb:97:in `<main>'
If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/homebrew/homebrew-services/issues/new

解决方案

cd /opt/homebrew/Library/Taps/homebrew/
rm -rf homebrew-services/
brew tap homebrew/services

PS: 第三步需要挂代理,否则下载不下来。