TEST

Broadlink RM Mini 3 與 Google Home 聲控快速筆記

Broadlink 博聯推出的 RM Mini 3

可以參考這個開箱、設定教學。特別是文章後段提到的「場景」功能。

https://playsmarthome.com/broadlink-rm-mini-3-review/

新增的場景,若有將「博聯」聯動至 Google Home,就會出現在日常安排 (Routine),
可以當做 Nest Hub 的遙控介面,設定的關鍵字則會成為語音指令。

操作範例

博聯新增場景「台視新聞台」,對應的是 MOD 遙控器的

-> [延遲0.5秒] ->-> [延遲0.5秒] ->

然後對 Google AI 說「Hey Google, 啟動台視新聞台」,Broadlink RM Mini 3 就會將 MOD 轉台至台視新聞了。
Google AI 這邊則會回覆:「OK,正在啟動台視新聞台」。

這個「啟動」是 Google 強制設定的呼號,但有辦法可以繞過,設定更自然的指令:
「音響大聲」、「查看節目資訊」等。

辦法也很簡單,只要進 Google Home 的「日常安排」設定另一組日常安排,取個自己喜歡的呼號,然後對應博聯的「啟動XXXXX」指令即可。

建議還可以購買支援紅外線的 HDMI 切換器,這樣一來連訊源切換都可以聲控嚕!

TEST

WordPress: Format and colorize code block by applying prism.js

Motivations

for (int i = 5; i < 10 ; i++) {
    Console.WriteLine("Hello Moto?");
}

If you are using Vantage for your WordPress site, and you want to make your code block looks fancy, follow the instructions:

Instructions

1. Make sure you have created a child theme based on Vantage, and it's activated.

2. Reset styles applied to code block.

I highly recommend to work with WP-SCSS plugin when writing CSS/SCSS, so you can have stylesheets organized without the costs of performance by using @import.

/* Reset the style set by Vantage (the parent theme) */
.entry-content pre, .entry-content code {
    background: unset;
    font-family: unset;
    border: unset;
    box-shadow: unset;
    overflow-x: unset;
}

Later we will apply prism.js and its stylesheet.

3. Insert code snippits to your child theme's "functions.php"

function code_pre_theme(){
    // To check if currently viewing page is a "post"
    if (is_singular('post')) {
        wp_enqueue_script('prism-js', 'https://cdn.jsdelivr.net/npm/prismjs@1.28.0/prism.min.js');
        wp_enqueue_script('prism-core-js', 'https://cdn.jsdelivr.net/npm/prismjs@1.28.0/components/prism-core.min.js');
        wp_enqueue_style('prism-css', 'https://cdn.jsdelivr.net/npm/prismjs@1.28.0/themes/prism.min.css');
        wp_enqueue_script('prism-autoloader-js', 'https://cdn.jsdelivr.net/npm/prismjs@1.28.0/plugins/autoloader/prism-autoloader.min.js');
    }
}
add_action('wp_enqueue_scripts', 'code_pre_theme', 10); //Number 10 heres depend on site. The princlple is to set a number larger than the essential scripts and styles belong to your parent theme, which is vantage in this case.

By enqueuing prism-core.min.js and prism-autoloader.min.js, it will utomatically loads languages's style when necessary.
You may opt-in languages based on your needs. For example, to load certain style based on has_tag('php'), has_tag('csharp') result.
Visit prism.js at cdnjs.com for more programming language supports.

Conlusion

You don't have to follow every steps as I did, as you may come up with a better solution for your own site.

At the time I wrote this article, I absolutely have zero knowledge in PHP, only knowing C#, Javascript, Java, SCSS; writing and modifying some php script isn't complicated, so go ahead and try all the possibilities.

TEST

趨勢科技 ServerProtect 密碼重設


layout: post
title: 趨勢科技 ServerProtect 密碼重設
date: 2021-09-15 15:02 +8
description: 密碼重設方法
toc: false
share: true
comments: true
tags: Windows TrendMicro AntiVirus

注意

本文為 Windows 平台運行 ServerProtect 的密碼重設方法,請務必詳細閱讀下列內容,並且自行檢查是否符合您的需求。

解決方法

  1. 開啟 regedit 登錄編輯程式
    若 OS 為 64 位元,循 HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ServerProtect\CurrentVersion\Agent
    若OS 為 32 位元,循 HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\ServerProtect\CurrentVersion\Agent
  2. 將其 AgentPassword 的值刪除。
  3. 這樣密碼即會變更為預設密碼:VPROTECT

心得

這種密碼系統也太脆弱吧!
這樣豈不任何人都可恣意 Bypass 密碼驗證了嗎?

參考資料

TEST

Windows IIS 8 網站莫名 403.3 驗證錯誤


layout: post
title: Windows IIS 8 網站莫名 403.3 驗證錯誤
date: 2021-09-15 11:49 +8
description: Windows 資料夾權限調整。
toc: false
share: true
comments: true
tags: IIS Windows

注意

本文為 Windows 的 IIS 8 及更新版本的解決方案。

檢查問題

  1. 創建一個新的網站,並建立簡單的 helloWorld.html 檔案,如果是在子目錄,記得要轉成「網站應用程式」。
  2. 該資料夾權限給予 Everyone 權限「Full Control」。
  3. 若如此能解決問題,則確立為權限設定問題。

主要解決方法

  1. 在 wwwroot 或是該網站根目錄,給予 IIS_IUSRS 群組 Read 和 Write 權限。
  2. 執行命令 iisreset /restart,這將重新啟動 IIS,以讓新權限設定生效。
  3. 在不同電腦上,瀏覽剛剛設定的網站,檢查是否可以正常顯示。若不行,則採取替代方法如下。

替代解決方法

  1. 在 wwwroot 或是該網站根目錄,給予 IIS AppPool\MyApplicationPoolName 群組 Read 和 Write 權限。
    ※此處 MyApplicationPoolName 應該是該網站的應用程式池名稱。
  2. 切換至 Internet Information Services (IIS) Manager,點選該網站。
  3. 右側面板點選 IIS 分類底下的 "Authentication"。
  4. 在 "Authentication" 下面的 "Anoymous Authentication" 選項,確保為 "Enable"。
  5. 對其點右鍵,選擇 "Edit..."。
  6. 預設選項應該為 "Specific user": "IUsr",我們切換為第二項 "Application pool identity"。
  7. 執行命令 iisreset /restart,這將重新啟動 IIS,以讓新權限設定生效。
  8. 在不同電腦上,瀏覽剛剛設定的網站,檢查是否可以正常顯示。我到這邊就解決問題了。

參考資料

TEST

利用 Google Maps Javascript 匯入 KML 檔案自動畫圖


layout: post
title: 利用 Google Maps Javascript 匯入 KML 檔案自動畫圖
date: 2021-08-24 17:41 +8
description: 如何不自己讀取資料,直接利用 KmlLayer 呈現。以及可能會碰到的問題。
toc: false
share: true
comments: true
tags: GoogleMaps Javascript Development

程式碼

可能問題

線條粗細和在 Google My Maps 或 Google Earth 上看到的不一樣! 怎麼變那麼粗?

需要手動在 KML 檔案中,自行針對每項 <LineStyle></LineStyle> 加入 <width>0.001</width>
0.001 可自行改成所需的值。
Tip: 尋找與取代 </LineStyle><width>0.001</width></LineStyle>