大选从上周二开始。周一看各种报道感觉民主党一边还是挺乐观的，NYT的The Daily讨论的几种情况里着墨比较多的是一上来拿下佛罗里达/乔治亚这样一边倒的大胜。下午开始看了一会儿网上和电视直播的选情，感觉还挺乐观，喝了两杯就昏昏睡去了。晚上十点多醒来一看吓了一跳，摇摆州几乎一片红色。。佛罗里达也已经被反超了。当即就有一种擦擦擦难道要再来四年的感觉。虽然看了很多分析说邮寄选票和提前投的票统计得慢而且偏蓝，所以会蓝移(blue shift)。但看到一片红色领先还是很难淡定。躺在床上焦虑的刷了俩小时手机，又起来看了半天选情。看到了Trump宣布自己胜选的那个发言(“Frankly, we did win”)，真是怒向胆边生。Twitter上喷了一句再去睡了。
文明是一个有点介于桌游和电脑游戏之间的游戏。一方面我贴有六角形棋盘的桌游照片经常被不玩桌游的人评论像文明，另一方面文明自己也有很著名的桌游版Through the Ages。我玩过新版和旧版Through the Ages，都不怎么喜欢玩，总觉得这游戏太拖沓；但电脑版的文明系列我却从来没玩过，可能因为文明系列流行的时候我已经只玩主机游戏了。这次玩了玩文明6，确实感到这里面很多资源管理的机制都是和桌游共通的，然而维护复杂度远远超过了一般桌游的程度，只适合做成电脑游戏让电脑去算了。
After working from home for a few months, we decided not to renew Flux’s office lease. So I brought a monitor back for my home work station. A problem soon surfaced: my 2017 13-inch Macbook Pro got annoying noisy when connected to a 4K monitor. Its fan speed shot up to maximum frequently and the whole system got slightly sluggish. So I started thinking: since there is little need to travel with a work laptop now, why not get a desktop?
Mac Mini is not powerful enough, Mac Pro feels like an expensive toy, and I don’t need another screen at home so iMac is out, too. It has been 10+ years since I used Windows. And I heard this new WSL2 (Windows Subsystem for Linux) thing was great. Let’s give it a try! The last time I used Windows for work was more than 10 years ago.
I wasn’t really in the mood of assembling a PC, and kind of want to get it to work asap. So I ordered a Dell XPS desktop. It arrived in a few days with Win 10 pre-installed. I connected it to monitor, my Apple mouse/keyboard. All worked! Great, but…
The single biggest challenge right off the bat was the shortcut keys… With ⌘ replaced by ⊞ Win and my strong muscle memory of using ⌘ shortcuts, it took me quite a while to map all these shortcut keys…PowerToys from Microsoft include a “Keyboard Manager” which can do most of them. (I later found PowerToys is not very reliable and the shortcut keys stop functioning from tiem to time). But then I need to use AutoHotKey to map out a few weird ones, such as disabling that “ctrl+scroll” zoom. Last but not least, a bunch of application-specific shortcut keys needs to be tweaked, e.g. VS Code. It was no fun. My biggest suggestion is to use a PC keyboard other than Apple’s Magic Keyboard.
Adjusting and getting used to the display was another pain in the butt. It took me a while to realize the “recommended” 150% zoom level on a 4K monitor was still way too small for me. I adjusted it to 200% and it looked much better. Fonts look different but generally OK in those popular apps (browser, code editor, terminal, etc).
The fun part started with WSL. It was actually really easy to install WSL, install a Linux in it, and get it to work with VS Code. Windows Terminal and Docker on Windows are two other things that integrate well with WSL. Basically, I installed dev tools in WSL: Git, Brew (yeah I was surprised Homebrew actually has a Linux version), Postgres, node, etc; checked out codes into WSL; use VS Code Remote WSL to connect to WSL. Then it’s a good combination of the two systems: all GUI run in Windows and all commands/servers run in Linux. Auto port forwarding makes it pretty seamless to use the two environments together, meaning you can start a server at port 3000 in WSL then open http://localhost:3000 in Chrome on Windows and it automatically works.
This desktop’s performance is as expected. For starter, It runs our API tests twice faster than my laptop… This one single reason justifies the hassle of switching. And I threw another 32G ram to the gig, now it runs any usual web dev workload without breaking a sweat. #peace
Common applications were easier to replace than I thought. Fortunately, most day-to-day tasks can be done in a browser now, or Electron-based apps that look the same as their Mac version. I don’t want to pick up another set of Mail/Calendar shortcuts, so I just use pinned tabs in Chrome for mail and calendar. Other apps that stay on the taskbar during worktime are Windows Terminal, VS Codes, File Explorer, Slack. Other apps I open from time to time for work are Zoom, Firefox. TablePlus, and Postman. After spending a day or two to get used to the Windows system and fonts, things are not bad.
There were definitely some tough issues. It took me about a day to figure out how to run Cypress testing… The solution was to run web servers (front-end and backend) in WSL and Cypress in Windows, and web servers need to bind IPv4 0.0.0.0 instead of IPv6… which showsWSL’s port forwarding doesn’t magically work for everything.
And one last benefit of using Windows is I can play some games on PC now. I bought Terraforming Mars on Steam the other day and found it only supported Mac :/ And maybe I’ll play Civilization 6 sometime? Anyway, nothing in mind right now.