What I hate and what I love about Mac OSX

I’ve been using OSX for almost 10 years, then I switched to Linux (Mint and Ubuntu) for a year and then I switched back to OSX.
There are several things that I hate about OSX (from a developer perspective), but eventually I realized that is the best system that fits my needs.
So, in this post I’m gonna list all the pros and all the cons about mac OSX compared to Linux or Windows, by hoping it would be useful for other developers (but not only) in order to evaluate a switch (or not) to/from mac OSX.

Let’s start with the…

Things I hate about mac OSX:

  • No “native” package manager:
    If you are a developer (especially a web developer) you need to install an huge number of libraries/packages/technologies on your machine and package managers like “apt-get” or “yum” in Linux make this task dead easy, by allowing the developer to download/compile/configure the required resources automatically and fast. On Mac OSX there are two “third party” package manager: MacPorts and Brew. While the latter seems to be the favorite by the OSX community, I slightly prefer the former for two simple reasons: it has ~4x the packages available for Brew, it’s better integrated with OSX and it doesn’t “break stuff” if you upgrade to new OSX versions. Anyway both managers are not as powerful/stable/rich as the ones available for Linux, so it may happens that a particular package is not available or that another gets updated later and upgrading/removing installed packages may be more complex compared to Linux.
  • Insensitive file system:
    Yep! on OSX “a.txt” and “A.txt” are the same file, or better you can’t have “a.txt” and “A.txt” in the same directory. While this may sounds reasonable, it may cause problems with CVS systems like git (renaming a file uppercase to lowercase or vice versa is not automatically tracked as change).
  • Silly windows maximization:
    The way Apple implemented windows maximization is just absurd! If I want to maximize a window I MEAN IT, let’s maximize that fuc**** window in order to expand to all the available space, don’t try to run “sophisticated algorithms” (I’m sarcastic of course) in order to adjust the window size based on its content!!! In OSX “el capitan” this issue have been mitigated, but maximization still sucks (especially in Finder).
  • .DS_Store files pollution:
    it’s really annoying to have these hidden files everywhere, especially if you have to share external drives with other people who don’t use OSX.
  • Worst file manager on the market:
    IMO Finder simply sucks! It has useless features like coverflow gallery and miss useful ones like split view, moreover due to the previously mentioned “Silly windows maximization” it’s really hard to make this software useful and easy to use in order to explore the file system

Things I love about mac OSX:

  • Stability:
    Love it or hate it, but Mac OSX is the most stable os on the market! In 10 years of active use I faced a kernel panic/system freeze 3/4 times only. On Linux you can “break the system” just installing/upgrading the wrong package and Windows is famous for its blue screen of death :)
  • Battery life:
    Since I use a laptop, battery life is very important and OSX is HIGHLY OPTIMIZED for the hardware on which it runs, in order to get the most from the battery. A macbook with a new battery can work for 8 hours or more (it’s ~3x the average of laptop battery duration!).
    My macbook pro has 4 years and it can still work for over than 4 hours!
  • Better performance and hardware usage:
    In addition to a better battery life OSX makes a better use of the machine hardware ensuring better performances.
    As a personal experience I recently noticed that a suite of tests I wrote for a Python project where running more than 2x slower on Linux (on the same machine).
  • Reliable suspension by closing the lid:
    You know what? I never NEVER shut down my mac! When I finish to work I simply close the lid and it goes into hibernation by “stopping the system” and preserving the battery. It can stay in that state for days and once I reopen the lid in a couple of seconds I can continue to work with all my programs still opened and properly running. This is amazing!
  • Spotlight:
    I love Spotlight! It’s one of the best software written by Apple. It’s reliable, blazing fast and versatile. I use it to launch applications in a breeze, find files on the mac and as a calculator. On Linux Gnome there is something similar, but Spotlight is far better for performance and super-fast file indexing… a killer feature of OSX!
  • Time machine:
    Another killer feature of OSX is its own backup software. It’s easy and reliable, nothing to configure but the external hard disk to use for backup storage. Time machine implements a smart incremental backup system (it means that it detects differences between the latest backup and the current system state and saves only the delta in the backup rather than the whole disk content).
    I restored my system from a Time Machine backup more than once and all went incredibly smooth (my user folders, installed app, preferences and so on were properly restored on the new machine).
  • Internet recovery:
    Did you erase your whole hard disk or did you messed up with the system so badly that it’s now not working at all and when you start your machine you see a grey screen with a question mark?
    Don’t panic! Restart the system by holding CMD + R and you will activate “Internet Recovery Mode” in which your machine will connect remotely to the Apple servers in order to download a fresh new copy of OSX and restore it on your machine… this features is super cool and deserve an huge applause to Apple!
  • I can play with all the toys I want:
    On OSX you can find several tools that are not available for Linux (Recently I’m experimenting with game development and for example Unity is not available for it a the time of this writing) and you can virtualize Windows and/or Linux or create multi boot machine with other os if you need/want to do so. The opposite instead is not possible since OSX runs only on mac hardware (ok, you can opt for hackintosh but I think it’s not the same as the native experience).
    So by using a mac with OSX you can target the web, iOS, Android, Windows, Linux, Mac or any other platform you can deploy software on it :)

Installing and configuring Linux Mint in dual boot on an Apple Macbook Pro with retina display


I’ve been an happy mac OSX user for almost 10 years, but recently something in my mind has changed… I don’t know… it’s like if… suddenly I’ve started to feel myself like a child which simulates to drive his father’s car (when it comes to the OS) when the reality is that I’m an adult that actually wants to drive his car and has a regular license and the experience to do that :P
So I decided to try the switch from OSX to Linux.
Linux’s world is a mess, there are a bazillion of distros and several “GUI engine” (I don’t know if this is a correct/acceptable term for talking about GNOME, KDE, Cinnamon and so on, but I’m a newbie in the Penguin’s planet :P) so initially my first target has been Ubuntu since it’s the most famous and supported version (and it has for example a dedicated site on my beloved stackoverflow newtork: askubuntu). Unfortunately most famous and adopted doesn’t mean “the best” (can you hear me windows users?!) and in fact after playing with Ubuntu 15 and 14 and by following a suggestion of a friend I tried Linux Mint and as far I tested it’s far better than Ubuntu: it’s more stable, more responsive, it has a better gui free from the several little bugs I found in Ubuntu, and most important currently it has the best support for HiDPI displays thanks to Cinnamon (Ubuntu’s Unity offers a way to scale the interface in order to match the highest pixel density of a retina, but you have to set it manually, Mint instead automatically detect your monitor and apply the right resolution… moreover even by setting the right resolution in Ubuntu, the login screen will always looks bad and several ui components like icons in notification popups will looks blurred… on Mint all the OS elements will automatically looks gorgeous like in OSX!). So I’m currently running Linux Mint Cinnamon 17.1 (code name “Rebecca”) on my macbook pro retina mid 2012.
I opted for a dual boot installation (with Linux starting as the default system) just to be able to use XCode in the future for an eventual iOS app development or something like that requiring OSX.
The installation (even in dual boot) is quite simple and, despite the many tutorial I found on the web, DOES NOT REQUIRE any esoteric third party software like ReFind, LinuxFlashDriveInstaller, BootMyPenguinToApple and so on (actually I invented all these names since I don’t remember the real ones, but you should get it).
So lets see how to install it…

1. Requirements

1. an external hard disk for backup
2. a flashdrive (less than 2gb needed!)
3. an internet connection
4. a cable adapter (you have to connect the macbook to the internet without wifi since you will install the necessary wifi drivers only later)

2. Backup your stuff

This is a very important step in order to avoid the loss of important files and hours/days/weeks or years of work!
If you never used TimeMachine is time to try it out and create a full backup on an external hard disk.
TimeMachine is awesome, you can restore your previous machine state even if you completely erase your primary disk! But if it’s awesome for OSX it’s pretty useless if you want to move your data to a new OS, since it use an incremental backup system that only OSX can properly use. So my suggestion is to have an external HD with 2 partitions: one for the time machine backup and another to manually copy the files you wish to use/conserve for another OS or for the future.

3. Partitioning (preparing the hard disk for running an additional OS)

Open disk utils (it’s an utility app included in OSX to manage disks), select your machine’s disk and add 2 new partitions (using the “+” button at the bottom of the window), one will be used to install Linux Mint, the second one will be used as swap partition. A swap partition is not mandatory but it’s highly recommend, since for example Linux needs it to allow features like hibernation. So the Linux partition should be at least 20gb, the swap partition a few gb, ideally not more than your available ram (in my case 8gb). You can choose any filesystem type for the new partitions, since we will properly format them during Linux installation. Even the partition name doesn’t matter (I choose “LINUX” and “SWAP”). Once you apply the defined partition scheme, your main partition (where OSX is installed) will be shrinked to make room for the new ones by preserving all the current content on the disk (obviously you should have enough free space on it). The partitioning may requires several minutes depending on the size and disk type of your machine.

4. Create a bootable Linux flash drive

Download the iso from Mint’s website (in my case I downloaded the 64bit Cinnamon edition).
Once downloaded you have to convert the iso into an img.
In the terminal app execute the following commands:

sudo hdiutil convert -format UDRW -o /path/to/mint.img /path/to/mint.iso
sudo mv /path/to/mint.img.dmg /path/to/mint.img

Now you have to write the image to the flash drive. Once the flash drive is plugged into the usb port, run the command:

diskutil list

in order to figure to which disk node it has been assigned to (disks “nodes” are in the form /dev/diskN, where N is an incremental number), then run the command:

diskutil unmountDisk /dev/diskN

(where N is the number related to your flash drive).
Now you have to write the image to the flash drive by running the following command:

sudo dd if=/path/to/mint.img of=/dev/rdiskN bs=1m

Note 1: “rdisk” it’s not a typo, but a trick to speed up the write process
Note 2: this command will replace all the data on the flash drive!
Note 3: it may takes some minutes to complete, and no progress input will be displayed, the only visible feedback will be the flashing cursor in the terminal
Note 4: once finished, or during one of the previous step, OSX may show an alert saying something like “disk X is not readable” and offering an option to format it. In this case just press “ignore” (or anyway the button that dismiss the alert without actions)

5. Installation

Once the image has been written to the flash drive (you will see in the terminal the report of written data once the command has completed his job), restart your mac by holding the alt (option) key pressed once you hear the typical booting sound. You will see a screen from which you can select from which disk to boot, choose your flash drive!
Before installing Linux Mint, ensure that: you are connected to the network via network cable and that your machine is connected to the power source.
By booting your mac using the flash drive containing Linux Mint image, you will “land” to the “portable” version of it (that is a working and ready to try Linux Mint OS). On the desktop you’ll see a DVD icon for the actual installation, double click it and proceed to the real installation.
Once you reach the installation screen “Installation type“, be very careful, this is the most important and “dangerous” step. There is a list of several options, but you have to choose the last one: “something else” (since it allows you to specify exactly what to do).
In the next screen you will see a panel with all available disks/partitions and a combo at the bottom “Device for boot loader installation”.
Now you have to find the partition you previously created for Linux (you should figure this out by reading its size and available space and in my case was “/dev/sd4”), then click on “change”, select a file system (the preferred one for Linux is “Ext4 journaling file system“), check “format partition“, set “/” as mount point, press “OK” and confirm your action.
Then you have to find the partition related to the swap, click “change” and select “use as swap area“.
Finally, change the selected option in “Device for boot loader installation” by specifying the proper Linux partition.
Then proceed with the installation by confirming and following the wizard.
At the end of the installation you will be asked to restart your machine, if you get stuck in a black screen and your machine does not restart… just press enter (it’s an embarrassing “little” bug in the GUI that may happen XD).
Your machine should reboot and automatically load Linux Mint OS (you can boot into Mac OSX by holding alt key during the booting).
Now you should have a working mac OSX/Linux Mint dual boot machine… but for Linux, there are a couple of things to do in order to have a fully working OS… for example you can’t currently use the wifi, but we are going to fix this and other issues in the “post installation” section…

6. Post installation

6.1 Installing updates

Once your machine reboots into Linux Mint, the OS should display an icon in the bar displaying available updates, by clicking it the software manager will open up, select all the available updates and install them.

6.2 Installing missing (wifi) drivers

Open the driver manager (just press the command key or “super” as it’s called in Linux and type “driver manager”), it will shows several drivers available for the NVidia (or whatever graphic card your machine has), but DON’T CHANGE THE DEFAULT DRIVER automatically installed by Mint (which should be the only open source one in the list), since as far I saw and even if it sounds odd, the proprietary drivers on Linux won’t work (black screen once installed and rebooted!). The same problem happens with Ubuntu (both 14 than 15).
However the driver for the “airport extreme” (the wifi), can be safely installed (and it’s the only one, available). Once installed you should be able to connect to the internet using the wifi (if not try rebooting your mac).

6.3 Macbook trackpad, external keyboard and mouse setup

There are some configurations to change and some “hacks” to do in order to have a working and conformable input setup. The trackpad works out of the box, but it doesn’t scroll using two fingers as I was used to do nor it has natural scrolling (inverted scrolling -> move up do go down and vice versa like on a mobile device).
So the first thing to do via GUI is to open the “mouse and touchpad” preference and under “Scrolling / Panel layout” choose “two-finger scrolling” and check “enable horizontal scrolling“. As you can see there is a ready-to-click option “enable natural scrolling” which actually does exactly what it says, but leave it unchecked, because it would break natural scrolling on an Apple Magic Mouse! (we will fix things in order to have a natural scrolling on both soon…)

6.3.1 Pairing that F@$%&*’ Magic Mouse!

Blue tooth pairing is automatically handled by Mint and setting up a (Apple) keyboard is dead simple and fast, you just need to turn the keyboard on and the OS will ask you to type a code on the keyboard for the pairing… BUT, setting up a blue tooth mouse is just… IMPOSSIBLE (via GUI), due to a weird bug, for which once the mouse is discovered and the OS opens a popup to insert the pairing code (which is 0000 by default), as soon you click on the input field in order to write the code, that damned popup gets closed, so the result is that you don’t have the opportunity to provide the code… so pairing fails :(
But, fuck off… let’s take the control and manually pairing the mouse using the terminal (fortunately we need to do this only once)!
We need a couple of packages that provides blue-tooth handling functionalities, so let’s get them:

apt-get install -y bluez-tools bluez-hcidump 

then follow the instructions under “solution”: here. I used that post to fix my problems too, but in my case I simply passed the passcode using the retrieved device mac address and I didn’t added it as “trusted device” as described in the tutorial (anyway my magic mouse is properly recognized each times).

6.3.2 Get rid of the “ctrl+v” that Linux OS automatically assigns to the middle mouse button (and that with an Apple Magic Mouse it’s a pain in the ass!!!)

Yep… the third button click on Linux it’s equivalent to a “paste” command, but using a mouse that doesn’t have physical buttons, accidental ctrl+v are very, very easy (I was going crazy by seeing pieces of urls/comments/variables added to my code each time I used the mouse!).
So, the solution is to remove the third button by the used layout, by running:

sudo sh -c "echo 'pointer = 1 0 3 5 4 7 6 8 9 10 11 12' >> ~/.Xmodmap"
sudo xmodmap ~/.Xmodmap

Buttons are numbered incrementally from 1 to 12 and the sequence from left to right means: button one, button two (so middle button), button 3 and so on… By specifying an invalid (missing) button like 0 or 13 we are removing it’s binding. With this command we are also redefining the order of “buttons” 4, 5, 6, 7 that are those related to scrolling gestures in order to have a natural scrolling effect even on the magic mouse… and this settings will also used for the trackpad… so now all should works perfectly!!!

6.3.4 Configuring specific apps in order to properly handle an HiDPI monitor (retina display)

Cinnamon does a great job in order to display the OS gui properly on an HiDPi monitor, but certain applications (mainly Java and QT ones) don’t look very good. Unfortunately these ones can “fixed” only if the vendor has implemented support for the different display (such JetBrains IDEs, chrome, firefox and so on), to find out the required settings in order to display these applications properly read this great resource on Linux Arch wiki.

6.3.5 Configuring the keyboard in order to use European letters like ü, á, ñ…

On Mac OSX even if you use an US keyboard you can hold a key to select one of it’s related “variants” with “special signs” (for example by pressing and holding “i” you can then select an “í” from an inline tooltip that shows up).
On Mint the only way I found in order to use special letters is to switch from “English (US)” keyboard layout to “English (US, International with dead keys)“, this one allows to print special letters by pressing right alt + letter key (so to print “í”, you have to press “i” + the alt key on the right of the keyboard).
Unfortunately the “International with dead keys” as a strange mappings for quotes and brackets, so I can’t set it as the default layout, instead when I need to type those letters I temporally switch from a layout to another using the icon in the system toolbar… it’s a reasonable effort :^)