2025/12/24

強制移除DC主機

 環境:

網域中某台DC有狀況,已無法正常與其他DC同步提供服務,或無法在登入使用之類的狀況。

因無法以正常的方式降級DC角色(dc-a),必須以其他方式移除該DC主機角色



解決過程:

假設五大角色並是在正常的DC主機(dc-b)中,我們就到該DC主機中做下列兩個步驟:

1. 開啟"Active Directory站台及服務" ,這邊會有每台DC,還有它跟哪些DC同步。

在裡面找到需移除的DC,都它們都刪掉,這樣正常的DC才不會去找它做同步。

2. 在DNS裡,正向對應區域裡,需移除的DC,通通移除掉(包含底下其他資料夾底下的資料),這樣才能確認其他主機透過DNS要詢問資訊時,不會回應錯誤的資訊。

2025/12/10

Linux主機間排程傳送檔案 不使用帳號密碼

   環境:

Linux 主機A,要設定排程,傳送特定檔案給Linux 主機B。

不想用帶有Linux 主機B的明碼帳號密碼 shell。



解決過程:

使用SSH Key-Based 身份驗證


A. 準備階段 ( A主機 )

  1. 取得公鑰內容:

Bash

cat ~/.ssh/id_dsa.pub

複製輸出的整行內容(從 ssh-dss 到最後的備註)。

B. 執行貼上與權限設定 ( B主機)

  1. 使用密碼連線到 B主機

Bash

ssh <B主機username>@<B主機IP>

  1. 確認或建立 .ssh 目錄並設定權限:

Bash

mkdir -p ~/.ssh

chmod 700 ~/.ssh

  1. 追加公鑰到 authorized_keys (使用您複製的公鑰內容替換 [您複製的公鑰內容])

請務必使用雙引號 >> 進行追加,避免覆蓋:

Bash

echo "[您複製的公鑰內容]" >> ~/.ssh/authorized_keys

  1. 設定 authorized_keys 權限:

Bash

chmod 600 ~/.ssh/authorized_keys

安全性注意

手動方式的最大風險就是權限設定。如果 ~/.ssh ~/.ssh/authorized_keys 的權限設定不正確 (例如太寬鬆,允許其他使用者寫入)SSH 伺服器會拒絕使用金鑰認證,並提示錯誤。


驗證階段 (無論使用哪個方法,必須進行)

 A主機上執行:

Bash

ssh <B主機username>@<B主機IP>

如果設定成功,系統將不會要求您輸入密碼,而是直接顯示 B主機的命令列提示符。

如果連線成功,您可以輸入 exit 退出,然後繼續設定您的 Cron Job

2025/12/09

Blogger裡面的廣告突然都沒了

    環境:

Google blogger + adsense


異常狀況:

多年前我的 blogger有申請adsense,想賺點廣告費,一開始的確也有看到有廣告收到,但大概在兩三年前,發現收入一直沒增加,點開網站才發現通通都沒廣告了。

但在adsense上的設定都沒去調整,狀態都是正常的,也設定了自動廣告,版面上也有設定廣告的視窗。

但就是沒廣告。



解決過程:

 之前上網查都沒什麼有用的解決。

後來gemini出現了,就想說問它看看,結果gemini說要在主題裡,用html編輯,插入一段語法,結果插入存檔後。



直接重新開啟網頁,裡面廣告馬上就出現了,太神奇了。

gemini的說明如下:


檢查自動化廣告的程式碼(重要!)

  • 在 Blogger 後台,進入 「主題」(Theme)「範本」 設定。

  • 點擊 「編輯 HTML」(Edit HTML)

  • 請檢查在 HTML 程式碼中,<head> 標籤之後,是否存在以下格式的 AdSense 程式碼片段:

    HTML
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-您的發布商 ID" crossorigin="anonymous"></script>
    

    ca-pub-您的發布商 ID 應替換為您自己的 ID)

  • 如果找不到這段程式碼, 這就是問題所在。您需要從 AdSense 後台重新取得**「自動化廣告」**的程式碼,並將其貼到 Blogger 的 <head> 區塊內。


Environment:

Google Blogger + AdSense


Issue:

Many years ago, I applied for AdSense on my Blogger site to earn some ad revenue. At first, I did see ads and some earnings coming in. However, around two or three years ago, I noticed that my revenue had stopped increasing. When I opened the site, I realized that all the ads had disappeared.

I hadn’t changed any settings in AdSense; everything still showed as normal. Auto ads were enabled, and ad slots were configured on the layout.

But no ads were showing.


Troubleshooting Process:

I previously searched online but couldn’t find any helpful solutions.

Later, when Gemini came out, I decided to ask it. Gemini suggested editing the theme’s HTML and inserting a specific code snippet. After inserting the code and saving the changes…

I refreshed the site, and the ads appeared immediately. It was amazing.


In the Blogger dashboard, go to “Theme” and click “Edit HTML.”

Check whether the following AdSense code snippet exists right after the <head> tag:

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-YourPublisherID" crossorigin="anonymous"></script>

(ca-pub-YourPublisherID should be replaced with your own publisher ID.)

If this code is missing, this is the root cause.
You need to go to the AdSense dashboard, retrieve the Auto Ads code again, and paste it into the <head> section of your Blogger theme.


2025/12/04

Solidworks 字型 arial unicode ms 未被正確的安裝 在pdf檔案中的一或多個文字字串可能遺失

   環境:

重灌WIN11,m365 office,Solidworks 


異常狀況:

Solidworks 有出現錯誤"字型 arial unicode ms 未被正確的安裝 在pdf檔案中的一或多個文字字串可能遺失"




解決過程:

 Office  2016 版之後不再維護這字型,在另存 PDF 會出現此問題。

下載該字型進行安裝即可。

代理商也有提供教學影片與字型載點。

https://www.youtube.com/watch?v=jWgUT9Op2kU 



Environment:

Fresh install of Windows 11, Microsoft 365 Office, Solidworks


Issue:

Solidworks displayed an error: "Font 'Arial Unicode MS' was not installed correctly. One or more text strings in the PDF file might be missing."


Solution:

This font is no longer maintained after Office 2016, which causes this problem when saving files as PDF. The issue can be resolved by downloading and installing the font. The authorized distributor has also provided a tutorial video and a font download link.

https://www.youtube.com/watch?v=jWgUT9Op2kU




2025/12/01

電腦有2個ip 但dns只有一筆記錄

 網域電腦透過dhcp,留到有線與無線網路的IP,但在DNS上,都只有出現一筆,而且是出現比較晚抓到IP的那一筆。

查了一下才發現是DHCP的設定中,DNS動態更新選項,預設是選"只有在DHCP用戶端要求時才動更新dns記錄",這個就會讓你兩個IP都在DNS上註冊。

但如果選"一律動態更新DNS記錄",就只會出現最新的那一筆IP記錄。






A domain-joined computer obtains both wired and wireless IP addresses through DHCP, but only one record appears in DNS, and it is always the one obtained later.

After checking, I found that this is caused by the DHCP setting for dynamic DNS updates. By default, it is set to “Dynamically update DNS records only if requested by the DHCP client,” which results in both IP addresses being registered in DNS.

However, if you change it to “Always dynamically update DNS records,” only the most recent IP address will appear in DNS.


solidworks功能表中文亂碼 中文名稱的STEP檔無法開啟

 win11安裝solidworks 後,出現一些功能表中文是亂碼、有中文名稱的STEP檔無法開啟

要進到"選用功能",把"台灣地區"這個選項解除安裝。