Linux Mint Sarah on MacBook Pro

Background

So, I have this 15-inch MacBook Pro with Retina Display early 2013 lying around and am contemplating buying the 2016 one. But, to be honest, I’m not so sure that I will be getting the best bang for my buck.

As such, I am looking to see if moving away from the macOS ecosystem is even possible for me, a person that has been with a version of Mac OS X for years now.

I had a lot of experience with Ubuntu and Fedora before, so, now I wanted to try something different.

I have already tried elementaryOS, and while their effort in prioritizing design and user experience is admirable, it just isn’t the best development OS on the market right now. I might right a follow up post on my experience with the OS later, but for now, I have moved on to Mint, the second one in line that caught my attention.

First Impressions

The first impression I got from the installer was amazing. It supported a hefty 1680×1050 Retina resolution out-of-the-box. My only gripe was with the WiFi driver not working right away.

I could remedy that by going to the “Driver Manager” setting in the System Settings app and enabling the proprietary driver for the WiFi.

While I was at it, I changed the graphics card’s driver to NVIDIA, and the processor microcode firmware to “intel-microcode”.

I guess I could have just waited for the installer to do that for me, but since I wanted to get a sense of the environment without installing first, these were a must for me.

After Installing

So, it turns out that enabling the drivers had nothing to do with the post-install state of the machine. I had to reenable them all. To make matters worse, for some reason, the fully installed version didn’t let me enable the WiFi driver without an Internet connection. Thankfully, getting a connection to the Internet from my my dongle-less MacBook was relatively easy, as I just had to plug in my iPhone to use it as a cellular modem — which to Mint’s credit, was recognized and used right away.

Everything was going smoothly. I installed git, Java, and then proceeded to install IntelliJ IDEA. It was remarkably good, with great performance.

If anything, the resolution of the screen was too much for me. I scaled it down a single level (to what I normally used with OS X) and … it all went bad. The graphics turned to pre-2000 quality with all the pixels visible, and the colors not that great.

This was more than a surprise, as the 1440×900 relation is exactly what I used with the OS X installed on the MacBook Pro. So, I was astounded that the quality got so poor by reverting to a lower resolution.

I looked at the drivers, and there it goes. The driver was not NVIDIA’s original, proprietary driver, and was an open source version from X.org instead. I switched to NVIDIA , it downloaded a number of packages, and it was a blast.

I installed everything I wanted (Dropbox, Wine, etc.). It was working great. Then, I shut it down and put it in my backpack for work.

The next day, I went to work, happy to have found a neat replacement for my macOS Sierra, by the name of Sarah. In it was all free, too. Yay!

Then, I started my computer, and was confronted by a purplish-black screen, instead of the Mint boot page. I went to recovery mode. No luck.

I had to go back to the very beginning and start reinstalling everything, barring the graphics driver. It was working, and all was good. I lived with this system for three days. But somehow, it felt really ugly. Then, I realized that I absolutely loved the graphics of my macOS system, and that my subconscious was protesting at its loudest, and thus ended my adventures in the Mint-land.

I tried Ubuntu, and to my surprise, it had the very same issues with NVIDIA, and wasn’t as great an experience as Mint was.

I reinstalled macOS.

Count Lines From Standard Input in Shell

Here’s a script that will help you count the lines of input from the standard input:

Now, you can find out the number of files in a directory using:

Update

As Jeff Harver has kindly pointed out in the comments, the same thing as the long script above can be accomplished using:

Backup Your Linux Machine

I was up to maintenance of my Debian box, and I came in need of creating and maintaining multiple, date-based backups of the machine.

Here is the bash script I wrote to accomplish this.

Once executed, this script will backup the target specified by “$target” (the whole filesystem in this case) and create a tar.gz file under “/backups/month/date.tar.gz”. You have to specify an “admin” email account to which notifications will be sent.

Having Your Shell Tweet

Have you ever wanted to have your *nix shell access Twitter?

Using the RESTful API, you can achieve this. However, you would need to set up your instance as an app and then configure the API keys and all the what-nots. I personally try to avoid such hassle whenever possible.

So, I got this shell script for you (which is not originally mine, but has undergone a fair bit of modification by me) which achieves this:

What this script does is fairly simple:

It opens up a a connection the mobile version of the twitter, submits a fake Login form, gains access to the page, and then posts all the input parameters collectively as your Tweet.

The problem currently is that you have to write in your twitter credentials inside the file. I might change that one day.

Dependencies

You will need to install “curl” on your machine to be able to run this.

Access super user shell

I recently had a problem with my Debian box; namely, that I couldn’t access my superuser shell the usual way by typing:

As this is a problem with the user bit of the “su” command not being set properly, you can fix this by logging in as root (or any other user with superuser privileges) and type:

I hope this saves someone’s time out there 😉