• Backup and Restore Kubernetes Volumes with Velero Restic Integration

    中文版: 使用Velero Restic集成备份及恢复Kubernetes数据卷 – Frank’s Weblog

    I built a Kubernetes cluster using OpenEBS as the storage backend. I selected Jiva as the storage engine, Jiva is a high-available storage controller, data is replicated to all nodes. To ensure the safety of the data, I used Velero and its Restic integration to backup the volumes to AWS S3.

    Install

    To install Velero CLI on your computer, see Velero Docs – Basic Install for install instructions.

    Prepare the kubeconfig. The kubeconfig should be placed in .kube/config and make sure kubectl get pod returns the correct result.

    Create an AWS credentials file with the following format, this credential should have access to the s3 bucket you provide below, note down the path to the file.

    (more…)
    Read more: Backup and Restore Kubernetes Volumes with Velero Restic Integration
  • ISO期权的行权及税务

    本文仅作为分享,不构成任何投资及税务建议。投资收益及AMT税务非常复杂,如果你是利益相关者,请务必自己花时间研究或咨询会计师。

    前段时间,我在公司工作满一年后收到了前25%的股票期权。对于如何处理这些期权,我进行了一些研究。

    和上市公司或PreIPO公司发放的RSU(Restricted Stock Unit, 受限股票单位)相比,Stock Options潜在的收益更大,同时风险也更高。全职员工通常拿到的是ISO(Incentive Stock Options)期权,另一种期权是NSO(Non-Qualified Stock Option),本文不作讨论。

    ISO期权在拥有一些税务优势的同时也会产生很大的税务风险。简单来说,ISO期权可能让你获得一大笔钱,或是(花钱买来的)一堆废纸,甚至在最坏情况下,可能让你因为税务破产。要在规避风险的同时使收益最大化,需要提早规划并谨慎操作。

    本文只讨论ISO期权的行权策略及联邦层面的税务问题。关于股票期权的基础知识请参考如下资源 :

    jlevy/og-equity-compensation: Stock options, RSUs, taxes

    Equity 101 Course

    Stock options explained for startup employees | Carta

    (more…)
    Read more: ISO期权的行权及税务
  • macOS Ventura Developer Beta5/Public Beta3 休眠期间重启Bug的解决方案

    我在我的2019 MacBook Pro上升级了macOS Ventura Public Beta3(22A5321d)之后出现了合盖休眠期间重启,并在唤醒之后丢失之前工作内容的问题。

    问题

    在macOS Ventura Developer Beta5/Public Beta3中,将MacBook合盖休眠后可能会遇到如下两个问题:

    1.再次开盖唤醒时无法从休眠中恢复,屏幕显示如下界面。长按电源键强行重启后可以正常启动。

    2.启动后屏幕弹出如下对话框,点击任意选项之后可以正常进入系统,但是之前的工作内容会丢失。(相当于系统重启),无论问题1有没有出现。

    (more…)
    Read more: macOS Ventura Developer Beta5/Public Beta3 休眠期间重启Bug的解决方案
  • Deploy Cloudflare Tunnel on Kubernetes

    中文版:在Kubernetes中部署Cloudflare Tunnel – Frank’s Weblog

    Cloudflare Tunnel is a tunneling service provided by Cloudflare. With Cloudflare Tunnel you can connect the origin to Cloudflare and provide service without exposing any ports on the server or cluster, therefore minimizing the attack surface.

    Cloudflare Tunnel was formerly known as Argo Tunnel. Later Cloudflare Tunnel became part of the Cloudflare Zero Trust and became available to all users for free in 2021[1].

    Cloudflare Tunnel

    Cloudflare Tunnel had several iterations in the past two years, many tutorials on the internet have become outdated. The latest Cloudflare Tunnel needs no configuration on the client (cloudflared) side besides token. All sites (services) can be configured on the Cloudflare web console. If a tutorial asks you to configure the site on Cloudflared through yaml, the tutorial is likely outdated.

    This post will use httpbin as an example to illustrate how to deploy Cloudflared on Kubernetes and serve other services deployed on the cluster.

    (more…)
    Read more: Deploy Cloudflare Tunnel on Kubernetes
  • 在Kubernetes中部署Cloudflare Tunnel

    English Version: Deploy Cloudflare Tunnel on Kubernetes – Frank’s Weblog

    Cloudflare Tunnel 是一个隧道服务,通过Cloudflare Tunnel可以无需在服务器上暴露任何端口的情况下将源站连接到Cloudflare并提供服务,从而降低攻击面。

    Cloudflare Tunnel以前叫Cloudflare Argo Tunnel。后来Cloudflare Tunnel成为了Cloudflare Zero Trust的一部分,并向所有用户免费提供[1]

    Cloudflare Tunnel

    Cloudflare Tunnel在过去两年经过了大量迭代,网络上的很多教程,甚至包括官方的教程都已经过时。最新的Cloudflare Tunnel无需在客户端(Cloudflared)上做除了token之外的任何配置,所有网站(服务)配置都可以通过Cloudflare Web控制台进行。如果一篇教程让你在Cloudflared上通过yaml来配置网站,那么这篇教程大概率是过时的。

    本文将以httpbin为例,介绍如何在Kubernetes上部署Cloudflared并路由Kubernetes上部署的其他服务。

    (more…)
    Read more: 在Kubernetes中部署Cloudflare Tunnel
  • 修复车身的锈迹及喷漆

    由于融雪剂的侵蚀,汽车后轮上方生锈在美国东北部是很常见的现象。我的这辆车从两年前开始,后轮上方出现了一个小锈斑,从去年冬天开始,这块锈开始扩大。如果放任不管的话,它会更快地蔓延,最终变得无法修复。所以我决定修复它。

    其中大部分的步骤参照了ChrisFix的视频,Chris的视频已经讲得很全面了。本文中我将介绍Chris在视频中没有涉及的一些细节,以及一些个人技巧。

    (more…)
    Read more: 修复车身的锈迹及喷漆
  • Troubleshooting Tailscale Network

    中文版:一次Tailscale网络问题的调试过程 – Frank’s Weblog

    As mentioned in an earlier post, I used Tailscale to create a mesh network that connects all of my devices, and I used a cloud server located in AliCloud Beijing as an exit node, in order to access geographically restricted internet services.

    However, I noticed that I could not access the Internet at all when using that exit node. I thought it was a network connectivity issue with the relays, so I didn’t worry too much about it. But afterward, I noticed some other services on that server stopped functioning, so I looked into it and found out that the problem was not that simple.

    First I noticed that I couldn’t access the internet at all from the server, but curl the IP address was working, which indicated the problem with DNS resolution. resolvectl status showed that there were two DNS servers. I assumed this was the DNS server for the Tailscale internal network (actually not, will elaborate later) since the IPs started with 100.100[1],

    Link 2 (eth0)
    ......
      Current DNS Server: 100.100.2.136
             DNS Servers: 100.100.2.136
                          100.100.2.138

    I tried dig @100.100.2.136 baidu.com to check the response from the DNS server and got connection timed out: no servers could be reached. The response from the command became normal after shutting down Tailscale. So probably Tailscale somehow affected the DNS resolution on the system.

    (more…)
    Read more: Troubleshooting Tailscale Network
  • 一次Tailscale网络问题的调试过程

    English version: Troubleshooting Tailscale Network – Frank’s Weblog

    前文提到,我使用Tailscale将我的所有设备组成了一个Mesh网络,并且将位于阿里云北京的轻量应用服务器作为出口节点用于访问一些限制地理位置的网络服务。

    然而我却发现在使用该出口节点时完全无法访问互联网。我本以为是Relay的网络质量问题就没有在意。但是后来陆续发现该服务器上的其他一些服务都出现了问题,于是进行了一番检查,结果发现问题并没有这么简单。

    首先我发现从服务器上完全无法访问互联网,但是直接curl IP地址是可以的,这样就基本上将问题定位到了DNS上。resolvectl status显示有两个DNS服务器,因为IP以100.100打头[1],我以为这是Tailscale内网的DNS服务器(实际上不是,请看后文)。

    Link 2 (eth0)
    ......
      Current DNS Server: 100.100.2.136
             DNS Servers: 100.100.2.136
                          100.100.2.138

    我试图dig @100.100.2.136 baidu.com来检查DNS服务器的回应,得到connection timed out: no servers could be reached.。关掉Tailscale之后,上述命令的回应则正常。因此我认为问题在于Tailscale从某种形式上影响了系统的DNS解析。

    (more…)
    Read more: 一次Tailscale网络问题的调试过程
  • 使用Tailscale组网

    前段时间无意中了解到了Tailscale这个产品。Tailscale是一个基于WireGuard的Mesh组网工具,可以将所有设备连接起来,组成一个大内网。Tailscale是商业软件,免费版最多支持20个设备和一个子网路由,对大多数家用需求来说应该够用了。

    我的需求主要有如下几点:

    外出时访问NAS

    家里的Spectrum网络虽然有公网IP,但是我并没有将NAS的文件服务暴露到公网。我目前使用的是通过端口转发暴露的群晖上自带的OpenVPN,能用但是体验并不好。

    安全访问

    在不安全的网络(如酒店/机场)中加密通讯以保证安全。

    地理位置

    用于访问一些有地域限制的网络服务,比如网易云或B站。

    (more…)
    Read more: 使用Tailscale组网
  • F-1 NRA投资股票帐户/High Yield Saving帐户的税务身份及报税问题

    本文仅作为经验分享,不构成任何税务或法律建议。

    大家都知道F1身份的前五年属于非税务居民(Non-resident Alien, NRA)。但是在券商和银行那里,对于NRA身份往往处理得很混乱。尤其是居住在美国,但又不是税务上的居民,就成了一个很tricky的点,需要在开户和报税时正确处理。

    开户

    通常来说,NRA不能在券商或银行在线开户,必须要去线下。如果在线开户的话,券商通常会默认你是税务居民(Resident Alien, RA),并要求你填写W9表格,所有税表也都会按照RA来处理。

    正确的做法应该是去线下开户,或线上开户后提交W8-BEN表格声明自己的NRA身份。有少量DP表示有些券商不给有美国地址的NRA开户,但是实际执行起来YMMV,如果一家不行,可以换一家。提交W9来“冒充“自己是RA虽然理论上不合规,但实际操作起来也没什么问题。[1][2]

    对于Robinhood, Marcus, SoFi这样的纯线上券商/银行,我们显然没有线下开户的选项。Robinhood一开始注册的时候只需SSN即可,不需要确认税务身份,Robinhood同样会默认你是RA。可能由于Robinhood上市之后的合规需要,去年8月我收到了来自Robinhood的邮件要求确认税务身份,如果是NRA则需要填写W8-BEN表格。[3]

    (more…)
    Read more: F-1 NRA投资股票帐户/High Yield Saving帐户的税务身份及报税问题