發表文章

筆記:BASH生成時間字串

維護常常會需要當天的log之類的,寫成script就需要用到時間字串

升級gitea

圖片
升級gitea 1.21.0 至 1.21.11 (2024-04-17)

在Ubuntu 16.04的Dockerfile中設定locale

會需要在Ubuntu 16.04的Dockerfile中設定locale,是因為打包image為了確保指令正常,需要在en_US.UTF-8環境下。

將pnpm從8.13.1升級到8.15.5

自從上次 將corepack升級 後,升級pnpm本身就沒有遭遇困難拉! 可喜可賀

在Ubuntu 16.04上安裝RTL8125BG PCIE 2.5Gbps網卡

圖片
這篇是解決在Ubuntu 16.04上安裝RTL8125BG PCIE 2.5Gbps網卡後會辨識不到的問題。如果是22.04則是已經內建,只需要把網卡裝上去就好了。

Ubuntu取得有線網路網卡的速度

最近WIFI6 (802.11ax)裝置已普及,傳輸速度大於1500Mbps,約為187MB/s。 回想使用很久的有線網路1000Mbps應當也要升級了,查了查對面的2.5Gbps交換器非常划算,價格可以平替家中產品,就需要確認一下目前本機有限網路卡的能力。

Note:Show git branch in bash prompt

圖片
Reference: How to show current git branch with colors in Bash prompt https://thucnc.medium.com/how-to-show-current-git-branch-with-colors-in-bash-prompt-380d05a24745 vim ~/.bashrc parse_git_branch () { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } if [ " $color_prompt " = yes ]; then # PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' PS1 = "\[\033[01;32m\]\u@\h\[\033[00m\]: \[\e[32m\]\w \[\e[91m\] \$ (parse_git_branch)\[\e[00m\]$ " else mirochiu@mirochiu-d820mt: /mnt/hdd2/node.repo/linebot_speech (master)$ c     

與Shared library(.so)相關的常用指令

1. 印出header readelf -h  會包含系統,例如Linux的64位元class是ELF64、OS/ABI部份寫Unix - GNU 2. 印出so檔案的連結名稱 readelf -a libexample.so | grep SONAME 3. 印出執行檔或so所需的so檔案 readelf -d a.out | grep NEEDED 4. 印出提供/使用到的symbol readelf -Ws libexample.so 也可用 nm libexample.so  如果除掉symbol得so這裡就會寫沒有symbol,印不出來

倒數計時器React hooks+MUI+typescript

圖片
這篇是受Tapas Adhikary所寫的 How to create a countdown timer using React Hooks 啟發 將它改成typescript和MUI的版本,並調整成自身使用的元件,並修改了 1. 使用  padStart()   處理時顯示分秒的雙位數字 2. 倒數30分鐘時會改變倒數時間成紅色 3. 避免顯示出NaN的狀況