Thinkphp 6 输出图片

搜索了下相关内容
大部分都是COPY同一来源的这篇文章
解决ThinkPHP里无法输出图片问题(关于设置响应头) https://www.php.cn/phpkj/thinkphp/472856.html
解决办法是扩展 Response类, 缺陷是 每次 composer update 就会覆盖掉扩展文件
这样的解决办法不在考虑范围之内…..

实际上这个问题官方也没写清楚
但是官方有例子啊
对 就是那个验证码 , 需求是一致的,直接看他代码就好了…..

继续阅读 →

批量开多个VPS,批量管理多个AMAZON网店站群

批量开多个VPS,来管理多个AMAZON网店站群

主要用途是
Amazon的商店站群管理 , 避免同区域IP同电脑,导致

之前给杭州一个电商公司, 部署了这个方案和大家分享下
使用反馈还不错,合同签的150个,美国几个州

好几年前接了一个客户,做电商代运营的

客户需求

  • 多台Windows系统的VPS
  • IP需要分布在美国不同的州和城市
继续阅读 →

自己养的微信,跪着也要上交资料

自己养的微信,跪着也要上交资料

绑的备用135号码的微信小号被封了
理由是长时间未登录
什么都没变过
经过一系列的验证码,扫码,发短信到1069
现在是临时登录状态
如果要继续使用
首先你要
1. 实名认证
2 .上传身份证照片
3. 绑定银行卡
户口本当然不用的,祖上18代也不用
注销?不存在的….
额,我已经删了微信了

继续阅读 →

把日常开发机器换成AMD了

因为网络问题现在不用本地电脑做开发了
办公室用的AMD 3600,大部分时间都是远程用和登录网银发发工资什么的

之前一直的E3-1270v2/32G内存/2x4T硬盘有些老了性能跟不上,也便宜 $49/月
主要是日常一些软件打开和编译太慢了,其他倒是没什么

现在配的是AMD 3900X 12核/64G内存/1块1000G Nvme + 1块4TSATA $99/月
其实SATA硬盘还是真必须配一块
Nvme的M2闪存快是真快
但是就目前使用来说,寿命有限
还可能出现密集读写掉盘和强制断电的时候丢数据

继续阅读 →

kernel: nvme nvme0: I/O xxx QID xxx timeout, aborting

10Gbps端口的服务器安装了2块NVME的硬盘
结果频繁的出现问题掉盘的问题

日志如下

Mar 10 13:10:10 10Gbps kernel: nvme nvme0: I/O 183 QID 3 timeout, aborting
Mar 10 13:10:10 10Gbps kernel: nvme nvme0: Abort status: 0x0
Mar 10 13:10:13 10Gbps kernel: nvme nvme0: I/O 384 QID 4 timeout, aborting
Mar 10 13:10:13 10Gbps kernel: nvme nvme0: Abort status: 0x0
Mar 10 13:10:14 10Gbps kernel: nvme nvme0: I/O 626 QID 5 timeout, aborting
Mar 10 13:10:14 10Gbps kernel: nvme nvme0: Abort status: 0x0
Mar 10 13:10:15 10Gbps kernel: nvme nvme0: I/O 879 QID 7 timeout, aborting
Mar 10 13:10:15 10Gbps kernel: nvme nvme0: Abort status: 0x0
Mar 10 13:10:28 10Gbps kernel: nvme nvme0: I/O 221 QID 5 timeout, aborting
Mar 10 13:10:28 10Gbps kernel: nvme nvme0: Abort status: 0x0
Mar 10 13:10:34 10Gbps kernel: nvme nvme0: I/O 510 QID 1 timeout, reset controller
Mar 10 13:10:55 10Gbps kernel: nvme nvme0: Device not ready; aborting reset, CSTS=0x1
Mar 10 13:10:55 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 271133736 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
Mar 10 13:10:55 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 2052266888 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
Mar 10 13:10:55 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 2175930376 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
Mar 10 13:10:55 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 7072889400 op 0x0:(READ) flags 0x80700 phys_seg 17 prio class 0
Mar 10 13:10:55 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 238328656 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
Mar 10 13:10:55 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 3954686056 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
Mar 10 13:10:55 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 6440531640 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
Mar 10 13:10:55 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 7301389616 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
Mar 10 13:10:55 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 6288979456 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0
Mar 10 13:10:55 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 2149595472 op 0x0:(READ) flags 0x80700 phys_seg 6 prio class 0
Mar 10 13:11:16 10Gbps kernel: nvme nvme0: Device not ready; aborting reset, CSTS=0x1
Mar 10 13:11:16 10Gbps kernel: nvme nvme0: Removing after probe failure status: -19
Mar 10 13:11:36 10Gbps kernel: nvme nvme0: Device not ready; aborting reset, CSTS=0x1
Mar 10 13:11:36 10Gbps kernel: print_req_error: 6 callbacks suppressed
Mar 10 13:11:36 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 2000203632 op 0x0:(READ) flags 0x1000 phys_seg 4 prio class 0
Mar 10 13:11:36 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 68158880 op 0x0:(READ) flags 0x1000 phys_seg 4 prio class 0
Mar 10 13:11:36 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 4036854464 op 0x0:(READ) flags 0x1000 phys_seg 4 prio class 0
Mar 10 13:11:36 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 78773728 op 0x0:(READ) flags 0x1000 phys_seg 4 prio class 0
Mar 10 13:11:36 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 1987798736 op 0x0:(READ) flags 0x1000 phys_seg 4 prio class 0
Mar 10 13:11:36 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 1986001320 op 0x0:(READ) flags 0x1000 phys_seg 1 prio class 0
Mar 10 13:11:36 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 4082978496 op 0x0:(READ) flags 0x1000 phys_seg 4 prio class 0
Mar 10 13:11:36 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 5906970992 op 0x0:(READ) flags 0x1000 phys_seg 1 prio class 0
Mar 10 13:11:36 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 3962823040 op 0x0:(READ) flags 0x1000 phys_seg 4 prio class 0
Mar 10 13:11:36 10Gbps kernel: blk_update_request: I/O error, dev nvme0n1, sector 6902965512 op 0x1:(WRITE) flags 0x100000 phys_seg 40 prio class 0
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): metadata I/O error in “xfs_trans_read_buf_map” at daddr 0x160153970 len 8 error 5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): metadata I/O error in “xfs_trans_read_buf_map” at daddr 0xf09d82c0 len 32 error 5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): metadata I/O error in “xfs_trans_read_buf_map” at daddr 0x98fd6a0 len 32 error 5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): metadata I/O error in “xfs_trans_read_buf_map” at daddr 0x4b1fde0 len 32 error 5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: nvme0n1: writeback error on inode 6619987520, offset 0, sector 6902965832
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): log I/O error -5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): metadata I/O error in “xfs_trans_read_buf_map” at daddr 0xec33e180 len 32 error 5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_do_force_shutdown(0x2) called from line 1250 of file fs/xfs/xfs_log.c. Return address = 00000000147aed99
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): Log I/O Error Detected. Shutting down filesystem
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): Please unmount the filesystem and rectify the problem(s)
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): log I/O error -5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): log I/O error -5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): log I/O error -5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): log I/O error -5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): log I/O error -5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): log I/O error -5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): log I/O error -5
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:36 10Gbps kernel: nvme0n1: writeback error on inode 77133302, offset 0, sector 684881640
Mar 10 13:11:36 10Gbps kernel: XFS (nvme0n1): xfs_imap_to_bp: xfs_trans_read_buf() returned error -5.
Mar 10 13:11:39 10Gbps kernel: VFS: busy inodes on changed media or resized disk nvme0n1
Mar 10 13:11:39 10Gbps kernel: nvme nvme0: failed to set APST feature (-19)
Mar 10 13:11:39 10Gbps systemd[1]: Stopped target Local File Systems.

https://forums.unraid.net/topic/92924-solved-sudden-problems-when-starting-vms/
这里也有同类错误,

分析了原因
大部分是密集型读写引起的
这个是CDN缓存节点,密集型读
NVME温度比较高,持续的话就开始节流
然后慢慢崩溃了
而且因为这个是ADATA的XPG消费级产品,不是企业级的

解决问题
1. 替换为三星的PRO系列 , 因为另外2台使用三星产品的并无问题
2. 尝试增加散热


Linux的Swap空间需要设置多大?

我们看看redhat的官方答复是怎么说的:

Amount of RAM in the system 物理内存Recommended swap space建议的交换空间大小Recommended swap space if allowing for hibernation如果开启休眠功能建议的交换空间大小
⩽ 2GB2 times the amount of RAM3 times the amount of RAM
> 2GB – 8GBEqual to the amount of RAM2 times the amount of RAM
> 8GB – 64GBAt least 4 GB1.5 times the amount of RAM
> 64GBAt least 4 GBHibernation not recommended

总结起来就是,如果不打算开启休眠功能,物理内存在8G以下,则swap设置为与物理内存一样大。如果物理内存在8G以上,swap空间设置为8G即可。当物理内存大于64G时,不建议开启休眠功能。

以下是Ubuntu的指南,更加细致:(从左至右依次是RAM大小,不开启休眠,开启休眠,最大值)

参考链接如下:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/installation_guide/s2-diskpartrecommend-ppc#id4394007

https://help.ubuntu.com/community/SwapFaq

NGINX反向代理一个IPv6问题

NGINX反向代理一个IPv6问题
最近部署了一台纯IPv4的缓存节点,来缓存Object Storage的内容
发现一个问题

Cache Node = Only IPv4
Backed Object Storage = IPv6/IPv4

缓存节点 bypass是 https://object.sss.com 域名格式
Nginx会自动解析所有IP 包括IPv6

然而 因为缓存节点服务器不支持IPv6 日志就出现很多错误

2021/01/30 00:25:06 [error] 1930#0: *1482670 connect() to [AAAA:BBBB:C:DDD:E:F:GGG:HHH]:443 failed (101: Network is unreachable) while connecting to upstream, client: AA.BB.CC.DD, server: example.com, request: “GET /download/file HTTP/1.0”, upstream: “https://[AAAA:BBBB:C:DDD:E:F:GGG:HHH]:443/download/file”, host: “example.com”

返回实际上还是返回的200,但是内容是无法访问的

解决方案
在location区域指定解析服务器并且关闭ipv6 就可以了

location / {
resolver 1.1.1.1 ipv6=off valid=30s;
set $empty “”;
proxy_pass https://example.com$empty;
}

OKHTTP3 出现断流问题的修复

安卓开发种,使用okhttp3 调试可能出现断流的问题

修复

成功人士的为人处世

之前去客户那溜达, 晚上一起去吃饭, 客户提议去吃意大利菜
因为有6个人,五座坐不下,客户就让司机开了台 丰田埃尔法
吃饭的时候, 一直在聊天 , 给人的感觉就是谦逊

吃完饭以后客户打包了一份餐, 给司机带回去给他孩子吃
司机一直在停车场等我们

所以成功都不是偶然
人啊,就是一场修行





为什么需要使用SSD或者NV闪存

为什么我们需要更快的存储设备?

这个机器是4T SATA x2 + Raid1 的结构
合并甲骨文EBS的镜像,HDD的效率低到发指 。 利用率始终100%
后面那个安装进程一直挂起。。。。。。

鉴于之前SSD丢数据的问题,这个机器还没办法换,。。。。。