range

If there were you, the world would be just right

1.如果是虚拟机环境需要关闭防火墙

setenforce 0
systemctl stop firewalld

2.更新epel源

yum -y install epel-release

3.yum安装RabbitMQ

yum -y install rabbitmq-server

4.查看已安装的插件

rabbitmq-plugins list

5.启动管理服务

rabbitmq-plugins enable rabbitmq_management

6.启动rabbitmq服务

systemctl start rabbitmq-server

7.登录管理后台

http://192.168.16.200:15672/
guest
guest

ik分词器安装 声明:安装完成后需要重新启动elasticsearch,elasticsearch-head,kibana

1.进入elasticsearch目录

# git文档查看 https://github.com/medcl/elasticsearch-analysis-ik

#执行安装
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.6.1/elasticsearch-analysis-ik-7.6.1.zip

2.重启es

3.elasticsearch-plugin list 可以通过这个命令来查看加载进来的插件


下载解压,主要kibana版本需要跟es版本一致

wget https://artifacts.elastic.co/downloads/kibana/kibana-7.6.1-linux-x86_64.tar.gz

tar -zxvf kibana-7.6.1-linux-x86_64.tar.gz

1. 修改kibana配置文件kibana.yml

vim config/kibana.yml

# 追加配置如下:
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://192.168.16.199:9200"]
i18n.locale: "zh-CN" #汉化

4. 启动kibana

#后台启动
nohup  ./kibana --allow-root  &

<?php

$db = new ran_pdo("qx_yisdk_user",true); 

$tables = [
    "yisdk_user",
];

foreach ($tables as $tab) {
    $count_sql = 'select count(*) c from yisdk_user where last_login_time>=1602518400 and uuid!=MD5(concat("new_",CONCAT_WS("_",channel,pf_game_id,user_id)))'; 

    $row = $db->get_one($count_sql);
    // 需要执行的条数
    $count = !empty($row["c"]) ? $row["c"] : 0;

    // 每次执行的条数 1000
    $do_num = 100;

    // 需要执行的次数
    $dc = ceil($count/$do_num);

    if($dc) for ($i=0; $i < $dc; $i++) { 
        $p = $i * $do_num;
        $sql = "select uuid,MD5(concat('new_',CONCAT_WS('_',channel,pf_game_id,user_id))) as new_uuid from yisdk_user where last_login_time>=1602518400 and uuid!=MD5(concat('new_',CONCAT_WS('_',channel,pf_game_id,user_id))) limit {$p},{$do_num}";

        $data = $db->get_all($sql);

        $update_sql = "UPDATE {$tab} a JOIN  (";
        $k = 0;
        foreach ($data as $key => $val) {

                $k = 1;
                $update_sql .= " SELECT '{$val['uuid']}' as uuid,'{$val['new_uuid']}' AS new_uuid UNION";

        }

        $sql = rtrim($update_sql,"UNION"); 
        $sql .= ") b USING(uuid) SET a.uuid=b.new_uuid";
        echo $sql;die;
        if($k){
            $db->query($sql);
        }
        sleep(1);
    }
}

可生成泛域名ssl网站

https://freessl.cn/
1 选择多域名通配符
2 选择浏览器方式生成

证书过期时间检查demo

<?php
$g = stream_context_create ([
    "ssl" => ["capture_peer_cert" => true],
    'http' => [
          'method' => 'GET',
        'user_agent' => 'shouwang.io ssl detector',
        'timeout'=>10
    ]
]);
$r = fopen("https://range8.cn/", "rb", false, $g);
$cont = stream_context_get_params($r);
$cert = openssl_x509_parse($cont["options"]["ssl"]["peer_certificate"]);

if(empty($cert['validTo_time_t'])) {
    throw new \Exception("Can't get cert expire time");
}

$fortyEightHours = strtotime("+48 hours");
if($cert['validTo_time_t'] <= $fortyEightHours) {
    throw new \Exception("Cert will expire in 48 hours");
} else {
    echo "证书过期时间:", date("Y-m-d H:i:s", $cert['validTo_time_t']);
}