Uncategorized

wp-cli 安裝與使用

https://wp-cli.org/

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp

使用

/usr/local/bin/wp --allow-root

範例

#!/bin/sh
# all web directories
target_path="/var/www/j7.lb168.tw"
## 安全緣故,改用 mysql_config_editor
#allow_root="--allow-root"

cron="cron event run --due-now"

# date format for backup file (dd-mm-yyyy)
date="$(date +"%Y.%m.%d-%H-%M")"

# mysql, mysqldump and some other bin's path
WP="/usr/local/bin/wp --allow-root"
CHOWN="$(which chown)"
OWNER="www-data"

cd $target_path
$WP $cron
$CHOWN -R $OWNER:$OWNER $target_path

exit 0;

極致速度的 DNS

各家 DNS 服務列表

CloudFlare

IPv4
1.1.1.1
1.0.0.1
IPv6
2606:4700:4700::1111
2606:4700:4700::1001

Google

IPv4
8.8.8.8
(google-public-dns-a.google.com)
8.8.4.4
(google-public-dns-b.google.com)
IPv6
2001:4860:4860::8888
2001:4860:4860::8844

TWNIC

IPv4
101.101.101.101
101.102.103.104
IPv6
2001:de4::101
2001:de4::102

101 是由 TWNIC (財團法人台灣網路資訊中心) 所設立的免費 DNS 解析服務

並委由 PwC Taiwan 每年審核系統,強調不記錄與用來定位廣告

基本上跟 Cloudflare 的做法相同。

中華電信

IPv4
168.95.1.1
168.95.192.1
IPv6
2001:b000:168::1
2001:b000:168::2