Official speedtest for Linux installation Author: Chuwen Time: 2021-07-24 Classification: Linux comment ##Preamble It turns out that 'speedtest cli' is not officially released. If you want to install it, follow the https://www.speedtest.net/apps/cli From the installation tutorial Let me tell you how to install and run speedtest in Linux ##Download Visit first https://www.speedtest.net/apps/cli Select the Linux distribution system that suits you, and then select the corresponding CPU architecture ! []( https://cdn.nowtime.cc/2021/07/24/3887586944.png ) I choose 'aarch64' here. Personally, it refers to the CPU of ARM64 bit architecture. Copy the download link, and then use wget to download: ``` #Wget download link wget https://install.speedtest.net/app/cli/ookla-speedtest-1.0.0-aarch64-linux.tgz ``` ##Installation ``` #Unzip the file tar zxvf and download the file name tar zxvf ookla-speedtest-1.0.0-aarch64-linux.tgz #Run ./speedtest ``` ##Operation results >The conclusion is that at least Ganzhou Mobile has not changed the rule of peer to peer ``` root@Chainedbox :~# ./ speedtest ============================================================================== You may only use this Speedtest software and information generated from it for personal, non-commercial use, through a command line interface on a personal computer. Your use of this software is subject to the End User License Agreement, Terms of Use and Privacy Policy at these URLs: https://www.speedtest.net/about/eula https://www.speedtest.net/about/terms https://www.speedtest.net/about/privacy ============================================================================== Do you accept the license? [type YES to accept]: yes License acceptance recorded. Continuing. Speedtest by Ookla Server: Guangzhou Unicom 5G - Guangzhou (id = 26678) ISP: China Mobile Guangdong Latency: 39.65 ms (0.08 ms jitter) Download: 359.46 Mbps (data used: 449.1 MB) Upload: 311.90 Mbps (data used: 556.8 MB) Packet Loss: 0.0% Result URL: https://www.speedtest.net/result/c/d3010769-3ca8-4b85-82ff-c2a3f41f7896 ```
One month's difference in the time of recording causes the apt install to prompt that there is a problem with the certificate Author: Chuwen Time: 2021-07-24 Classification: Linux comment I haven't logged in to my home NAS for several months. The main reason is that my broadband and corporate networks don't have IPv6. Only mobile phones can have IPv6 when they are hot. Only when they are connected to the home router VPN can they access Today I heard that * * Jiangxi Mobile Broadband * * no longer provides peer-to-peer up and down peer-to-peer broadband. I wanted to test the speed, but I didn't install 'speedtest cli', so I directly executed 'apt install speedtest cli', but the installation failed. The following message is probably prompted: ``` server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none ``` Because my side has been repaired, and the terminal only retains part of the execution history, it is impossible to paste the original text ##Solution There may be some problem with your system time. You can use the 'date' command to view: ```shell root@Chainedbox :~# date Monday, June 14, 2021 03:50:33 UTC ``` At first glance, the time difference is more than one month, so it's no wonder to report the certificate problem, Just need to calibrate the time ```shell root@Chainedbox :~# sudo ntpdate -s ntp.aliyun.com root@Chainedbox :~# ntpdate -u ntp.aliyun.com 24 Jul 14:32:15 ntpdate[24105]: step time server 203.107.6.88 offset 3494399.184393 sec root@Chainedbox :~# date Saturday, July 24, 2021 14:32:24 UTC ``` ###Finally, speedtest cli is successfully installed ``` root@Chainedbox :~# apt install speedtest-cli Reading package list complete Analyzing dependency tree for package Reading status information Complete The following [new] software packages will be installed: speedtest-cli 0 software packages have been upgraded, 1 software package has been newly installed, 0 software packages need to be uninstalled, and 157 software packages have not been upgraded. You need to download the 19.1 kB archive. After decompression, 85.0 kB of additional space will be consumed. Get: 1 https://mirrors.tuna.tsinghua.edu.cn/debian stretch/main arm64 speedtest-cli all 1.0.0-1 [19.1 kB] 19.1 kB has been downloaded, taking 0 seconds (32.6 kB/s) Selecting unselected package speedtest cli. (Reading database... The system currently has 58082 files and directories installed.) Preparing to unpack/ speedtest-cli_1.0.0-1_all.deb ... Unpacking speedtest cli (1.0.0-1) Processing trigger for man db (2.7.6.1-2) Setting speedtest cli (1.0.0-1) ```
Git pull excludes pulling a folder/only pulling a folder Author: Chuwen Time: 2021-07-24 Classification: Linux comment ##Preamble For company projects, 'vendor' has been uploaded to 'git', resulting in conflicts when 'composer update' and other related 'composer' commands are executed locally and 'git pull' is used again ##Usage >The reference is: https://zhgcao.github.io/2016/05/11/git-sparse-checkout/ ```shell git config core.sparsecheckout true #Indicates that only the/path1 directory is pulled echo "/path1" >> .git/info/sparse-checkout #Add an exclamation mark to indicate that pulling the/path1 directory is excluded echo "!/path1" >> .git/info/sparse-checkout git checkout master ```
WordPress uses the wp command to create. opt files to support multiple languages Author: Chuwen Time: 2021-07-20 Classification: PHP comment ##Preface >Personally, please correct any mistakes First, you need to understand one thing. Before creating the '. opt' file, first add the following key comments (* * Text Domain * * and * * Domain Path * * fields) to your plug-in comments: -* * Text Domain * *: text domain (personal understanding), which is more critical -* * Domain Path * *: the path where the translation file is stored ``` /** *Plugin Name: the name of the plug-in * Plugin URI: https://nowtime.cc/ *Description: Introduction to Plug in * Version: 0.0.1 * Author: Chuwen * Author URI: https://nowtime.cc * Text Domain: chuwen * Domain Path: /i18n/languages/ * Requires at least: 5.5 * Requires PHP: 7.0 * * @package Chuwen * @date 2021/7/20 14:50 */ ``` After the above work is completed, you can continue to look down ##Install wp command >WP-CLI is a command line interactive interface for managing WordPress. It can complete plug-in updates, multi site settings and many other operations without a browser. Official website address: https://wp-cli.org/zh-cn/ [Official] Installation documentation:[ https://wp-cli.org/zh-cn/# Install]( https://wp-cli.org/zh-cn/# Installation“ https://wp-cli.org/zh-cn/# Install ") ###This article mainly introduces the installation of macOS and Linux systems ####Linux installation tutorial ```shell cd ~ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar #Check Phar file to ensure it works properly: php wp-cli.phar --info #To execute the WP CLI command with wp, you must have execution permission and PATH has been registered in the environment variable, for example: chmod +x wp-cli.phar sudo mv wp-cli.phar /usr/local/bin/wp #Final re verification wp --info ``` ####MacOS can be installed with Homebrew >Official Homebrew installation document: https://docs.brew.sh/Installation >The installation tutorial can refer to: https://zhuanlan.zhihu.com/p/111014448 After Homebrew installation, execute 'brew install wp cli' ####Windows Installation Tutorial >Search on the Internet by yourself. Because * * some functions will be limited in Windows * *, I recommend installing WSL (Windows subsystem) on Windows 10 and above, and then refer to the Linux system to install the 'wp' command ###Verifying the installation wp command Enter 'wp -- info' to verify ! [Enter wp -- info to verify the installation result]( https://cdn.nowtime.cc/2021/07/20/1827334578.png ) ```shell chuwen@MiBook # wp --info OS: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64 Shell: /bin/zsh PHP binary: /usr/local/Cellar/ php@7.3 /7.3.28/bin/php PHP version: 7.3.28 php.ini used: /usr/local/etc/php/7.3/php.ini MySQL binary: MySQL version: SQL modes: WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli WP-CLI vendor dir: phar://wp-cli.phar/vendor WP_CLI phar path: /Users/chuwen WP-CLI packages dir: WP-CLI global config: WP-CLI project config: WP-CLI version: 2.5.0 ``` ##Generate a '. pot' file -Suppose your WordPress root directory is: `/www/wwwroot/wordpress.com` -Suppose your WordPress plug-in directory is: `/www/wwwroot/wordpress. com/wp content/plugins/chuwen` First enter your * * plug-in directory** ```shell cd /www/wwwroot/wordpress.com/wp-content/plugins/chuwen ``` Then generate the '. opt' file ```shell #If you follow the initial practice, the generated '. opt' file will be automatically placed in the 'Domain Path' folder wp i18n make-pot . #If you want to specify the file storage path and file name wp i18n make-pot . i18n/languages/chuwen.pot ``` Finally, the generated results can be viewed from the files in the 'i18n/languages/' directory of your plug-in ###Generate Multilingual Copy the generated example 'chuwen. pot', name it 'en_US. pot', and then use the tool to translate it
After WordPress uses CloudFlare, it is unable to enter the background, redirects too many times, and prompts Sorry, you are not allowed to access this page Author: Chuwen Time: 2021-07-10 Classification: PHP comment ##Specific reasons 1. CloudFlare's SSL configuration is "flexible" ! [CloudFlare's SSL configuration is "flexible"]( https://cdn.nowtime.cc/2021/07/10/21193480.png ) 2. The WordPress background is configured with https ! [WordPress background is configured with https]( https://cdn.nowtime.cc/2021/07/10/3223298541.png ) Eventually, the browser will always report "too many redirects", or WordPress will directly report 'Sorry, you are not allowed to access this page` CloudFlare SSL configuration is "flexible", which means that * * the origin * * (that is, your WordPress) blog does not support https, and then CloudFlare can achieve: Browser -- https -->CloudFlare -- http -->your server (WordPress) **But * *, you configured your WordPress address in the WordPress background to start with the 'https' address, so when CloudFlare accesses your WordPress, your WordPress tells CloudFlare that you can only access it through https, and CloudFlare tells your browser that you can only access https This creates a cycle ##Solution Change the SSL configuration of CloudFlare to "Full" or "Full (Strict)", * * Full is recommended * * For details: ! []( https://cdn.nowtime.cc/2021/07/10/2167830392.png )