簡訊認證不再安全 建議改用 App OTP 認證

現在做身份確認,常常會使用簡訊來認證,這個已經被認定不是安全的作法,建議改用 App OTP 的認證方式比較安全。

閱讀全文〈簡訊認證不再安全 建議改用 App OTP 認證〉

PHP 於 CLI 單行直接執行的用法

PHP 想要像 Perl、Python 可以單行執行,或者是 cat、tail -f 持續餵資料給程式接收,要怎麼做呢?

範例取自:Decoding URL encoding (percent encoding)

  1. alias urldecode='python -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"'
  2. alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
  3. urldecode 'q+werty%3D%2F%3B'
    • q werty=/;
  4. $ urlencode 'q werty=/;'
    • q+werty%3D%2F%3B

閱讀全文〈PHP 於 CLI 單行直接執行的用法〉

使用 Percona innobackupex 備份 與 還原 MySQL

MySQL 的 InnoDB 只能用 mysqldump,而沒辦法使用 cp 來備份,這點可以使用 Percona 出的 innobackupex 來解決~

Percona 出很多 MySQL 的工具,可以做同步、快速備份 等等 ..

閱讀全文〈使用 Percona innobackupex 備份 與 還原 MySQL〉

Linux Bash 出現 bind: warning: line editing not enabled 的問題修復

於 Linux 的 Bash shell 依照此篇文章「Bash 使用 Tab 自動完成 檔案或目錄的輸入」的做法,使用 bind 來做些設定,但是在 scp 到這台 server 時,就會出現下述警告訊息:

bind: warning: line editing not enabled

要如何避免這個訊息呢?

閱讀全文〈Linux Bash 出現 bind: warning: line editing not enabled 的問題修復〉

田.滿:宜蘭五個小學生拍出來的紀錄影片

宜蘭自從雪隧開通後,交通便利、觀光人口也變多,帶動一些很神奇的現象,農田不種稻米,變成種房子了...

這部紀錄片除了紀錄外,更特別的地方是,這是由五位小學生拍出來的,相信老師帶領的也是很辛苦,有空花半個小時來看看這部影片吧!準備拍第二部了~

閱讀全文〈田.滿:宜蘭五個小學生拍出來的紀錄影片〉

MySQL 出現 InnoDB STORAGE ENGINE failed 修復

MySQL 要從備份還原啟動,但是發生啟動失敗,在 mysql 的 error log 裡面看到下述訊息。

Unable to start MySQL service: Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

InnoDB: Using Linux native AIO
InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported storage engine: InnoDB

170122 12:01:00  InnoDB: Warning: table 'mysql/innodb_index_stats' InnoDB: in InnoDB data dictionary has unknown flags 50.
170122 12:01:00  InnoDB: Warning: table 'test/collect' InnoDB: in InnoDB data dictionary has unknown flags 50.
170122 12:01:00 [ERROR] /usr/sbin/mysqld: Table './mysql/user' is marked as crashed and should be repaired
170122 12:01:00 [Warning] Checking table:   './mysql/user'
170122 12:01:00 [ERROR] 1 client is using or hasn't closed the table properly
170122 12:01:00  InnoDB: Warning: table 'test/users'
InnoDB: in InnoDB data dictionary has unknown flags 50.

要怎麼修復呢?

閱讀全文〈MySQL 出現 InnoDB STORAGE ENGINE failed 修復〉