Linux or Windows?
Title image credit to https://analyticsindiamag.com/linux-vs-windows-which-is-the-best-os-for-data-scientists/

Linux or Windows?

I grew up with command line interfaces. My first computer was a Lambda PC-8300, which only had BASIC in ROM; then DOS with an Apple II clone. My first x86 (8086) clone had dual 5.25" floppy drives (how cool is it to be able to copy floppy without reading part of it into memory (because the RAM is smaller than disk size) and keep swapping disks?), and ran Microsoft (!!) DOS 3.1. All those years without a graphical user interface, and without knowing what a mouse was.

No alt text provided for this image

Windows 3.0 completely changed my interaction with computers. With programs and windows I could minimize and move (not forced full screen any more!), my productivity was dramatically better. That mouse cursor I could move anywhere on the screen, freely and precisely, was my favorite.

However, soon, I found myself opening a Windows program called MSDOS more often. It opened a "window" of command line interface (it's now called "command prompt" in modern Windows) , the good old DOS. There were things I just knew how to do better with command lines, for example, copy files with certain pattern in filenames, to a directory nested multiple levels inside another.

No alt text provided for this image

In college, I started working exclusively on Unix, HPUX and Solaris more specifically. It was a dream to replace my home computer with a sexy SPARCstation running Solaris, it never came true as the price was just astronomic for a student. But during those years, though all of the Unix desktops had graphical user interface as well, command line was king. We telnet into lab computers from home via 33.6kbps analog modem connections and used vi for coding. Yes, we could redirect the DISPLAY of a remote shell to an XServer on home computer if a graphical program was absolutely needed (for example, plot a chart), but nobody would survive the lag for practical use.

I was introduced to Linux in college. It was free, but because download speed was way too slow, people started to sell CDROM burned with various Linux distributions. It was so cool to partition the hard disk, install Redhat and boot into it. The terminal with black background and greenish foreground fronts screamed professionalism! The biggest problem with Linux that time was driver support, due to the vast variety of hardware chips used in x86 ecosystem, video cards, sound cards, modems, etc. However, recent years, with greater community support, and hardware vendor consolidation, Linux compatibility is very acceptable on x86/64.

As a side note, Solaris eventually released on x86 as well, trying to grab market share on commodity hardware. However, Solaris itself wasn't open source (with the exception of short-lived OpenSolaris project), so reading and modifying Solaris source wasn't possible.

In recent years, Linux command line was my main environment especially for coding. VI was my only editor, and shell script as plumbing to put workflow together (build, deploy, etc.). This practice has served me well with the heavy usage of EC2. In fact, I rarely do coding on my local computer; I ssh into an EC2 Linux instance and develop there. With that, the demand of hardware for the computers has become low. At one time, I was living on a $100 chromebook, and it worked out pretty well. Alright, I still needed to browse non-text-friendly web sites, and to use office productivity tools like Excel, so command line only wouldn't work.

But seriously, there are things Linux and command line can do so elegantly. For example, there was a need to download an m3u8 AES128 encrypted segmented video file from a web site. With a stackoverflow search, all I needed was 1 line!!

curl "$1" -s | awk 'BEGIN {c=0} $0 ~ "EXT-X-KEY" {urlpos=index($0,"URI=")+5; ivpos=index($0,"IV="); keyurl=substr($0, urlpos, ivpos-urlpos-2); iv=substr($0, ivpos+5); print "key=`curl -s '\''"keyurl"'\'' | hexdump -C | head -1 | sed \"s/00000000//;s/|.*//;s/ //g\"`"; print "iv="iv} $0 !~ "-KEY" && $0 ~ "http" {printf("curl -s '\''"$0"'\'' | openssl aes-128-cbc -K $key -iv $iv -d >seg%05i.ts\n", c++)}' | bash

Another example, to git clone all private repository in my organization, it's just a few lines:

for repo in $(curl https://api.github.com/orgs/$organization/repos?type=private\&per_page=100 -u ${user}:${token}  | jq .[].ssh_url | sed -e 's/^"https://'  -e 's/"$//')
do
  git clone $repo
done

I challenge you to try the same tasks in Windows using graphical applications!

Until a few years ago, I had dual boot Windows and Linux on my computers. The drawback, of course, was the trouble of rebooting into each system, and the inability to easily share files across them. I had tried virtual machines such as Virtualbox. I didn't have to reboot any more, but I hated the fact that VM constantly ate my system resources.

That is until I discovered WSL (Windows Subsystem for Linux). WSL does binary translation of Linux kernel to Windows kernel at compatibility layer, as a result, no dedicated VM was used, to preserve resources as much as possible. Ubuntu on WSL is so good and fast, I find no need to boot into Linux at all. I can easily access Windows filesystem from WSL, and vice versa, after all, they are native in the same system. I am able to run VcXsrv and have WSL redirect DISPLAY to it, to run graphical programs, such as GIMP and Matplotlib. Nearly all Linux programs I need to use work under WSL smoothly and reliably.

Nearly... except Docker. Docker doesn't work on WSL. In 2019, Microsoft released preview of WSL2. WSL2 is real Linux kernel running in a managed lightweight VM compared to WSL's compatibility layer. Don't be fooled by the term of VM here. This is a managed VM similar to Windows Sandbox. You don't have to start it or terminate it, WSL2 does it for you. Memory usage is elastic and managed by WSL2. In fact, you don't even know it's run in a VM from user perspective. It runs faster than WSL (in a published tarball test, WSL2 has performed 20x faster than WSL). And it runs docker containers natively! WSL2 will be generally available in Windows 10 version 2004 which is supposed be in second quarter of 2020. But you can easily install and use WSL2 now through Windows Insider Program, for free.

With WSL and WSL2, I don't have a reason to dual boot. All the features I need from Linux are perfectly and easily accessible inside Windows. The side benefit? I can also use Microsoft Office. :)

Desmond C.

Product Exec | Ex PayPal, eBay | Payment | Risk/Identity/Trust & Safety | Marketplaces | Insurance

4 年

You had a SparcStation in college. That was pretty cool. They were so expensive.

回复

要查看或添加评论,请登录

Kenny Shi的更多文章

  • Simple GraphQL API in AWS Lambda

    Simple GraphQL API in AWS Lambda

    I am building a simple app. The internal APIs which the app uses are all GraphQL endpoints.

    3 条评论
  • Free Web Hosting on IBM Cloud

    Free Web Hosting on IBM Cloud

    In this age, all cloud computing companies offer some kind of free services. We are not talking about limited-time free…

    1 条评论
  • Decoding EMV Contactless

    Decoding EMV Contactless

    Last time we used Smart Card Shell to look into how EMV Chip/Contact communication works. This time, we will try to…

    4 条评论
  • Integration Comparison: Adyen, Braintree, Stripe

    Integration Comparison: Adyen, Braintree, Stripe

    When a new online merchant chooses a payment gateway, one likely narrows them down to Adyen, Braintree, PayPal, Stripe.…

  • PCI-DSS For Online Merchants

    PCI-DSS For Online Merchants

    PCI-DSS (Payment Card Industry - Data Security Standard) was invented because of the data breaches. Data breach is one…

  • Thoughts on Amazon Fraud Detector

    Thoughts on Amazon Fraud Detector

    Over the past 4 years, I have been exclusively operating on AWS as my cloud computing platform. AWS offers so many…

  • Examining Your EMV Chip Cards

    Examining Your EMV Chip Cards

    Now we are a few years into EMV mandates in the US, we all have one or more EMV chip cards in our wallet and have used…

  • Overloaded "Online vs Offline" in EMV Card Processing

    Overloaded "Online vs Offline" in EMV Card Processing

    When EMV card processing is discussed, one confusing usage of terminology is Online vs Offline. They mean different…

  • Hiring and Firing

    Hiring and Firing

    For the past week, I happened to be exposed to events, conversations, advise about career, interview and hiring, so I…

    1 条评论
  • Working With Fraud and Risk Vendors

    Working With Fraud and Risk Vendors

    In a recent Trust and Safety Meetup, we had a good discussion around "build or buy". Today's fraud and risk solution…

    3 条评论

社区洞察

其他会员也浏览了