八字大運交運時間計算方法

例子: 1984年4月29日 06:28 女性

陽男陰女 -> 順行下一節令
陽女陰男 -> 逆行上一節令
陽女 1984年4月29日 06:28
逆行上一個節令 1984年4月4日 22:22
節令與出生時間相差
1984年4月4日 22:22 ~ 1984年4月29日 06:28

相差 24.34444日
3日為1年計算

24.34444日 / 3 = 8.1148148年
8.1148148年 = 8年 零 0.1148148年

0.1148148年 x 365.25 = 41.936日

41.936日 / 30日 = 1月 11日

交運時間為 8年 1月 11日
1984年4月29日 06:28 + 8年 1月 11日
= 1992年6月9日 06:28
1992年6月9日 壬丁年

acme.sh renew

source : https://www.howtoforge.com/getting-started-with-acmesh-lets-encrypt-client/#renew-the-lets-encrypt-ssl-certs

Install Let’s encrypt SSL cert

Apache example:

acme.sh --install-cert \
--domain example.com \
--cert-file /path/to/cert/cert.pem \
--key-file /path/to/keyfile/key.pem \
--fullchain-file /path/to/fullchain/fullchain.pem \
--reloadcmd "sudo systemctl reload apache2.service"

Renew the Let’s Encrypt SSL certs

acme.sh --renew -d example.com --force

Filter input text only accept number and dot vue.js

Source : Mengseng Oeng (2018), https://stackoverflow.com/questions/39782176/filter-input-text-only-accept-number-and-dot-vue-js

HTML

 <input @keypress="onlyNumber" type="text">

VUE JS

onlyNumber ($event) {
   //console.log($event.keyCode); //keyCodes value
   let keyCode = ($event.keyCode ? $event.keyCode : $event.which);
   if ((keyCode < 48 || keyCode > 57) && keyCode !== 46) { // 46 is dot
      $event.preventDefault();
   }
}

resync a master-slave replication

Source: https://stackoverflow.com/questions/2366018/how-to-re-sync-the-mysql-db-if-master-and-slave-have-different-database-incase-o, David Espart 2010

This is the full step-by-step procedure to resync a master-slave replication from scratch:

At the master:

RESET MASTER;
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;

And copy the values of the result of the last command somewhere.

Without closing the connection to the client (because it would release the read lock) issue the command to get a dump of the master:

mysqldump -u root -p --all-databases > /a/path/mysqldump.sql

Now you can release the lock, even if the dump hasn’t ended yet. To do it, perform the following command in the MySQL client:

UNLOCK TABLES;

Now copy the dump file to the slave using scp or your preferred tool.

At the slave:

Open a connection to mysql and type:

STOP SLAVE;

Load master’s data dump with this console command:

mysql -uroot -p < mysqldump.sql

Sync slave and master logs:

RESET SLAVE;
CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=98;

Where the values of the above fields are the ones you copied before.

Finally, type:

START SLAVE;

To check that everything is working again, after typing:

SHOW SLAVE STATUS;

you should see:

Slave_IO_Running: Yes
Slave_SQL_Running: Yes

That’s it!