2019-03-30

Chrome 的 Command Mode (--headless) 進行 ScreenShot

遇到一個問題
使用 Chrome 的 Command Mode (--headless) 進行 ScreenShot 指令如下:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --headless --disable-gpu --run-all-compositor-stages-before-draw --aggressive-cache-discard --disable-notifications --disable-remote-fonts --disable-reading-from-canvas --disable-remote-playback-api --disable-shared-workers --disable-voice-input --enable-aggressive-domstorage-flushing --window-size=1024,768 --screenshot="C:\Temp\ScreenShot.png" "https://www.google.com"

這個指令在 cmd 視窗直接執行時沒有問題,可以取得圖檔
但是如果放到 Task Scheduler 裡面跑的時候卻無法取得圖檔

由於不知道怎麼查 Chrome 的 Log ,所以先朝打開 Log 著手
在以下網站查到了怎麼開 Log

2019-03-28

PHP Webhook API Close Connection

Webhook API 一般希望在接收連線資料後盡速將連線中斷再去執行後面的其他運算
實際運作可以這樣:
1. 先回應 200 ok
2. 取得 HTTP header
3. 取得送來的資料
4. 斷線
後面再去做資料運算
程式碼這樣寫

2019-03-08

Hidden / Disable items in Windows 10 Settings App

微軟想用 Settings App 取代 Control Pannel
其中的一些設定項目必須用以下方式在 GPO 中設定才能隱藏起來


  1. Open the Local Group Policy Editor and then go to Computer SettingsAdministrative Templates, and then Control Panel.
  2. Double-click the Group Policy Settings Page Visibility option and then select Enable.
  3. Depending on your need, specify either a ShowOnly: or Hide: string.
    If you want to only show only Proxy and Ethernet, the string would be as follows:
    ShowOnly:Network-Proxy;Network-Ethernet
    Hide:Network-Proxy;Network-Ethernet
To determine the URI of a Settings app page, look up the URI on the ms-settings: URI scheme reference page.

2019-03-05

踩雷系列: Windows Server 2019 網卡設定 發生錯誤: Windows cannot access the specified device path or file

新式的設定視窗中

Settings -> Ethernet -> Change adapter options

顯示:

Windows cannot access the specified device, path or file. You may not have the appropriate permission to access the item.

















事實上如果開檔案總管自己輸入 Control Pannel 到舊式的網卡設定是沒問題的

解決辦法參考: