平时有习惯,手搓一遍后把这次的内容记下并完善,下次直接用。
因为我喜欢安装最新版本的,而不是固定tag,所以找ai优化了一下,先api查询最新版本,再根据版本号构造链接下载压缩包。
大致意思如下:
~~sh</s><i> </i>tag_name=$(wget -qO - "https://api.github.com/repos/:user:/:repo:/releases/latest" | jq -r '.tag_name') mkdir -p /usr/foo/bar cd /usr/foo/bar wget https://github.com/:user:/:repo:/releases/download/$tag_name/Xx-linux-64.zip unzip Xx-linux-64.zip ...<i> </i><e>
然后安装报错
--2025-04-xx 01:23:45-- https://github.com/:user:/:repo:/releases/download//Xx-linux-64.zip
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2025-04-xx 01:23:45 ERROR 404: Not Found.
unzip: cannot find or open Xx-linux-64.zip, Xx-linux-64.zip.zip or Xx-linux-64.zip.ZIP.
<e>```</e>
复现的时候发现<C>~~`</s>tag_name<e>`</e></C>为空,直接api访问提示频率受限。
查了一下<URL url="https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-unauthenticated-users">[~~官方文档<e>](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-unauthenticated-users)</e></URL>,发现未登录用户最多只有60请求每小时(IP相关)。
所以,如果你用的是nat或者warp的ip,脚本安装东西失败的时候不妨考虑一下这个问题。
</r>
0
2
可以共享、可以push的免费邮箱,更可使用自定义域名,完美契合您的各项需求。
2 risposte
Ordinamento