Site icon GetPageSpeed

CentOS/RHEL 8 as your developer machine. Utilizing 64GB of RAM for performance

Linux Command Line

Linux Command Line

CentOS/RHEL 8 is not only good for server setups. Linux distros, in general, are more favorable as developer machines.
Largely so, because development involves deploying final apps to a Linux server anyway.

Let’s review some of the things you want to consider when using CentOS/RHEL 8 as your developer machine.

Many items will involve leveraging your RAM as much as possible. (I’m using a machine with 64GB RAM for a reference).

Install a mail client

CentOS/RHEL 8 comes with the Evolution email client by default. If you want something modern and fancy, install Mailspring:

sudo dnf install mailspring

Install a Hackable Editor

You will have an IDE of course, but for quick file edits, I prefer something lighter, e.g. Atom (not so light though):

sudo rpm --import https://packagecloud.io/AtomEditor/atom/gpgkey
sudo sh -c 'echo -e "[Atom]\nname=Atom Editor\nbaseurl=https://packagecloud.io/AtomEditor/atom/el/7/\$basearch\nenabled=1\ngpgcheck=0\nrepo_gpgcheck=1\ngpgkey=https://packagecloud.io/AtomEditor/atom/gpgkey" > /etc/yum.repos.d/atom.repo'
sudo dnf install atom

Put /tmp to RAM

You have a lot of RAM, why not have temporary files reside in RAM?

Add the following to /etc/fstab (make sure to update the username), then reboot:

tmpfs                      /tmp                    tmpfs   mode=1777,strictatime,nosuid,nodev                  0  0
tmpfs                      /home/danila/.cache     tmpfs   defaults,relatime,uid=danila,gid=danila,mode=0755   0  0

Put dnf cache to RAM

tmpfs                      /var/cache/dnf          tmpfs   defaults,relatime,uid=root,gid=root,mode=0755       0  0

Run rm -rf /var/cache/dnf/* and attempt to mount the directory via mount -a.

If all is well, then you can see that it’s mounted in df -h output.

Speeding up various apps

I have a few apps, which “misbehave” by placing their caches as some subdirectory within ~/.config data.
They sort of want their stuff in one place, similar to Windows and its Application Data thing.

In Linux systems, we can and should use ~/.cache where applicable.
Moreover, this will allow us to leverage our RAM-based cache.

Create /etc/tmpfiles.d/caches.conf

d /home/danila/.cache/profiler 755 danila danila
d /home/danila/.cache/Mailspring 755 danila danila
d /home/danila/.cache/Upwork 755 danila danila
d /home/danila/.cache/Slack 755 danila danila

Then you can create the dirs now:

systemd-tmpfiles --create caches.conf

For each app, you need to close it, then remove its current cache directory and replace it with a symlink to .cache somewhere:

# Mailspring
rm -rf ~/.config/Mailspring/Cache
ln ~/.cache/Mailspring -s ~/.config/Mailspring/Cache

# Upwork
rm -rf /home/danila/.Upwork/Upwork/UserData/Cache
ln -s /home/danila/.cache/Upwork /home/danila/.Upwork/Upwork/UserData/Cache

# Slack
rm -rf /home/danila/.config/Slack/Cache
ln -s /home/danila/.cache/Slack /home/danila/.config/Slack/Cache

Speedup Jetbrains IDEs

Now that our ~/.cache is mounted in tmpfs, we can simply reconfigure some apps that don’t make use of this “proper” location, to use do the right thing of using it, and speeding them up.

E.g. PyCharm (Community Edition is amazing and free):
https://www.jetbrains.com/help/idea/tuning-the-ide.html#system-directory

Open IDE, then select Help -> Edit Custom Properties…

Then set:

idea.system.path=~/.cache/pycharm
idea.log.path=~/.cache/pycharm/log

After this just restart the IDE.

Desktop Conveniences

Moving from another OS like OS X or Windows, you will absolutely miss something at the bottom (dock).
You will also miss the system tray, or “notification icons” area. This can be solved rather easily with some Gnome extensions:

sudo dnf install gnome-tweaks gnome-shell-extension-dash-to-dock gnome-shell-extension-topicons-plus 

After this, log out from your session and back in. Then enable the extensions in the Tweaks app.

Fix JRE:

cd /usr/lib/jvm/jre
ln -sn lib conf

Read more

Exit mobile version