压测工具ab安装
yum -y install httpd-tools
ab -n 10 -c 100 http://localhost/
Mac brew 特别慢
替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
重置为官方地址:
安装php时,使用 brew tap Homebrew/homebrew-core 因为其他第三方tab已经迁移/弃用了,全部合并到这里。若不是官方地址会报错,此时需要重置为官方地址,方法如下:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://github.com/Homebrew/homebrew-core
Mac Homebrew 如何更换国内镜像源
替换brew.git:
$ cd "$(brew --repo)"
中科大:
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
清华:
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
替换homebrew-core.git:
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
中科大:
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
清华:
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
替换homebrew-bottles:
中科大:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile
清华:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile
应用:
$ brew update
微信支付回调常见问题
地址必须外网可以访问,回调地址不能包含?否则会被截断
使用putty连接虚拟机上的centos提示Network:connection refused
使用桥接连接情况下虚拟机设置地址不要和本机ip相同,否则会有冲突。
修改之后不要忘了重启生效/etc/init.d/network restart
还有出现连接超时的情况,原因是连接远程主机即虚拟机的ip地址写错了,在虚拟机通过ifconfig查看对应ip地址,用得到的ip地址去连接即可
最近某次,新建一个ssh客户端后,ls, vi,等基础命令都不可以使用
-bash: XX: No such file or directory
但在其它还未关闭的ssh终端中可以使用,推测是/etc/profile文件的问题,显示$PATH后发现不对;切换root权限准备修改profile文件后,发现vi命令不能用
解决方法
在ssh终端中执行下面语句,可以让此会话终端中环境变量起作用
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
然后修改/etc/profile文件,重新source后系统恢复正常
后记
- 后来找到原因是有人修改profile文件时,使用了
$PATH=<newpath>
,后面没有使用”:”拼接原来的$PATH
,导致PATH丢失了重要环境变量 - cd在出现问题时仍可使用,
<Tab>
键也可起到ls的作用
微信小程序支付时如果价格为0.00,小程序统一下单接口会报错,后续preay_id为null,支付流水号也没有
解决方法:建议价格为0时,跳过小程序支付调起步骤,提交订单时订单金额为0直接走回调