JIAYX 发布的文章

首先根据 certbot.eff.org 的引导,安装好 certbot

执行命令

certbot certonly --manual -d *.jiayx.net --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns-01
输入 Y 回车
添加 DNS TXT 解析记录

然后回车就申请好了,感觉比以前简单多了。


通配证书自动化

参考 https://github.com/ywdblog/certbot-letencrypt-wildcardcertificates-alydns-au

自动更新
0 */12 * * * /usr/bin/certbot renew --manual --preferred-challenges dns --manual-auth-hook /root/certbot-letencrypt-wildcardcertificates-alydns-au/au.sh --renew-hook="/usr/sbin/nginx -s reload" >> /var/log/certbot.log

有部分软件的开机启动项放在 /Library/LaunchDaemons

使用 sudo launchctl unload xxx.plist 可以去掉某个软件的开机自启

深信服的 EasyConnect 有一个进程叫做 EasyMonitor 可以说是非常流氓了,开机自启 + 常驻内存 + 内存泄露,时间长了以后会占用 1g 以上的内存。
它的 plist 位于 /Library/LaunchDaemons/com.sangfor.EasyMonitor.plist 使用上述命令可以干掉它。

干掉他这个进程非常开心,但是会遇到一个问题,再次启动 EasyConnect 的时候,它不乐意了,会提示初始化失败,请重新安装,这时候就得重新 load 这个 plist 了,执行 sudo launchctl load /Library/LaunchDaemons/com.sangfor.EasyMonitor.plist

公司 VPN 没得选,只能向流氓低头了

查看 binlog 是否开启
show variables like '%log_bin%'

开启 binlog
[mysqld]
log-bin=mysql-bin(随意写)

主从同步
binlog_format=ROW
server_id = 1

授权
GRANT SELECT, REPLICATION SLAVE,REPLICATION CLIENT ON *.* TO 'gosync'@'172.16.33.%/255.255.240.0' identified by 'password';

撤销权限
REVOKE SELECT,'REPLICATION SLAVE','REPLICATION CLIENT' FROM 'gosync'@'172.22.48.0/255.255.240.0';

修改用户密码
mysqadmin -u gosync -p password

刷新权限(更改生效)
FLUSH PRIVILEGES;

1. 先添加 ppa:ondrej/php 源

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

如果找不到 add-apt-repository 命令则执行

sudo apt-get install software-properties-common

2. 安装 PHP7.1

sudo apt-get install php7.1 php7.1-common
sudo apt-get install php7.1-fpm php7.1-curl php7.1-xml php7.1-zip php7.1-gd php7.1-mysql php7.1-mbstring

3. 验证

php -v

4. 移除旧的 PHP 版本(可选)

sudo apt-get purge php7.0 php7.0-common
.....

参考 https://ayesh.me/Ubuntu-PHP-7.1

rfc1738 page 18 - page 19 中定义了 URL 中允许出现的字符

摘录如下:

lowalpha       = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" |
                 "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" |
                 "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" |
                 "y" | "z"
hialpha        = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" |
                 "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" |
                 "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"

alpha          = lowalpha | hialpha
digit          = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
                 "8" | "9"
safe           = "$" | "-" | "_" | "." | "+"
extra          = "!" | "*" | "'" | "(" | ")" | ","
national       = "{" | "}" | "|" | "\" | "^" | "~" | "[" | "]" | "`"
punctuation    = "<" | ">" | "#" | "%" | <">


reserved       = ";" | "/" | "?" | ":" | "@" | "&" | "="
hex            = digit | "A" | "B" | "C" | "D" | "E" | "F" |
                 "a" | "b" | "c" | "d" | "e" | "f"
escape         = "%" hex hex

unreserved     = alpha | digit | safe | extra
uchar          = unreserved | escape
xchar          = unreserved | reserved | escape
digits         = 1*digit

写成正则是这样的

^[a-zA-Z\d$-_.+!*'(),{}|\^~[]`<>#%";/?:@&=]+&

参考资料:http://www.rfc-editor.org/rfc/rfc1738.txt