在 Laravel 中使用 PHPSocketIO 提供服务

参考测试文章,https://www.workerman.net/a/1621 可以了解到通过 laraman 与 phpsocketio 结合的使用方式。接下来便可以通过自定义进程为项目提供即时通讯服务。下方是部分 demo 代码。

config/socketio.php

全文

https://discuss.plugins-world.cn/post/owle1ScG

检查服务器内存资源占用进程信息

通过命令快速获取服务器内存资源占用信息,方便分析项目资源占用情况。

{
  echo "总内存和CPU使用百分比:";
  ps -eo %mem,%cpu --sort=-%mem | awk 'NR>1 {mem+=$1; cpu+=$2} END {print "总%mem: " mem "\n总%cpu: " cpu}';

  echo "内存占用前10的进程:";
  ps -eo %mem,%cpu,...

全文

https://discuss.plugins-world.cn/post/B0Q4k8Jj

K3S Dashboard 部署

Kubernetes-Dashboard 是基于网页的 Kubernetes 用户界面。你可以使用 Dashboard 将容器应用部署到 Kubernetes 集群中,也可以对容器应用排错,还能管理集群资源。

1、安装 Kubernetes 控制面板

wget https://ghproxy.com/https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0...

全文

https://discuss.plugins-world.cn/post/gdqT5Ccb

k3s kubelet 通过 secret 拉取私有镜像仓库的镜像

在服务器创建 secret。便于后续的镜像进行认证拉取

export HUB_SERVER=registry.cn-shenzhen.aliyuncs.com
export HUB_USERNAME=my24251325@gmail.com
export HUB_PASSWORD=
kubectl -n translate create secret docker-registry aliyun-docker-hub \
  --docker-server=$HUB_SERVER \...

全文

https://discuss.plugins-world.cn/post/vMjJ03Xw

k3s 部署测试文件

这里是一份部署测试使用的文件。测试 nginx 在 k3s 环境中,能否符合预期运行。

关于如何搭建 k3s 集群,可查看之前的文章:

全文

https://discuss.plugins-world.cn/post/ZhIsPuMX

在阿里云创建注册集群,并可视化管理自建 k3s 集群,集群管理的 UI 最低需 ¥90.25/月

成本:

  • SLB 费用:¥ 0.100 /时
  • EIP 费用:¥ 0.800 /GB,¥ 0.020 /时

合计:

  • 后付费:(¥0.100 + ¥0.020) x 24 x 31 = ¥89.28
  • 流量费:xG x 0.8/G

注册集群整体费用:¥90.25/月

操作步骤:

  1. 根据搭建跨云 k3s 服务步...

全文

119391697240407_.pic.jpg 119411697240455_.pic.jpg 119461697240757_.pic.jpg 119481697240837_.pic.jpg 119471697240825_.pic.jpg 24021697241020_.pic.jpg
https://discuss.plugins-world.cn/post/4E2CTwvv

搭建跨云 k3s 服务

需要注意防火墙问题

协议 端口 目标 描述
TCP 6443 子节点 主节点 Kubernetes API Server
TCP 10250 所有节点 所有节点 Kubelet 指标收集
UDP 51820 所有节点 所有节点 Flannel WireGuard
TCP 1024-65585 所...

全文

https://discuss.plugins-world.cn/post/2Bexcn8C

服务器获取内网、外网IP

外网IP

export PUBLIC_IP=$(curl -Ls http://ipv4.rehi.org/ip)

export PUBLIC_IP=$(curl -Ls http://ifconfig.me/ip)

内网IP

export PRIVATE_IP=$(ip -o -4 addr list | grep eth0 | awk '{print $4}' | cut -d/ -f1)

https://discuss.plugins-world.cn/post/AyaFGviO

使用 vim 的简单配置项

经常需要在服务器上编辑文件。这里是几个没有外部依赖的常用配置。需要写入 ~/.vimrc 文件中

set nu "显示行号
set relativenumber "显示相对行号
set tabstop=4 "设置tab锁进
set hlsearch "设置搜索高亮
set autoindent "设置自动缩进
set backspace=2 "设置使用退格键删除
```...

全文

https://discuss.plugins-world.cn/post/ie8xnKMh

使用 MAC 电脑的一些系统配置变更

以下操作需要在命令行进行

  • 关闭 DStore 并禁止压缩 zip 文件产生 __MAXOSX 目录

参考文章:https://blog.csdn.net/sun124608666/article/details/123471794

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
  • 修改系统主题

参考文章:...

全文

https://discuss.plugins-world.cn/post/F4lUX2GP

插件管理器重大升级,插件目录结构层级缩减。

本次升级主要兼容插件管理器的升级变更,由 extensions/plugins/ 目录缩减层级为 plugins

下方是手动升级的相关步骤说明。

  1. 删除 vendor 与 composer.lock
rm -rf vendor composer.lock
  1. 更新插件管理器
composer update plugins-world/market-ma...

全文

https://discuss.plugins-world.cn/post/wX1xhHZF
上滑加载更多