Submitted by gouki on 2022, October 20, 9:30 AM
好几次遇到阿里云的镜像更新有问题了,明明某个库有了最新版,但阿里云就是报版本不存在。今天又出现了这样的情况,安装laravel-zero的时候,require-dev中有个laravel/pint ^1.2,直接就报了
Problem 1
- Root composer.json requires laravel/pint ^1.2, found laravel/pint[dev-main, v0.1.0, ..., v0.2.4, v1.0.0, ..., v1.1.3] but it does not match the constraint.
由于之前也遇到过这个问题,当时是unset掉 aliyun镜像,换成了官方镜像,但确实是慢,所以我就看了一眼其他镜像,比如以前常用的https://packagist.phpcomposer.com,在国内没有其他镜像的时候,它做了很大的贡献,然而也太不稳定了。直接报:
Problem 1 - Root composer.json requires laravel-zero/framework, it could not be found in any version, there may be a typo in the package name. Problem 2 - Root composer.json requires nunomaduro/termwind, it could not be found in any version, there may be a typo in the package name. Problem 3 - Root composer.json requires laravel/pint, it could not be found in any version, there may be a typo in the package name. Problem 4 - Root composer.json requires mockery/mockery, it could not be found in any version, there may be a typo in the package name. Problem 5 - Root composer.json requires pestphp/pest, it could not be found in any version, there may be a typo in the package name. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details. - It's a private package and you forgot to add a custom repository to find it Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
看来,已经多年没有更新过了,真可惜了。
配好之后,composer u,完成。记录一下
1、阿里:composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
2、腾讯:composer config -g repos.packagist composer https://mirrors.tencent.com/composer/
3、清除:composer config -g --unset repos.packagist
带 -g 的是全局的,不带 -g,就是当前项目了。
PHP | 评论:0
| 阅读:2964
Submitted by gouki on 2022, October 20, 2:02 AM
在很久很久以前,我其实一直是使用阿里云的,直到后面腾讯也出了云。当然使用量明显没有阿里大,而且我还一直是推荐阿里的。
由于国内的一些原因,有些网站没法备案(比如个人网站,还不能介绍自己做的项目,只能用公司网站。。),所以,部分网站采用了香港的服务器。
在早些年吧,用aws的lightsail,便宜,但没有香港区,只有:日本、韩国、新加坡,这些地区吧,白天访问都挺正常,一到晚上就开始抽风,于是几乎全部撤出,采用阿里云香港。
前两年都挺OK。好象从21年起,阿里云香港也开始逐步抽风了,最高的时候丢包率达到了25%左右,白天也是一切正常。
因此只能想办法再尝试尝试换了。这次就换到腾讯去了,看看效果如何。
--
话说从03年到现在,也算是用了不少服务器了。
04~05,自己买AMD的芯片组装的windows服务器,托管在上海漕河泾,后因为那边经常断电烧坏了
08年开始,买了朋友的一台dell的2U,托管在edong,也是因为他们迁机房的问题,导致我整个断网2个月,alexa排名从1万掉到10万开外,就再也没有恢复过
11年开始使用linode,然后就是各种其他的大大小小的、知名的不知名的服务器都在尝试,感觉就是在不停踩坑
用过GCP、AWS,还有盛大云、DO,OVH的等。后面因为开始做外包,慢慢全部不再使用,直接用国内的阿里云,这两年在慢慢切回腾讯云。
有几个小原因,比如备案,你在A站备案,到腾讯还是不能使用2级域名。必须要在他那边备案,所以才不得不使用香港主机,先用起来,后面备案再切。所幸现在的网站都是git来git去的。基本上部署一个网站也就半小时就行了。
没用docker,PHP用docker感觉没啥大意义。之前用过,因为要跑不同的PHP版本,从5.6~8都有,那时候不得不用docker。现在基本上都以7.4为主,即使上8也不会有大问题,所以不再使用Docker了。
废话说的太多了,睡觉~
Misc | 评论:0
| 阅读:2928
Submitted by gouki on 2022, October 19, 9:43 AM
突然发现uniapp好象无法分类。
用uniapp的时候突然发现使用背景图的时候打包无法打进去。本来这也没多大事,毕竟所有的图片几乎都是从网上拉过来的。但只是一个背景色也要从网上下载就有点麻烦了。所以就看了一下
1、如果不是变量的,得用相对路径,比如 /static/background.png,要写成 ../../static,注意当前文件和static的相对路径
2、如果是变量的,得一一require进来。然后用变量与require的对量对应
3、或者你还是用image标签,但是这个image标签外用view做好对应,如果上面有堆叠其他内容,会相对比较麻烦一点
4、还是用网上的地址吧,尽量使用云存储,不然如果是小水管网站,这么一拉取,其他内容可能变被卡住了。
基本上就这么些方法。
Javascript | 评论:0
| 阅读:3013
Submitted by gouki on 2022, October 14, 9:49 PM
其实我一直在想,这个功能什么时候会被关掉。
开始:
用cloudflare tunnel的时候,从没想过会在macos上出问题,如果你直接cloudflared service install,不会运行,即使你sudo了也不会,因为这个运行的只是cloudflared,并不带任何参数。
需要在相应的plist下面加上<string>tunnel</string><string>run</string>才OK。
加之前需要先unload,然后再load。否则无效。
其他都与官方一致。
---
如果用sudo了。需要将~/.cloudflared/下的内容copy到/etc/cloudflared下面。如果不放心或者担心没权限,可以修改uuid.json,将路径改为/etc/cloudflared/。其他照旧
记得配合一下valet,因为valet tld之后,子域名的映射会比较方便。
而且valet也支持multi php version。
---EOF
苹果相关 | 评论:0
| 阅读:3003
Submitted by gouki on 2022, October 14, 11:25 AM
远程操作家里的mac mini进行更新的时候,突然报错:
XML/HTML代码
- mini:Homebrew mini$ brew update
- Warning: No available formula with the name "ca-certificates".
- ==> Searching for similarly named formulae...
- Error: No similarly named formulae found.
- ==> Searching for a previously deleted formula (in the last month)...
- Warning: homebrew/core is shallow clone. To get its complete history, run:
- git -C "$(brew --repo homebrew/core)" fetch --unshallow
-
- Error: No previously deleted formula found.
- ==> Searching taps on GitHub...
- Error: No formulae found in taps.
- Error:
- homebrew-core is a shallow clone.
- To `brew update`, first run:
- git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
- This command may take a few minutes to run due to the large size of the repository.
- This restriction has been made on GitHub's request because updating shallow
- clones is an extremely expensive operation due to the tree layout and traffic of
- Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
- automatically to avoid repeatedly performing an expensive unshallow operation in
- CI systems (which should instead be fixed to not use shallow clones). Sorry for
- the inconvenience!
于是执行
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow ,然而执行下来还是:
XML/HTML代码
- error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504 Gateway Time-out
- fatal: the remote end hung up unexpectedly
然后我就用打开git trace进行查看:
XML/HTML代码
- GIT_TRACE=2 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
- 10:29:28.798061 exec-cmd.c:139 trace: resolved executable path from Darwin stack: /Applications/Xcode.app/Contents/Developer/usr/bin/git
- 10:29:28.798668 exec-cmd.c:236 trace: resolved executable dir: /Applications/Xcode.app/Contents/Developer/usr/bin
- 10:29:28.799328 git.c:418 trace: built-in: git fetch --unshallow
- 10:29:28.801482 run-command.c:643 trace: run_command: GIT_DIR=.git git-remote-https origin https://mirrors.ustc.edu.cn/homebrew-core.git
- 10:29:28.812513 exec-cmd.c:139 trace: resolved executable path from Darwin stack: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-remote-https
- 10:29:28.813122 exec-cmd.c:236 trace: resolved executable dir: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core
- 10:29:28.929816 run-command.c:643 trace: run_command: git fetch-pack --stateless-rpc --stdin --lock-pack --include-tag --thin --depth=2147483647 https://mirrors.ustc.edu.cn/homebrew-core.git/
- 10:29:28.935164 exec-cmd.c:139 trace: resolved executable path from Darwin stack: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git
- 10:29:28.935863 exec-cmd.c:236 trace: resolved executable dir: /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core
- 10:29:28.936585 git.c:418 trace: built-in: git fetch-pack --stateless-rpc --stdin --lock-pack --include-tag --thin --depth=2147483647 https://mirrors.ustc.edu.cn/homebrew-core.git/
- error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504 Gateway Time-out
- fatal: the remote end hung up unexpectedly
这个。。--depth=2147483647,居然这么深?
---
在非正常之前,做了不少操作,比如用官方的uninstall脚本清除了系统,然而也没有什么用。所幸,现在正常了。
苹果相关 | 评论:0
| 阅读:2945