>

Coding away from home

Coding away from home

Sometimes I need to code even if I am not at my work desk. In addition, I do not have a laptop anymore to fulfill this need.

Currently, my dev environment is composed of my tower PC (which is also my gamer PC where I constantly die from bosses of my favorite souls like games) and a homelab server, that I built aiming to monitor and update my stock market data database.

My PC runs Windows 11, primarily for its excellent compatibility with games and the impressive Windows Subsystem for Linux (WSL2), which I use for development tasks on Ubuntu. This setup has been my go-to for years, offering the best of both worlds. I can seamlessly run services like a Jupyter server within Ubuntu while taking advantage of Windows services such as Syncthing to sync my Obsidian notes and Sunshine for accessing my Steam library via Moonlight. I'm highly satisfied with the flexibility and performance this configuration provides.

In my homelab server, I run Proxmox as a hypervisor and I can play with many Linux VMs and LSX containers. My main Linux VM runs Debian and it is where I run all services to monitor and update my financial market database. Even if I don't need a user interface in my homelab setup, I can easily install and run one If I want to.

The described above is my dev environment de facto and I am very comfortable with it.

The obvious solution for my problem is to use a laptop (no matter the Operation System) with internet access and a terminal emulator to access my WSL2 instance and Linux VMs through SSH.

Actually, that is the way I do it, but instead of a laptop, I chose a tablet! More specifically the Tab S9 Plus comes with a keyboard.

Connecting to the Batcave

The connection with my computers is made through SSH, but, instead of opening the ports on my router and setting a domain to it through no-ip, I opted to use VPN solutions. In this case, I am very happy with Tailscale.

With tailscale I can easily connect with all my devices and give them internal domains directly on tailscale admin panel. As long the machines are in the same tailnet, I can safely transfer data among all computers, just knowing the domain, user, and password of the target system.

Terminal emulator

As I said before, I could use a notebook with any operational system and a terminal emulator.

Since I use Android in my "on-the-go" dev environment, I chose Termius as a terminal emulator. Termius has interesting functionalities like terminal tabs and automatic routine tasks.

There are not many options for terminal emulators in Android. Besides Termius, I used Termux for a long time (a very good option as well). But since Termius integration with customization fonts (NerdFonts in this case) is easier I opted for it.

Code Editor

For code editor, we have good excellent options. The first one, and probably the most beloved one, is the VS Code. Microsoft did a really good job by allowing remote connections among VS code instances by accessing tunnels linked to github or Azure accounts.

What I do is to let a VS code server instance run on every system that I need access. On the tablet side, I use the VS code web version to interact with them through the classic VS code UI.

I could stop this section here and set VS code as the best solution, but unfortunately, I face an annoying disconnection problem every 10 to 15 minutes. This happens only on Android and I have not fixed it yet.

Until then, I will use the next option for the code editor: NeoVim. Although NeoVim is not so popular (actually most people that I know hate it), it shines running directly on the terminal. If you never used it before, you should give it a try, it is not easy... but once you get used to it, it is like you are the Code Wizard.

Every day I use it I get more comfortable with its workflow. I am amazed by all the keyboard bidings and by the plugins developed by the community. But since I am a noob yet, I chose to not set up NeoVim from scratch, instead, I am using LazyVim to set up everything.

Useful tools

Now I already have everything that I need to code away from home. I have a code editor and SSH access to the system terminal.

But since I like to test different options, sometimes I find good solutions that are worth showing. The last tool that I found useful was a native Android application to test API endpoints: the API Tester. You can configure your requests just like insomnia, for example.

Some problems

Besides the disconnection problem with VS Code, code using a Tablet brings other annoying problems to deal with.

The most annoying thing for me is the lack of native inspection tools in browsers. If you are a front-end developer you know how useful is the possibility to access a CSS element through the inspection tool and change it to check how It looks, or even access the console feature from the inspection tool for debug purposes. Unfortunately, the Android browsers do not have this functionality.

But since the backend and data science are my favorite things regarding software development, I can survive without such too.

Is this setup for everyone?

It’s very likely not, unless, like me, you enjoy spending a few minutes or hours configuring every detail of the environment. For me, the whole process is very rewarding, and it’s something I’ve carried with me since adolescence, back when I spent a good part of it installing different Linux distros, thinking I was a "hacker" running apt update.

Other alternatives using the tablet

I used to access my machine remotely using software like TeamViewer, Parsec, or even Moonlight.

These are still good options, but the bandwidth consumption is higher, and since I prefer working in the terminal and most of the time my connection is 5G, I’ve opted not to use it as frequently. Occasionally, when I visit my father’s house, where the Wi-Fi signal is 5GHz, I access the Windows machine remotely.

Final considerations

I've always liked tablets, the first time that I coded on one was with a Tab S6 Lite, in a very similar setup that I described in this post. Upgrading to a tablet with a bigger screen, such as the Tab S9 Plus, greatly improved my workflow. However... if I could go back, with the same budget I could buy a MacBook air. It offers all the benefits of the tablet but with a better and more stable Operating System.

List of abbreviations

  • VM - Virtual Machine
  • WSL2 - Windows Subsystem For Linux 2
  • SSH - Secure Shell
  • VPN - Virtual Private Network
  • LXC - Linux Container