<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by 想吃燒肉 on Medium]]></title>
        <description><![CDATA[Stories by 想吃燒肉 on Medium]]></description>
        <link>https://medium.com/@bird23074035?source=rss-5dd58985cdfa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uS0HC0qC59Wi3lMKMykIEQ.jpeg</url>
            <title>Stories by 想吃燒肉 on Medium</title>
            <link>https://medium.com/@bird23074035?source=rss-5dd58985cdfa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:25:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bird23074035/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[一台 Server 放入多個 Github 倉庫的Deploy key(ssh-key)]]></title>
            <link>https://bird23074035.medium.com/%E4%B8%80%E5%8F%B0-server-%E6%94%BE%E5%85%A5%E5%A4%9A%E5%80%8B-github-%E5%80%89%E5%BA%AB%E7%9A%84deploy-key-ssh-key-320c162000db?source=rss-5dd58985cdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/320c162000db</guid>
            <category><![CDATA[ssh-keys]]></category>
            <category><![CDATA[deploy-keys]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[想吃燒肉]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 04:57:09 GMT</pubDate>
            <atom:updated>2025-03-06T13:04:28.895Z</atom:updated>
            <content:encoded><![CDATA[<p>在微服務盛行的時代，每個 Github 的倉庫放在一個 t2.nona 的 Server 上面也是很常見的，但總是有需要一台開發主機上面放多個微服務來節省成本，所以也必須在一台 Server 上面放入多個 Deploy key(ssh-key)。</p><p>官方解法：<br><a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys">https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys</a></p><p>步驟：</p><ol><li>建立 ssh-key</li></ol><p>先建立兩組 key，my_key1 跟 my_key2</p><pre>$ ssh-keygen</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iyuq5xktK56I98NY6SjGRA.png" /><figcaption>建立 key1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MfXgkX9reSg1DIQl-mljqg.png" /><figcaption>建立 key2</figcaption></figure><figure><img alt="會成功建立兩組 key" src="https://cdn-images-1.medium.com/max/296/1*tI4C_2Bod4BCogTLvvSOww.png" /><figcaption>會成功建立兩組 key 在 .ssh 資料夾裡面</figcaption></figure><p>2. 分別放入 github 倉庫的 deploy key 裡面</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bBRJjDPTKFlWfppAyYet2g.png" /></figure><p>3. 在 .ssh/ 下面加入 config 檔案，來管理這些 key：</p><pre># path: .ssh/config<br>Host my-repository1<br>    HostName github.com<br>    User git<br>    IdentityFile ~/.ssh/my_key1<br>    IdentitiesOnly yes<br><br>Host my-repository2<br>    HostName github.com<br>    User git<br>    IdentityFile ~/.ssh/my_key2<br>    IdentitiesOnly yes</pre><p>4. 連線測試</p><pre>ssh -T git@my-repository1<br>ssh -T git@my-repository2</pre><p>5. 可以來 Clone 你的 Repository 瞜</p><p>載起來!!</p><pre>git clone git@my-repository1:webber0928/myDemo1.git<br>git clone git@my-repository2:webber0928/myDemo2.git</pre><p>這樣就可以成功用不同的 SSH 金鑰來 Clone 不同的 Repo 🎉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=320c162000db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[用 Python 做地理編碼 Geopy 的轉換]]></title>
            <link>https://bird23074035.medium.com/%E7%94%A8-python-%E5%81%9A%E5%9C%B0%E7%90%86%E7%B7%A8%E7%A2%BC-geopy-%E7%9A%84%E8%BD%89%E6%8F%9B-cc4747fb5431?source=rss-5dd58985cdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc4747fb5431</guid>
            <category><![CDATA[geopy]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[geo]]></category>
            <dc:creator><![CDATA[想吃燒肉]]></dc:creator>
            <pubDate>Wed, 25 Sep 2024 01:29:04 GMT</pubDate>
            <atom:updated>2024-09-25T01:29:04.163Z</atom:updated>
            <content:encoded><![CDATA[<p>事情是這樣的，一個朋友找我幫忙做經緯度轉換地址的小程式，然後說要請我吃爽的，我就這樣被收買了。</p><p>我第一時間想說串一下 <a href="https://developers.google.com/maps/documentation/geocoding/overview#ReverseGeocoding">Google Geocoding API</a> 就好了，應該很快，結果居然要收費了，這根本不合啊！我只好再找看看有沒有開源的方案可以使用，然後就找到了這個 「<a href="https://pypi.org/project/geopy/">Geopy</a>」！</p><p>Geopy 是一個用來處理地理編碼相關功能的 Python 套件。它讓 Python 開發者可以輕鬆地利用第三方地理編碼服務，來獲取全球各地的地址、城市或國家的座標。</p><p>如果你需要查找更詳細的資訊，可以參考 Geopy 的<a href="https://geopy.readthedocs.io/en/stable/index.html?highlight=user_agent">Documentation</a>。</p><p>✅ 首先安裝起來</p><pre>pip install geopy</pre><p>✅ 直接上範例</p><pre>from geopy.geocoders import Nominatim<br>geolocation = Nominatim(user_agent=&quot;geotest&quot;)<br><br>location = geolocation.reverse(&quot;25.0290277, 121.4468422&quot;)<br>print(location)<br>print(location.row)<br><br>###### location 回傳值<br>環漢路二段, 泰豐里, 新莊區, 瓊林, 新北市, 242001, 臺灣<br><br>###### location.row 回傳值<br>{&#39;place_id&#39;: 232642483, &#39;licence&#39;: &#39;Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright&#39;, &#39;osm_type&#39;: &#39;way&#39;, &#39;osm_id&#39;: 506708130, &#39;lat&#39;: &#39;25.0290409998263&#39;, &#39;lon&#39;: &#39;121.44684053263208&#39;, &#39;class&#39;: &#39;highway&#39;, &#39;type&#39;: &#39;tertiary&#39;, &#39;place_rank&#39;: 26, &#39;importance&#39;: 0.053400489051651755, &#39;addresstype&#39;: &#39;road&#39;, &#39;name&#39;: &#39;環漢路二段&#39;, &#39;display_name&#39;: &#39;環漢路二段, 泰豐里, 新莊區, 瓊林, 新北市, 242001, 臺灣&#39;, &#39;address&#39;: {&#39;road&#39;: &#39;環漢路二段&#39;, &#39;neighbourhood&#39;: &#39;泰豐里&#39;, &#39;suburb&#39;: &#39;新莊區&#39;, &#39;village&#39;: &#39;瓊林&#39;, &#39;city&#39;: &#39;新北市&#39;, &#39;ISO3166-2-lvl4&#39;: &#39;TW-NWT&#39;, &#39;postcode&#39;: &#39;242001&#39;, &#39;country&#39;: &#39;臺灣&#39;, &#39;country_code&#39;: &#39;tw&#39;}, &#39;boundingbox&#39;: [&#39;25.0290254&#39;, &#39;25.0335279&#39;, &#39;121.4467161&#39;, &#39;121.4531914&#39;]}</pre><p>geocoders 包含 Google 地圖、Bing 地圖和 Nominatim 等 API。我用 Nominatim的原因是他可以免費使用，但有查詢數量限制。如果需要更多查詢數，就需要考慮其他付費服務喔。</p><p>user_agent 是 設置為自己的應用名稱，為了限制每個應用的請求數量。</p><p>所以這樣好像就搞定了！</p><p>✅ 成果直接附上</p><pre><br>import pandas as pd<br>from openpyxl import load_workbook<br>from geopy.geocoders import Nominatim<br>from tenacity import retry, stop_after_attempt, wait_fixed<br>import time<br><br># init geopy <br>geolocation = Nominatim(user_agent=&quot;geotest&quot;)<br><br># 讀取 xlsx<br>df = pd.read_excel(fileName, sheet_name=0)<br>df[&#39;地址&#39;] = None<br><br># 使用 tenacity 重試邏輯<br>@retry(stop=stop_after_attempt(3), wait=wait_fixed(5))  # 最多重試 3 次，每次重試間隔 5 秒<br>def reverse_geocode(latitude, longitude):<br>    location = geolocation.reverse(f&quot;{longitude}, {latitude}&quot;)<br>    result = f&quot;{location.raw[&#39;address&#39;][&#39;postcode&#39;]}{location.raw[&#39;address&#39;][&#39;city&#39;]}{location.raw[&#39;address&#39;][&#39;suburb&#39;]}{location.raw[&#39;address&#39;].get(&#39;neighbourhood&#39;, &#39;&#39;)}{location.raw[&#39;address&#39;].get(&#39;road&#39;, &#39;&#39;)}{location.raw[&#39;address&#39;].get(&#39;house_number&#39;, &#39;&#39;)}&quot;<br>    if location.raw[&#39;address&#39;].get(&#39;road&#39;, &#39;&#39;) != location.raw.get(&#39;name&#39;, &#39;&#39;):<br>        result += f&quot; {location.raw.get(&#39;name&#39;, &#39;&#39;)}&quot;<br>    print(result)<br>    return result<br><br># 逐行進行經緯度反向地理編碼<br>for idx, row in df.iterrows():<br>    latitude = row[&#39;緯度&#39;]<br>    longitude = row[&#39;經度&#39;]<br>    <br>    if pd.notna(latitude) and pd.notna(longitude):<br>        try:<br>            df.at[idx, &#39;地址&#39;] = reverse_geocode(latitude, longitude)<br>        except Exception as e:<br>            print(f&quot;[{longitude}, {latitude}] Error for index {idx}: {e}&quot;)<br>        time.sleep(2)<br><br># 寫入結果到新工作表<br>with pd.ExcelWriter(fileName, engine=&#39;openpyxl&#39;, mode=&#39;a&#39;) as writer:<br>    df.to_excel(writer, sheet_name=&#39;Sheet2&#39;, index=False)<br><br>wb = load_workbook(fileName)<br>ws = wb[&#39;Sheet2&#39;]<br><br>for column_cells in ws.columns:<br>    max_length = 0<br>    column = column_cells[0].column_letter<br>    for cell in column_cells:<br>        try:<br>            if cell.value:<br>                max_length = max(max_length, len(str(cell.value)))<br>        except:<br>            pass<br>    adjusted_width = (max_length + 2)<br>    ws.column_dimensions[column].width = adjusted_width<br>wb.save(fileName)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc4747fb5431" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[R語言 與 VS Code 的相遇]]></title>
            <link>https://bird23074035.medium.com/r%E8%AA%9E%E8%A8%80-%E8%88%87-vs-code-%E7%9A%84%E7%9B%B8%E9%81%87-54164e10a7de?source=rss-5dd58985cdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/54164e10a7de</guid>
            <category><![CDATA[r語言安裝]]></category>
            <category><![CDATA[vscode-r]]></category>
            <category><![CDATA[安裝教學]]></category>
            <dc:creator><![CDATA[想吃燒肉]]></dc:creator>
            <pubDate>Mon, 04 Sep 2023 05:34:11 GMT</pubDate>
            <atom:updated>2023-09-04T05:34:11.309Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>就是在 VS Code 上面寫 R 啦！！</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*ou3KMatJrIAoPsBP.jpg" /></figure><blockquote>為什麼明明就有 RStudio，還要用 VS Code 來寫呢？</blockquote><blockquote>因為比較<strong>潮 </strong>ʅ（´◔౪◔）ʃ</blockquote><ol><li>安裝 R</li></ol><p><a href="https://cran.rstudio.com/">The Comprehensive R Archive Network</a></p><p>請選擇自己的系統進行安裝。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yY5hJu4rxSTfT2vodR9hdA.png" /></figure><p>2. 安裝 VS Code 擴充套件</p><ul><li>R (2.8.1): <a href="https://marketplace.visualstudio.com/items?itemName=REditorSupport.r">https://marketplace.visualstudio.com/items?itemName=REditorSupport.r</a></li><li>R Debugger (0.5.4): <a href="https://marketplace.visualstudio.com/items?itemName=RDebugger.r-debugger">https://marketplace.visualstudio.com/items?itemName=RDebugger.r-debugger</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*xcwstZ-P4eFXnnorrdUK1w.png" /></figure><p>3. 功能介紹</p><ul><li>右下角可開 R Terminal，反白後執行(control/command + Enter)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*LmDUeSD0LrDK_pqmzIRAcg.png" /></figure><ul><li>R 的套件可以看到變數資料，點選 standard_df 右邊的 View 符號</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1yXGD-6SIdKv5_xZg6Kqlw.png" /></figure><ul><li>視圖直接執行 ggplot 程式碼即可</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d6Hr2Y-u8q6d-D08v8AWUA.png" /></figure><p>就這樣，打完收工！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54164e10a7de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[mac]自建測試的Docker環境]]></title>
            <link>https://bird23074035.medium.com/mac-%E8%87%AA%E5%BB%BA%E6%B8%AC%E8%A9%A6%E7%9A%84docker%E7%92%B0%E5%A2%83-2ac0eaa6b8cc?source=rss-5dd58985cdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ac0eaa6b8cc</guid>
            <dc:creator><![CDATA[想吃燒肉]]></dc:creator>
            <pubDate>Thu, 12 Jan 2023 08:36:47 GMT</pubDate>
            <atom:updated>2023-01-12T08:36:47.861Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>最近輔大陳若儀引發的流水席之亂，有沒有想起了過去的美好！？</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rqztIrcGDMqeONeR8suF6A.png" /></figure><p>安裝 Docker 桌面版</p><p><a href="https://www.docker.com/">Docker: Accelerated Container Application Development</a></p><p>從 Docker 安裝 Ubuntu 22.04 LTS</p><ol><li>搜尋 ubuntu</li><li>找到你要的版本</li><li>選擇版本按下 RUN</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XjNFHn4uIo4v3-aWyVPPtw.png" /></figure><p>用 Run 啟動你的 Imag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Chx_uEZ5wDAofHdgRlpJcg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mvqho6E5TPC_PZ04HuHqlA.png" /></figure><p>[當一切看似正常，但不出意外的話馬上就要出意外了～]</p><p>是的！完全無法啟動！？？？？？</p><p>解法：使用 Terminal</p><pre>$ docker run -itd --name ubuntu-2204 -p 8085:80 ubuntu:jammy</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*04C6kdHSb80YNw0BLVeBEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CrIHd_ozbWGaHm_izLFR2A.png" /></figure><p>OK！搞定了！</p><p>完成的結果圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6IHh1gHOb66mfC2nIdF_xA.png" /></figure><p>雖然跟開一個 ubuntu 的 vm 有些許不同，但仔細看其實都是些大同小異的東西，重點是之後測試某些東西也不用麻煩 OP 了，可喜可樂～</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ac0eaa6b8cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[刪除手機瀏覽器 safari / chrome / firefox 中點擊的灰色背景]]></title>
            <link>https://bird23074035.medium.com/%E5%88%AA%E9%99%A4%E6%89%8B%E6%A9%9F%E7%80%8F%E8%A6%BD%E5%99%A8-safari-chrome-firefox-%E4%B8%AD%E9%BB%9E%E6%93%8A%E7%9A%84%E7%81%B0%E8%89%B2%E8%83%8C%E6%99%AF-fcb7675ab35?source=rss-5dd58985cdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcb7675ab35</guid>
            <dc:creator><![CDATA[想吃燒肉]]></dc:creator>
            <pubDate>Thu, 05 Jan 2023 02:56:25 GMT</pubDate>
            <atom:updated>2023-01-05T02:58:07.711Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>生命中其實有很多小確幸等著你去發掘, 來吧 2023!!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*mWWSnq-FCHj11iVx.png" /></figure><p>事情是這樣的，有人發現手機的點擊會有一個背景的產生覺得是一個 Bug，因此希望能夠把這個問題修掉……( 範例如下圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oCgZAlgQCOaiBXbU.png" /></figure><p>我的理解是為了讓使用者能夠知道點擊了什麼才有的高亮提示，但畢竟我只是個小螺絲釘而已。</p><p>跟同事查了一下，果然發現了一個特別的 CSS-webkit-tap-highlight-color</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0zJzbbxS5qbXap0OJdgVQ.png" /></figure><p>所以答案呼之欲出，加上以下 CSS 即可解決問題</p><pre>a { <br>  -webkit-tap-highlight-顏色：透明；/* 去除高亮 */<br> }</pre><p>參考:</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-tap-highlight-color">https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-tap-highlight-color</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcb7675ab35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Nodejs] PM2 & Nuxt 零停機部署]]></title>
            <link>https://bird23074035.medium.com/nodejs-pm2-nuxt-%E9%9B%B6%E5%81%9C%E6%A9%9F%E9%83%A8%E7%BD%B2-50660d4f6093?source=rss-5dd58985cdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/50660d4f6093</guid>
            <dc:creator><![CDATA[想吃燒肉]]></dc:creator>
            <pubDate>Thu, 05 Jan 2023 02:40:24 GMT</pubDate>
            <atom:updated>2023-01-05T02:40:24.035Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>對宅宅工程師來說，武漢肺炎並不可怕，可怕的是那些薪水不足以支付你的股票交割金</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/0*o6dc5zOx0YlzQ4xR" /></figure><p>零停機部署(Zero Downtime Deployment)</p><p>意思是你有 4 個正在運行的實例(instances)，您可以一次重新加載一個實例，當一個實例正在重新加載時，其他 3 個實例將使服務器保持活動狀態。因此，您可以更新您的網絡服務器，<strong><em>而無需離線甚至一秒鐘</em></strong>。</p><p>這邊介紹的是 PM2 &amp; Nuxt 的用法。<br>對於大部分工程師來說，設置和使用<strong> </strong><a href="https://pm2.keymetrics.io/docs/usage/cluster-mode/"><strong>PM2 cluser</strong></a><strong> </strong>非常容易，但是我們嘗試在我們的 nuxt server 上使用卻會遇到了一些問題。</p><p>首先，創建我們的 nuxt 服務器：</p><pre>$ pm2 start npm --name MyAppName -- start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/0*iLhtQfhO9TTmJXkM.png" /></figure><p>但是在嘗試啟動多個實例時，我們很快就會遇到問題。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IE4uow_ioILbaLp6.png" /></figure><p>現在雖然這是默認在 PM2 的fork模式下運行，但即使我們指定在cluster 模式下運行，我們仍然會遇到錯誤。</p><p>如果我們只使用 1 個實例並嘗試重新加載服務器怎麼辦？好吧，由於 Nuxt 在後台的工作方式，如果我們嘗試在服務器運行時重建服務器，在刪除構建文件並為新構建重新散列後，我們將遇到 404 錯誤。如果我們的靜態文件夾中的文件被更改，我們也會遇到問題。</p><p>那麼如果我們不能只是重建和重新加載一個服務器，我們也不能運行多個實例，那麼我們如何實現零停機部署？</p><p>nuxt-start: <a href="https://www.npmjs.com/package/nuxt-start">https://www.npmjs.com/package/nuxt-start</a></p><p>我們可以在目錄底下建立一個檔案 <strong>ecosystem.config.js</strong></p><pre># ecosystem.config.js<br>module.exports = {<br>  apps : [{<br>    name : &#39;[prod] MyAppName&#39;, // App name that shows in `pm2 ls`<br>    exec_mode : &#39;cluster&#39;, // enables clustering<br>    instances : 4, // or max<br>    script : &#39;./node_modules/nuxt-start/bin/nuxt-start.js&#39;, <br>    // The magic key<br>  }]<br>};</pre><p>啟動方式</p><pre>$ pm2 start ecosystem.config.js</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LJTMEFg2PJ2IFvfK.png" /></figure><p>搞定！現在可以生成 Nuxt 服務器的多個實例以獲得更好的性能，並利用零停機時間部署在更新期間保持網站在線。</p><p>參考</p><ul><li><a href="https://www.npmjs.com/package/nuxt-start">https://www.npmjs.com/package/nuxt-start</a></li><li><a href="https://github.com/nuxt/nuxt.js/issues/4797">https://github.com/nuxt/nuxt.js/issues/4797</a></li><li><a href="https://medium.com/@vipercodegames/nuxt-deploy-809eda0168fc">https://medium.com/@vipercodegames/nuxt-deploy-809eda0168fc</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50660d4f6093" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[該如何驗證 ssl 是否錯誤]]></title>
            <link>https://bird23074035.medium.com/%E8%A9%B2%E5%A6%82%E4%BD%95%E9%A9%97%E8%AD%89-ssl-%E6%98%AF%E5%90%A6%E9%8C%AF%E8%AA%A4-baf387cf679c?source=rss-5dd58985cdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/baf387cf679c</guid>
            <dc:creator><![CDATA[想吃燒肉]]></dc:creator>
            <pubDate>Sun, 20 Jun 2021 05:50:53 GMT</pubDate>
            <atom:updated>2021-06-20T05:52:47.190Z</atom:updated>
            <content:encoded><![CDATA[<p>該如何驗證 ssl 是否錯誤</p><blockquote>我上班領的不是薪水，是精神賠償金</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/0*615jz21h5H504mPE" /></figure><p>最近公司在 Godaddy 上面買了憑證，所以需要安裝到 Server 上面</p><p>安裝完成該如何驗證是否正確呢?<br>可以將網域丟到線上工具上面跑看看</p><ul><li><a href="https://www.sslshopper.com/ssl-checker.html#hostname=api.webzz.co">https://www.sslshopper.com/ssl-checker.html</a></li><li><a href="https://www.cloudflare.com/zh-tw/lp/ssl-test/">https://www.cloudflare.com/zh-tw/lp/ssl-test/</a></li><li><a href="https://globalsign.ssllabs.com/">https://globalsign.ssllabs.com/</a></li></ul><p>剛好我的們子網域就出現了錯誤</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*q6xtLPxDapA8_rMSrN4MIg.png" /></figure><p>所以現在的狀況是，主網域正常，但子網域的驗證出現了問題。</p><p>後來發現，子網域的憑證是需要 chained 起來的</p><pre>cat bbas334bdcca.crt gd_bundle-g2-g1.crt &gt; chained.crt</pre><pre># cat 你買來的憑證.crt bundle好的憑證.crt &gt; chained.crt</pre><p>最後再把這個憑證放進去 ssl 裡面即可</p><p>搞定。</p><p>參考</p><ul><li><a href="https://www.coder.work/article/4037541">https://www.coder.work/article/4037541</a></li><li><a href="https://shazi.info/openssl-%E6%AA%A2%E6%B8%AC-ssl-%E7%9A%84%E6%86%91%E8%AD%89%E4%B8%B2%E9%8D%8A-certificate-chain/">https://shazi.info/openssl-%E6%AA%A2%E6%B8%AC-ssl-%E7%9A%84%E6%86%91%E8%AD%89%E4%B8%B2%E9%8D%8A-certificate-chain/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=baf387cf679c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Window10 安裝 MySQL 8.0]]></title>
            <link>https://bird23074035.medium.com/window10-%E5%AE%89%E8%A3%9D-mysql-8-0-2f9e6968f41c?source=rss-5dd58985cdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f9e6968f41c</guid>
            <category><![CDATA[mysql-8]]></category>
            <category><![CDATA[mysql-server]]></category>
            <category><![CDATA[windows-10]]></category>
            <category><![CDATA[mysql-workbench]]></category>
            <dc:creator><![CDATA[想吃燒肉]]></dc:creator>
            <pubDate>Mon, 07 Jun 2021 20:48:44 GMT</pubDate>
            <atom:updated>2023-01-30T14:23:08.556Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>看好了世界，台灣人只示範一次......</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*cHe7B-FdXu9VRcpP.jpg" /></figure><p>原本家裡的 Window 只是讓我玩樂的工具，迫於居家防疫只好把它拿來灌一點程式了．．．ㄒ_ㄒ</p><p>其實我第一個想到的是 xampp，但是他欺騙我的感情。<br>「XAMPP是一個把Apache網頁伺服器與PHP、Perl及MariaDB集合在一起的安裝包。」</p><p>我一直以為那個 M 是MySQL……，所以只好官網上面直接下載摟～</p><h4>首先，我們先進入下載 MySQL 的網站</h4><p><a href="https://dev.mysql.com/downloads/mysql/">MySQL :: Download MySQL Community Server</a></p><ol><li>選擇你的作業系統</li><li>進入下載頁面</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*aZDv-x5XTyT8w6htaVTlew.png" /></figure><p>選擇一般版本即可，web 版本我是沒用過啦，交給你分享了 ^_&lt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*TnyuLlGscYUrP8GZTG5nVA.png" /></figure><p>不用註冊也可以下載喔！阿你要我也是不反對～</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*mNMZkr2yT1K95OaqS3086Q.png" /></figure><h4>接著把 MySQL 安裝起來吧</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*WqjKwzC8njWaCPxNiMA4jQ.png" /></figure><p>MySQL Workbench — 是一款資料庫的GUI工具，專門為MySQL 設計。<br>啊我本人是覺得挺好用的啦，除了三不五時會當機之外（？）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*ZgXcf03L4Sf9uHdjoyos0Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*12GeC4iHXosjxoPCQIjJ8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*k0hda8V-A4RgIZJliI0ynA.png" /></figure><p><strong>還是要記得安裝 MySQL Server 捏</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*Pv_hsC1rYnICqkiz6Ulclw.png" /></figure><p>我安裝Server 就好，你們自己看著辦</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*VurKLyQR35nNc1d0-AkgZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*7j-zTfi3NzNhXbPxlfh_oA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*JZU6MQDhEKVMrhpeXR49Aw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*dfaO4eADZwJFtOQtp9AB4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*mUa0LBkd307nikxC7VwfxA.png" /></figure><p><strong>密碼記得要設定嘿！！</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*i7xehYIfstpE6B1BNRXErg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*dNPdCSqxdHTJ1j3uzA_bug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*o1rVv7zgVaTyLGxPlqIwnA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*P9XR5g3dC7NW4Ls3w2Gd4A.png" /></figure><p>馬上來連線看看吧！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wxwvCPG2GWuhsCwejR5Pew.png" /></figure><p><strong>填寫剛設定好的密碼</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*TZDsOvtr4gy3-Qsi7qnZIQ.png" /></figure><p><strong>可以先用 Test Connection 確認連線</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*30Q0jYDENwKL1UoyBF3mQQ.png" /></figure><p>搞定！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f9e6968f41c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[用 php 讀檔案的範例]]></title>
            <link>https://bird23074035.medium.com/%E7%94%A8-php-%E8%AE%80%E6%AA%94%E6%A1%88%E7%9A%84%E7%AF%84%E4%BE%8B-f61611941041?source=rss-5dd58985cdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/f61611941041</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[讀檔]]></category>
            <dc:creator><![CDATA[想吃燒肉]]></dc:creator>
            <pubDate>Wed, 20 Jan 2021 09:24:36 GMT</pubDate>
            <atom:updated>2021-06-07T19:47:54.661Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>到底要投資什麼才能賺好賺飽呢？ 你還是投資自己吧</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/0*mqC-uO3dBzgGra8t.png" /></figure><p>最近想要一些工具可以自動讀檔案，想說都在寫 js ，想用不同的語言來試試看，那就決定是你了 「PHP」！</p><p>那我的目標就是</p><ol><li>讀取整個目錄</li><li>讀取裡面的檔案資料</li><li>根據資料做整理，變成我要的形狀</li></ol><p>#讀取目錄的寫法 （<a href="https://www.php.net/manual/en/function.scandir.php">scandir</a>）</p><pre>$dir = &quot;./models/&quot;;    // 我想要讀取的目錄為 ./models/<br>$file = scandir($dir);<br>print_r($file);        // 回來是陣列</pre><p>#一行一行讀取裡面的檔案內容 (<a href="https://www.php.net/manual/en/function.fopen">fopen</a>, <a href="https://www.php.net/manual/en/function.feof">feof</a>, <a href="https://www.php.net/manual/en/function.fgets">fgets</a>, <a href="https://www.php.net/manual/en/function.fclose">fclose</a>)</p><pre>$file_path = &quot;./models/fundAllocationMapping.js&quot;;<br>$file = fopen($file_path, &quot;r&quot;);</pre><pre>$result = array();<br>$i = 0;<br>while (!feof($file)) {<br>  $result[$i] = fgets($file); // fgets()函式從檔案指標中讀取一行<br>  $i++;<br>}</pre><pre>fclose($file);<br>$result = array_filter($result);<br>print_r($result);</pre><p>#取得我想要的資料(<a href="https://www.php.net/manual/en/function.strpos">strpos</a>)</p><pre>$str = &#39;123456&#39;;<br>if (strpos($str, &#39;123&#39;) !== false) {<br>  echo &quot;str 字串包含 123&quot;;<br>} else {<br>  echo &quot;str 字串不包含 123&quot;;<br>}</pre><p>組合起來：</p><p>我想要取得那行包含有 「: {」以及 「belongsTo」「hasOne」「hasMany」的字串</p><pre>&lt;?php<br>  $dir = &quot;./models/&quot;;<br>  $file = scandir($dir);<br>  <br>  foreach ($file as $key =&gt; $value) {<br>    if ($key &gt; 1) {<br>      $file_path = &quot;./models/$value&quot;;<br>      $file = fopen($file_path, &quot;r&quot;);<br>      $i = 0;<br>      echo (&quot;$value \n&quot;);</pre><pre>      while (!feof($file)) {<br>        $result[$i] = fgets($file); //fgets()函式從檔案指標中讀取一行<br>        if (strpos($result[$i], &#39;: {&#39;) !== false &amp;&amp;<br>          strpos($result[$i], &#39;hooks&#39;) === false) {<br>          echo $result[$i];<br>        }<br>        if (strpos($result[$i], &#39;belongsTo&#39;) !== false) {<br>          echo $result[$i];<br>        }<br>        if (strpos($result[$i], &#39;hasOne&#39;) !== false) {<br>          echo $result[$i];<br>        }<br>        if (strpos($result[$i], &#39;hasMany&#39;) !== false) {<br>          echo $result[$i];<br>        }<br>        $i++;<br>      }</pre><pre>      fclose($file);<br>      $result = array_filter($result);<br>      // print_r($result);<br>  }<br>}</pre><p>搞定！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f61611941041" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[工具的靈魂 — VS Code]]></title>
            <link>https://bird23074035.medium.com/%E5%B7%A5%E5%85%B7%E7%9A%84%E9%9D%88%E9%AD%82-vs-code-1abe2e0f603f?source=rss-5dd58985cdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/1abe2e0f603f</guid>
            <category><![CDATA[vscode]]></category>
            <dc:creator><![CDATA[想吃燒肉]]></dc:creator>
            <pubDate>Wed, 22 Jan 2020 08:51:38 GMT</pubDate>
            <atom:updated>2020-01-22T08:51:38.451Z</atom:updated>
            <content:encoded><![CDATA[<h3>工具的靈魂 — VS Code</h3><blockquote>好的工具總會隨著時間的演化搭載更方便的技術</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*hEMKQ9sC6PWnj9AF.jpg" /></figure><h3>Chinese (Traditional) Language Pack for Visual Studio Code</h3><p>我中文我驕傲。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6puwPhTirb5LuDO7.jpg" /></figure><h3>JavaScript (ES6) code snippets</h3><p>JavaScript 征服宇宙。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*nos2T_kePFhT1fPu.jpg" /></figure><h3>Remote — SSH</h3><p>當公司配給你 window 電腦時, 裝 Virtualbox 的 ubuntu 又會讓電腦當機時…，你會需要這個方便的工具連線到你的遠端來做事。</p><pre><strong>Host</strong> 我的機<br>    <strong>HostName</strong> 10.10.10.32 <br>    <strong>User</strong> webber</pre><pre><strong>Host </strong>我的測試機<br>    <strong>HostName </strong>10.10.10.33<br>    <strong>PreferredAuthentications </strong>password<br>    <strong>PubkeyAuthentication </strong>no<br>    <strong>User </strong>webber</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*wdbOl0GSXAd5-spStxFBBA.png" /></figure><p>還有什麼推薦的呢!?<br>本人是認為他預設已經很多棒棒搭的東西惹~</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1abe2e0f603f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>