小明的網誌

一個工程師的故事

By

把 wordpress 用到的 php 弄到 8.2.x, 紀錄遇到的問題及解決方法

問題1:

Too few arguments to function WP_Widget::__construct(), 0 passed in /usr/share/nginx/html/wp-includes/class-wp-widget-factory.php on line 62 and at least 2 expected

Read More

By

弄了一個無互動的自動裝 Debian 的步驟

緣由

在 P 社, 曾利用 ansible + cobbler 弄了自動重灌, 但想把它 改為 shell script 直接處理, 結果差不多被我弄出來, 完成度大概 90%

Read More

By

修改 Debian console 解析度為 640×480 + disable ipv6

緣由

維護 Debian 主機時, 常需要接 KVM/IPKVM, 但若 KVM/IPKVM 有這樣狀況, 無法讓 console 畫面顯示正常, 唯有更改解析度

Read More

By

設定 docker 版本的 sshd server

情境說明/緣由

  • 為了保護 Linux host, 避免被攻陷
  • 方便工程師上傳程式碼: 配合 scp, rsync over ssh 等
  • 過程能加密

Read More

By

調整 docker 基本設定

情境, 緣由

  • 希望 container root id 不等於 host root id
  • container log 能自動 rotate

Read More

By

為了 wordpress 優化 php-fpm docker container image

雖然已經有 wordpress dockerhub offical image, 但就算用 alpine 版本, 差不多要 290MB, 真的覺得大了點

# docker images
REPOSITORY   TAG                                    IMAGE ID       CREATED       SIZE
php          7.4-fpm-alpine-cytseng.ibb.tw-custom   82b6ca953c77   2 hours ago   108MB
php          7.4-fpm-alpine-origin-custom           292aff464569   2 hours ago   49.5MB
wordpress    php7.4-fpm-alpine                      5ecc056e48e2   2 days ago    290MB
alpine       3.15                                   0ac33e5f5afa   2 weeks ago   5.57MB

我自己做的只要 108MB, 少了超過 150MB, 覺得很有成就感, 有需要的就自己撿去用

花了一些時間, 大概 2,3 天吧, 為了 wordpress 優化 php74-fpm docker container
直接把結果貼上來

Read More

By

過年弄了一個 bourne shell script 可產出 IPMI sensor node-exporter text prom 版本

綠由

原本在 github 就有好用的 awk script ipmitool
但不管 FreeBSD, Linux 都要再另外裝 gawk 才能正常運作, 所以就決定寫一個以 bourne shell script 弄一個萬用版本

Read More

Verified by MonsterInsights