Commit 39c6a669 authored by 王进波's avatar 王进波

update

parents d7c78378 f3e27095
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
- [浏览器缓存策略——maxAge与maxStale](doc/浏览器缓存策略——maxAge与maxStale.md) - [浏览器缓存策略——maxAge与maxStale](doc/浏览器缓存策略——maxAge与maxStale.md)
- [一点点历史——浏览器history](doc/a-little-bit-of-history.md) - [一点点历史——浏览器history](doc/a-little-bit-of-history.md)
- [Simple-Page Applications And Server——单页面应用程序与服务器](doc/Simple-Page Applications And Server.md) - [Simple-Page Applications And Server——单页面应用程序与服务器](doc/Simple-Page Applications And Server.md)
- [npm package.json中的`~`与`^`有什么不同](doc/difference-between-tilde-and-caret-in-npm-package.json-file.md)
- [使用跨域——Using CORS](doc/using-cors.md) - [使用跨域——Using CORS](doc/using-cors.md)
- ...[EcmaScript 6 ]() - ...[EcmaScript 6 ]()
- ...[TypeScript]() - ...[TypeScript]()
...@@ -45,6 +46,7 @@ ...@@ -45,6 +46,7 @@
- [Calibre-web电子书网站的使用](doc/Calibre-web的使用.md) - [Calibre-web电子书网站的使用](doc/Calibre-web的使用.md)
- [ike-scan扫描服务端的ike加密算法](doc/ike-scan扫描服务端的ike加密算法.md) - [ike-scan扫描服务端的ike加密算法](doc/ike-scan扫描服务端的ike加密算法.md)
- [用 LinqPad 进行快速开发](doc/LinqPad快速开发数据轮询持久化.md) - [用 LinqPad 进行快速开发](doc/LinqPad快速开发数据轮询持久化.md)
- [用Quartz.net开发定时调度]
......
# What's the difference between a tilde (~) and a caret (^) in a npm package.json file?
Written by [Michael Lee](https://michaelsoolee.com/about/) on July 13, 2017
If you use npm to manage packages in your JavaScript application, you’re probably familiar with the package.json file.
```
{
"devDependencies": {
"ember-cli": "~2.14.0"
}
}
```
The syntax is in JSON format where the key is the name of the package and the value is the version of the package to be used.
npm uses the package.json file to specify the version of a package that your app depends on.
The version number is in [semver syntax](http://semver.org/) which designates each section with different meaning. semver is broken into three sections separated by a dot.
```
major.minor.patch
1.0.2
```
Major, minor and patch represent the different releases of a package.
npm uses the tilde (~) and caret (^) to designate which patch and minor versions to use respectively.
So if you see `~1.0.2` it means to install version `1.0.2` or the latest patch version such as `1.0.4`. If you see `^1.0.2` it means to install version `1.0.2` or the latest minor or patch version such as `1.1.0`.
\ No newline at end of file
...@@ -302,3 +302,28 @@ technosoft2000/calibre-web ...@@ -302,3 +302,28 @@ technosoft2000/calibre-web
docker start calibre-web docker start calibre-web
``` ```
### WordPress
```shell
sudo docker run \
--name wordpress \
--restart always \
-p 808:80 \
-e WORDPRESS_DB_HOST='192.168.12.38' \
-e WORDPRESS_DB_USER='root' \
-e WORDPRESS_DB_PASSWORD='000000' \
-d wordpress
```
### PHPMyAdmin
```shell
sudo docker run \
--name phpmyadmin \
-d \
-e PMA_HOST=192.168.12.38 \
-e MYSQL_ROOT_PASSWORD=000000 \
-p 809:80 \
phpmyadmin/phpmyadmin
```
...@@ -98,7 +98,7 @@ root@ubuntu:/# sudo du -hsx * | sort -rh | head -10 ...@@ -98,7 +98,7 @@ root@ubuntu:/# sudo du -hsx * | sort -rh | head -10
5.3M run 5.3M run
``` ```
### mysql 主从复制状态查询 ### MySQL 主从复制状态查询
Start the MySQL command-line utility on the slave server: Start the MySQL command-line utility on the slave server:
...@@ -114,3 +114,82 @@ Check the replication status using the show slave status command (the status of ...@@ -114,3 +114,82 @@ Check the replication status using the show slave status command (the status of
mysql> SHOW SLAVE STATUS \G; mysql> SHOW SLAVE STATUS \G;
``` ```
### MySQL slave服务启停
```shell
start slave;
stop slave;
```
### MySQL 8.0 caching_sha2_password认证
MySQL 从8.0 版本以后默认使用 `caching_sha2_password plugin` 进行身份验证,之前的版本默认使用 `mysql_native_password plugin` 进行身份验证的客户端连接 8.0 时会报错,在 `caching_sha2_password plugin` 下修改用户密码的语句如下:
登录后执行
```sql
ALTER USER user
IDENTIFIED WITH caching_sha2_password
BY 'password';
```
将密码验证回复成`caching_sha2_password plugin`的语句如下:
登录后执行
```shell
use mysql;
select host,user,plugin from user;
```
打印如下
```shell
+-----------+------------------+-----------------------+
| host | user | plugin |
+-----------+------------------+-----------------------+
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session | caching_sha2_password |
| localhost | mysql.sys | caching_sha2_password |
| localhost | root | caching_sha2_password |
+-----------+------------------+-----------------------+
4 rows in set (0.00 sec)
```
执行语句修改plugin为`mysql_native_password plugin`
```shell
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码'; flush privileges;
```
打印如下
```shell
+-----------+------------------+-----------------------+
| host | user | plugin |
+-----------+------------------+-----------------------+
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session | caching_sha2_password |
| localhost | mysql.sys | caching_sha2_password |
| localhost | root | mysql_native_password |
+-----------+------------------+-----------------------+
4 rows in set (0.00 sec)
```
### Arch Linux 添加未授信gpg密钥
使用yaourt从 AUR 源码包编译时遇到未知gpg密钥,不允许安装的错误,需要手动将gpg密钥添加到本地授信密钥中。如果你本地已有 gpg密钥对,直接将报错中提示的不可信密钥添加到用户的个人密钥中即可,如下:
```
gpg --recv-keys 5CC908FDB71E12C2
```
> --recv-keys key IDs: Import the keys with the given key IDs from a keyserver.
如果当前用户还没有创建gpg密钥数据库,则手动创建如下:
```
gpg --full-gen-key
```
> -full-gen-key: Generate a new key pair.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment