homestead+phpstorm xdebug

编辑php环境的debug,添加xdebug.idekey= PHPSTORMvi /etc/php/7.3/fpm/conf.d/20-xdebug.inizend_extension=xdebug.so xdebug.mode = debug xdebug.discover_client_host = true xdebug.client_port = 9003 xdebug.max_nest

- 阅读全文 -

php htlm修复

使用DOMDocument进行html修复$htmlStr="<p>1111</p>"; $doc = new DOMDocument(); $doc->loadHTML(mb_convert_encoding($str, 'HTML-ENTITIES','UTF-8')); //获取html $html= $doc->saveHTML();

- 阅读全文 -

debian使用ipset来封禁大量ip

//安装ipsetsudo apt-get install ipset //创建ip集banthis,hash是ip类型,可以选其他的网络类型sudo ipset create banthis hash:ip //禁止80端口访问/禁止所有端口(如果是docker部署,记得加在DockerUser里)sudo iptables -I INPUT -m set --match-set banthis

- 阅读全文 -

shell 提取日志里的访问ip

#!/bin/bash log_file=./logs/access.log ip_file=./banip.tmp uniq_ip_file=./uniq_ip.tmp grep -P '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' -o $log_file >$ip_file sort $ip_file | uniq >$uniq_ip_file

- 阅读全文 -

vagrant debian 扩容

vagrant的vm虚拟机空间不足,要进行扩容先安装vagrant插件vagrant plugin install vagrant-disksize 然后在vagrantfile加入config.disksize.size = "50GB" 接着vagrant halt vagrant up vagrant ssh 扩容,和普通linux一样apt-get install gd

- 阅读全文 -