作者归档:杨龙

IPv6字符串表示最大长度(字符数)

45个字符,数据库设计时存储IPv6需要 varchar(45)

45 characters.

You might expect an address to be

0000:0000:0000:0000:0000:0000:0000:0000

8 * 4 + 7 = 39

8 groups of 4 digits with 7 : between them.

But if you have an IPv4-mapped IPv6 address, the last two groups can be written in base 10 separated by ., eg. [::ffff:192.168.100.228]. Written out fully:

0000:0000:0000:0000:0000:ffff:192.168.100.228

(6 * 4 + 5) + 1 + (4 * 3 + 3) = 29 + 1 + 15 = 45

Note, this is an input/display convention – it’s still a 128 bit address and for storage it would probably be best to standardise on the raw colon separated format, i.e. [0000:0000:0000:0000:0000:ffff:c0a8:64e4] for the address above.

正则零宽断言

https://blog.csdn.net/u010801439/article/details/77921037

零宽断言表示匹配字符的时候再添加一些定位条件,使匹配更精准。

  • \w+(?=ing) 匹配以ing结尾的多个字符(不包括ing)
  • \w+(?!ing) 匹配不是ing结尾的多个字符
  • (?<=re)\w+ 匹配以re开头的多个字符(不包括re)
  • (?<!re)\w+ 匹配不是re开头的多个字符
  • (?<=\s)\d+(?=\s) 匹配两边是空白符的数字,不包括空白符

本文参考:https://www.w3cschool.cn/rxoyts/l17fcozt.html

正则表达式30分钟入门教程:

https://deerchao.cn/tutorials/regex/regex.htm

php编译问题

configure: error: jpeglib.h not found.

yum -y install libjpeg-devel

configure: error: xpm.h not found.

yum install libXpm-devel -y

configure: error: freetype-config not found.

yum install freetype-devel -y

configure: error: Unable to locate gmp.h

yum install gmp-devel -y

php 7.4 GD全开

./configure –enable-fpm –with-pdo-mysql –enable-mbstring –with-mysqli –with-openssl –with-zlib –enable-bcmath –enable-gd –with-curl –enable-exif –with-zip –with-pear –with-jpeg –with-webp –with-freetype –with-xpm –enable-gd-jis-conv

“Cannot open /dev/vmmon: No such file or directory” 解决办法

方法一:关闭安全引导

方法二:签名vmmon和vmnet

1.生成key对
$openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VMware/"
2.使用内核自带的scripts/sign-file签名模块
$sudo /usr/src/kernels/`uname -r`/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vmmon)
$sudo /usr/src/kernels/`uname -r`/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vmnet)
注意:sign-file的路径可能不太一样自己find一下

3.导入key
$sudo mokutil --import MOK.der
输入一个秘密记住,然后重启电脑,在efi控制台同意操作

重启后vmware服务就能正常启动了

参考链接:https://kb.vmware.com/s/article/2146460