2019-09-17

Line Notify 發訊 with PHP


流程:
  1. 使用者必須先將 Line Notify 加入為好友
  2. 使用者瀏覽一個網頁,網頁中告知【點擊這裡】將您的帳號與 Line Notify 的本服務連結
  3. 瀏覽器導向 Line Notify 網站
  4. 使用者點擊後登入 Line 帳號並選擇要連結的聊天室或 1 對 1 聊天室
  5. Line Notify 網站 Call Back 回你的網站並交付 Access Token
  6. 使用該 Access Token 向 User Push Message

2019-05-09

使用 Let's Encrypt 來作為 VDI - RDCB 憑證時更新 GPO 派送 Thumbprints 的處理

連接 RemoteAPP 或 VM 的時候會跳出以下訊息
A website is trying to run a RemoteApp Program. Make sure that you trust the publisher before you connect to run the program
This Remoteapp program could harm your local or remote computer.



已知這個必須以 GPO 派送 RDCB 憑證的 Thumbprints
GPO 設定路徑如下:
Windows Components\Remote Desktop Services\Remote Desktop Connection Client
>> Specify SHA1 thumbprints of certificates representing trusted .rdp publishers
但要使用 Let's Encrypt 這種兩、三個月就要更換一次憑證的免費方案的話
還要手動更新 GPO 設定中的指紋太麻煩了,於是找到相關的 PowerShell 指令可以用

2019-05-08

Step-by-Step Guide for upgrading SYSVOL replication to DFSR (Distributed File System Replication)

以下文章非本人撰寫,僅為預防出處網頁有一天不存在而轉載
This Article is not written by myself.
Just a backup in case of the original one might be offline someday.
All credit goes to http://www.rebeladmin.com

Origin URL:
http://www.rebeladmin.com/2015/04/step-by-step-guide-for-upgrading-sysvol-replication-to-dfsr-distributed-file-system-replication/

SYSVOL is a folder shared by domain controller to hold its logon scripts, group policies and other items related to AD. All the domain controllers in network will replicate the content of SYSVOL folder. The default path for SYSVOL folder is %SystemRoot%\SYSVOL. This folder path can define when you install the active directory.

Windows Server 2003 and 2003 R2 uses File Replication Service (FRS) to replicate SYSVOL folder content to other domain controllers. But Windows server 2008 and later uses Distributed File System (DFS) for the replication.  DFS is more efficient than FRS. Since windows server 2003 is going out of support, most people already done or still looking for migrate in to latest versions. However migrating FSMO roles WILL NOT migrate SYSVOL replication from FRS to DFS. Most of the engineers forget about this step when they migrate from windows 2003 to new versions.

For FRS to DFS migration we uses the Dfsrmig.exe utility. More info about it available on https://technet.microsoft.com/en-au/library/dd641227(v=ws.10).aspx

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 到舊式的網卡設定是沒問題的

解決辦法參考:

2019-02-27

Install SQL on Server Core

先用 Standard / Enterprise 版產生 ConfigurationFile.INI
*. Express 版本安裝 GUI 沒有一個 (Ready to Install 的步驟可以停下來產生 .ini 檔)
取得 ConfigurationFile.INI 後進行以下變更