Need to create some signed-url links, using following command. gsutil signurl -d 2d service-account-key.json gs://my-gcs-bucket/my-object But the response keeps auguing The signurl command requires the pyopenssl library (try pip install pyopenssl or easy_install pyopenssl) Already check those variables and install …
Read More以前就一直很愛用 ruby 提供的 securerandom 來產生隨機字串, 但之前長時間使用 Python2 進行開發,一直忽略了 Python3 應該也會有類似的 module, 直到昨天有需求又查了一下發現,ㄏㄏ早在 3.6 就有提供這個 module 了,試一下跟 securerandom 87% 像,推薦給大家 簡單來說用 secrets 的好處是比起傳統 random module 產生出來的隨機字串 更具有密碼學上的安全性 更快,更簡單可以產生字串 原理的話其實就是用 os.urandom 取代 random module 內的擬隨機演算法
偷懶版本,要注意 32 是 bytes, …
Read More身為一個資料水管工,在開發的時候常常需要用 docker compose 把整套 Airflow 拉起來測試, 這時候我的 intel-based 筆電常常就會起飛,在咖啡廳都被路人瞪,讓我非常不好意思。 昨天試玩了一下 OrbStack,覺得好棒棒 第一點是 OrbStack 啟動速度超級快! 以前覺得 Docker Desktop 記憶體吃太兇的時候就想讓他重開,要等等上一分鐘, 現在 OrbStack 啟動只要數秒,連偷個懶都不行,很不方便。 再來是資源使用率部分, Memory 顯著有感,以前大概會吃到 10G swap,換了之後大概只吃到 3G, CPU 部分也滿不錯,之前開 Docker Desktop 的時候其他東西都 …
Read MoreJSON_VALUE_ARRAY 只吃 scalar value 任何不在 {string, number,boolean} 都會變成 NULL, 像是 select JSON_VALUE_ARRAY('{"product_ids": [UCCU]}', "$.product_ids"); – Row f0_ 1 null 但如果裡面有 NULL 則會噴錯 select JSON_VALUE_ARRAY('{"product_ids": [null]}', "$.product_ids"); Array cannot have a …
Read More自從用 markdown 開始寫工作日誌與筆記,一直放在 iCloud 上面,之前看到 iCloud 掉資料的新聞覺得好像還是有必要多異地備份一下,那時候選了 S3,看重的當然是 11 nines 的耐用性,這樣畢生筆記萬無一失了吧。 這陣子發現 Cloudflare 的 R2 可以開始用 beta 版本了,基於我本人是 Cloudflare 無腦粉,馬上就想把目前的筆記也丟一份放在上面,於是就來研究一下。 首先 Cloudflare R2 跟 S3 一樣是 11 nines,對外宣稱的耐用性跟 S3 一樣,再來是每 GB 價錢,R2 目前是 $0.015 per GB per month,跟 S3 Virginia $0.023 …
Read More買了 BOOX note5 之後, 覺得電子紙螢幕呈現效果真舒服, 所有要長時間閱讀的東西都想丟進去. 另外發現雖然系統用 Android 11, 理論上可以裝所有 Android App, 包含瀏覽器, 不過在裝了一堆 App 發現都是虛幻, 排版與文字呈現還是用 epub 格式最好. 本次範例使用 EbookLib, requests 以及 mark_mew 大大的關於我幫新公司建立整套部屬流程那檔事 為範例 感謝 mark_mew 大大分享自身經驗 另外粗粗產生出來的 epub 還是有很多排版問題要修, 像是圖片不見了, script tag 跑出來了, 在過一層 strip_tags 應該會好一點. 看來最適合的還是轉小說進 …
Read More在家工作之後,幾乎都是用公司筆電,一些個人專案不小心套到公司 email 設定, 想說可能要寫個 script 來處理,沒想到一行就解決了。 git config –local user.name "Kaneshiro Takeshi" git config –local user.email "your_email@example.com" git rebase –root –exec 'git commit –amend –no-edit –reset-author'
Read More跟登山小夥伴走了劍龍稜,天公賞臉,給了一個晴天,殊不知這樣的好天氣是這次行程最大的挑戰。 整路幾無遮蔭的曝曬,讓我狂噴汗,體力消耗得非常快。 隊友也受抽筋所苦,所幸受熱心山友贈與的鹽巴,讓症狀緩解不少。 中途在 555 峰休息的時候,拿出早上在瑞芳車站前買的有夠香飯糰,但沒什麼食慾,咬了一口又默默放回背包… 劍龍稜一定要挑個好天氣走啊,時程長,也不是很好撤退。 但回頭看照片大家都是笑的,形象管理做得非常好(? 成為山羊的感覺 快樂的上坡 快樂的下坡 解鎖新視角,基隆山 & 茶壺山 劍龍稜還會想在爬,不過讓我先休息個兩年吧。
Read MoreS3 does support the HTTP range request It’s useful when you want the partial lines from a big file. By aws s3 command line aws s3api get-object –range bytes=0-10000 –bucket=[BUCKET] –key=[KEY] partial_results
Read MoreTry to switch to jupterlab, the cpu/mem graph looks greeeat. https://github.com/jtpio/jupyterlab-system-monitor But install n-times, the graph still no showing. Thanks my colleague Bill, indicate the version issue of nbresuse Reinstall the package, finally works! $ brew install node $ pip install jupyterlab $ pip …
Read More