{"id":12191,"date":"2020-09-10T20:03:52","date_gmt":"2020-09-11T00:03:52","guid":{"rendered":"https:\/\/b2.broom9.com\/?p=12191"},"modified":"2020-09-21T12:07:11","modified_gmt":"2020-09-21T16:07:11","slug":"windows-long-time-no-see","status":"publish","type":"post","link":"https:\/\/b2.broom9.com\/?p=12191","title":{"rendered":"Windows, Long Time No See"},"content":{"rendered":"\n<p>After working from home for a few months, we decided not to renew Flux&#8217;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?<\/p>\n\n\n\n<p>Mac Mini is not powerful enough, Mac Pro feels like an expensive toy, and I don&#8217;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&#8217;s give it a try! The last time I used Windows for work was more than 10 years ago.<\/p>\n\n\n\n<p>I wasn&#8217;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&#8230;<\/p>\n\n\n\n<p>The single biggest challenge right off the bat was the shortcut keys&#8230; With \u2318 replaced by \u229e Win and my strong muscle memory of using \u2318 shortcuts, it took me quite a while to map all these shortcut keys&#8230;<s> <a href=\"https:\/\/github.com\/microsoft\/PowerToys\">PowerToys<\/a> from Microsoft include a &#8220;Keyboard Manager&#8221; which can do most of them.<\/s> (I later found PowerToys is not very reliable and the shortcut keys stop functioning from tiem to time). But then I need to use <a href=\"https:\/\/www.autohotkey.com\/\">AutoHotKey<\/a> to map out a few weird ones, such as disabling that &#8220;ctrl+scroll&#8221; 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&#8217;s Magic Keyboard.<\/p>\n\n\n\n<p>Adjusting and getting used to the display was another pain in the butt. It took me a while to realize the &#8220;recommended&#8221; 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).<\/p>\n\n\n\n<p>The fun part started with <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/wsl\/install-win10\">WSL<\/a>. It was actually really easy to install WSL, install a Linux in it, and get it to work with VS Code. <a href=\"https:\/\/github.com\/microsoft\/terminal\">Windows Terminal<\/a> and Docker on Windows are two other things that integrate well with WSL. Basically, I installed dev tools in WSL: Git, <a href=\"https:\/\/docs.brew.sh\/Homebrew-on-Linux\">Brew<\/a> (yeah I was surprised Homebrew actually has a Linux version), Postgres, node, etc; checked out codes into WSL; use VS Code <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode-remote.remote-wsl\">Remote WSL<\/a> to connect to WSL. Then it&#8217;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 <code>http:\/\/localhost:3000<\/code> in Chrome on Windows and it automatically works.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"811\" data-attachment-id=\"12193\" data-permalink=\"https:\/\/b2.broom9.com\/?attachment_id=12193\" data-orig-file=\"https:\/\/b2.broom9.com\/wp-content\/uploads\/2020\/09\/image.png\" data-orig-size=\"1613,1277\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/b2.broom9.com\/wp-content\/uploads\/2020\/09\/image-1024x811.png\" src=\"https:\/\/b2.broom9.com\/wp-content\/uploads\/2020\/09\/image-1024x811.png\" alt=\"\" class=\"wp-image-12193\" srcset=\"https:\/\/b2.broom9.com\/wp-content\/uploads\/2020\/09\/image-1024x811.png 1024w, https:\/\/b2.broom9.com\/wp-content\/uploads\/2020\/09\/image-300x238.png 300w, https:\/\/b2.broom9.com\/wp-content\/uploads\/2020\/09\/image-768x608.png 768w, https:\/\/b2.broom9.com\/wp-content\/uploads\/2020\/09\/image-1536x1216.png 1536w, https:\/\/b2.broom9.com\/wp-content\/uploads\/2020\/09\/image-1568x1241.png 1568w, https:\/\/b2.broom9.com\/wp-content\/uploads\/2020\/09\/image.png 1613w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>This desktop&#8217;s performance is as expected. For starter, It runs our API tests twice faster than my laptop&#8230; 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<\/p>\n\n\n\n<p>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&#8217;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.<\/p>\n\n\n\n<p>There were definitely some tough issues. It took me about a day to figure out how to run Cypress testing&#8230; 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&#8230; which showsWSL&#8217;s port forwarding doesn&#8217;t magically work for everything.<\/p>\n\n\n\n<p>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&#8217;ll play Civilization 6 sometime? Anyway, nothing in mind right now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After working from home for a few months, we decided not to renew Flux&#8217;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&hellip; <a class=\"more-link\" href=\"https:\/\/b2.broom9.com\/?p=12191\">Continue reading <span class=\"screen-reader-text\">Windows, Long Time No See<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[900,122,901],"class_list":["post-12191","post","type-post","status-publish","format-standard","hentry","category-blog","tag-win-10","tag-windows","tag-wsl","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1Q1al-3aD","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/b2.broom9.com\/index.php?rest_route=\/wp\/v2\/posts\/12191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/b2.broom9.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/b2.broom9.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/b2.broom9.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/b2.broom9.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12191"}],"version-history":[{"count":0,"href":"https:\/\/b2.broom9.com\/index.php?rest_route=\/wp\/v2\/posts\/12191\/revisions"}],"wp:attachment":[{"href":"https:\/\/b2.broom9.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/b2.broom9.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/b2.broom9.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}