<?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 BunnyBit on Medium]]></title>
        <description><![CDATA[Stories by BunnyBit on Medium]]></description>
        <link>https://medium.com/@bunnybit?source=rss-be1e8186c4f5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*J-nSmY5W16L6v7rF2pcm8w.jpeg</url>
            <title>Stories by BunnyBit on Medium</title>
            <link>https://medium.com/@bunnybit?source=rss-be1e8186c4f5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:22:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bunnybit/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[Web EME 除錯流程]]></title>
            <link>https://bunnybit.medium.com/web-eme-%E9%99%A4%E9%8C%AF%E6%B5%81%E7%A8%8B-fd02c2b84318?source=rss-be1e8186c4f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd02c2b84318</guid>
            <category><![CDATA[steaming]]></category>
            <category><![CDATA[eme]]></category>
            <category><![CDATA[drm]]></category>
            <category><![CDATA[web]]></category>
            <dc:creator><![CDATA[BunnyBit]]></dc:creator>
            <pubDate>Tue, 12 Mar 2024 17:43:53 GMT</pubDate>
            <atom:updated>2024-03-12T17:43:53.160Z</atom:updated>
            <content:encoded><![CDATA[<p>在 Web Player 的 DRM Playback 流程上遇上問題麻？可以參考此份指南進行除</p><h3>記錄 EME API 通訊過程</h3><ul><li><a href="https://github.com/peaBerberian/EMESpy.js">GitHub — peaBerberian/EMESpy.js: Report every EME API (for media DRMs) a webpage calls</a></li></ul><p>先依靠上面的 script 就可以監聽 Player 對 EME API 作了哪些動作，產生了哪些錯誤</p><h3>使用 Widevine 官方整合工具解析 License</h3><ul><li><a href="https://integration.widevine.com/diagnostics">Widevine Integration Platform</a></li></ul><p>再使用此 site 幫忙 Parse License Request / Response</p><h3>記錄事發 Browser Version / CDM Version</h3><ul><li>about://components，chromium 系 Browser 可以使用此除錯頁面取得 CDM 版號</li></ul><h3>向 Widevine Team 發出技術咨詢信件</h3><p>找尋 CWIP 證照的開發者，麻煩他們寄出技術咨詢信件</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd02c2b84318" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apple MacOS App 散佈安全性手續]]></title>
            <link>https://bunnybit.medium.com/apple-macos-app-%E6%95%A3%E4%BD%88%E5%AE%89%E5%85%A8%E6%80%A7%E6%89%8B%E7%BA%8C-acb502749a7e?source=rss-be1e8186c4f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/acb502749a7e</guid>
            <category><![CDATA[notarization]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[codesign]]></category>
            <category><![CDATA[electronjs]]></category>
            <dc:creator><![CDATA[BunnyBit]]></dc:creator>
            <pubDate>Tue, 12 Mar 2024 17:38:15 GMT</pubDate>
            <atom:updated>2024-03-12T17:38:15.031Z</atom:updated>
            <content:encoded><![CDATA[<p>MacOS 上要散佈/發佈 App 需要處理不少安全性問題，主要有這三個程序需要處理</p><h3>Code Signing</h3><p>這是一種過程，蘋果的開發人員使用他們的 Apple 開發者帳戶來「簽名」他們的應用程式。這種簽名證明了該應用程式確實由它聲稱的開發者建置，並且在簽名後沒有被修改過。當你在 macOS 上打開一個已簽名的應用程式時，你可以在「關於此應用程式」對話框中看到「已驗證」的標誌，這表明該應用程式已被簽名，並且是由該開發者所提供的。</p><h3>Notarization</h3><p>這是蘋果在 macOS 10.14.5（Mojave）和更高版本中引入的一個新的安全性功能。當開發者完成應用程式的簽名後，他們可以選擇將其提交給蘋果的 notarization 服務。蘋果會掃描應用程式以尋找惡意軟體和其他安全問題，並檢查應用程式是否使用了合適的安全性實踐（如使用了最新的簽名技術等）。如果應用程式通過了這個檢查，蘋果會回傳一個「票證」(Ticket)，證明該應用程式已被驗證為安全。</p><h3>Stapling</h3><p>當開發者收到蘋果回傳的 notarization「票證」後，他們可以選擇將這個票證「繫附」（staple）到他們的應用程式上。這稱為「stapling」。當你嘗試打開一個已繫附票證的應用程式時，macOS 會檢查這個票證，而不是向蘋果的伺服器請求驗證。這對於在沒有網路連接的情況下打開應用程式很有用，因為它允許你的電腦在離線驗證應用程式的安全性。</p><p>這些安全性實踐都是為了確保蘋果的用戶能安全地下載和使用應用程式，並確保這些應用程式不含有惡意軟體，並且在下載後沒有被修改過。</p><h3>GateKeeper</h3><p>Gatekeeper 是 Apple 在 macOS 中用來保護用戶免受惡意軟體攻擊的一種保護機制。其主要的工作方式是通過限制哪些應用程式可以在你的電腦上執行。</p><p>Gatekeeper 具有以下三種安全級別：</p><ol><li><strong>只允許從 App Store 安裝應用程式</strong>：這是最安全的選擇，因為所有在 App Store 中的應用程式都被 Apple 審核過，並確定不包含已知的惡意軟體或者不良的行為。</li><li><strong>允許從 App Store 和已識別的開發者安裝應用程式</strong>：這是預設的選擇。已識別的開發者是參加了 Apple 開發者計劃的開發者，他們的應用程式必須經過 Apple 的數字簽名認證，才能被運行。這提供了一定程度的保護，但仍然允許用戶安裝並非從 App Store 下載的應用程式。</li><li><strong>允許從任何來源安裝應用程式</strong>：這是最不安全的選擇，並且在近期版本的 macOS 中被隱藏起來了。選擇這一選項意味著用戶可以運行任何應用程式，無論其是否經過了數字簽名。</li></ol><p>透過以上的設定，Gatekeeper 能有效地防止用戶意外地安裝和執行包含惡意軟體的應用程式。但是，即使在最安全的設定下，用戶仍然需要小心避免受到網路釣魚攻擊或者其他形式的社交工程攻擊，因為 Gatekeeper 不能完全防止這類攻擊。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qud2KMj1VNs8yNff_Cey9g.png" /></figure><h3>Apple 官方文件</h3><h4>Code Signing</h4><p><a href="https://developer.apple.com/support/code-signing/">Code Signing — Support — Apple Developer</a></p><p><a href="https://developer.apple.com/developer-id/">Developer ID — Apple Developer</a></p><h4>Notarization</h4><p><a href="https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow">Customizing the notarization workflow | Apple Developer Documentation</a></p><p><a href="https://developer.apple.com/videos/play/wwdc2022/10109">What’s new in notarization for Mac apps — WWDC22 — Videos — Apple Developer</a></p><p><a href="https://developer.apple.com/documentation/technotes/tn3147-migrating-to-the-latest-notarization-tool">TN3147: Migrating to the latest notarization tool | Apple Developer Documentation</a></p><h3>GateKeeper</h3><p><a href="https://support.apple.com/zh-tw/HT202491">在 Mac 上安全地開啟 App — Apple 支援 (台灣)</a></p><h4>Prerequisites — 各步驟的前置要求</h4><h4>Code Signing</h4><p>Developer ID certificate</p><ul><li>需要從 Apple Developer Account Holder 帳號裡匯出 Developer ID certificate</li></ul><p>教學文件</p><ul><li><a href="https://developer.apple.com/help/account/create-certificates/create-developer-id-certificates/">Create Developer ID certificates — Create certificates — Account — Help — Apple Developer</a></li></ul><h3>Notarization</h3><p>appleId</p><p>appleIdPassword</p><ul><li>除了使用真的密碼，也可以使用 <a href="https://support.apple.com/zh-tw/HT204397">app-specific password</a> 來防止 leaking 風險</li></ul><p>teamId</p><ul><li>something like this ZKULCVJ8S9</li></ul><h3>對於 Electron 上的影響</h3><p>因為已將 Electron 建置工具遷移至 electron-builder 的關系，因此 MacOS Code-sign 的動作已藉由 electron builder 使用 <a href="https://github.com/electron/osx-sign">electron/osx-sign</a> 工具完成</p><p>(來源：<a href="https://www.electron.build/code-signing)">https://www.electron.build/code-signing)</a></p><p>而另外 notarization 的動作需要另外自行整合 <a href="https://github.com/electron/notarize/">electron/notarize</a> 工具實現</p><h3>Notarytool 除錯教學</h3><p>當你遇上 notary 相關問題，可以參考此章進行除錯</p><h4>列出所有 notary event history</h4><p>xcrun notarytool history</p><p>列出所有 notary history 後，找最近的 submit uuid，再使用下列指令弄明白為何 notary 失敗了</p><h4>取得特定 notary event info</h4><p>xcrun notarytool info ${UUID}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acb502749a7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Widevine CDM Error Code 38 Reproduce Guide]]></title>
            <link>https://bunnybit.medium.com/widevine-cdm-error-code-38-reproduce-guide-6c245b534b1f?source=rss-be1e8186c4f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c245b534b1f</guid>
            <category><![CDATA[widevine]]></category>
            <category><![CDATA[drm]]></category>
            <dc:creator><![CDATA[BunnyBit]]></dc:creator>
            <pubDate>Tue, 12 Mar 2024 17:17:11 GMT</pubDate>
            <atom:updated>2024-03-12T17:17:11.762Z</atom:updated>
            <content:encoded><![CDATA[<p>This document serves as a guide on how to reproduce the error with system code 38 in the Widevine CDM.</p><h3>Reproduce Step</h3><ol><li>clone git reproduce repo</li></ol><pre>git clone -b fix/reproduce-widevine-cdm-problem git@github.com:et84121/rx-player.git</pre><p>2. install package</p><pre>yarn install</pre><p>3. run dev server</p><pre>yarn start</pre><p>4. open browser, go url <a href="http://localhost:8000/">http://localhost:8000</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EmG5WAtHBfvwaX8d" /></figure><p>5. Open DevTool / Console, follow instruction to apply EMESpy to monitor CDM error<br><a href="https://github.com/peaBerberian/EMESpy.js#including-the-script-directly">https://github.com/peaBerberian/EMESpy.js#including-the-script-directly</a></p><p>6. Click `Reproduce Widevine Error` Button to start reproduce</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CSclf7HorMWYP5ER" /></figure><p>7. Wait for a night, system code 38 error will occur.</p><p>8. While waiting for the error to occur, I recommend closing the DevTool to prevent a large number of log messages from consuming all the memory on your computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DkC7C4nkPKrdvcPD" /></figure><h3>Some Thoughts</h3><p>This error seems to occur probabilistically. However, following the given steps, I was able to reproduce the same error three or four times.</p><p>The key to reproducing this error mainly lies in making concurrent calls to MediaKeySession.update(). I’ve set the number of concurrent jobs to 30.</p><p>I speculate that this error might arise due to a race condition when the CDM is writing the license. I would appreciate it if your team could look into this further.</p><h3>Links</h3><p>Reproduce Repo</p><ul><li><a href="https://github.com/et84121/rx-player/tree/fix/reproduce-widevine-cdm-problem">https://github.com/et84121/rx-player/tree/fix/reproduce-widevine-cdm-problem</a></li><li>this is a fork version of <a href="https://github.com/canalplus/rx-player">RxPlayer</a></li></ul><p>The main code for reproduction is in this file.</p><ul><li><a href="https://github.com/et84121/rx-player/blob/fix/reproduce-widevine-cdm-problem/demo/full/scripts/modules/player/contentDownload.js">https://github.com/et84121/rx-player/blob/fix/reproduce-widevine-cdm-problem/demo/full/scripts/modules/player/contentDownload.js</a></li></ul><p>EMESpy</p><ul><li><a href="https://github.com/peaBerberian/EMESpy.js">https://github.com/peaBerberian/EMESpy.js</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c245b534b1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python 爬蟲 監察院 調查報告]]></title>
            <link>https://bunnybit.medium.com/python-%E7%88%AC%E8%9F%B2-%E7%9B%A3%E5%AF%9F%E9%99%A2-%E8%AA%BF%E6%9F%A5%E5%A0%B1%E5%91%8A-3dbaea454cbb?source=rss-be1e8186c4f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dbaea454cbb</guid>
            <category><![CDATA[爬蟲]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[BunnyBit]]></dc:creator>
            <pubDate>Tue, 08 Oct 2019 14:02:56 GMT</pubDate>
            <atom:updated>2019-10-08T14:02:56.595Z</atom:updated>
            <content:encoded><![CDATA[<p>記錄一下爬取監察院調查報告中的過程思路<br>TA 是那些對於對於網頁分析較為不熟悉的朋友們</p><p>過程中使用的工具組合有</p><ul><li>Python</li><li><a href="https://beautifulsoup.readthedocs.io/zh_CN/v4.4.0/">Beautiful Soup 4</a></li><li><a href="https://requests.kennethreitz.org/en/master/">requests</a></li><li>concurrent.futures</li><li>Json</li></ul><p>最後兩個是python 的內置套件<br>一個為了開thread來加速用<br>一個是將爬下來的資料轉存為Json用</p><h3>觀察</h3><p>首先進入監察院網站<br>點擊左側 <strong>監察成果 -&gt; 調查報告</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BdLRjDGFNKvDuAA1pXjpOQ.png" /></figure><p>看了看網址</p><p><a href="https://www.cy.gov.tw/sp.asp?xdUrl=./CyBsBox/CyBsR1.asp&amp;mp=1&amp;ctNode=910">https://www.cy.gov.tw/sp.asp?xdUrl=./CyBsBox/CyBsR1.asp&amp;mp=1&amp;ctNode=910</a></p><p>xdUrl? 這參數有點特別 可能是用 iframe 連結到另個 site 的</p><p>開 devTool 來看看</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*lWhX2c6yD85x-aQqWKiscw.png" /></figure><p>果不其然 是用 iframe 嵌入的呢!<br>點擊 src 上的網址<br> <a href="https://cybsbox.cy.gov.tw/CYBSBoxSSL/edoc/list/inv">https://cybsbox.cy.gov.tw/CYBSBoxSSL/edoc/list/inv</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z-fRpk66tYiVUzcsSCfoXg.png" /></figure><p>看來這個URL才是調查報告真正的site location</p><p>再來是分頁的部份<br>目前我知道實作分頁的有幾種方法</p><ul><li><strong>HTTP Get <br></strong>把 page number 當參數發出 <br>也就是會在網址上觀察到page number 類似的參數<br>但點了幾頁後網址沒什麼變化</li><li><strong>HTTP Post</strong></li><li><strong>Ajax</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*Ad56xAZ68e0uFpiWzE9kFQ.png" /></figure><p>檢查一下 分頁 button 元素看看有沒有什麼線索</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*NQB6wYSku0OEgCzANJzT4A.png" /></figure><p>看來點擊後會觸發 goPage() 此 JS 函式呢</p><p>正要翻翻此段函式在哪時<br>往上一看<br>不就正是它本人麻</p><pre>function goPage(page){<br>   $(&#39;#page&#39;).val(page);<br>   $(&#39;#form1&#39;).submit();  <br>}</pre><p>看來它做的動作有</p><ul><li>找到 id=page 的html元素 把page值塞給它</li><li>找到 id=form1 元素 進行submit</li></ul><p>這不就正是一個表單嘛<br>那這個表單在哪呢？<br>其實不大不小<br>翻翻source code 後就可以找到了</p><pre>&lt;form id=&quot;form1&quot; action=&quot;/CYBSBoxSSL/edoc/list/inv&quot; method=&quot;post&quot;&gt;<br> &lt;input id=&quot;page&quot; name=&quot;page&quot; type=&quot;hidden&quot; value=&quot;0&quot;&gt;<br> 審議日期：<br> &lt;select id=&quot;fromYear&quot; name=&quot;fromYear&quot;&gt;<br>  &lt;option value=&quot;&quot;&gt;全部&lt;/option&gt;<br>   &lt;option value=&quot;2019&quot;&gt;108&lt;/option&gt;<br>   &lt;option value=&quot;2018&quot;&gt;107&lt;/option&gt;<br>   &lt;--略--&gt;<br> &lt;/select&gt;年<br> &lt;select id=&quot;fromMonth&quot; name=&quot;fromMonth&quot;&gt;<br>  &lt;option value=&quot;&quot;&gt;全部&lt;/option&gt;<br>  &lt;option value=&quot;1&quot;&gt;1&lt;/option&gt;<br>  &lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;<br>  &lt;--略--&gt;<br> &lt;/select&gt;月<br>  至<br> &lt;select id=&quot;toYear&quot; name=&quot;toYear&quot;&gt;<br>  &lt;option value=&quot;&quot;&gt;全部&lt;/option&gt; <br>   &lt;option value=&quot;2019&quot;&gt;108&lt;/option&gt;<br>   &lt;option value=&quot;2018&quot;&gt;107&lt;/option&gt;<br>   &lt;--略--&gt;<br> &lt;/select&gt;年<br> &lt;select id=&quot;toMonth&quot; name=&quot;toMonth&quot;&gt;<br>  &lt;option value=&quot;&quot;&gt;全部&lt;/option&gt;<br>  &lt;option value=&quot;1&quot;&gt;1&lt;/option&gt;<br>  &lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;<br>  &lt;--略--&gt;<br> &lt;/select&gt;月<br> &lt;font color=&quot;red&quot;&gt;<br>   調查案號輸入範例：099司調0001<br> &lt;/font&gt;<br> &lt;br&gt;<br>調查案號：<br> &lt;input id=&quot;searchNo&quot; name=&quot;searchNo&quot; type=&quot;text&quot; value=&quot;&quot;&gt;<br>案件性質：&lt;select id=&quot;caseAttrLv1&quot; name=&quot;caseAttrLv1&quot;&gt;<br>    &lt;option value=&quot;&quot;&gt;請選擇&lt;/option&gt;<br>    &lt;option value=&quot;內政&quot;&gt;內政&lt;/option&gt;<br>    &lt;option value=&quot;外交&quot;&gt;外交&lt;/option&gt;<br>    &lt;option value=&quot;國防及情報&quot;&gt;國防及情報&lt;/option&gt;<br>    &lt;option value=&quot;財政&quot;&gt;財政&lt;/option&gt;<br>    &lt;option value=&quot;經濟&quot;&gt;經濟&lt;/option&gt;<br>    &lt;option value=&quot;教育及文化&quot;&gt;教育及文化&lt;/option&gt;<br>    &lt;option value=&quot;交通及採購&quot;&gt;交通及採購&lt;/option&gt;<br>    &lt;option value=&quot;司法及獄政&quot;&gt;司法及獄政&lt;/option&gt;<br>    &lt;option value=&quot;少數民族&quot;&gt;少數民族&lt;/option&gt;<br>    &lt;option value=&quot;僑政&quot;&gt;僑政&lt;/option&gt;<br>    &lt;option value=&quot;其他&quot;&gt;其他&lt;/option&gt;    <br>   &lt;/select&gt;<br>   被調查機關：&lt;input id=&quot;unit&quot; name=&quot;unit&quot; type=&quot;text&quot; value=&quot;&quot;&gt;<br> 關鍵字：&lt;input id=&quot;reason&quot; name=&quot;reason&quot; type=&quot;text&quot; value=&quot;&quot;&gt;<br> &lt;input id=&quot;includeAttach1&quot; name=&quot;includeAttach&quot; type=&quot;checkbox&quot; value=&quot;1&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;_includeAttach&quot; value=&quot;on&quot;&gt;含電子檔<br> &lt;input type=&quot;submit&quot; value=&quot;查詢&quot; onclick=&quot;goPage(1);&quot; onkeypress=&quot;goPage(1);&quot;&gt;<br>&lt;/form&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oTZavi4c7BkSNcUkGSWxHw.png" /></figure><p>看來我們不只找了分頁<br>連keyword相關的查詢欄位都找出來了呢</p><p>看來分頁是透過表單發出HTTP Post實作的<br>將需要的欄位id抓一抓 <br>id=”page” id=”reason” <br>本次只需要這兩個欄位 分頁 和 關鍵字</p><p>再來是驗證<br>把 devTool 切換至 Network 分頁<br>在網頁裡下 關鍵字 和 點擊分頁<br>來看看是否真的發出了HTTP Post了</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vbbsps385hFQx6CxtGVcxg.png" /></figure><p>type 為 document 的就是我們跟http server 要回的html file了<br>點它一下後可得</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o0uIa2lx4XLg32lWxMJikQ.png" /></figure><p>右側有個bar拉到底</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TVH5MeDBIJgsLZGZHN1ITw.png" /></figure><p>可以看到我們發出的 HTTP Post request 裡有我們剛剛找的那些欄位</p><h3>動工</h3><p>接著就可以動工開始寫 python 了</p><p>首先是取得想要頁面的code</p><pre>import requests</pre><pre>pages = requests.post(url, data={&#39;page&#39;: str(pageNum), &#39;reason&#39;: &#39;性別平等教育法&#39;, &#39;includeAttach&#39;: 1})</pre><p>這樣就可以獲得特定頁數特定關鍵字的網頁html了</p><p>懶了 直接貼上全部的 Code 😂</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de7e31d2f349f737ef0cf10be1f38822/href">https://medium.com/media/de7e31d2f349f737ef0cf10be1f38822/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dbaea454cbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running ROS on WSL2]]></title>
            <link>https://bunnybit.medium.com/running-ros-on-wsl2-8e191d4e425d?source=rss-be1e8186c4f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e191d4e425d</guid>
            <category><![CDATA[roses]]></category>
            <category><![CDATA[wsl]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[BunnyBit]]></dc:creator>
            <pubDate>Wed, 02 Oct 2019 06:05:59 GMT</pubDate>
            <atom:updated>2019-10-02T06:25:19.256Z</atom:updated>
            <content:encoded><![CDATA[<p>寫這篇目的是記錄一下 “WSL2” 跑 ROS的 一些注意事項<br>避免有人二次踩雷</p><p>基本上還是照著已有的說明走<br> <a href="https://janbernloehr.de/2017/06/10/ros-windows">https://janbernloehr.de/2017/06/10/ros-windows</a></p><p>要注意的部分是這<br><a href="https://github.com/microsoft/WSL/issues/4106">https://github.com/microsoft/WSL/issues/4106</a></p><p>因為 WSL2已經改用微軟自家的虛擬機hyper-v來實作 WSL<br>所以在internet connection上也改用虛擬網卡<br>因此WSL1 的 DISPLAY=localhost:0 反而不對了<br>在localhost上會找不到 windows host 上的 X server</p><p>我在windows 上用的 X server 是 VcXsrv</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*cEPFd-46deh7knzi2a6NhQ.png" /></figure><blockquote>1. put the “-ac” option</blockquote><blockquote>2. select “Disable access control”</blockquote><blockquote>3. nano ~/.bashrc<br><em>export DISPLAY=$(</em> cat /etc/resolv.conf | grep nameserver | awk ‘{print $2}’<em>):0</em></blockquote><blockquote>4. disable “firewall” rule, switched to windows firewall and it by self asks whether to allow this application over the firewall and just select ‘yes’ for that.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e191d4e425d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GOOGLE Drive 相互複製 對拷]]></title>
            <link>https://bunnybit.medium.com/google-drive-%E7%9B%B8%E4%BA%92%E8%A4%87%E8%A3%BD-%E5%B0%8D%E6%8B%B7-8517efe97fb8?source=rss-be1e8186c4f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8517efe97fb8</guid>
            <category><![CDATA[rclone]]></category>
            <category><![CDATA[fast-copy]]></category>
            <category><![CDATA[google-drive]]></category>
            <dc:creator><![CDATA[BunnyBit]]></dc:creator>
            <pubDate>Fri, 23 Mar 2018 19:22:34 GMT</pubDate>
            <atom:updated>2019-02-27T08:17:07.737Z</atom:updated>
            <content:encoded><![CDATA[<h3>前言</h3><p>Google Drive Edu帳號人人有<br>但如果有人和我一樣在原學校不幸被退學</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*-NRQAkBhaQFxYAtkBG6TsA.png" /></figure><p>在新學校又獲得了新帳號，該怎麼把那數TB的資料搬至新帳號呢？</p><p>以下是我使用的方法</p><h3>正文</h3><p>使用工具 Rclone ，經過國外VPS數據中心的高速網路快速的複製，即可。</p><h4><a href="https://rclone.org/drive/#limitations">限制：</a></h4><p>GOOGLE Drive 目前(2018–03-24)限制 每日只能上傳750GB。<br>因此過大的話只能分日上傳。</p><p>Drive有不少限制，使得rclone只能同時上傳兩個檔案，但單檔傳輸率皆極高(much faster at 100s of MBytes/s)，但許多小檔可能需要更長的時間</p><pre>Drive has quite a lot of rate limiting. This causes rclone to be limited to transferring about 2 files per second only. Individual files may be transferred much faster at 100s of MBytes/s but lots of small files can take a long time.</pre><pre>Server side copies are also subject to a separate rate limit. If you see User rate limit exceeded errors, wait at least 24 hours and retry. You can disable server side copies with --disable copy to download and upload the files if you prefer.</pre><p><strong>工具</strong>:<a href="https://rclone.org/"> https://rclone.org/</a><br><strong>VPS</strong>: <a href="https://cloud.digitalocean.com/droplets">https://cloud.digitalocean.com/droplets</a><br><strong>姑狗</strong>: <a href="https://console.developers.google.com/">https://console.developers.google.com/</a></p><h3><a href="https://github.com/ncw/rclone">Rclone</a></h3><p><a href="https://github.com/ncw/rclone">Rclone </a>為一個用GO寫的開源軟體，支援多平台與各種網路空間。<br><strong>安裝 <br></strong>curl https://rclone.org/install.sh | sudo bash <br><strong>設定</strong><br>請參考 <a href="https://blog.csie.io/rclone-loves-google-drive.html">https://blog.csie.io/rclone-loves-google-drive.html</a><br>有些設定選項不要照填，發展中的軟體更改快速，例如現在支援的空間不只13個，Gdrive就被安排到選項11去了。</p><h3><a href="https://m.do.co/c/9a27a09949b2">DigitalOcean</a></h3><p>VPS 選用的是 DigitalOcean，原因只是 Github Edu有送它們的 credit，加上它們對網路流量的限制只是寫好看的而已</p><p><a href="https://m.do.co/c/9a27a09949b2">點選此連結註冊你我都可以獲得10鎂的 credit</a>，我複製了5T的資料也才花3鎂不到。</p><p>DigitalOcean 連 google 的throughput 我使用時平均達到 1700 Mbps upper 。</p><p>在RAM記憶體方面，請依照你使用的參數下去調整你所需要的記憶體。個人經驗是如果你的檔案偏向單檔大於1GB，chunk-size 設定又在64M 以上，可能會需要到8G的記憶體。</p><p>可以使用工具<a href="https://www.howtogeek.com/howto/ubuntu/using-htop-to-monitor-system-processes-on-linux/"> Htop</a> 觀察rclone使用的記憶體。</p><h3><a href="https://console.developers.google.com/">Google Console</a></h3><p>如果你可以取得比以下標準API限制的話，去Google Console拿個新Google Drive Api Key吧。</p><p>詳細可參考：<a href="https://rclone.org/drive/#making-your-own-client-id">https://rclone.org/drive/#making-your-own-client-id</a></p><p>基本上就是以下的API限制造成小檔案複制緩慢。</p><pre><a href="https://stackoverflow.com/questions/42590824/google-drive-rest-api-limitations">Google Drive Rest API Limitations</a></pre><pre>Queries per day 1,000,000,000<br>Queries per 100 seconds per user 1,000<br>Queries per 100 seconds 10,000</pre><h3>開始複製</h3><p>以下是我使用的命令和參數組合</p><pre>rclone copy --drive-chunk-size=64M --transfers=2 --fast-list --stats=10s -v g-ncu:/ g-nccu:/</pre><p>複製時可搭配工具 <a href="https://larrylu.blog/tmux-33a24e595fbc">Tmux</a> 避免突然的斷線造成工作階段結束。</p><p><a href="https://github.com/mattthias/slurm/wiki">Slurm </a>工具可用來圖型化觀察傳輸率。</p><pre>用法<br>slurm -i eth0(網卡名稱 DO預設eth0 可用ifconfig查詢)</pre><h3>參數解釋</h3><p>詳細的說明可以參考Rclone說明 <a href="https://rclone.org/drive/">https://rclone.org/drive/</a><br>下面只是把Drive會用的到說明複製於此，詳細的可回Rclone官網查詢。</p><h4><a href="https://rclone.org/commands/rclone_copy/">rclone copy</a></h4><p>Copy files from source to dest, skipping already copied.</p><h4>—drive-chunk-size=64M</h4><p>Upload chunk size. Must a power of 2 &gt;= 256k. Default value is 8 MB.</p><p>Making this larger will improve performance, but note that each chunk is buffered in memory one per transfer.</p><p>Reducing this will reduce memory usage but decrease performance.</p><pre>A 64M chunk-size is used for performance purposes. <br>Google recommends as large a chunk size as possible.<br>Rclone will use the following amount of RAM at run-time <br><br>    (8MB chunks by default; not high enough)... <br>    RAM = (chunk-size * num-transfers)<br><br>So our command will use larger chunk sizes (more RAM)...<br><br>RAM = 0.5 GB = (64MB * 8 transfers)</pre><h4><strong>— buffer-size=SIZE</strong></h4><p>Use this sized buffer to speed up file transfers. Each --transfer will use this much memory for buffering.</p><p>Set to 0 to disable the buffering for the minimum memory usage.</p><h3>— fast-list</h3><p>When doing anything which involves a directory listing (eg sync, copy, ls - in fact nearly every command), rclone normally lists a directory and processes it before using more directory lists to process any subdirectories. This can be parallelised and works very quickly using the least amount of memory.</p><p>However, some remotes have a way of listing all files beneath a directory in one (or a small number) of transactions. These tend to be the bucket based remotes (eg S3, B2, GCS, Swift, Hubic).</p><p>If you use the --fast-list flag then rclone will use this method for listing directories. This will have the following consequences for the listing:</p><ul><li>It <strong>will</strong> use fewer transactions (important if you pay for them)</li><li>It <strong>will</strong> use more memory. Rclone has to load the whole listing into memory.</li><li>It <em>may</em> be faster because it uses fewer transactions</li><li>It <em>may</em> be slower because it can’t be parallelized</li></ul><p>rclone should always give identical results with and without --fast-list.</p><p>If you pay for transactions and can fit your entire sync listing into memory then --fast-list is recommended. If you have a very big sync to do then don’t use --fast-list otherwise you will run out of memory.</p><p>If you use --fast-list on a remote which doesn’t support it, then rclone will just ignore it.</p><h3>— transfers=N</h3><p>The number of file transfers to run in parallel. It can sometimes be useful to set this to a smaller number if the remote is giving a lot of timeouts or bigger if you have lots of bandwidth and a fast remote.</p><p>The default is to run 4 file transfers in parallel.</p><h3>-v, -vv, — verbose</h3><p>With -v rclone will tell you about each file that is transferred and a small number of significant events.</p><p>With -vv rclone will become very verbose telling you about every file it considers and transfers. Please send bug reports with a log with this setting.</p><p>Use this sized buffer to speed up file transfers. Each --transfer will use this much memory for buffering.</p><p>Set to 0 to disable the buffering for the minimum memory usage.</p><h3>— checkers=N</h3><p>The number of checkers to run in parallel. Checkers do the equality checking of files during a sync. For some storage systems (eg S3, Swift, Dropbox) this can take a significant amount of time so they are run in parallel.</p><p>The default is to run 8 checkers in parallel.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8517efe97fb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[各種光世代小知識]]></title>
            <link>https://bunnybit.medium.com/%E5%90%84%E7%A8%AE%E5%85%89%E4%B8%96%E4%BB%A3%E5%B0%8F%E7%9F%A5%E8%AD%98-b40817b0563d?source=rss-be1e8186c4f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b40817b0563d</guid>
            <category><![CDATA[pppoe-relay]]></category>
            <category><![CDATA[光世代]]></category>
            <category><![CDATA[光纖上網]]></category>
            <category><![CDATA[中華電信]]></category>
            <dc:creator><![CDATA[BunnyBit]]></dc:creator>
            <pubDate>Fri, 23 Mar 2018 18:09:29 GMT</pubDate>
            <atom:updated>2018-03-23T18:09:29.239Z</atom:updated>
            <content:encoded><![CDATA[<p>最近家裡新裝設了中華電信光世代的100m/40m<br>在裝設的過程中學習到了不少事情，因此來做個記錄</p><p><strong>[硬體部份]</strong></p><p>我家並不是真的光纖到家(FTTH，H指的是Home)，它大約只有到我家社區門口(FTTB，B指的是Building)，之後再走雙電話線進來我家(使用之技術為VDSL2)，接著進ZyXEL P883數據機。</p><p>從光纖節點到進家裡的這部份，稱之為最後一哩(The Last Mile)，依據現在中華電信的做法有三種：<br>1、直拉光纖進家，這是最好的，不再多說。<br>2、以單電話線入家，次等。<br>3、以雙電話線入家，最差。通常是在離光化箱過遠時才會這麼做，缺點不少：PING過高(由於雙線bonding的關系)、容昜產生串音干擾(產生斷線之現像)。</p><p>以目前中華電信的立場來說，它們是支持光纖入府的，但光纖吃基本建設，有時又會遇到路權問題而無法埋設線路。<br>就目前網路上看到的資訊，是可以要求中華電信幫改為光纖入府的，如有遇到問題可以找當區中華電信<strong>規設科</strong>同仁詢問。</p><p>個人經驗是在打電話與中華電信溝通後，經過兩次場勘與和社區委員討論後，兩三個月後開始施工。過程中因走暗管埋設不行，現場討論後改以明管鋪設。</p><p><strong>[軟體部份]</strong></p><p>PPPOE(Point-to-Point Protocol Over Ethernet)，從字面上的意思來看就是為一種建立於乙太網路之上的點對點協議，這個協議的層級是位於OSI模型裡的連結層，中華電信靠這種方式來讓機房之機器能與你家電腦溝通。</p><p>NAT(Network Address Translation)網路位址轉換，這是一種由於ipv4位址的不足而流行起來的技術，主要是可藉由一個真實ip來讓後端為數不少的電腦共用此真實ip來上網的技術。現成流行的路由器、ip分享器、wifi分享器都具有此功能。</p><p>為什麼講這兩個技術呢？</p><p>需要知道現今中華電信的數據機大多已經擁有<br>1.硬體PPPOE撥接<br>2.NAT<br>3.Wifi AP<br>4.PPPOE Relay 這幾種功能。<br>因此1+2+3可以讓小烏龜直接變成普通家用wifi分享器<br>而因P883具有pppoe relay之功能，所以就算是位於P883 後的電腦，也可以經由pppoe再撥號來取得真實ip來上網，這樣就可以免掉需要設定port forwarding的煩惱，以及如果有在打game的話，直接以電腦進行撥號也可以降低ping值。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b40817b0563d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Ubuntu 16.04 筆電上省電招數]]></title>
            <link>https://bunnybit.medium.com/linux-ubuntu-16-04-%E7%AD%86%E9%9B%BB%E4%B8%8A%E7%9C%81%E9%9B%BB%E6%8B%9B%E6%95%B8-d554b51c0f1c?source=rss-be1e8186c4f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d554b51c0f1c</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[power-save]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[BunnyBit]]></dc:creator>
            <pubDate>Fri, 23 Mar 2018 17:55:53 GMT</pubDate>
            <atom:updated>2018-03-23T17:55:53.998Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. PowerTop</h3><p><a href="https://01.org/powertop/">PowerTOP</a> 是個分析、監控電力消秏的節能工具程式，它是由 Intel 於 2007 年以 <a href="http://www.gnu.org/licenses/gpl-2.0.html">GPLv2</a> 授權釋出的開放原始碼專案。我們可以使用它找出 GNU/Linux 上秏電的套件，並透過停用不必要的功能以達到省電的效果，是筆記型電腦 (Laptop) 必裝的實用工具。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qYpRltMrIkSdItqv.png" /></figure><h4>安裝方法</h4><pre># Debian, Ubuntu</pre><pre>$ sudo apt install powertop</pre><h3>2. 安裝 intel 圖形驅動程式</h3><p>現在市面上筆電普遍是intel的CPU，大多有整合圖形晶片，安裝相關的驅動程式不僅可以有效加速圖形介面的繪製時間，也可以有效的省電</p><p>官網<a href="https://01.org/zh/linuxgraphics"> INTEL® GRAPHICS FOR LINUX*</a></p><p><strong>安裝方法</strong></p><p>安裝時，請選擇 update tool，選擇適合自已的版本(<strong>注意ubuntu 17.10已經不再使用Xorg做為預設的桌面圖形server</strong>)，下載解壓縮後，裡面有script可以圖形化安裝。</p><p>下載網址 <a href="https://01.org/zh/linuxgraphics/downloads/update-tool">intel grapics Update_tool</a></p><h3>3. Nvidia 專有驅動程式</h3><p>現今筆電上大多使用intel內顯而已，如果是標榜有外顯的筆電，通常是N家的顯示晶片，可以關掉它來減少電力的消耗。</p><p>使用Ubuntu 內建的額外驅動程式進行安裝。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/0*VSyRUVwRv60zCpCp." /></figure><p>接著在程式集裡找到nvidia x server settings，切換成使用<strong>intel內顯模式</strong>，減少電力消耗。<br>當然如果你要打電動或是進行3D應用，可以切換回來，加速運算。</p><p>透過以上方法，至少就我來說，筆電從原有100%電量只能用一個半小時，成功提升到可以使用四個小時以上。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d554b51c0f1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>