blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];

FORBIDDEN/12/index read-only / allow delete (api)

官方解决方法:

curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

_all 可以改为自己的索引名称,也可以直接执行

curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

原文链接:https://www.cnblogs.com/zhja/p/9717536.html

Git更安全的强制推送 -force-with-lease

Git 的 push --force 具有破坏性,因为它无条件地覆盖远程存储库,无论你在本地拥有什么。使用这个命令,可能覆盖团队成员在此期间推送的所有更改。然而,有一个更好的办法,当你需要强制推送,但仍需确保不覆盖其他人的工作时,-force-with-lease 这条指令选项可以帮助到你。


作者:LeviDing
链接:https://juejin.im/post/5985b9c56fb9a03c376de762
来源:掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

统计php-fpm内存占用总量

ps auxf|grep www_sockets | grep -v grep | awk ‘{print $6}’ | awk ‘{sum+=$1} END {print “Memory =”, sum/1024/1024, “GB”}’

根据需求定制 红色部分是你要修改的部分

git子模块支持分支

You can set the submodule to track a particular branch (requires git 1.8.2+), which is what we are doing with Komodo, or you can reference a particular repository commit (the later requires updating the main repository whenever you want to pull in new changes from the module – i.e. updating the commit hash reference).

git submodule add -b master https://github.com/Komodo/trackchanges.git src/modules/trackchanges

php iOS内购验证库

项目地址:

https://github.com/sn01615/ios-iap-php

安装:

composer require sn01615/ios-iap-php

使用:


use sn01615\iap\ios\Verify; include "../vendor/autoload.php"; $cc = new Verify(); $receipt = ".."; // 凭据 $cc->endpoint(true);// 可选切换到沙盒环境 $vv = $cc->query($receipt); // 打印结果 var_dump($vv);

PHP7 扩展Hello world

[root@local2 ext]# ./ext_skel --extname=Hello

Creating directory Hello
Creating basic files: config.m4 config.w32 .gitignore Hello.c php_Hello.h CREDITS EXPERIMENTAL tests/001.phpt Hello.php [done].

To use your new extension, you will have to execute the following steps:

1.  $ cd ..
2.  $ vi ext/Hello/config.m4
3.  $ ./buildconf
4.  $ ./configure --[with|enable]-Hello
5.  $ make
6.  $ ./sapi/cli/php -f ext/Hello/Hello.php
7.  $ vi ext/Hello/Hello.c
8.  $ make

Repeat steps 3-6 until you are satisfied with ext/Hello/config.m4 and
step 6 confirms that your module is compiled into PHP. Then, start writing
code and repeat the last two steps as often as necessary.

[root@local2 ext]# 
# phpize 
# ./configure --enable-Hello
# make
# php -i | grep Hello
# php Hello.php 

Linux 系统级别PATH添加目录

修改此文件 /etc/profile.d/sh.local ,添加如下内容

pathmunge /usr/local/bin after
# pathmunge 是个shell函数 after 表示在路径后面添加,不加after 表示在路径签名加
# /usr/local/bin 是我们要添加到PATH的路径