Category: 自由開源

  • 如何 (濫用) prompt_toolkit 的自動補齊功能做到互動式命令列工具

    Figure 1. 使用 prompt_toolkit multi column autocompletion 功能做出 interactive command line tool. 目標與結論 本文的目標是想要在 command line 做到可以互動式選擇、展開有階層關係的文字列表工具。 使用 prompt_toolkit 的 autocompletion 功能,以及 prompt_toolkit.shortcuts.prompt 的 pre_run hook 達到互動式列表選擇的功能。 動機 寫好 awesome-cli 之後,覺得全部一次顯示的話會花很多時間在滾動捲軸上面 (因為有太多 list item),用 grep 沒有辦法展開一個 section 裡面的東西 (-A -B 的數量很不一致)、然後用 pipe head/less 會出現 BrokenPipelineError。 覺得 tui 太 heavy,因此想要做一個可以簡單選單互動、展開內容的 interactive command line tool. 實做選擇 PyInquirer […]

  • 台灣無線電頻率分配查詢 - Taiwan Radio Frequency Allocations Spectrum Search

    台灣無線電頻率分配查詢 - Taiwan Radio Frequency Allocations Spectrum Search

    輕鬆搜尋台灣無線電頻率分配狀況,提供頻段業務分配以及頻段細項狀況。Search Taiwan Radio Frequency Allocations easily, provide frequency allocation usage & detail. 搜尋來源:台灣無線電頻率分配表 (2020/09 核定本) GitHub: mlouielu/Taiwan-Radio-Frequency-Allocation-Spectrum

  • NGINX 設定 WebDAV (HTTPS + Authentication)

    為了能夠自由的同步 Zotero 中的論文,我們可以透過 WebDAV 來同步電腦中的論文到雲端上。以下分為四個步驟介紹如何在 Ubuntu 使用 NGINX 設定帶有 HTTPS、Auth 的 WebDAV 功能。 A. 安裝與設定 NGINX 安裝 nginx-full (dep: libnginx-mod-http-dav-ext) $ apt install nginx-full 加入 WebDAV 設定檔 $ sudo nano /etc/nginx/sites-available/webdav.conf $ cd /etc/nginx/sites-enabled $ ln -s ../sites-available/webdav.conf . webdav.conf 內容 如果你要使用 domain name,請在 listen 前面補上 server_name server_name your-webdav-domain.com; B. 測試 NGINX WebDAV (w/o HTTPS/Authentication) […]

  • 상처팔이 (Sell My Heart) 羅馬拼音歌詞 - 鄭基高 - MCT

    韓文歌詞 알 거 없잖아궁금해 하지마내가 말했잖아피곤하게 하지마 적당히더 바라지마내게 많은 것을 바라지마나보다 나를 더 아는척하지마웃기잖아니 맘대로 와서상처받았다니 어쨌다니우리 사이가 뭐냐니계속 그런 말 하려거든 가렴어쩌면 난 너를 원했는지도 몰라아냐 그랬나 봐 그래서 니가이렇게 날 숨막히게 하나 봐이런 또 내 탓인가 봐미안하게 됐네언제나 내가 망치게 되네미안하긴 한데상처받았다니 어쨌다니우리 사이가 뭐냐니그런 말할 거면아예 모르는 사람처럼지내는 게 나을걸난 아무런 […]

  • 編譯帶有除錯資訊的 LLVM/Clang library 並於編譯時替換 dynamic library

    編譯帶有除錯資訊的 LLVM/Clang LLVM CMake Build Reference: https://llvm.org/docs/CMake.html LLVM Getting Started: https://llvm.org/docs/GettingStarted.html 快速編譯以及快速連結請參考 LLVM Getting Started 的 Common Problem 的 CMake 選項,上面的範例 CMake 選項已經將 Common Problem 的選項開啟 (或關閉)。 替換編譯時使用的 dynamic library CMake - CMakeLists.txt Makefile 編譯連結時出現 undefined reference to `llvm::DisableABIBreakingChecks' 確認 include directories 是不是正確的: target_include_directories( foobar PUBLIC /home/llvm-project/build/include) 確認編譯 LLVM/Clang 時是否有加上 LLVM_ENABLE_ABI_BREAKING_CHECKS=OFF 可以透過 cmake . 來更新 […]

  • 在 Linux 上處理 GoPro Hero 6 影片 GPS 資料

    TL; DR: 一團糟。 買這種運動攝影機,規格什麼的都不是重點,記得先去看軟體支援度跟後製的問題比較重要。尤其一到了 Linux 上什麼都跟沒有差不多。 GoPro 沒有 GPX 從  GoPro 的資料夾裡面我們可以發現沒有任何的 GPX 檔,只有影片本身而已。沒有 GPX 檔就很難處理 GPS 的資料。 網路上搜尋後,看到 stilldavid/gopro-utils,原來是把資料放在影片裡面。透過 ffprobe 可以看到這個 datastream: [crayon-65692bd997741965434053/] Stream #0:2(eng), handler_name GoPro MET 的 datastream 就是我們要的東西。 上面提到的 gopro-utils 已經幫你做好 parsing 的部份,只要照著內文的說明就可以......失敗了! 從影片擷取 GoPro 資料流 總之,GoPro Hero 6 沒有辦法透過 handler_name 來指定,需要用這個方式才可以: [crayon-65692bd997748860740151/] 把 -map 直接用 id 來指定就可以了。 自行處理的部份 stilldavid/gopro-utils 提供從影片中分離出 GPS data 的方式。可是秒數精度不夠 […]

  • IOTA-Python - A Pure-Python implementation of IOTA node

    IOTA-Python - A Pure-Python implementation of IOTA node

    IOTA-Python - A Pure-Python implementation of IOTA node The target of IOTA-Python is to create a pure Python implementation of IOTA node, and to learn about how IRI works. Currently, it can read out the data from IRI rocksdb without IRI RESTful API. Why? It gave you the full access power of the IRI database! GitHub: […]

  • Deploy IOTA IRI (IOTA Refernce Implementation) full node on Arch Linux

    Deploy IOTA IRI (IOTA Refernce Implementation) full node on Arch Linux

    IOTA IRI is the reference implementation of IOTA nodes. There are some pain about IOTA documentation on the GitHub, after some explore, I note the step for others to reduce the pain of install and running IOTA iri in full node. 0x1 Installation of IRI on Arch Linux On Arch Linux, there have a aur/iri, so […]

  • 我在 2017 年 8 月中前在 CPython 的貢獻

    我在 2017 年 8 月中前在 CPython 的貢獻

    我從 2017 年的 2 月下旬開始踏入 CPython contribute 的領域。自 CPython 在 2017 年 2 月 24 日首次合併我所提交的 patch 之後,我在這段期間持續的為 CPython 貢獻了一些的 patches 以及 pull requests。這篇文章記錄了我這段時間的狀況。 合併統計 [crayon-65692bd9983de864547901/] 共計 19 個 patches 被合併進入 master branch,其中多數為 IDLE 相關的 patches,其中 bpo-30523 由 Victor Stineer metor 下完成,可以參考 Victor Stinner - New Python test.bisect tool。 PR 統計 在 GitHub 上尚為 Open 的 […]

  • 使用 Python 套件 twstock 抓取台股股票資料 - 01 如何入門

    使用 Python 套件 twstock 抓取台股股票資料 - 01 如何入門

    說到 Python 上面的台股股票套件,大家第一時間一定是想到 toomore/grs,可以說是紅到不能再紅的一個套件。但是他壞掉了。所以誠心向大家推薦改用 mlouielu/twstock。 mlouielu/twstock 以簡潔為目標,延續 toomore/grs 的方便功能 (內建分析,四大買賣點),重新設計一套新的可用的台股抓取套件,同時支援基本市況報導網站的即時資料蒐集。讓大家可以專注在爬蟲設計上面。 使用的方法很簡單,透過 pip install 就可以裝載最新版的 twstock: [crayon-65692bd9987ba710449901/] 使用範例: 抓取單檔 (台積電 2330) 股票歷史紀錄 [crayon-65692bd9987bf196738883/] 抓取單檔 (台積電 2330, 旺矽 6223) 股票即時資料 [crayon-65692bd9987c1698812206/] 抓取多檔股票即時資料 [crayon-65692bd9987c3920824545/]   了解更多 想要了解更多,可以到 twstock - GitHub 觀看原始碼。如果想要了解更多功能,可以到 twstock - documentation 觀看詳盡的文件。如果還是不知道該怎麼做,請來 twstock - gitter 發問。 此外,也歡迎共同貢獻,請使用 GitHub 的 issues 以及 Pull Request 功能。感恩!