Switching to Linux for Work & Play

I’ve been thinking of replacing my 5-year-old Macbook Pro for a while now, and as always, the easiest thing to do would’ve been to just buy the latest model. Apple also has a lot of exciting stuff planned for the Mac, and it’s a great time to be a Mac user, with Big Sur modernizing the interface quite a bit, and the eventual ability to run iOS apps. Apple is definitely firing on all cylinders.

So why a switch to Linux right now? And why Linux instead of Windows? Here’s a few reasons.

Electron Apps are Taking Over

I couldn’t have contemplated such a switch 5 years ago. Simply because my editor in those days was Textmate, an app built for the Mac. Nowadays it’s VS Code, a cross-platform editor from Microsoft. Then there’s Slack, or Twist, or Todoist, or Hey, everything runs on Electron. And Electron apps can run equally well on Windows or Linux. There’s no special Mac-sauce in my apps anymore.

In fact, this is a strike against Windows as well, because my first thought was to switch to Windows (with WSL2), but again, Electron apps work everywhere.

Development Experience is way better on Linux

You deploy everything to a Linux server, and developing on Linux means there’s always 1:1 parity. Even as a frontend developer, tools such as Docker work natively on Linux whereas it’s a horrendous memory-sucking abomination on the Mac. And Apple has been moving away from making the Mac developer-friendly: with enhanced protections such as SIP & Developer ID (which to be honest are legitimate wins for non-developers) more and more open-source software have stopped working or stopped being supported on the Mac. Apple used to ship with the latest open-source software, but now the bundled versions of most tooling is embarassingly out of date. And instead of supporting or building software such as homebrew, all of Apple’s focus is on its own application ecosystem. I’m again not singularly critical of Apple here: they are one of the few big companies that understand the value of focus, but in my case, this focus works against me & my programming profession.

This is again another strike against Windows because while WSL2 is very exciting, with Microsoft now shipping a Linux kernel and updating it through Windows Update, nothing will ever beat Linux compatibility than… Linux.

There are now “Good Enough” Distros on Linux

Me running VS Code, all Doist apps, Steam, and composing this blog post, all on Linux

I’m using Pop!_OS, an operating system meant for developers, which I suppose is strengthened by the fact that the name has got both an exclamation mark and an underscore 😁. But the interesting thing is, after a few bits of customization, it looks and works almost like a Mac. And it’s much, much snappier than my old Macbook Pro.

I like Pop!_OS also because it comes with sensible defaults, and like all variants of Linux, allows for a lot of customizability. I quickly switched off the native tiling feature, but it’s nice that it’s available, as are tons of other developer-specific customization in gnome-tweak-tool. I also remapped a few keyboard shortcuts to be compatible with my Mac muscle memory.

There are a few shortcomings of course:

  1. Native apps (like the Finder equivalent) are less polished, and some (like Quick Look) are not available at all. I’m hoping this improves soon. Note that most apps (even the Terminal for example) have excellent Electron equivalents. Run that, and you get the same experience you will on a Mac.
  2. I’m really used to the menu bar being at the top. Unfortunately, Gnome doesn’t seem to have a reliable Global menu solution.
  3. Font rendering is still sub-par. I’m not sure what exactly is wrong, but I can certainly see a difference in Linux. I tried several combinations of font smoothing and aliasing to get something decent looking, but it’s sad that out of the box nobody has focused on this important UX yet. Default fonts are also fugly, so I had to install and customize a few replacements, thankfully this is easy to do.
  4. You have to be familiar with the command-line to get things done. This is not a bad thing for me as a developer per se, but just putting it out there for other folks who might be looking to switch. Some GUI apps simply refuse to work (the Pop Shop or the App Store equivalent is a good example), and some require esoteric configuration for some tasks (remapping my extra mouse keys).
  5. Hardware compatibility is still somewhat of an issue. The first WiFi dongle I purchased simply refused to work, and I had to research and chug over some extra money for a Linux compatible one. However, my extremely finicky mouse (Logitech MX Master) worked out of the box. So did my Xbox controller, and most everything else I connected. Pop!_OS also comes with an installer that has my proprietary NVIDIA drivers pre-installed, a big win when it comes to the hell I remember that was installing compatible video drivers earlier. It’s way better than the last time I tried Linux, but things still can be improved. The Mac of course sets the gold standard here: in all the time I’ve plugged stuff into the Mac, I don’t think I’ve ever installed a driver.

Well that’s all I can think of for now. It’s surprising that besides these few warts, Linux works surprisingly well for my use-cases. In fact, besides my muscle memory acting up for a few shortcuts (I’m used to Ctrl+A/Ctrl+E, and Option+arrow keys for line traversal on a Mac), and some ridiculous shortcut key decisions on Linux (why not Super+C and Super+V for a global copy/paste shortcut for god’s sake), I’m reasonably comfortable in Linux even after a couple of days of switching over. I’m still using my old Mac keyboard, and I’ll change that soon, because I’m still not completely used to the Super/Ctrl key switch for most shortcuts.

Again: this is a big strike against Windows. The Windows UI always looked too busy for me. It’s got too much stuff on the screen, and the Start Menu is just horrible. There’s also no Dock, and that’s one UI element that I always want available. I looked into this quite deeply because the last time I was on Windows, I was a big LiteStep/BB4Win enthusiast, and while there are signs of a revival, again: my UI preferences run counter to what Microsoft builds.

You can now Game on Linux

So one of my supposed “Linux will never work for me” deal-breakers was gaming. Not that Macs are suitable for gaming—in fact, quite the opposite—but, if I’m going to switch away from a Mac, I want the benefits of being a gamer. I used to love playing World of Warcraft and Elder Scrolls, and that’s something I’d like to revive, especially in the post-COVID world.

So imagine my surprise when my apathetic googling for “Linux gaming” produced some really surprising results. Apparently, during the time I was ignoring Linux, Valve decided to produce a piece of software called Proton—an almost zero-configuration tool built on top of the venerable Wine, and a new port of DirectX over to Linux called DXVK. So gaming on Linux is now as simple as: install Steam, click a few checkboxes, download a game, and hit Play. It’s remarkable when it works, and some games even perform better on Linux. Note: this is not all games, but every one of the games I like to play works well: ESO, Witcher 3, No Man’s Sky, everything works, and works well. This is honestly an astounding development. Except for this, I would’ve gone the Windows and WSL2 route, and it’s still surprising to me when I get the games to work. And in typical open source fashion, there are now better builds of Proton than what Valve ships in house.

Microsoft should honestly be very afraid. There’s potential that Linux can be a better gaming platform FPS-wise, with most of the next-gen cloud gaming platforms running Linux and if there’s any group of tech folks more sensitive to bigger numbers, it’s the gaming crowd. Meanwhile for me personally it almost seems like the best of both worlds: a Mac-like Unix environment that can run games too. Fricking awesome.

So that’s why I switched. What next?

I know this will come as a surprise to many who know me as the quintessential Apple fanboy but I’ve always been pragmatic in my head 😋. I started searching for an alternative only because my age-old Macbook Pro was getting too slow for development, and quite frankly, a top-of-the-line iMac would have gotten me all of these benefits, except perhaps the gaming bit. But these machines are insanely expensive in India, and cannot be custom-configured to boot. For half the price of a Macbook Pro, I bought an assembled PC off of Amazon, and it has been serving me well. This also doesn’t mean I’ll never switch back to a Mac: there’s a lot to love there, and I definitely want to see how Apple ARM shapes up. But for work and play, it’s Linux as of now. Peace.

Terminal in Leopard

I haven’t really seen it mentioned before, but the Leopard terminal is finally up to a Gnome’s or KDE’s terminal’s standards, and as is usual with Apple, especially with some of the window style selections, much better. It has tabs too, and there’s a preset which closely matches the way I used to customize iTerm. Great stuff.

Web.py on MacOSX

I’m loving web.py for developing tiny web apps. Here’s how to get it going on a Mac:


sudo port -v install python2.4 py-setuptools mysql5
#coz macports insists on adding a '5' suffix to all mysql5 tools.
sudo ln -s /opt/local/bin/mysql_config5 /opt/local/bin/mysql_config
sudo easy_install web.py cheetah markdown MySQL-python DBUtils

Not the twenty odd steps that’s on the web.py page (that even includes installing and configuring postgresql – bizarre!).

What I love about web.py is that this small bit of code:


#code.py
import web

urls = (
'/', 'index')

class index:
    def GET(self):
        print "Hello, world!"

if __name__ == "__main__": web.run(urls, globals())

… and running python code.py in a terminal gets you a working dev environment. Even camping doesn’t feel this tiny.

Edit: the performance numbers for this simple action are also very impressive:


time httperf --client=0/1 --server=localhost --port=8080 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --rate=500
httperf --client=0/1 --server=localhost --port=8080 --uri=/ --rate=500 --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --num-calls=1
Maximum connect burst length: 17

Total: connections 10000 requests 10000 replies 10000 test-duration 20.000 s

Connection rate: 500.0 conn/s (2.0 ms/conn, <=24 concurrent connections)
Connection time [ms]: min 0.1 avg 1.8 max 2987.4 median 0.5 stddev 42.2
Connection time [ms]: connect 0.7
Connection length [replies/conn]: 1.000

Request rate: 500.0 req/s (2.0 ms/req)
Request size [B]: 60.0

Reply rate [replies/s]: min 499.8 avg 500.0 max 500.0 stddev 0.1 (4 samples)
Reply time [ms]: response 1.0 transfer 0.0
Reply size [B]: header 108.0 content 14.0 footer 2.0 (total 124.0)
Reply status: 1xx=0 2xx=10000 3xx=0 4xx=0 5xx=0

CPU time [s]: user 3.75 system 9.17 (user 18.7% system 45.8% total 64.6%)
Net I/O: 88.9 KB/s (0.7*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
httperf --client=0/1 --server=localhost --port=8080 --uri=/ --send-buffer=409  3.75s user 9.17s system 64% cpu 20.028 total

That’s 10K connections and more than 500req/s in a 20 sec timeframe. Really good.

Ubuntu Gutsy

Ubuntu Logo

I tried out the new Ubuntu Gutsy today on my mom’s Compaq Presario V3000 (didn’t install, just tried out the LiveCD) and found it to be a really good revamp from the last version. Now WiFi works out of the box, the battery indicator works perfectly, and there’s a bluetooth screen for managing bluetooth devices. The new desktop effects are also pretty cool: I switched from ‘normal’ to ‘extreme’ and found em windows wobbling all over the place. The inbuilt virtual desktop is also smooth and not distracting. While the fonts look a bit too rough, I found web pages very readable in Firefox, and the color theme is also pretty easy on the eyes (although I’d prefer a more colorful default theme). I love the Ubuntu Terminal, it’s much better than the default Mac one.

I can cautiously say that Ubuntu has gotten to the point where a web programmer (a non ASP type) can easily ditch Windows for Linux and not pay the premium for a Mac. There are things the Mac still does better and places where the Mac experience feels a lot more polished, but Ubuntu is closing the gap very fast.

Tata Indicom Plug2Surf on a Mac

My mom and bro gave me a Tata Indicom Plug2Surf for my last birthday (geeky gift, I know. What can I say? They know me too well). It’s only been with me for a couple of days but I’m already addicted to the sweet device. And as usual, set up is as Mac-ish as can be… if you know the proper settings.

  1. Start by plugging in your Tata Indicom device. It’s a blocky ugly but functional device that takes up more than its share of USB ports on my Macbook. The small light should change from red to orange and then stay a pale green.

    Tata Indicom Plug2Surf pics

  2. Open System Preferences and navigate to Network. A Qualcomm CDMA Technologies MSM device should already be detected. Select that and click Configure.


  3. Fill up the settings as in the pic below. The number to dial is #777, the username and password are the same: ‘internet’ (lame!). Be sure to check Save Password to avoid nag screens.

  4. Click on the Modem tab and from the list choose the ‘au CDMA 1x WIN W01K’ modem. The default selection will not work. Navigate back to the PPP tab and click Dial Now…

  5. You’ll be presented with Internet Connect, the general dialer application for the Mac. I use this for VPN connections as well. Check ‘Show modem status in the menu bar’ and click Connect. It should take under 5 seconds and the dialog will expand to show statistics for the connection.

The tariffs are reasonable. It’s Rs. 2500/- for the device and Rs. 350/ per month (paid like a postpaid bill) for 30 hours of net access a month (overcharges are 25ps for a minute). I have a BSNL plan otherwise, so this is for mobile net. It’s not entirely as plug2surf as the advertisement shows however since on Windows devices, you’ll have to install a driver (provided in a tiny CD). On a mac, you don’t, but you don’t know how much of tariff you’ve used either.