VPS主机测试脚本

持续更新。

目前参考自使用脚本测试VPS

硬盘IO及全球下载速度测试

使用秋水逸冰的一键Bench脚本

wget -qO- bench.sh | bash

或者下载到本地运行:

wget https://cdn.kelu.org/blog/2017/09/bench.sh
chmod +x bench.sh
./bench.sh

我经常运行到一半就卡了,不知道为什么,一般就看个I/O速度。

全国网络测试

来自于91yun,包括了全国PING值的测试和各地路由的走法,偏向于网络测试。

wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/91yuntest/master/test_91yun.sh && bash test_91yun.sh s

服务器性能测试

简单的对CPU进行运算测试,需要跑的时间很长,请耐心等好最后测试出来的跑分。如下:

wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh
chmod +x unixbench.sh
./unixbench.sh

线路测试

wget —no-check-certificate https://raw.githubusercontent.com/wn789/Superspeed/master/superspeed.sh
chmod +x superspeed.sh
./superspeed.sh

参考资料


Laravel 部署问题 —— "Please provide a valid cache path"

最近新建了一个 laravel 5.5项目,发现本地运行好好的,部署到服务器就发现出问题了。

在访问后台 admin 页面时提醒出错:

Please provide a valid cache path

经过一番排查,这个可以算作是 gitignore 的问额,也可以不算233333

之前在本地创建项目时,使用的是 github 默认的 laravel 的 gitignore。所以很多文件没有创建,系统缓存没办法创建,于是就出现了这样的问题。

最后的解决办法是手动创建了下面这些目录:

  • storage/framework
  • storage/logs
  • storage/framework/cache
  • storage/framework/sessions
  • storage/framework/views
  • bootstrap/cache

最后就 ok 了。


postgresql 使用不同账号新建数据库

今天用 postgresql 的默认账号 postgres,想新建一个角色然后新建数据库,竟然报错:

ERROR:  must be member of role "ttfix"

好奇以前为什么没有发现这个问题——《# PostgreSQL入门》

比较简单的解决办法是在新建用户后,将新用户的权限赋予当前用户,再进行其他操作。具体如下:

GRANT "ttfix" to postgres;
CREATE DATABASE "ttfix" owner "ttfix";
GRANT ALL PRIVILEGES ON DATABASE ttfix to ttfix;
REVOKE ttfix from postgres;

参考资料