分類
好用軟體

在本地端執行DeepSeek模型

最近火熱的 DeepSeek LLM模型, 你玩過了嗎?

其實也可以很容易地在地端執行這個 LLM模型, 當然也可以執行其他廠家的 LLM模型. 使用的工具為這個十分好用的 ollama:

https://ollama.com/

ollama 這個開源工具是用來簡化在地端執行這些 LLM模型的工具, 方便快速地可以在本地部署執行環境, 而且也可以在本地提供 API服務的功能.

先來看看在 Windows/Mac/Linux 下如何運行, 它將執行環境打包可以下載的安裝檔, 安裝完成後是利用 console 來執行互動式指令, 以 Windows 為例, 先下載一個安裝程式, 安裝完成後, 利用 console 來執行, 常用指令如下:

分類
好用軟體

幫幫數發部吧!

日前的一篇新聞:

https://www.upmedia.mg/news_info.php?Type=24&SerialNo=216712

看到有關這個”樂齡好幫手”網站上的點閱率偏低的問題:

https://agepass.adi.gov.tw/

看起來已經看不到點閱率了, 我們只好利用 API 來查看看, 以首頁第一篇的內容網址: https://agepass.adi.gov.tw/card/h57 為例, 我們可以利用該網址的 API Call 來取得內容:

curl 'https://agepass.adi.gov.tw/api/v1/card/h57' -H 'Referer: https://agepass.adi.gov.tw/card/h57'

在 Console 執行一下可以取出對應的 JSON 回應 (或利用線上工具 https://reqbin.com/curl), 其中的 view_count 如下:

"view_count": 486,
"like_count": 15,

也就取得了點閱次數為 486 次了, 隨著多打幾次 curl 點閱次數也會隨之增加, 大家可以利用這個方式來取得文章的點閱次數, 也可以幫幫數發部的網站有更多的點擊數哦!

[2024/11/24 17:05]

由於原來的範例中的 https://agepass.adi.gov.tw/card/h57 文章已下架了, 所以可以改用其他可用的文章如:

分別對應的 API 為 https://agepass.adi.gov.tw/api/v1/card/h66https://agepass.adi.gov.tw/api/v1/card/2220

利用 curl 訪問指令如下:

curl 'https://agepass.adi.gov.tw/api/v1/card/h66' -H 'Referer: https://agepass.adi.gov.tw/card/h66'
curl 'https://agepass.adi.gov.tw/api/v1/card/2220' -H 'Referer: https://agepass.adi.gov.tw/card/2220'

PS:

上面的 curl 為 linux 下的內建指令, 若是在 Windows 下要使用內建的 cURL, 語法不太相同, 指令則為:

curl -H “Referer: https://agepass.adi.gov.tw/card/2220” https://agepass.adi.gov.tw/api/v1/card/2220

 

 

 

分類
懶得分類

你是哪種 AWS服務?

你是哪種 AWS服務?

https://psy.aws-educate.tw/

這個還蠻另類的心理測驗耶, 來測看看你是什麼 AWS服務.

我的結果是 S3

快來測試看看你是哪種 AWS的服務吧!

分類
WebTrend

Google Trending搜尋趨勢API

利用 Google Trending 搜尋趨勢: https://trends.google.com/trending?geo=TW 取得最近的搜尋趨勢.

上面的連結是取得台灣地區的搜尋趨勢, 而其他地方的如下:

若要取得這個內容, 有沒有 API工具可以利用呢? 看起來 Google 目前沒有這個公開的 API可供利用, 不過這家公司提供了這個服務:

https://serpapi.com/

其中的 Google Trends API 可以提供這個結果:

https://serpapi.com/google-trends-api

分類
懶得分類

收到 Yahoo電商的通知信了

Yahoo 電商的通知信如下:

親愛的用戶您好:

 

感謝您對我們的信任與支持,謹在此通知您,自即日起,香港商雅虎資訊股份有限公司台灣分公司所提供之Yahoo Taiwan電子商務服務係隸屬於統一集團旗下之服務。

 

本公司已針對Yahoo Taiwan電子商務服務條款(請點選參閱全文)及Yahoo Taiwan電子商務隱私權保護政策(請點選參閱全文)進行更新,當您繼續使用本公司電子商務服務,即表示您同意並接受更新後之「Yahoo Taiwan電子商務服務條款」及「Yahoo Taiwan電子商務隱私權保護政策」。

 

如有任何問題,請洽詢本公司客服:https://tw.help.yahoo.com/kb/SLN36801.html

 

香港商雅虎資訊股份有限公司台灣分公司
經理人:Peter Nac Wong (黃吉樂)

看起來已被統一集團併購完成了. 根據服務條款中的內容, 包含以下服務:

Yahoo購物中心、Yahoo購物中心商店、Yahoo中古車及Yahoo拍賣等在內的電子商務服務

請參閱相關新聞:

分類
好用軟體

IP調查小程式-功能新增

之前介紹了使用 Cloudflare worker來進行客戶端 IP調查的小程式(https://diary.tw/archives/2182), 最近新增一些功能上來.

  1. 利用瀏覽器訪問時, 會加上完整的 html, 並增加了 Google Analytics 追蹤碼, 來記錄使用的次數.
  2. 若是利用非瀏覽器訪問時, 會直接輸出純文字 ip 而不會加上其他的內容, 例如: curl https://ip.diary.tw/
  3. 利用這個 geoplugin 這個免費的 API 功能來查找對應 IP的資訊, 請參考這個 API文件說明: https://www.geoplugin.com/webservices/json, 使用方式為 https://ip.diary.tw/?data=geo, 可以查找對應 IP的所在地與該地區使用貨幣與匯率. 輸出範例如下:
{
  "geoplugin_request":"12.34.56.78",
  "geoplugin_status":200,
  "geoplugin_delay":"1ms",
  "geoplugin_credit":"Some of the returned data includes GeoLite2 data created by MaxMind, available from <a href='https:\/\/www.maxmind.com'>https:\/\/www.maxmind.com<\/a>.",
  "geoplugin_city":"New Taipei City",
  "geoplugin_region":"New Taipei City",
  "geoplugin_regionCode":"NWT",
  "geoplugin_regionName":"New Taipei City",
  "geoplugin_areaCode":"",
  "geoplugin_dmaCode":"",
  "geoplugin_countryCode":"TW",
  "geoplugin_countryName":"Taiwan",
  "geoplugin_inEU":0,
  "geoplugin_euVATrate":false,
  "geoplugin_continentCode":"AS",
  "geoplugin_continentName":"Asia",
  "geoplugin_latitude":"24.9466",
  "geoplugin_longitude":"121.586",
  "geoplugin_locationAccuracyRadius":"20",
  "geoplugin_timezone":"Asia\/Taipei",
  "geoplugin_currencyCode":"TWD",
  "geoplugin_currencySymbol":"NT$",
  "geoplugin_currencySymbol_UTF8":"NT$",
  "geoplugin_currencyConverter":32.0408
}

 

請大家多加利用 IP查找小功具: https://ip.diary.tw

 

[2026/5/30 10:36]

由於原來的 ip geolocation service 已變成只有付費方案了如下:

{
  "geoplugin_status":403,
  "geoplugin_message": "geoPlugin API is no longer available for free use. To continue access, please upgrade to a paid plan",
  "geoplugin_url": "https://www.geoplugin.com/subscription"
}

 

所以改用仍有 free tier 的另一個服務: https://ipgeolocation.io/, 免費就有一定的使用量可供應用, API 也簡單, 只需要註冊帳戶, 就可以拿 API Token 去訪問取得資訊, API 使用方式請參考:

https://ipgeolocation.io/documentation/ip-location-api.html

調整一下程式碼, 之後訪問 https://ip.diary.tw/?data=geo 時, 就可以拿到對應的回傳結果如下:

{
  "ip": "12.34.56.78",
  "location": {
    "continent_code": "AS",
    "continent_name": "Asia",
    "country_code2": "TW",
    "country_code3": "TWN",
    "country_name": "Taiwan",
    "country_name_official": "Republic of China",
    "country_capital": "Taipei",
    "state_prov": "New Taipei City",
    "state_code": "TW-NWT",
    "district": "Banqiao District",
    "city": "New Taipei City",
    "zipcode": "231",
    "latitude": "24.97828",
    "longitude": "121.53948",
    "is_eu": false,
    "country_flag": "https://ipgeolocation.io/static/flags/tw_64.png",
    "geoname_id": "11697228",
    "country_emoji": "🇹🇼"
  },
  "country_metadata": {
    "calling_code": "+886",
    "tld": ".tw",
    "languages": [
      "zh-TW",
      "zh",
      "nan",
      "hak"
    ]
  },
  "currency": {
    "code": "TWD",
    "name": "New Taiwan Dollar",
    "symbol": "NT$"
  },
  "asn": {
    "as_number": "AS38841",
    "organization": "kbro CO. Ltd.",
    "country": "TW"
  },
  "time_zone": {
    "name": "Asia/Taipei",
    "offset": 8,
    "offset_with_dst": 8,
    "current_time": "2026-05-30 10:34:55.910+0800",
    "current_time_unix": 1780108495.91,
    "current_tz_abbreviation": "CST",
    "current_tz_full_name": "Taipei Standard Time",
    "standard_tz_abbreviation": "CST",
    "standard_tz_full_name": "Taipei Standard Time",
    "is_dst": false,
    "dst_savings": 0,
    "dst_exists": false,
    "dst_tz_abbreviation": "",
    "dst_tz_full_name": "",
    "dst_start": {},
    "dst_end": {}
  }
}

資訊更多元更豐富了, 歡迎多加利用.

[2026/8/17 7:20]

原來在 Cloudflare 中有 request.cf 變數(可參考: https://developers.cloudflare.com/workers/runtime-apis/request/),裡面也有對應的地理資訊,新增 https://ip.diary.tw/?data=geo2 範例資料如下:

{
  "httpProtocol": "HTTP/2",
  "clientAcceptEncoding": "gzip, deflate, br",
  "requestPriority": "weight=42;exclusive=0;group=0;group-weight=0",
  "edgeRequestKeepAliveStatus": 1,
  "requestHeaderNames": {},
  "clientTcpRtt": 12,
  "clientQuicRtt": 0,
  "colo": "TPE",
  "asn": 38841,
  "asOrganization": "kbro CO. Ltd.",
  "country": "TW",
  "isEUCountry": false,
  "city": "Banqiao",
  "continent": "AS",
  "region": "Taipei",
  "regionCode": "TPE",
  "timezone": "Asia/Taipei",
  "longitude": "121.46719",
  "latitude": "25.01427",
  "tlsVersion": "TLSv1.3",
  "tlsCipher": "AEAD-AES128-GCM-SHA256",
  "tlsClientRandom": "iZQjjbMHDvqj7bV9mGrvFOLCfcVTM7EfuEhmcEf6biE=",
  "tlsClientCiphersSha1": "Ycpx9ze2EIngjFvfLFng3z8MFzM=",
  "tlsClientExtensionsSha1": "fmoiUXxub2JA3Bd4T7jJ6OCQJ/s=",
  "tlsClientExtensionsSha1Le": "75rYBxmWw7lFoVazIKaJJGtd1xc=",
  "tlsExportedAuthenticator": {
    "clientHandshake": "d9433345ccb61cda32fc50991665f17c63e3f1d63d7bf8ef016c552543ee0920",
    "serverHandshake": "948cc32b3413616b0a331ed886a26abca9625c85e753afb790711648aa0497d4",
    "clientFinished": "90eb15c16b0812c9168d858e7d02b142a8358b1480766efb85b37479d74a41fa",
    "serverFinished": "1df4bd5176a49fbfd4f40e2b04827eed5e0a32ef520a1d4934cabd915f2ea9b4"
  },
  "tlsClientHelloLength": "1885",
  "tlsClientAuth": {
    "certPresented": "0",
    "certVerified": "NONE",
    "certRevoked": "0",
    "certIssuerDN": "",
    "certSubjectDN": "",
    "certIssuerDNRFC2253": "",
    "certSubjectDNRFC2253": "",
    "certIssuerDNLegacy": "",
    "certSubjectDNLegacy": "",
    "certSerial": "",
    "certIssuerSerial": "",
    "certSKI": "",
    "certIssuerSKI": "",
    "certFingerprintSHA1": "",
    "certFingerprintSHA256": "",
    "certNotBefore": "",
    "certNotAfter": "",
    "certRFC9440": "",
    "certRFC9440TooLarge": false,
    "certChainRFC9440": "",
    "certChainRFC9440TooLarge": false
  },
  "verifiedBotCategory": "",
  "edgeL4": {
    "deliveryRate": 284711
  }
}

 

大家也可以多加利用!

分類
懶得分類

AI供電問題-台電宣佈桃園(含)以北不核供大型AI資料中心

AI運算需要大量的電力.

先來看一下相關新聞:

https://finance.ettoday.net/news/2794524

人工智慧(AI)用電可觀,台電董事長曾文生今天表示,未來AI生活型態對台灣用電影響主要在製造端,包含GPU、CoWoS、伺服器生產;為減緩輸電瓶頸,目前桃園以北地區已不再核供5MW以上資料中心,他呼籲高科技產業到「支持電源開發的縣市發展」。

無論哪個國家, 都在持續努力跟上這波算力需求大戰, 不過基礎設施很重要, 算力其實是基於各式上游基礎而來, 如 GPU, Server, 機房, 網路, 土地, 電力等.

電力應用除了在直接算力上發生外, 另一個相當大的耗用在降溫, 也就是散熱空調, 當然大家也都在努力做更好的設計來改善這個散熱所需要的電力問題. 這個議題可以參考 PUE (Power usage effectiveness – https://zh.wikipedia.org/zh-tw/%E9%9B%BB%E8%83%BD%E4%BD%BF%E7%94%A8%E6%95%88%E7%8E%87)

另外有關於輸電問題, 長程輸電, 也會有對應的電力損耗, 請參考: https://zh.wikipedia.org/zh-tw/%E8%BC%B8%E9%9B%BB%E7%B3%BB%E7%B5%B1#%E6%90%8D%E8%80%97

要能兼顧國力、經濟發展AI算力, 又要能有效率, 降低損耗, 這都是很重要的課題.

不過話說回來, 生意的本質在成本效益的轉換, 若有企業出得起, 設置在哪會是什麼問題嗎?

繼續閱讀:

 

分類
好用軟體

幾個AI工具的比較

最近的AI工具熱潮, 大家跟上了嗎?

先列出幾個常用的AI工具:

再來利用這幾個AI工具自己來比較, 題目如下:

請比較以下幾個 AI 工具:

  • https://www.perplexity.ai/
  • https://chatgpt.com/
  • https://gemini.google.com/
  • https://claude.ai/
  • https://copilot.microsoft.com/

Perplexity 回答如下:

Perplexity AI

  • 由 Anthropic 公司開發的對話式 AI 助手
  • 擅長回答各種問題,提供詳細、有見地的回答
  • 可以進行多輪對話,記憶上下文
  • 支持多種語言

ChatGPT

  • 由 OpenAI 開發的對話式 AI 模型
  • 擅長自然語言交互,回答問題、寫作等
  • 知識庫截止時間較早,無法回答最新事件
  • 免費使用,但有使用限制

Gemini (Google AI)

  • 由 Google 開發的 AI 助手
  • 集成了 Google 的搜索、知識圖譜等技術
  • 可以回答問題、進行對話
  • 支持多種語言

Claude (Anthropic)

  • 由 Anthropic 公司開發的 AI 助手
  • 擅長回答問題、寫作、分析等
  • 可以進行多輪對話,記憶上下文
  • 支持多種語言

GitHub Copilot (Microsoft)

  • 由 Microsoft 與 OpenAI 合作開發的程式碼輔助工具
  • 可以根據註釋或上下文自動生成程式碼片段
  • 集成在 VS Code 等 IDE 中使用
  • 主要面向程式開發人員

總的來說,這些 AI 工具都具有強大的自然語言理解和生成能力,在問答、寫作、程式開發等方面有不同的特點和優勢。選擇時可以根據具體需求和使用場景進行選擇。

(可以參考原始回答: https://www.perplexity.ai/search/qing-bi-jiao-yi-xia-ji-ge-ai-g-wu.ArzfNSWu69ieeKD3tAQ#0)

分類
數學

[數學]兩正整數和與積之和為62,求兩正整數和

題目為:

a, b ∈N, a+b+ab=62, 求 a+b =?

解:

a + b + ab = a(b+1) + b = 62

a(b+1) + b + 1 = 63

(a+1)(b+1)=63

∵a, b ∈N, 因式分解 63 為 9 x 7 或 21 x 3

於是 (a+1)(b+1)=9×7 或 (a+1)(b+1)=21×3

∴a+1=9, b+1=7 或 a+1=21, b+1=3

得 a+b=14 或 a+b=22 (ie. (a,b)=(8,6),(6,8),(20,2)(2,20))

 

分類
好用軟體

iTerm2在MAC下使用滑鼠滾輪(or Trackpad兩指上下)時, 不會滾動畫面問題

可能是某次更新後, 在 iTerm2下的 Trackpad兩指上下滑動時, 發現只會出現指令的前後則內容, 而無法控制畫面內容的上下滾動.

查了一下資料, 有這篇: https://superuser.com/questions/1753719/how-do-i-get-mouse-scroll-in-less-to-work-in-iterm2-like-it-does-in-terminal

不過我原本的 Scroll wheel sends arrow keys when in alternate screen mode設定就是 Yes了, 而且從字義上來看反而應該要選 No才對, 調整後, 果然一切正常了, 太好了.

如何選到這個選項? 左上角的 [iTerm2] [Settings] [Advanced] 捲到 Mouse 這個區塊, 就可以找到這個設定囉.