Normal view

There are new articles available, click to refresh the page.
Before yesterdayRoy Li's Blog

Iceland 2024.08

25 August 2024 at 03:24
home

🇮🇸Iceland 2024.08

notion image
notion image
notion image
💡
照片还在更新中
 
Roy Li © 2024

让 Tailscale MagicDNS 和 Surge 共存

1 June 2024 at 17:30
home

🧭让 Tailscale MagicDNS 和 Surge 共存

Surge 和 Tailscale 因为同为网络工具存在互相冲突的情况,一直以来我都不得不关闭 Tailscale 的某些功能使其工作。这篇文章试图使用一些特殊方法绕过限制,让 Tailscale MagicDNS 和 Surge 共存。
💡
@Blankwonder 审阅这篇文章后更新了 Surge for Mac,现在已经能够正常使用 <machine name>.<tailnet name>.ts.net 域名,如果你想省略 <tailnet name> 可以继续往下读。

什么是 Tailscale MagicDNS

Tailscale can automatically assign DNS names for devices in your network when you use the MagicDNS feature.
Tailnet 内的设备会被分配一个唯一的 100.64.0.0/10 地址。你可以直接访问这个 IP 地址,但是正如直接使用 IP 网上冲浪是个坏主意,直接使用 IP 也不是个好主意。所以 Tailscale 会为每个 IP 也分配一个 ts.net 的地址。
这个域名并非公网 DNS 能够解析,而是由 Tailnet 内 100.100.100.100 这个 DNS 服务器解析的。这一 DNS 服务名叫 MagicDNS。
notion image
如图,你只需要记得 machine name,并且开启 Tailscale MagicDNS,你只需要在浏览器中输入 https://monitoring 就相当于访问 https://onitoring.yak-bebop.ts.net:443

问题

当 Tailscale 启动时它会在路由表中写入下面的内容,告诉系统遇到这些 IP 的请求就交给 Tailscale 的 utun 接口。
然而当 Surge 的高级模式开启时,Surge 处于某种原因无法将 DNS 查询的数据包发往 utun9,即便你在规则中写了这样的规则。
这个限制似乎并不发生在 TCP 请求,因为后面的解决方案无需加入这些的规则。
💡
这个问题在新版的 Surge for Mac 中已经得到解决

解决

我在浏览 Tailscale 文档时发现,他们提供了 API 接口来获取所有的实例名称和地址,这样就能自己实现一个 DNS 解析。下面是脚本内容。
⚠️
如果你加入了多个 Tailnet,这个脚本并不适用!
使用脚本之前,你需要准备三个字段:
  • TENANT_ID
    • notion image
  • TAILNET_NAME - 你可以在 这里 找到,填入包含 ts.net 的名称
  • ACCESS_KEY - 你可以在 这里 申请 API access tokens,有效期最长 90 天

使用

接下来你便可以使用 <machine name>.ts.net 来连接对应的主机实例。
这个方案无法实现 search domains 所以你至少需要写上 ts.net。由于我不考虑多个 Tailnet 的情况,也不需要记住你 Tailnet 的名称。

注意

  1. 脚本的 Key 只有 90 天有效期,你需要定期更新
  1. 每次访问 *.ts.net 只要域名解析未过期都会发起一次请求,通常这不是问题,如果你遇到了问题可以在评论中告诉我
Roy Li © 2024

更加高效的 Surge Ponte 网络分流

31 May 2024 at 08:00
home

🏃‍♂️更加高效的 Surge Ponte 网络分流

背景

自从 Ponte 上线以来,我就一直用它来实现外网访问内网的隧道。这个方案稳定,适应不同类型的宽带网络,无论是 NAT 网络还是公网 IP 都能无感回家。最近无意发现一直以来使用的配置有一个微小的缺陷所以用这篇文章来记录优化的过程。

起因

我家的网段是 192.168.114.0/24 ,Surge 的配置中有这样一段:
这样即便身处内网连接也会通过设备 PYCELLE 转发。我家的大部分网络服务都位于这台设备上,但同时也有 NAS 和路由器。一般情况下这么写都没问题,但如果遇到 Mac mini 升级我的 Surge 就完全无法访问内网,电脑使用 NAS 备份也会先经过一次 PYCELLE 再去到 NAS,略显低效。

解决

解决的思路很简单,在家时直连 192.168.114.0/24 ,在外面时先隧道连接 PYCELLE 再去到目标的地址。Surge 提供 Rule 类型的脚本,能够很容易解决这个问题。
是的,我家所有联网的设备都以 GOT 角色或者城市命名了。
这个脚本主要的判断依据有三点:
  1. 是否连接了家里的 WiFi 热点
  1. 有线连接的设备是否使用 192.168.114.1 作为网关
  1. 连接的目的地是否位于 192.168.114.0/24
另外为了使这个脚本生效,你还要在配置中引入它:
因为我家的内网网段比较简单,所以使用了 String.prototype.includes ,假设你家的内网有多个网段可能需要下面的函数来判断子网。
 
Roy Li © 2024

Apple TV + LG C2 + SONOS Beam + Dolby Atmos 配置

26 November 2023 at 01:00
home

🎵Apple TV + LG C2 + SONOS Beam + Dolby Atmos 配置

·Roy·comments
Created Time
前不久从 Grover 租了个 SONOS Beam Gen 2,在配置 Dolby Atmos 时遇到了点小问题,在这里记录一下最终的配置方法。
notion image
SONOS Beam 是一款很实惠并且支持 Dolby Atmos 的回音壁。最近德国 Grover 黒五给出了很实惠的价格我就果断下手了。本来是想租 Arc 的,但苦于我家电视无法壁挂,不能给 Arc 流出足够空间,只能退一步要了 Beam。
这篇文章虽然是关于 Dolby Atmos 的配置,但我想提一下解决另一个有趣的问题。LG C2 的底座高度非常矮,根本无法在不改造底座的情况下容下任何回音壁。我在 Reddit 上意外碰到有个老兄给电视垫了一个 Ikea LACK 书柜架,完美留出一个 Beam 的高度,这才解决了不凿墙使用回音壁的问题。
这款书架的高度是 5 厘米,长和宽非常适合 LG C 系列的底座。书架和底座的高度之和约为 11 厘米。
好了,进入正题。

Beam 的配置

注意你需要把回音壁连接至电视的 eARC 接口。LG C2 的 HDMI 2 是 eARC 接口。

电视的配置

  • 「音频 Sound」-「音频输出 Sound Out」-「使用有线扬声器 Use Wired Speaker」,选择「HDMI(ARC) Device」
  • 「音频 Sound」- 「高级设定 Advanced Settings」-「选择 HDMI 输入音频格式」,选择「比特流 Bitstream」
    • notion image
  • 「音频 Sound」- 「高级设定 Advanced Settings」-「DTV 音频设定 DTV Audio Settings」,选择「自动 Auto」
  • 「音频 Sound」- 「高级设定 Advanced Settings」-「eARC 支持」,选择「开启 On」
    • notion image
  • 「音频 Sound」- 「高级设定 Advanced Settings」-「数字音频输出 Digital Sound Output」,选择「自动 Auto」
    • notion image
    • 虽然这个设定选择「直通 Passthrough」似乎更合理,但事实是只有选择自动 Dolby Atmos 才能被正确传输到 SONOS

Apple TV 的配置

notion image
如果你能在「设置」-「视频和音频」-「音频格式」中看到如截图所示的样子,「沉浸式音频」处于「开」的状态,则说明设置成功。

验证

随便找一部支持 Dolby Atmos 的电影,如果你能在 SONOS 应用中看到标识则说明音频流被正确识别。
notion image
 
All rights reserved
Except where otherwise noted, content on this page is copyrighted.
Title: Apple TV + LG C2 + SONOS Beam + Dolby Atmos 配置 - Roy Li's Blog
URL: https://royli.dev/blog/2023/apple-tv-lg-c2-sonos-beam-dolby-atmos-configuration
Roy Li © 2023

奥本海默 IMAX 全球观影指南

22 July 2023 at 06:00
home

奥本海默 IMAX 全球观影指南

·Roy·comments
Created Time
奥本海默已上映,这篇文章将帮助你寻找最适合自己的 IMAX 影厅,并顺便分享一些网络上找到和奥本海默有关的视频。
首先是 橙红Iris 带来的影厅选择指南。视频客观对比了 IMAX 和杜比影院的硬件数据和实际体验,我觉得对身在海外的朋友们非常有用。
Video preview
片中她分享了 Arvin 老师 整理的全球 IMAX 影厅的 specifications,数据之详尽可以让 nerd 们原地下跪。
下面是一些和奥本海默相关的视频。
IMAX 70mm 胶片如何拼接
Video preview
如何放映 IMAX 70mm 胶片(南半球唯一一家能够放映 15/70 胶片的影院)
Video preview
 
All rights reserved
Except where otherwise noted, content on this page is copyrighted.
Title: 奥本海默 IMAX 全球观影指南 - Roy Li's Blog
URL: https://royli.dev/blog/2023/oppenheimer-imax-guide
Roy Li © 2023

Blog, recharged

13 July 2022 at 03:30
home

Blog, recharged

·Roy·comments
Created Time
I’ve been using Typlog as my blogging platform for the past few years. It’s been an excellent product for many reasons — extremely low friction editing experience, easy-to-use dashboard, reliability. I have to admit that I don’t write very often, but when I do, it doesn’t give me a hard time. However, an idea has been keeping bugging me for the past few months.
Typlog and other blogging platforms, like Ghost.org (paid version), promise a user-friendly experience, but they’ve rarely used “customization” as a selling point. Typlog supports code injections, custom header/footer, custom HTML contents, etc, which are already better than many blogging platforms (some of the features need the Pro plan). However, customizing a component on the website is still very hard. For example, preview links like Notion.
notion image
Typlog has added the link preview support for some websites, like Douban and IMDB, still not as good as Notion.
Another reason that made me really think about migrating to somewhere else was that engineering a dynamic personal website isn’t really different from engineering a product. It’s a great opportunity to learn and experiment stuff. If you look at Brian Lovin’s personal website, it literally has everything you could think of.

Options out there

Self-host Ghost

It’s funny that before I moved to Typlog, I was using the self-host Ghost and now it’s become an option again. Developing a custom theme for a Ghost blog is tremendous work, not to mention adapting to the big yearly update. Many third-party packages like the S3 storage package haven’t been updated for years. It takes time to keep your instance and theme updated.
The paid service is good, however, it’s not cheap as I’m not a regular blogger, I also don’t need the subscription management feature.

Static Site Generation

Static Site Generation (SSG) is a quite enticing option as it can be very flexible in styling and other customization aspects. It’s now much easier to generate the website in an automated way, such as using GitHub Actions, as compared to the old way, doing everything locally.
This solution (Gatsby, Hugo, Hexo…) satisfies my current needs. However, if I want to add dynamic content in the future it’d be difficult for the following reasons:
  • The solutions don’t include a running service, which means I’d need another service to output the dynamic content.
  • Generating happens in build time, the time consumed only grows over time.

Notion + X

Notion is more than capable of being a CMS, and it’s free! The problem left is how to render the content to a browser, like a blog. There are quite a few cool services doing so.
However, I don’t want to spend more than 10 bucks a month on this 😈.
Spencer first introduced his idea back in 2021, which uses Next.js as the renderer. It got my eyes.

Notion + Next.js

Next.js probably is one of the coolest projects in the React community. It’s made by Vercel, which probably is one of the coolest companies out there.
Next.js gives different ways to deliver your content.
  • Server-Side Rendering (SSR)
  • Static Site Generation (SSG)
  • Client-side Rendering (CSR)
The last one is what I want to talk about.
If you’ve ever used the SSG before, you know everything hosted on your server is rendered at build-time, meaning if you want to add or change content, you need to build again. ISR, however, doesn’t require the subsequent building. A page would be built when someone accesses the URL. Pages that have already been built can also be updated upon new requests once become expired. How cool is that?
Since it essentially is a Next.js service, it’s up to you to decide which parts are dynamic and which aren’t.
In order to render blocks from Notion, you’ve got two options.

Digest the raw data and render them

Notion has its official API now. You can query your database, search content and many stuff through the API.

react-notion-x suite

react-notion-x consists of two essential parts:
  1. notion-client - A wrapper of the Notion private API used by their clients.
  1. react-notion-x- A collection of React components that transform the raw data into actual pages with Notion-like styling.
Yes, it uses private APIs. The author published another package notion-compat to make it possible to use the official API, but it has a few drawbacks (see the link).
You’d be amazed by how much react-notion-x can do out of the box. Kudos to Travis Fischer.

Blog, recharged

What you are seeing right now is the recharged blog that results from my days of work. I have to say “thank you” to Spencer because I copied a lot of things from this blog so that I could have this MVP this fast. I strongly recommend you to read these posts about his website if you are interested in the idea (promise me you will come back).
My blog uses both the official and the private API because the former one handles Collections better and the latter one handles rendering better.
royli.dev
geekdadaUpdated Mar 7, 2023
Apart from copying things from Spencer’s website, I tried to solve the problems Spencer mentioned in his post.

Image

Notion stores images (and other assets) on the S3 service. The image URLs you get from Notion’s API, either the private or the public, are signed. They are short-lived instead of permanent. There’s a chance that the page generated by Next.js is still valid but the URLs are expired, and the viewer gets a bunch of 400 errors.
resource-proxy
geekdadaUpdated Mar 7, 2023
Introducing the Resource Proxy (I know, I’m bad at naming). What it does is shown below.
notion image
The key used for indexing each asset is calculated based on the identifier. When the same identifier is requested, no matter what the signature is, the Resource Proxy always point to the same file in the private S3 bucket.
notion image
Unlike the Notion S3 bucket, which takes permission very seriously, we don’t need to react if the author changes the permission. Once the asset is saved, it’s there forever.
The Resource Proxy takes care of the dimension as well. It saves the image in a temporary place, probes the dimension using
probe-image-size
nodecaUpdated Aug 30, 2023
, then saves the metadata to the database. The metadata makes it possible to use next/image.

What’s left

RSS feed

If you have subscribed to my blog, the feed still works, just without the main content. Generating the body content in an RSS feed is not easy as Next.js only allows outputting HTML content unless you fiddle with _server.ts.

Tag and search

Will be available soon.

The end

I really enjoyed the process of building this website, especially when I could control almost everything however I’d like.
All rights reserved
Except where otherwise noted, content on this page is copyrighted.
Title: Blog, recharged - Roy Li's Blog
URL: https://royli.dev/blog/2022/blog-recharged
Roy Li © 2023

借由 Litestream 方便备份你的 SQLite 数据库

5 June 2022 at 04:23
home

借由 Litestream 方便备份你的 SQLite 数据库

·Roy·comments
Created Time
SQLite 数据库有着管理简单、功能丰富等优点,很多时候我都偏向于在个人项目或者部署开源项目时选择使用 SQLite,而不是 MySQL 或者 PostgresQL。 这么做虽然开机一时爽,但是时间久了就会在不同服务器的不同目录下留下一个个数据库文件。如何备份他们成了一件头痛的事情。

什么是 Litestream

Litestream 是一个用 Go 编写的,用于 SQLite 数据库的流式复制工具。它作为一个单独的后台进程运行,并不断地从磁盘上复制写前日志页到一个或多个副本。这种异步复制提供了类似于 Postgres 或 MySQL 等数据库服务器的灾难恢复。
SQLite 有一个名为 "WAL"(预写日志)的日志模式。它首先将数据库页面的变化写入一个单独的 -wal 文件,然后再将这些页面复制回主数据库文件。这让 SQLite 提供了安全的原子事务,因为如果一个事务被回滚,它可以简单地删除 WAL。如果页面直接写入数据库文件,那么在回滚时就没有办法取回原始的页面数据。WAL 也允许读事务在事务开始时有自己的数据库快照视图,因为同一数据库页面可以有多个实例分布在数据库文件和 WAL 中。然而,WAL 不断增长,所以最终页面必须被移回数据库文件,以便 WAL 可以重新开始记录。这个过程被称为 检查点,只有在没有事务的情况下才能进行。这就是 Litestream 复制 SQLite 的关键所在。
上面一段翻译自 Litestream 文档
Litestream 除了使用简单的优点,它还省钱。我目前所有备份的数据库加起来不到 500MB,一个月只需几十美分(默认备份频率和快照留存配置)。
notion image

Getting Started

💡
本文以 Ubuntu 系统为例
为了避免本文随时间推移而过时,请参照 官方文档 进行安装。安装完成后 Litestream 便会以守护程序的方式随系统启动。
安装完成之后你就可以编辑它的配置文件 /etc/litestream.yml
  • 关于配置文件完整的解释请看 这里
编辑结束后就可以重启 Litestream。
成功!
notion image

如何恢复

All rights reserved
Except where otherwise noted, content on this page is copyrighted.
Title: 借由 Litestream 方便备份你的 SQLite 数据库 - Roy Li's Blog
URL: https://royli.dev/blog/2022/use-litestream-to-duplicate-sqlite-databases
Roy Li © 2023

EdgeRouter 为特定设备设置 DHCP Option

28 December 2021 at 23:52
home

EdgeRouter 为特定设备设置 DHCP Option

·Roy·comments
Created Time
对于开启了 Surge 高级模式的局域网来说,分别配置网关和 DNS 无疑是痛苦的。我们既希望 Apple TV 这样的设备能利用 Surge,又希望普通的上网设备,如智能家居,能直接连接路由器。你可以使用 Surge 的路由器功能,但这不是适用所有人的解决方案。这篇文章会介绍如何使用 EdgeRouter 来给局域网内的特定设备分配独立的 DHCP 配置,节约你的宝贵时间。
首先说明我使用的设备和系统版本:
另外需要说明的一点是,这篇教程不依赖路由器系统内置的 dnsmasq,可以直接在现有的 DHCP 配置上做修改。
我不能保证其它版本也能如法炮制,不过其它型号应该都能参考这篇教程。

分配静态 IP

在 EdgeOS 中,想要独立配置 DHCP Option,分配静态 IP 是必不可少的。请先为你要配置的设备设置一个静态的 IP。
notion image

配置 DHCP Option

这篇教程会使用 GUI ,也就是 Config Tree,进行配置。
service / dhcp-server / shared-network-name / LAN / subnet / 192.168.114.0/24 / static-mapping 下找到你要配置的设备。
notion image
这时候右边会显示下面的表单。
notion image
ip-addressmac-address 已经被预先填入,你需要做的就是增加两项 static-mapping-parameters。假如你的 Surge 网管地址是 192.168.114.10 则你需要在两个输入框内填入下面的字段。
你可以一次性配置多台设备,或者分别预览后保存。配置成功后重新连接设备 Wi-Fi 即可生效。
All rights reserved
Except where otherwise noted, content on this page is copyrighted.
Title: EdgeRouter 为特定设备设置 DHCP Option - Roy Li's Blog
URL: https://royli.dev/blog/2021/edgerouter-dhcp-option-settings-6451115f
Roy Li © 2023

EdgeRouter 配置 UPnP2 方法

25 July 2021 at 08:00
home

EdgeRouter 配置 UPnP2 方法

·Roy·comments
Created Time
我使用路由器系统为 EdgeRouter X v2.0.9-hotfix.2。其面板中提供的 UPnP 选项为旧版本的 UPnP,若要配置 UPnP2 则需在 Config Tree 或命令行中完成。
另外附上一个用于 NAT 类型检测的工具,不过很可惜只支持 Windows。
NatTypeTester
HMBSbigeUpdated Aug 30, 2023
 
All rights reserved
Except where otherwise noted, content on this page is copyrighted.
Title: EdgeRouter 配置 UPnP2 方法 - Roy Li's Blog
URL: https://royli.dev/blog/2021/setup-upnp2-on-edgerouter
Roy Li © 2023

一种方便管理 iOS 壁纸的方法

28 January 2021 at 20:52
home

一种方便管理 iOS 壁纸的方法

·Roy·comments
Created Time

下载捷径

如何使用

在文件应用中,找到你想要的图片,如图操作。
notion image
这里顺便推荐一下 Irvue。它可以读取你 Unsplash 里的影集和喜欢的图片,自动更改 macOS 的壁纸。你可以将它保存图片的路径设置到 iCloud Drive 或其它同步盘的目录下,这样手机也能直接使用这些壁纸。是不是特别方便?
真是简单到我都不好意思写这篇文章。
All rights reserved
Except where otherwise noted, content on this page is copyrighted.
Title: 一种方便管理 iOS 壁纸的方法 - Roy Li's Blog
URL: https://royli.dev/blog/2021/manage-ios-wallpapers
Roy Li © 2023

2020 年度总结

11 January 2021 at 08:00
home

2020 年度总结

·Roy·comments
Created Time
以前从来没有写过年度总结,一方面自己懒,另外一方面觉得自己写东西实在不是什么好手,当众露怯就不好了。2020 对我的影响实在是太大了,所以逼迫自己写下这篇年度总结,希望自己不要忘记这一年发生过的事情。
在 2019 年 11 月的时候,我和一家位于德国柏林的公司 SumUp 签订了劳动合同,原计划 2020 年 3 月入职。入职前的这段时间里我的工作就是准备签证,并且搬离广州。就在准备前往柏林开启我人生的新篇章时,我的 2020 开始了。

工作

我预约面签的时间是 1 月 21 日。这一天广州还不太能感受到疫情的影响,我前往领事馆的路上大概只有 20% 的人戴着口罩。我和家人预计这场疫情可能会比 SARS 缓和,因为政府已经经历过了 SARS 的考验。这时候我觉得就算疫情肆虐中国,我可能也已经离开了。
签证的补交材料在 2 月前公司同事复工并且回到办公室后才得以集齐。这时候,我已经和公司沟通推迟原本定于三月的开工日期,SumUp 非常理解地同意了我的提议并且暂不决定新的日期。
非常不幸的是,我的公司由于无法提供领事馆需要的疫情期间入境豁免证明(工作紧迫性证明),我的签证一直拖到 9 月都无法被批准。这时公司已经无法再继续等待,便和我签署了解除劳动关系合同。这份豁免证明按照领事馆的书面规定应该由雇主提供,但是我的签证官却要求必须增加一份德国政府部门出具的工作紧迫性证明。

再次找工作

抱着最后一搏的想法,我又开始投简历。在经过了一个月密集的面试后,我最终敲定了另一家位于柏林的公司 Klarna
2020 年 12 月我再一次来到德国领事馆,提交了新的签证申请,不知道这回结果会怎样。
在找工作期间,有不少推友找到我想让我分享找工作的技巧。网络上已经很多找工作和面试的经历分享,这里我就说一个没有人提及的技巧吧。
大家都希望能进耳熟能详的大厂,但现实可能自己只够得到自己不认识公司的要求。如何快速筛选出处在自己喜欢的领域、具备合适规模(规模太小可能不愿意招收来自中国的应聘者)的公司呢?介绍给大家 Crunchbase。Crunchbase 类似国内的企查查,通过它你可以了解到一家公司的规模、财务状况、融资信息、新闻等等。借助 7 天的 trial Pro 账户,你还可以检索到同领域同规模的其它公司。由于他们的规模和领域类似,假如有一家邀约面试那另外几家八成也会向你投来橄榄枝。
notion image
你还可以借助 LinkedIn 和 Glassdoor 来进行交叉比对,判断一家公司是否适合自己。

Side Projects

因为没有全职工作,2020 年我在 side projects 上花费了很多时间。通过这些业余项目,让我有机会尝试没有用过的技术,我认为这是业余项目带给我最大的价值。

Surgio

Surgio 2020 年总共发了 50 多个版本,收获了 439 个 star,月下载量超过 5000。
我在 Surgio 中尝试了:
  1. React:在前公司写了好几年 Vue,结果找工作时几乎都是要求 React。这个项目让我重拾了多年前写过的 React。
  1. Serverless:为了方便部署 Surgio Gateway,我对比了国内国外多种 Serverless 的部署方案,调研了不同方案下的开发和维护体验,最终选定 Vercel。

YASD

YASD 的诞生主要是为了解决我自己的需求,另一方面也是为了想尝试一下 CSS-in-JS 这种开发模式的体验如何。
这个项目开发和优化花了一两周的时间,收获了 100 个 star。
项目中用到了:
  1. sumup-oss/circuit-ui:这个 UI 框架是之前我准备入职公司的开源项目。虽然他们不要我了但是我觉得这个框架还挺好看的,而且基于 emotion 开发也可以帮助我更好了解 CSS-in-JS。
  1. tailwindcss:Tailwind 在 2020 年确实火了一把,并且奇迹般地实现了商业化并且盈利了。我在这个项目中使用 Tailwind 来开发 circuit-ui 无法满足的组件样式,体验非常爽。

A Translator

我一直想开发一个收费服务,体验维护一个商业项目的全流程,便有了 A Traslator。这个服务通过调用 DeepL 的 API,借助我开发的软件集成来实现文字翻译。
目前这个服务上线了快两个月,实现了账面上的收支平衡。没有计算我自己的劳动力投入,不过还是达到了我预期的目标。
项目中用到了:
  1. Stripe:不得不说 Stripe 的开发者服务实在是太完善了,从接入支付到售后都让我给钱给得心服口服。
  1. Chrome Extension:这会终于体验了一次开发 Chrome 插件是怎样的,如何封装插件、组织内测、分发插件。
  1. Strapi:我在自己的私活里用过 Strapi,这个项目的后台和 API 也是通过 Strapi 完成的。Strapi 开箱即用的特点非常适合用在小项目里,同时也提供了便利的方式自定义拓展。它也有一个很突出的问题,就是文档不够全面和及时,不少功能仅是一笔带过,经常需要浏览源码和 issue 才能搞懂。
  1. 有客:来自新小科技的有客是一个刚面世不久的客服系统,免费额度刚好能够满足我这样小项目的需求。他们的 Slack 集成也快上线了。
  1. Datadog:在面试 Klarna 时得知他们的前端团队使用 Datadog 来监控应用性能和健康度,我就在自己的项目里加入了探针,自己切身体验 Datadog。Datadog 确实非常方便,只需简单配置便可在不侵入代码的情况下实现完备的 Node 应用健康度监控。

其它

除了上面用 Node 实现的工具和服务之外,我还在学习 Go。最近我写了两个小工具 steam-otpflomo-cli。不得不说在开发体验上 Go 真的高过 Node 不知道多少。
另外,我终于在 30 岁之前拿到了驾照。

新的一年

2020 给我开了个大大的玩笑,我对 2021 唯一的希望就是他比 2020 更好,即使只是好一点点我也愿意。
最后,感谢各位在我最沮丧时激励我的家人和朋友;Twitter 上帮忙转发的推油和 @chemhack 的雪中送炭。
notion image
 
All rights reserved
Except where otherwise noted, content on this page is copyrighted.
Title: 2020 年度总结 - Roy Li's Blog
URL: https://royli.dev/blog/2021/2020-year-in-review
Roy Li © 2023

DeepL Translate for Bob

17 December 2020 at 08:00
home

DeepL Translate for Bob

·Roy·comments
Created Time

下载插件

bob-plugin-deepl-translate
geekdadaUpdated Jul 7, 2022

介绍

notion image
插件本身支持直接调用 DeepL API,但是因为 DeepL 的 API 计划收费较高让很多人望而却步。为此,我又额外开发了一个 API 可以让你以比较低的价格使用 DeepL API。如果感兴趣可以到 这里 查看。对了,这个服务叫 A Translator。
我已经开发了支援 A Translator 的 Shortcuts, Taio 和 Bob 的插件,可以让你非常爽地在 iOS 和 macOS 上使用 DeepL 服务。你可以在后台找到他们的下载地址。

头图来自 Raphael Schaller
All rights reserved
Except where otherwise noted, content on this page is copyrighted.
Title: DeepL Translate for Bob - Roy Li's Blog
URL: https://royli.dev/blog/2020/yi-ge-fan-yi-api-5fa95c7d
Roy Li © 2023

使用 IFTTT 来添加 flomo 条目

17 December 2020 at 08:00
home

使用 IFTTT 来添加 flomo 条目

·Roy·comments
Created Time
flomo 已经以光速支持了从 API 导入条目,这为我们使用 flomo 提供了更多的可能性。这篇文章我会以 Pocket 为例,教大家如何用 IFTTT 来自动添加加星文章到 flomo。
因为 IFTTT 的 Webhook 程序(applets)无法分享,大家只能举一反三来自己建立程序。

新建一个程序

我们先选择一个触发器。这里我们选择 "New favorite item"。
notion image
随后,再选择一个服务。搜索 "Webhooks" 即可找到 Webhooks 服务。这个服务只有一个动作,那就是发起一个请求。
notion image
将你的 flomo API 填入 URL,其它菜单项如图填入。
notion image
最后一项 Body 你可以抄我的,也可以自己发挥。需要注意的是,变量需要用 <<<>>> 包裹,不然将无法调用 API。
Body
效果
notion image

问题

Pocket 本身有标签系统,但是因为 IFTTT 的限制我们无法将 Pocket 的标签转变为 flomo 的标签。希望将来 flomo 能拓展其 API 把此链路打通。
如果你还没开始使用 flomo,欢迎使用我的 推荐链接 注册。通过此链接注册你可获赠 14 天 PRO 会员!
欢迎各位在评论区分享你有什么借助 IFTTT 实现的好点子吧!
All rights reserved
Except where otherwise noted, content on this page is copyrighted.
Title: 使用 IFTTT 来添加 flomo 条目 - Roy Li's Blog
URL: https://royli.dev/blog/2020/using-flomo-with-ifttt
Roy Li © 2023

一个命令行工具 —— croc →

18 October 2020 at 22:33
home

一个命令行工具 —— croc →

·Roy·comments
Created Time
croc
schollzUpdated Aug 30, 2023
croc is a tool that allows any two computers to simply and securely transfer files and folders. AFAIK, croc is the only CLI file-transfer tool that does all of the following:
  • allows any two computers to transfer data (using a relay)
  • provides end-to-end encryption (using PAKE)
  • enables easy cross-platform transfers (Windows, Linux, Mac)
  • allows multiple file transfers
  • allows resuming transfers that are interrupted
  • local server or port-forwarding not needed
  • ipv6-first with ipv4 fallback
  • can use proxy, like tor
notion image
All rights reserved
Except where otherwise noted, content on this page is copyrighted.
Title: 一个命令行工具 —— croc → - Roy Li's Blog
URL: https://royli.dev/blog/2020/croc-cd6c9b87
Roy Li © 2023
❌
❌