2023年3月23日 星期四

ifup and ifdown equivalent nmcli command

ifup eth0 = nmcli con up eth0
ifdown eth0 = nmcli con down eth0

ifup, ifdown command still available in NetworkManager-initscripts-updown package
dnf -y install NetworkManager-initscripts-updown

2023年3月12日 星期日

解決 Windows 工作排程器 錯誤訊息: 已回報下列錯誤: 工作定義使用了過時的功能

Windows不曉得何時拿掉了工作排程顯示訊息的功能,但還是能設定,後面括號(已過時)
最後會出現如下的畫面。
奇怪,不能設定為何不拿掉設定選項?


替代方式是用執行程式 msg
新增引數輸入 * 要顯示的訊息


2023年1月15日 星期日

Detect iPhone by Port 62078

現在手機預設都有開 Random MAC Address 的功能,也就是無法用 MAC 來判斷是那一家廠商
iPhone 手機有一個固定會 Listen 的 Port 62078,若 Scan 這個 Port 有回應,可以判斷這個 Device 可能是 iPhone
Android 則沒有固定會 Listen 的 Port

2023年1月9日 星期一

Using iperf3 to test uload and download

Server side
iperf3 -s

Client side
iperf3 -c server_host -b 10M -t 60 -P 5 # Test upload
iperf3 -c server_host -b 10M -t 60 -P 5 -R # Test download
頻寬 10M,測試時間 60 秒,使用 5 個平行連線
iperf3 只能一個 Client 對一個 Server
若要多個 Client 對同一台 Server,Server 端需執行多個 iperf3 用不同的 Port 切開

2023年1月6日 星期五

Detect if a VM is running in Google Compute Engine

Detect if a VM is running in Compute Engine

sudo dmidecode -s system-product-name | grep "Google Compute Engine"
這個需要 root 權限,實際上是去讀取 /sys/firmware/dmi/tables/DMI
用 strings /sys/firmware/dmi/tables/DMI | grep "Google Compute Engine" 也行

若程式沒有 root 權限,可以去讀取 /etc/hosts 有沒有包含 Added by Google 字樣
grep "Added by Google" /etc/hosts

2023年1月2日 星期一

RouterOS Packet Sniffer Streaming

RouterOS 的儲存空間有限,要分析封包可以用 Packet Sniffer Streaming,
將封包轉送到 PC,再用 Wireshark 收。
它會用 TZSP 封裝協定將封包再包一層後再轉送

Tools / Packet Sniffer / Streaming Enabled 打勾,輸入 Server IP 及 Port (預設37008)
Apply / Start,還可以下 Filter 條件

在 PC 端的 Wireshark 下 tzsp 過濾條件即可查看

2022年11月24日 星期四

ffmpeg MKV to MP4 with embed subtitle

使用 ffmpeg MKV 轉 MP4 內嵌字幕

ffmpeg -i input.mkv -vf subtitles=input.mkv:si=2 output.mp4

si=2 是指第三個字幕 stream, 第一個是 0
可先用 ffprobe 查看有幾個字幕

2022年11月13日 星期日

ngrok

ngrok 這個服務可以建立一個 Public URL 對應到 localhost:80

機器要能連網,在 NAT 下 OK

ngrok http 80

在測試時或一些特殊情境滿好用的



ifup and ifdown equivalent nmcli command

ifup eth0 = nmcli con up eth0 ifdown eth0 = nmcli con down eth0 ifup, ifdown command still available in NetworkManager-initscripts-updown pa...