Building a Custom Workstation

Moving to Ubuntu from MacOS

Getting the right OS for the Custom Workstation, https://medium.com/@MazizEsa/assembling-the-workstation-5a3287b56f23. I found there are a few things that I need to adapt in order to be productive moving to Ubuntu, such as equivalent software, new habits that need to be picked up and also some difficulties that need to be mitigated.

Image for post
Ubuntu 20.04

The move

I’ve been using MacOS and Windows as my daily drivers (MacOs for work, Windows for non-work related) and Linux when I need to deploy stuff and troubleshoot on server. MacOS has been good in facilitating my software development workflow (integration, ease of use, polish-ness, reliability) however, lately (well since few years back, I’m using Macbook Mid 2015), the direction Apple is taking and going is toward something that I and many others disagree.

Extensibility

One main reason is extensibility. Since(if I remember correctly) retina Macbooks, the RAM is soldered to the motherboard. That means the only chance to get bigger RAM is during purchase and then you are stuck with it until EOL. For me, as more things need to be run on docker and virtual machine (VM) for development and testing, getting more memory would be extremely helpful, or even necessary (in Apple world, that means getting a new MacBook now).

Image for post
Image for post
Macbook 16 inch RAM and Storage Selection

Then the SSD, the drives use Apple’s own proprietary connector (not your standard m.2 or SATA). So the only time you can get a bigger size SSD is during purchase (officially). After purchase, you can only get such storage from unofficial channels. Good comparison on the connectors, https://beetstech.com/blog/apple-proprietary-ssd-ultimate-guide-to-specs-and-upgrades#hdr-5

Cost

The factor above means the only official way to get bigger RAM and Storage is at the time of purchase, which Apple charges at a premium 2–3x more than what you can buy separately (you can see in the screenshots above).

These are just a few, there’re performance issues (CPU throttles due to heat management, https://www.theverge.com/2018/7/24/17605652/macbook-pro-thermal-throttling-apple-software-fix), quality control in recent models such as:

  1. Keyboards https://www.businessinsider.com/apple-butterfly-keyboard-macbook-issues-timeline-2019-4
  2. Battery issue
    - https://www.apple.com/newsroom/2019/06/important-notice-for-batteries-in-certain-macbook-pro-units/#:~:text=Cupertino%2C%20California%20%E2%80%94%20Apple%20today%20announced,and%20pose%20a%20safety%20risk.
    - https://support.apple.com/en-my/15-inch-macbook-pro-battery-recall
  3. GPU problems https://www.macrumors.com/2017/05/20/apple-ends-2011-macbook-pro-repair-program/#:~:text=Apple%20launched%20the%20repair%20program,allegedly%20due%20to%20faulty%20GPUs.&text=Apple%20will%20continue%20to%20repair,2013%20models%2C%20free%20of%20charge.

So, moving on to other alternatives. From Software Engineer perspective.

Ubuntu, a Software Engineer perspective

Both Ubuntu and Fedora were in my consideration but I chose Ubuntu because I already used Fedora for a time, before (trying new things ;)).

I use a wide range of tools for my daily tasks as a software engineer, ranging from IDE, tools from package manager, ease of setting it up things, a light image capturing and editing capabilities, convenience to manage screen brightness, color and other configurations, shortcuts and etc. We will see how this fare with MacOS. Bare in mind most of it are my opinions and preferences, hence you may or may not agree.

Terminal

I love iTerm2, combo-ed with oh my zsh. While the oh my zsh is a non issue as it is compatible linux, finding the right terminal took sometime. I pretty much tried Guake, Tilda and terminator and settle down with terminator since it is the most (in my opinion) similar to iTerm2.

Image for post
Terminator Terminal with Oh My Zsh, theme “tonotdo”

Guake and Tilda approach are like the FPS game console where you press tilde key, and the console will appear from the top (some from the bottom) but in this case, it’s from the top. I’m more comfortable with terminator, and will be using it as my main terminal.

Package Manager

In Ubuntu, I’d initially setup the environment using apt and Ubuntu Software. A bit extra step initially (certain software couldn’t be obtained with apt-get, and I had to use Ubuntu software because it’s a front of various apt commands) compared to MacOS, as I’m able to get most things with Homebrew + cask (casks for GUI app, which is just a param when calling Homebrew).

Installing terminal programs:

brew install app-engine-java

Installing GUI programs:

brew cask install yourkit-java-profiler

I did tried Linuxbrew, but unfortunately the cask doesn’t work on Ubuntu. I’m just going to stick with apt + Ubuntu software as both of them are native package managers.

Brightness and Color Control

My eyes are very sensitive to brightness and blue light. Staring at the monitor with full blast blue light and brightness will cause headache. On Mac and Windows I have the option to use Flux to reduce the blue light and keyboard shortcuts to reduce the brightness (ALT + PAGE UP / PAGE DOWN for Windows and Screen Lock and Pause for Mac). I use both as Flux alone is not enough. On Ubuntu there’s a native software brightness controller but for my case it doesn’t work (even after configuring grub with acpi_osi and acpi_backlight), probably due to my aging monitor (BenQ G2420HD) or some miss-configuration. Also, the brightness controller on the monitor doesn’t work so, yeah all software. Would try to figure it out but later as for now, lets see some other alternatives.

Flux Alternative

There’re several options I’ve tried from Flux (0.1), Redshift and finally brightness controller. Flux for linux seems abandoned and un-maintained https://github.com/xflux-gui/fluxgui, last updated September 2013. It suggested to use redshift-gtk. Installed and and try to run and nothing. Got to kill the app, tried few times, same thing. Then, I’d tried the command line version, which is pretty bare bone. For example, changing the brightness you have to do it from command line and figure out the value accordingly.

redshift -b 1.00:0.1

Sure you can customize and bind to a shortcut and make it work but, I’ll keep on searching for something else, hopefully simpler. For now, keep this one in view.

Image for post
Brightness Controller

I’d proceed to try Brightness Controller, https://github.com/LordAmit/Brightness,. Initially, I thought I’d encountered a problem because adding the repo always takes a long time (tried this a few times). But searching the internal DB,

apt-cache search brightness

it seems it’s already there. So I just proceed to install it. Seems better than redshift. Not only it has color temperature control, it also has brightness controller as well. Fits the bill. Now to make it start after login in the OS.

Image for post
Bringhtnesss Controller Auto-Sstartup

Auto-Startup

By default the brightness-controller doesn’t start automatically. You have to configure it on your own. You can do so by adding the bin into the start-up preference in Ubuntu. As I’m new to the Ubuntu environment, I am not sure where the software installed via apt is being stored. So a nice utility is available in Ubuntu to trace the package files:

dpkg -L brightness-controller

being -L flag to list out the files of the package.

Brightness Shortcut

No native shortcut on Ubuntu unless you have a keyboard that does support brightness. Even then, I doubt it could work as my Ubuntu as it doesn’t have the default brightness slider working. For now, I will just manually change the brightness via brightness controller. Will find better way later, maybe manually macro the shortcut, who knows.

Storage Configuration

I dual boot this machine with both Windows and Ubuntu. So I configure the SSD to have 3 partitions, 1 for windows (NTFS), 1 for Linux which is Linux File system, and another one NTFS(data and stuff).

As my data is stored in the NTFS partition, I need to make Linux able to easily mount read / write the data partition seamlessly. One snag was by default the partition will not be automatically mount. You need to access the partition by opening the drive (by User session). This is a problem for example if you store your source code inside the data partition (your IDE will report no such directory or location). This can be fixed by making the partition automatically mounted and readable as follows:

a) Switch off Windows Fast Startup

When this option is enabled, Windows will not go to full shutdown, instead put into a hibernation state. https://support.microsoft.com/en-my/help/4011287/windows-updates-not-install-with-fast-startup. This prevents other OS from mounting the partition drive properly.

Image for post
Windows 10 Fast Start Up Config
(Control Panel) → (Power Options) → (Choose What The Power Button Do) on top left

b) Set the mounting configuration accordingly

After that, you need to configure the mounting configuration. You can open the GUI Mount Option from Disks → Partition you want to configure. This is just a nice front-end for manually editing the fstab config. You could configure directly on the text configuration in the file below:

/etc/fstab
Image for post
Ubuntu Partition Mount Option

Disable the toggle button for “User Session Default” and check the Mount at system startup.

If there’re still permission issues you could append “umask”, “uid”, “gid” the back. If not and it works by default, let it be.

In the beginning I didn’t realize that you need to disable fast start up, so I proceed to modify the mounting option (umask, gid, and uid) and it work (probably at that time due to fast start up). But then the read-only issue occurred again and disabling the fast startup finally resolve the issue for good. The above was result from testing out the cases.

With all that setup, now the software.

Software Compatibility

Most things that I use are compatible with both Windows and Mac. Take for example Microsoft Office and Flux, it is supported on both Windows and Mac. But there are few things that need a replacement. I’m just going to go through the overall.

Java

I’m using both JDK 1.8 and 11 for my projects, so I’ve been using Jenv https://www.jenv.be/ to manage JAVA_HOME on terminal. It works on both Ubuntu and MacOs. No problem there.

Integrated Development Environment (IDE)

My IDE of preference is Intellij by Jetbrains. It’s a multi platform IDE, for Windows, Mac and Linux. Integration with other tools like GIT, Maven, Gradle and terminal work seamlessly. Easily assign shortcuts for things such as clean, build and stuff. No issue for me.

Postman

On MacOS I’ve been using postman for endpoint tests. Postman does support Linux bins, hence, no issue here.

It can be installed via Ubuntu Software.

Git GUI

For things that’s tracked with git but not code, I prefer to use something like source tree (not compatible with Linux). So far I haven’t found any alternative yet that’s free (Git kraken is a good candidate but paid). Will look into it later or for the time being just use command line.

Alfred

You have an alternative for Linux, Albert. But I didn’t try it and just use the Activities instead (just by pressing the super key). Activities also able to search sub applications, for example Display within Settings, Keyboards and etc. At the same time the search doesn’t get too verbose until searching the text within files, so it’s good enough for my usage.

Image Editor (GIMP)

For simple scaling, crop, overlay text or shapes for emphasis I’d choose gimp. A bit overkill for these purposes but still, better than nothing. In MacOS, the Preview is capable of doing all the above, so no heavy weight image editor is needed.

Confluent Platform

On MacOS (this is more of the package manager or maybe how the provider package the software), installing the platform and running it includes everything, kafka, zookeeper, control center and schema registry. For the case of the package from the apt, it seems it excluded the control center. You need to install manually to use it. One extra step but it still work.

Sublime

It’s a multi-platform text editor so it works on Ubuntu as well. A side note, one thing I like about sublime, compared to visual-studio code is you can enable the syntax highlighting without saving the file with the extension type.

Diagram Tool

I’ve been using draw.io, integrated with Google Drive. So no issue here as it can be run anywhere where chrome can be run.

Note Taking App

I’ve just moved from keep to Notion. It has native application on both Windows and MacOS but not Ubuntu / Linux flavor. But still, it can be run as a web app. Not ideal, but acceptable.

Reason for the move to Notion is because it can practically able to create a full formatted note (code, multi level headers, image, export to PDF and etc.) Pretty neat.

Shortcuts

Super vs Command Key

In MacOS, you don’t have Super key where the Activities will be activated when you press it. Shortcuts for Cut / Copy paste works with Command + C / X. It works the same within the terminal.

In Ubuntu case, due to the super key, you will use CTRL C + X for copy / paste with the exception of within terminal where you will use with another key combination such as shift (CTRL + C + Shift). CTRL + C is assigned to kill the process within the terminal.

Texts

Navigating / selecting whole word in MacOS can be done with CTRL + Arrow key left, whole line COMMAND + (left / right) and right and whole paragraph CTRL + up / Down which understandable because it doesn’t have Home, and end key on Macbook. Different case if you use external keyboard though.

For Ubuntu, (I am using dekstop), Navigating / Selecting whole word can be done with CTRL + (left / right), whole line Home / End and whole paragraph using CTRL + (up / down).

Personally prefer the Command + (left / right) for whole line as my finger don’t have to travel far to reach the Home / End. But this can be solved via brute force by remapping the key to somewhere nearer… if needed.

Hi-Suite (Huawei software)

The software only compatibles with Windows and MacOS. No alternative on Linux. However, for accessing and transferring files, it can be done directly without any third party tool.

Screen Snapshots

On MacOS it’s native, screen shots can be done native-ly via shortcuts. Command + shift + 4 / 3, depending if you want to save it on clipboard or desktop. Once this shortcut is invoked, it will trigger a cross-hair for you to drag in order to indicate which part of the screen you want to capture (much like Windows Snipping tool).

On Ubuntu, you have print screen button to contend with and it will either capture the whole screen, the application currently selected or trigger the same cross-hair for you to drag to indicate which area you want to capture (shift +print-screen button). Then this will be stored in the picture folder. Combining with CTRL will store the screen shot on the clipboard (I.E, CTRL + Shift + Print Screen button).

Not much change except for the shortcuts. Maybe it’s more convenient as you need to press less button to trigger the snapshot capture process in Ubuntu.

Media (Image, Video, Sound) Preview

This can be done by highlighting the media icon and press space bar. Depending type of the media, it will either display a thumbnail image, play the video itself on a small screen or sound.

Image for post
Gnome Sushi

On Ubuntu, this can be achieved by installing a third party tool called (many others but I’m just to choose this one) gnome-sushi. Same functionality but you need a bit of time to search, easy sure, but compared to where the functionality is baked into the OS, is a tad bit of inconvenience.

Substitute Summary

My choice.

  1. IDE, most work on multi platform
  2. Package Manager, Homebrew, depending on distro, for Ubuntu, apt , Ubuntu Software
  3. Terminal, Terminator.
  4. Brightness & Blue light, Brightness Controller.
  5. Preview, gnome-sushi and GIMP.

Conclusion

In short amount of time, I’d manage to find substitutes make Ubuntu a more “homey” development environment . Not the best but it works. Few take away based on my 2 cents.

Time vs Money

It seems you have to spend a bit more time on making things fit your workflow. It’s cheaper to use Ubuntu but you going to end up googling stuff to find equivalent software or things that you are familiar before (also true for any new OS). You can see this in the case of dual booting, where the fast boot with Linux compatibility is not an issue when configured with boot camp.

I’d an issue with WIFI before 10 years ago where driver (wifi card) is not supported on Linux but not for this case. This time, everything works; sound, graphic (NVIDIA, probably after Linux showed the finger, lol), network, mobo.

I still haven’t figure out the reason why the Ubuntu native brightness control didn’t work. That require more time to figure out. Which brings next point:

Hardware Compatibility

Perhaps the brightness control issue shows how a close and deeply integrated ecosystem helps polish the experience. Since Apple tightly control the hardware being used for its products, this is a boon in terms of user experience. Everything is compatible and has a higher chance of working with each other (within the ecosystem off course).

“Polishness”

Personally the experience on MacOS is more polished. Everything works out of the box. In some cases more time is needed for you know know how to make it work (brightness control and blue light software, for example).

So far I haven’t done heavy coding yet on this machine. More sharing will be done later after maybe months of usage.

Freedom

Being open sourced, gives you the liberty to know what’s going on under the hood. Having a PC without being attached to any manufacturer also give you the freedom to buy, procure and repair your computer parts. Can’t say for Apple products. Software wise there are open source options but for hardware you are locked and have to play by their rules. Vendor tight locked-in has spark the right to repair movement (https://en.wikipedia.org/wiki/Electronics_right_to_repair), being Apple as one of the parties that fight the bills from the movement. Basically this right enables consumers to repair and modify their own electronic devices.

All in all, there’re pros and cons. If cost and principle are not the issue then Apple might be good to go with. It’s worth mentioning, even within apple the’re debates on right to repair, https://www.ifixit.com/News/43008/apple-emails-reveal-internal-debate-on-right-to-repair. Who knows maybe in the future, few more Macbook generations down the line, things might change.

Until then, I’m sticking with Linux for now for my desktop here.

Written by

Someone who bricked a motherboard after flashing the wrong rom because of trying to OC an intel celeron from 400mhz to beyond 600mhz in 3rd grade.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store