avatar
boketuiguang
分享利用RP2040 DIY 实体密钥
只需不到十元 用 RP2040 DIY 一条 YubiKey FIDO2 物理密钥 简介:利用RP2040来DIY一个袖珍的实体验证密钥,成本只需约十元
avatar
boketuiguang
记录折腾HomeAssistant的过程
最近重新拾起了对HA的兴趣,遂在博客里记录折腾过程 目前共有三篇博客: Docker 部署 Home Assistant 并接入米家与 ESPHome Home Assistant 绑定米家账号后怎么刷新设备列表 Home Assistant 配合小米人体传感器 2s 实现人走关灯 欢迎评论交流
avatar
busylog
openwrt firewall4 rules if zones settings are all reject
WAN DHCP and LAN DHCP. note that WAN DHCP input is already given by openwrt default. uci add firewall rule uci set firewall.@rule[-1].src='lan' uci set firewall.@rule[-1].name='lan-dhcp-in-dst68' uci set firewall.@rule[-1].proto='udp' uci set firewall.@rule[-1].dest_port='68' uci set firewall.@rule[-1].target='ACCEPT' uci set firewall.@rule[-1].family='ipv4' uci add firewall rule uci set firewall.@rule[-1].dest='lan' uci set firewall.@rule[-1].name='lan-dhcp-out-src68' uci set firewall.@rule[-1].proto='udp' uci set firewall.@rule[-1].src…
avatar
鱼翅
上帝搬石头:关于三值逻辑的一些胡思……
叠甲时间 这是一篇纯主观的胡思乱想,内容仅涉及简单的哲学和逻辑学概念,诸位看官且当个乐子看看就行,轻喷~ 看小品就看小品,你胡思乱想个啥? 《喜人奇妙夜》这个节目挺有意思的,之前经常刷到切片,里面有些作品属实脑洞大开,时而让我大半夜笑出了声。之前刷到一个作品,讲述一个哲学家、一个灯神、一个打劫犯的故事,灯神想要赶紧实现完三个愿望退休,哲学家想要一个真心热爱哲学…
avatar
busylog
Celebrate HLS support on Chrome 142+
You can use more browsers than players? Requirements: the Header Editor extension from https://he.firefoxcn.net/ if something can play on ffmpeg/mpv but not browser? "headers": { "user-agent": "Lavf/58.29.100", "referer": "_header_editor_remove_" } if something triggered direct downloads (application/octet-stream)? "condition": { "regex": "\\.m3u8" }, "headers": { "content-type": "application/vnd.apple.mpegurl" }, this might be useful as well. %{start msedge -argumentlist ("-inprivate", $_)} other interesting redirection: (.*)/flutter_bootstrap\.js(.*) -> $1/main.dart.js$2 Domains: font.googleapis.com -> font.googleapis.cn ajax.googleapis.com -> cdnjs.cloudflare.com
avatar
busylog
Notes for migrating to new iPhone
keep the old phone until finance/banking apps are successfully tested, and record related info first. but delete the app wont actually hurt as long as you dont wipe the phone to reset device id. remove most cards from Apple Pay, it will be saved to the cloud but some needs cvv / sms / phone verification later. you cant receive SMS until the entire transfer ends so you wont be successful re-enable those cards, so do it later. delete those Chinese apps that could simply re-login with mobile number and SMS (unless chats/files are valuable), it saves time…
avatar
Rei
【Rei on Rails】#13 TailwindCSS + DaisyUI 简介
介绍 TailwindCSS + DaisyUI 在 Ruby on Rails 中的使用。 视频 https://www.bilibili.com/video/BV1yDyaBCEpX/ 引用 Tailwind CSS https://tailwindcss.com/ daisyUI https://daisyui.com/ CSS Utility Classes and "Separation of Concerns" https://adamwathan.me/css-utility-classes-and-separation-of-concerns/ Adam Wathan - Tailwind CSS: It looks awful, and it works - Rails World 2023 https://www.youtube.com/watch?v=TNXM4bqGqek
avatar
Rei
【Rei on Rails】#12 RubyGems 分裂?
梳理 RubyGems 分裂出 gem.coop 事件的始末。 视频 https://www.bilibili.com/video/BV1YLWvzYEn8/ 引用 Ruby Central’s Attack on RubyGems https://pup-e.com/goodbye-rubygems.pdf Strengthening the Stewardship of RubyGems and Bundler https://rubycentral.org/news/strengthening-the-stewardship-of-rubygems-and-bundler/ A board member's perspective of the RubyGems controversy https://apiguy.substack.com/p/a-board-members-perspective-of-the Why I'm not rushing to take sides in the RubyGems fiasco https://justin.searls.co/posts/why-im-not-rushing-to-take-sides-in-the-rubygems-fiasco/ Ruby Central’s “security…
avatar
Rei
在 Rails 应用实现用户行为统计
本文介绍如何用 ahoy/groupdate/chartkick 实现用户行为统计。 B 站视频 https://www.bilibili.com/video/BV1ysxCzLEnH/ 代码摘要 ahoy https://github.com/ankane/ahoy 安装 Ruby 库: gem "ahoy_matey" bundle install rails generate ahoy:install rails db:migrate 配置 API: # config/initializers/ahoy.rb Ahoy.api = true 安装 JavaScript 库: npm add ahoy.js 修改 app/javascript/applicatoin.js: import ahoy from "ahoy.js" window.ahoy = ahoy Ruby 收集: ahoy.track "event_name", language: "Ruby" JavaScript 收集: ahoy.track("event_name", {language: "JavaScript"}); groupdate https://github.com/ankane/groupdate 安装库: gem "groupdate…
avatar
busylog
Some simple ideas that can be done in minutes with any chat AI
simple progress and deliverables are important for programming/ai beginners. 1 expand script curl supports [1-99] like number enumeration, and bash supports {a,b,c,d} list expand. write a python script that expand argv[1]. (seq -f "%g" number also works though) 2 pastebin note that in python 3.14, there is no more multipart parser to accept file upload easily. save the file/text under upload-timestamp-randomnumber.txt and use Content-Type application/octet-stream for any file/text display. 3 line joiner or slot joiner(if all keyword appeared, display in order) script filename a…
avatar
电子芥末
加密币钱包助记词保护器
为了安全,本项目采用完全本地运行的 HTML 和 JS, 完全不使用第三方库。 比金属板打点更好 我的灵感来源是这个 onekey 金属板打点 但我认为金属板有两个问题:1. 贵; 2. 不够安全。 于是我想出了这个替代方法,用汉字来代替打点,比金属板更安全、更不怕丢失,而且还免费 使用方法 项目地址 https://github.com/ahui2016/wallet-passphrases-protector 下载本项目的全部 html 和 js 到本地,双击打开 index.html 即可开始使用。 基本原理 随机生成一个英语单词与汉字…
avatar
电子芥末
极简 Markdown 阅读器
Safe and Simple Markdown Reader in the Browser 浏览器里的 Markdown 阅读器,极简,安全。 使用浏览器阅读 Markdown 的好处 不需要安装软件 如果你和我一样同时使用 Firefox/Chrome 等多个浏览器, 那么,使用本阅读器就能确保 markdown 文档里的链接在当前浏览器里打开。 极简 只有一个 HTML 文件,包含 HTML CSS JavaScript 一共不到 100 行代码。 安全 不安装软件,不安装浏览器插件,减少危险因素。 自由 真正脱离任何生态。 回归本质, Markdown 文档就是纯文本文档,可以自由地使用任何文本编辑器…
avatar
Rei
Geeknote 开源
很高兴的宣布,Geeknote 已经开源,仓库位于 https://github.com/chloerei/geeknote 。 为什么开源? 开源的想法由来已久,其中一个原因是开源很酷。我管理的另一个社区 Ruby China 是开源的,Geeknote 借鉴的网站之一 dev.to 是开源的,所以我也想把 Geeknote 开源。 另一个原因是我想给 Ruby on Rails 社区提供一个新手友好的开源项目。Rails 的开源项目不少,知名的例如 Discourse、GitLab、Chatwoot 等。但这些项目由于历史积累和业务复杂度,其实不适合新手阅读。 什么是…
avatar
Rei
Turbo Stream Broadcast - 被低估的 Rails 功能
我一直认为,把 Rails 作为前后端分离项目的后端是一种浪费。类似于在 Mac 上安装 Windows 系统,没有什么可以阻止你这样做,而且看起来很美好:Windows 系统更大众化,Mac 硬件做工好,似乎是强强联合。但是深度 Mac 用户会知道,这丢失了很多软硬件一体化设计的优势。 Rails 优势在于前后端紧密集成,有的功能只有在全栈环境下才能使用,Turbo Stream Broadcast 就是其中一个。Broadcast 在官方文档中只有一个小节的介绍,并且没有完整示例,可能…
avatar
Rei
LLMRPG - 用于角色扮演的大语言聊天应用
最近做了一个用于角色扮演的大语言聊天应用,想跟大家分享。 这个应用可以给 AI 设定各种角色,然后跟这些角色进行聊天。支持私聊和群聊,并且自己可以扮演其中的角色参与聊天。 示例: 为了方便体验,我部署了一个在线版本:(已下线) https://app.llmrpg.com/ 注意在线版本的数据不加密,我可能会观察使用情况来改进应用。 如果你注重隐私,这个项目已经开源,可以尝试自己部署: https://github.com/chloerei/llmrpg 使用方法 注册账号。 到“角色”创建角色定义…
avatar
Muspi Merol
为什么不用静态分析来实现 HMR
几个月前,我看到 How to build Hot Module Replacement in Python 这篇文章,讲的是用他们的 Tach 这个 Python 静态分析工具,可以获得一个依赖图,类似这样的键值格式: { "a.py": ["b.py", "c.py"], "b.py": ["d.py"], "d.py": ["e.py"], "c.py": ["f.py"] } 说起来,这个项目上个月开始 unmaintained 了 😅 一问才发现原来是开发者跑去 AI 创业了。我觉得网友说的挺好: I guess that's the issue with open source tools being backed by VCs. These tools will never…
avatar
busylog
iPhone Shortcuts tips
Generate QR Code (from Clipboard, Show in Quick Look) Great way to transfer short text/url between devices. Extract Text from Images (OCR, from Clipboard, Show in Quick Look) Automation: When NFC card is detected (set some Speak? action) Note that it is the most quick way to confirm NFC functionality is working, without 3rd party apps. check SEID in Settings. if it is available then the secure element is working. the antenna may not be connected correctly (NFC antenna is a loop, one connect to small antenna, and one connect to rare case). iPhone does NOT support reading / connecting…
avatar
Rei
daisyUI - 我找到了理想中的 UI 库
我已经有几年时间没有使用 UI 库,近几年的项目我都是从头开始写 UI,小到按钮、对话框,大到响应式布局。原因是以前的 UI 库样式千篇一律,又难以定制,我宁愿从头开发。 重复了几次后,我感觉累了。UI 优化是没有尽头的,工作量已经影响到功能开发。有时我会觉得,如果自己没有 CSS 经验,就不会花那么多时间在 UI 上了。 最近开始一个新项目的时候,我决定放弃什么都自己做的想法,选一个过得去的…
avatar
busylog
One liner powershell for ipv6-literal.net
Read-Host "Enter IPv6 address" | %{ ($_ -replace ':','-' -replace '%','s') + '.ipv6-literal.net' }
avatar
busylog
Example Windows Sandbox conf (wsb)
<Configuration> <AudioInput>false</AudioInput> <VideoInput>false</VideoInput> <MemoryInMB>8192</MemoryInMB> <MappedFolders> <MappedFolder> <HostFolder>C:\Users\USER\Downloads</HostFolder> <SandboxFolder>C:\Users\WDAGUtilityAccount\Downloads</SandboxFolder> <ReadOnly>false</ReadOnly> </MappedFolder> </MappedFolders> <LogonCommand> <Command>netsh advfirewall firewall add rule name="SearchHost.exe" dir=out action=block program="C:\Windows\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\SearchHost.exe" enable=yes</Command> <Command>netsh advfirewall firewall add…