跳到主內容

最近更新的頁面

學習 Typescript

【Treeman】總覽 稍後閱讀

https://www.typescriptlang.org/ https://ts.xcatliu.com/ 推薦學習資源 1. 官方與經典教材 (權威必讀) TypeScript...

由 treeman 更新於 8 個月前

【Mac】指令開關wifi - lan

【Treeman】總覽 Mac

  vim ~/.zshrc # networksetup -listallhardwareports 查詢介面 export ETH_IF="en0" # 實體網卡 expo...

由 treeman 更新於 8 個月前

【Redis】Sentinel 相關指令

【Treeman】總覽 DB相關

下面整理一份「常用 Redis Sentinel 指令速查」(以你目前 master name = mymaster 為例)。先記得:Sentinel 是連 26379(或你映射的 26380/...

由 treeman 更新於 9 個月前

【JS】?? 與 || 比較

【Treeman】總覽 Javascript

在 JavaScript 中,?? (Nullish Coalescing) 和 || (Logical OR) 看起來很像,都是用來提供預設值的運算子,但它們判斷「什麼時候該用預設值」的標準完...

由 treeman 更新於 9 個月前

【Gemini】Gemini vs Vertex AI

【Treeman】總覽 AI相關

vertex ai 與 gemini. 是什麼關係 簡單來說,Vertex AI 是「平台」,而 Gemini 是「模型」。 它們的關係可以類比為:Vertex AI 是「廚房(包含所有工具...

由 treeman 更新於 9 個月前

【Linux】swap相關

【Treeman】Linux

  從你貼的 top 看起來 Swap 使用率偏高(KiB Swap: 79.8/1044476 很像是 79.8% / 1,044,476 KiB),要「釋放 swap」本質上就是把已經...

由 treeman 更新於 9 個月前

【Shell】【tip】 找出目前誰使用swap

【Treeman】Linux shell

who_use_swap.sh #!/bin/bash for p in /proc/[0-9]*; do pid=${p##*/} swap=$(awk '/VmSwap:...

由 treeman 更新於 9 個月前

【Shell】linux 下source、sh、bash、./執行指令碼的區別

【Treeman】Linux shell

linux 下source、sh、bash、./執行指令碼的區別 - IT閱讀 (itread01.com) 1、source命令用法:   source  FileName   ...

由 treeman 更新於 9 個月前

【Shell】date 做 timestamp 格式轉換計算

【Treeman】Linux shell

要將日期與 timestamp 互相做格式轉換,只要使用 date 就可以達成,date 還可以順便做些日期的加減換算。 日期轉換成 timestamp $ date -d "2018-02...

由 treeman 更新於 9 個月前

【Shell】awk 取出特定欄位

【Treeman】Linux shell

AWK 要取得最後一個欄位的值是使用: $NF AWK 要取得倒數第二個欄位的值是使用: $(NF-1) 由後往前取,就繼續 -2、-3... 下去即可 範例:awk '{print $(...

由 treeman 更新於 9 個月前

【Shell】取得pubic ip

【Treeman】Linux shell

#curl ifconfig.me; echo 175.99.111.111

由 treeman 更新於 9 個月前

【shell】內建變數

【Treeman】Linux shell

$BASH_ENV  absolute path of startup file $CDPATH  directories searched by cd $FCEDIT  absolu...

由 treeman 更新於 9 個月前

【Shell】動態呼叫awk自訂函數

【Treeman】Linux shell

*test.sh #!/bin/bash awkshell="/tmp/newdf.$$" #awkshell="/tmp/newdf" trap "rm -f $awkshell" e...

由 treeman 更新於 9 個月前

【Shell】【tip】使用暫存表,更新crontab

【Treeman】Linux shell

  #!/bin/bash # $$ => pid,使暫存檔名不重複 tmp_file=/tmp/cron$$ # 利用trap 刪除暫存檔 #This installs a tr...

由 treeman 更新於 9 個月前

【 Shell】【Tool】測試機器防火牆是否開通

【Treeman】Linux shell

https://medium.com/%E8%BC%95%E9%AC%86%E5%B0%8F%E5%93%81-pks%E8%88%87k8s%E7%9A%84%E9%BB%9E%E6%BB%B...

由 treeman 更新於 9 個月前

【Shell】【Tool】批次更新密碼

【Treeman】Linux shell

如果有許多使用者需要批次重設密碼並強制其在下次登入時更新,可以使用一個簡單的 Shell 腳本來自動化這個過程。假設你有一個包含所有目標使用者名稱的文字檔,例如 users.txt,可以按照以下...

由 treeman 更新於 9 個月前

【Shell】【tip】使用 echo 輸出排程時間到log

【Treeman】Linux shell

# 使用 echo 輸出排程時間到log # 測試輸出到 /tmp/crontab.log 0 8 * * * echo "$(date '+\%Y-\%m-\%d \%H:\%M:\%...

由 treeman 更新於 9 個月前

【Shell】【Tip】列出環境變數網址解析dns

【Treeman】Linux shell

#!/bin/bash export A_HOST="https://www.google.com/a/b" export B_HOST="https://tw.yahoo.com/...

由 treeman 更新於 9 個月前

【Shell】【Tool】call_api

【Treeman】Linux shell

call_api() { curl -fsS \ --connect-timeout 2 \ --max-time 5 \ --retry 2 --retry...

由 treeman 更新於 9 個月前

【Linux】【Ubuntu】如何修改 ip

【Treeman】Linux 【網路相關】

以下提供在 Ubuntu 18.04 以後(netplan) 與 Ubuntu 16.04 舊版(/etc/network/interfaces) 的常見修改方式,請依照你實際版本選擇。 1️...

由 treeman 更新於 9 個月前