DEV Community

Cover image for How I set my Linux computer for coding

How I set my Linux computer for coding

David Mendoza (He/Him) on January 10, 2020

Hello guys, it's me again today I'm going to show you what's my setup for a Linux machine take in mind I'm not talking about a RPI or a server, I'm...
Collapse
 
ghost profile image
Ghost

Ubuntu-fonts are also pretty nice for coding, I've tried all of them and always come back to Ubuntu's, even tho I used Ubuntu just for about a week like 8+ years ago. Doesn't have ligatures but I kinda prefer it that way sometimes ligatures hide things like == Vs === but is a matter of taste.

Collapse
 
phillpeters profile image
Phill Peters

A kindred spirit! I don't think I'll ever be able to move away from Ubuntu fonts.

Collapse
 
mendoza profile image
David Mendoza (He/Him)

Hahahaha give firacode a change belive me you won't regret it

Thread Thread
 
phillpeters profile image
Phill Peters

Yeah I suppose I should

Thread Thread
 
ghost profile image
Ghost

don't let them sway yo with their ligatures!, be strong and follow the path of... Ubuntu fonts?

I don't know try them, but I suspect that you'll come back, for me is really annoying to read code in a font I dislike or find hard to read. And also, Ubuntu font is the only just the right size, with others 8 is too small and 9 too big for me.

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

Hahahaha neveeeeer he must come to our ligatures!

Thread Thread
 
phillpeters profile image
Phill Peters

I would try them just to give them the chance, but I know I would be back with Ubuntu fonts before long. I always think non-developers must find it weird, but if your dev environment is easy on your eyes, it's that much more fun to do the work. I use VS Code with Ubuntu font, and a custom mash-up of Material Dark and One Dark Pro themes. It looks so good on my 4K monitor.

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

Daaamn... That sound awesome hahahah I have a 32 inch television that I use as monitor :v

Thread Thread
 
ghost profile image
Ghost

I currently have 2x1080p monitors; is that 4K as awesome as it sounds? is not too much light (too tiresome)? have you found 32" is a good fit for arms length distance or would you recommend something a bit bigger? and finally, did you found difficult to find a TV without color compression? with color compression fonts get blurry but maybe new TVs don't compress or comes with options to disable it.

Thread Thread
 
mendoza profile image
David Mendoza (He/Him) • Edited

Well I found 32" to be fine, I had just used 4k for video games actually, and my tv doesn't make my fonts get blury, actually it's a new TV and it costed like HNL 3500 (~150 USD), but if you are using a laptop try a tv as a second monitor man there is not that much difference

Thread Thread
 
ghost profile image
Ghost

I'll give it a thought, as you may know, once you add a monitor you can't take it away, to add a screen to the workflow is a big commitment. If you are not careful everything but 10 screens will feel wrong. Is like when you buy your first mechanical keyboard, after that all the keyboards that felt okay, start feeling like garbage.

Thread Thread
 
mendoza profile image
David Mendoza (He/Him) • Edited

I will always say one monitor is meh it gets the job done, two monitors are great it gets the work done faster and three are a overkill don't get me wrong if you can afford 3 get them by all means but two should be enough for most programmers

Thread Thread
 
mwarner77 profile image
Mark Warner • Edited

(Disclaimer: I used to write for a popular PC gaming website about gaming graphics and displays, so my opinions on monitors probably diverge somewhat from what may be thought of as more "mainstream".)

At work, I use three external 1080p monitors in a line, and my laptop's 15" 4k display. I keep my console (putty/bash and chrome dev console) window up full time on the leftmost display, vs code on the next, Chrome and other apps (db tools, etc.) and outlook on the laptop screen. It works pretty nicely.

At home I have just a single 27" 4k display, and while it is really nice for smoothing font edges, you have to scale everything up at least 50% to keep icons and text from disappearing, so I tend to think 4k is wasted for coding on a desktop monitor. High-DPI scaling works really well in Windows 10, but not so great in any linux distro I've used. They mostly limit you to whole number scaling (100%, 200%, etc.), and the scaling is far from global/universal. Windows is also not completely universal, but at least you can do 125% or 150% without having to do anything special. It actually defaulted to 150% on my 27" display.

Anyway...point is, if you have more monitors, you'll find something to put on them. I keep (only half-jokingly) asking for 2 or 3 more at work. The primary benefit is always having various windows open and On Top.

Thread Thread
 
ghost profile image
Ghost

is like the size of drawers, closets or pockets. You'll never have too much space, only too much stuff on them. But they are also like cake, nobody "needs" cake, nobody "need" 3 monitors (well maybe some). But we want them anyway :)

 
phillpeters profile image
Phill Peters

I'm rockin three 28" monitors. It's a pretty sweet setup, if I do say so myself.

Collapse
 
laurentpayot profile image
Laurent Payot

I use Ubuntu fonts with ligatures (from Fira) thanks to github.com/ToxicFrog/Ligaturizer

Collapse
 
ghost profile image
Ghost

Ok, I think that settles our little nonsensical and almost cult-like discussion of the thread above, thank you very much (ironic) I guess we'll have to go back to Xorg Vs Wayland, Vim Vs Emacs or something like that. Or are you gonna rationally solve those too? ugh

PS: So the fonts work well? no weird characters sometimes?, asking for a friend, I'll tell him to try them...

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

For me it did man

Thread Thread
 
ghost profile image
Ghost

damn

Collapse
 
mendoza profile image
David Mendoza (He/Him)

I have used ubuntu's too, but actually I'm exactly the opposite I need the ligatures hahaha I loved them, that's why I recommend fira code, there's some really good. But they are paid...

Collapse
 
patryktech profile image
Patryk

For web dev, I'd also recommend:

  • Docker, docker-compose (run your software in containers - very handy for replicating the same setup on your dev machine and deployment servers, and keeping architecture as code).
  • Guake (for Gnome) or Yakuake (KDE) dropdown terminal - why bother alt-tabbing through a million windows when you can just toggle the terminal with F12 - very handy to run tests, restart containers, etc.
  • pytest, jest, cypress ... Software that isn't tested is broken as designed.
  • CI/CD ... I use Gitlab-CI (😍😍😍), but any CI tools will do (Travis is popular on GitHub, I believe, there's also Jenkins, etc.) Run your tests every time you push to your repo.
Collapse
 
ghost profile image
Ghost

Docker is invaluable, because of your reasons and also to easily try versions without making a mess with your system filling it with a bunch of libs, programs, config files, etc. And gives you freedom to use whatever weird distro you like (if you work in Linux) instead to be tied to something similar than your target.

Collapse
 
mendoza profile image
David Mendoza (He/Him)

I agree on this, sometimes getting tons of libraries on your PC is not the best and it can help

Collapse
 
mendoza profile image
David Mendoza (He/Him)

I love them all, you know I have just used jest. I have never used a test on any other software hahaha, oh and ci just for expo

Collapse
 
patryktech profile image
Patryk

Jest is great for unit tests, and some integration tests.

Cypress is amazing for end-to-end testing. I love watching it open a browser, and interact with my site in a full-fledged UI.

Biggest reason tests take time away from dev sometimes is because of how much I just love watching them run 😅

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

I can tell that I do love watching them, but I don't think that they are necessary 100% especially if you are testing while coding,
I have used jest for integration, but never for unit.

Collapse
 
alexisfinn profile image
AlexisFinn

Over the course of years programming with linux, I've gone through a lot of stuff. But there's always some new stuff that when I give it a go I can no longer do without it, here are a few recently discovered utilities that are definitely staying for the win:

RipGrep: Search through files for a pattern at lightning speed
github.com/BurntSushi/ripgrep

fzf: Filter search results with ease
github.com/junegunn/fzf

z: Jump easily and quickly between your most often used directories, without all that cd nonsense
github.com/rupa/z

tig: Terminal interface for git, pretty sexy and usefull, I would recommend adding an alias tig='tig status' as it starts by default in tree view, but most of the time what I want is to see current status and prepare to commit.
github.com/jonas/tig

Collapse
 
alexisfinn profile image
AlexisFinn • Edited

Forgot another of my favorites:

Bat: A cat replacement with syntax highlighting, you'll never use cat again
github.com/sharkdp/bat

Collapse
 
mendoza profile image
David Mendoza (He/Him)

Damn! All of them sound amazing, let's hope beginners read the comments and see this one

Collapse
 
timepieces141 profile image
timepieces141 • Edited

I love powerline for my terminal, especially seeing what branch and/or virtual env I'm in: powerline.readthedocs.io/en/latest/

If you write in Python you can't live without virtual environments. So virtual environment wrapper is essential: pip install virtualenv virtualenvwrapper. I know python3 comes with venv, but I've never invested enough time to figure out if virtualenvwrapper still works with that, and I can't live without virtualenvwrapper.

People have already mentioned docker, but I just like to point out that even if a docker image is not your final artifact, they are a great tool for allowing any developer to run your unit tests regardless of how they have set up their development system, specifically OS (now that docker is on the big 3). And anything that allows your developers to run your code in a repeatable environment will save time, and that very same process can be used on your CI/CD server.

Collapse
 
mendoza profile image
David Mendoza (He/Him)

I haved never seen powerline, but now I love it hahaha, you know I think is an old habit of not using virtual environment when I was leaning python people always install everything global, I haven't used any virtual environment for that, but I hope I can give it a try, oh and docker... I know... I know haha it's that I don't always do unit testing so I thing right now is not necessary plus it's a beginners tutorial

Collapse
 
timepieces141 profile image
timepieces141

Well, I am 20 years into this and if there is one thing I could advise beginners, it's to write your unit tests from the very beginning. It's far easier to update a unit test than it is to take time out to write unit tests for an entire code base that is lacking them. And in languages that are interpreted instead of compiled, such as python, it's your quickest and easiest way to catch simple logical errors. And you get syntax and typo checks for free. Add in linting, and you have a simple workflow that produces an incredibly low rate of bugs. Saving time is the name of the game.

As for the virtual envs, I also see this as a way to reduce bugs - specifically dependencies in setup.py. While working, one might determine they need a library, install it, write the code, and move on, forgetting to add it to a requirements file. Creating a new virtual env from scratch to run your unit tests right before you push to git removes the potential for missing dependencies. And you can roll that whole process up into a script. I create an env, run pytest, run pylint, run coverage, run an HTML report, and destroy the env all in a bash script. That, or run it in a fresh docker container.

Collapse
 
shmink profile image
Tom Nicklin

Have you been using unix long?

Thread Thread
 
timepieces141 profile image
timepieces141

Pure Unix, no. We had a few Spark boxes at the beginning of my IT days. But soon after everything was Red Hat flavor Linux. By the time I had migrated into software development, Ubuntu was gaining popularity. Not sure the IT department ever left RH, but cyber devs did favor Debian-based.

Collapse
 
ojoanalogo profile image
Alfonso Reyes

Great post David! I love reading detailed and concise posts like yours ;)

I'd like to recommend to install "nvm" instead of the node binary, since you may find some projects where your node installation needs to be an older version o newer. With nvm you can manage your node versions with ease.

Btw is nice to see other latam folks here on DEV, keep it on!

Collapse
 
mendoza profile image
David Mendoza (He/Him)

Thanks for the compliment, its my first long and concise post, but I see people liked it so I might write more,

You are completely right for the nvm but I didn't included just because of the simplest way for a beginner to start.
Btw Honduras here, where are you from?

Collapse
 
ojoanalogo profile image
Alfonso Reyes

Well yes, I agree with you on the nvm comment, although when I started I wish i had learn to use nvm first haha.

And yes, congratulations on all the positive feedback you are receiving, I hope to see more posts of your authorship.

Mexico here, saludos :D

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

Thinking about it... they are some times i needed an old npm... you are right hahaha

I just posted a quick tutorial on makefiles, and I had one on readme files just in case you are interested

Saludos Mexico Ten una buena semana amigo :D

Collapse
 
ghost profile image
Ghost

My recommendation, XFCE4-Terminal. I've tried all terminal emulators available in Linux through the years. From the heavy Konsole to the light st and let me tell you; XFCE4-Terminal is by far the best for me, dropdowns don't work for me, I always hace 20+ open terminal, to open videos, play music, code, write documentations, testing, read news in RSS, etc.

If you are concerned about RAM, with 20+ open terminals XFCE4-Terminal eats less RAM than st, has transparency (I use tiling WM so I like to see my wallpaper once in a while :) ), has included scrolling (I'm watching you st), is fast, stable and resizes text with the window. And has a reasonable dependencies (I'm watching you now Konsole). Others to consider are Alacritty, which is very fast but consumes a lot of RAM, if you don't open too many instances is no problem (20MB Vs 70MB is not much difference) only with an unnatural amount of open instances becomes a problem, and is because has no deamon mode which is a plus because is one falls doesn't affect the other instances, but XFCE4-teminal never falls anyway.

Collapse
 
mendoza profile image
David Mendoza (He/Him)

damn... this a 100% hardcore hahaha i love how you use more than 20 terminals, I means tops i use 4 or 5 never over 10, I respect that...

Collapse
 
ghost profile image
Ghost • Edited

I don't know, most of the time is insecurity, will I still use this?, maybe, let just get another terminal..., unwatched yt videos, paused music, etc.

I guess sounds fancier than it is, is just the fact that my current uptime is 60 days, sounds impressive but is mostly laziness and not updating kernels (I think I have 3 piled up) and I haven't been in the mood update them so why bother rebooting, just suspended at night.

Usually things that sound awesome really are not; openbox because I was awesome? nope, low RAM, after that i3, now because I was awesome? nope again, for a while I didn't have space to work with a mouse and my old touchpad was awful so, avoid mouse it was: ratpoison > awesome > xmonad > Qtile > i3 and I got used to it so, that's what I use it now.

Everything CLI?, low RAM again and again got used to it. Same with RSS that allow me to close about 10 browser tabs, my bookmarks are a black hole mess, so if I close a tab is dead to me and only destiny will lead me back to it, so a lot of tabs, a bunch of RAM that seemed precious to me before, I know..., don't overthink it.

Even my overpopulated Conky/i3 status bat is just to keep RAM and CPU at bay.

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

man sometimes laziness is awesome! hahaha

Collapse
 
goodevilgenius profile image
Dan Jones

As many people have mentioned, if you're working with node, a node version manager is essential, since you may have different projects that require different node versions.

Most people recommend nvm. I used nvm for a very long time, until I found nave. I definitely prefer nave now. For each project, I can create a .naverc with the required version. Then, when I start working, I do nave auto path/to/project/root. It creates a subshell using the required version of node, and when I'm done, I can just exit that subshell, and I'm back to my preferred version of node.

Collapse
 
yeraycat profile image
Yeray Catalá

I'd change nodejs to nvm.

It will make your life really easier if you need to switch node versions.

Collapse
 
mendoza profile image
David Mendoza (He/Him)

I know, but for the simplicity of the begginers I just putted npm, I don't think that they would download someone's else project right away

Collapse
 
oziniak profile image
Oleh Ziniak

I've seen a lot of people finding out about nvm way too late, leaving pain reinstalling node. Because sometimes even minor versions matter. In the ruby community, they learn about rvm right from the start. And I've noticed a lot of people suggesting it here from real-life experience. So I guess it would be great if you could edit an article. Don't get me wrong, it is awesome, but may be even better. Cheers!

Collapse
 
aimerib profile image
Aimeri Baddouh

I'm surprised nobody mentioned tmux yet. Tmux is a terminal multiplexer, so it allows you to have split panes, multiple "windows" and more importantly, it allows you to disconnect from a session, then reconnect to it again and never lose the status of any of your screens.

By far my favorite development environment tool of late

Collapse
 
gerbosan profile image
Carlos A.

Good advice.

I don't use Ubuntu but can't deny it's one of the favorite distros for developers.

I use openSUSE Leap and would recommend

  • linuxbrew which makes easier to have a good platform to develop Ruby (like MacOS, openSUSE uses an old version of Ruby) or any other language (though have not tried)
  • Zsh and Oh my zsh, Zsh installed using my distro repos
  • nvm, a requirement to have the any version of Node, though Docker can help a lot managing such.
  • Yakuake, dropdown terminal, addictive
  • Flatpak or snapd to get and install some packages not available
  • Wine, to run some Windows programs
  • VS Code is amazing, just need another article to mention those many good plugins that increase it's productivity.
  • KDE, ;) I'm happy with it.
Collapse
 
mendoza profile image
David Mendoza (He/Him)

Damn... All of those are great, I haven't used opensuse just because I didn't liked the DE but your recommendations are great, I Always have snap on my ubuntu's by defualt so that's why I didn't mention it hahaha

Collapse
 
gerbosan profile image
Carlos A.

;)
The distro is not relevant. openSUSE allows many DE: Gnome, KDE, xfce, etc.

I worked with Ubuntu for a while, but couldn't get used to Gnome, but I used Guake, linuxbrew.
Something we forgot to mention is the browser. =|
Also the musicplayer =D My usual is Clementine which is lighter than Amarok.

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

You are right... Should I added now? I mean I use Firefox and rhythmbox but I can add them

Collapse
 
geraldew profile image
geraldew

It seems odd that after putting on so much Open Source software that you'd then install something that isn't. As it happens, someone else here on Dev recently posted the why and how to use VSCodium instead.
dev.to/misterf/why-and-how-you-sho...

Collapse
 
mendoza profile image
David Mendoza (He/Him) • Edited

You know I have used it but I think it too hard for beginners and newbies to compile it and installed it on their pc, when vs code is just a .deb that you can open on your pc. plus is not closed source anyway

Collapse
 
geraldew profile image
geraldew

I suggest you read the article I linked to, which links to descriptions of how/where to install it - quite without having "to compile it". I did that myself just before posting my comment - to ensure I wasn't suggesting something too difficult. Go look again and you'll see it is also "just a .deb that you can open on your pc".

And, the source you are currently suggesting definitely is a closed source edition.

Given the wide currency of the "VSCode" name I'd accept that as a valid enough reason for not confusing newer users with license technicalities. Almost none of us run our programs on Open Hardware CPUs so pragmatism wins over purity with this kind of thing.

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

Oh damn you are right, the first time I tried it I had to compiled it but that's great, I hope people see this comment and give it a tried.

Collapse
 
chrisjimallen profile image
Chris Allen • Edited

Really interesting and relevant post. I currently own a MacBook Pro 2017 with touchbar. It's the nicest looking piece of junk you've ever seen. After 12 years on a Mac doing server admin and web dev, i just picked up an XPS 13 to put Ubuntu on, and I'm finally ditching Apple shit and properly joining the Linux community. Only critique I have of your post is advertising the fact you pirate stuff. I'd be a hypocrite if I said its bad as I've done it in the past, I guess we all have, but it kind of knocks your credibility a tiny bit. All in all a great post, keep it up.

Collapse
 
mendoza profile image
David Mendoza (He/Him)

Hahaha I know but growing in the country and the knowing how poor my family where, it's an old habit hahaha, I do own a Netflix and Hulu now, but I always need popcorn time on my Pcs just in case

Collapse
 
chrisjimallen profile image
Chris Allen

Good luck with Linux, I'm making the switch tomorrow, and can't wait.

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

Greaaat, feel free to comment more if you have any questions

Collapse
 
twitch0125 profile image
Kaleb Ercanbrack

Give Cascadia Code a try

Collapse
 
mendoza profile image
David Mendoza (He/Him)

Oh damn... Oh damn... it looks awesome, I downloaded it and opened a c++ project, it looked awesome, opened a js project, IT LOOKED AWESOME.
Man this is a great font BUT I have come to see a font that i look more than dank mono its beautiful and it has cursive AND ligatures... I mean its paid... but I'm saving to buy it (its 40.00£)
take a look at it.
dank mono

Collapse
 
twitch0125 profile image
Kaleb Ercanbrack

Ahh I've been debating if I should get Dank Mono haha. I wonder if I could get my work to pay for it :p

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

I tried it on their site and I fell in love man hahahaha

Thread Thread
 
twitch0125 profile image
Kaleb Ercanbrack

Check out Victor Mono, very similar to Dank Mono but it's free :p

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

Exactly hahaha it's awesome

Collapse
 
roestvrijstaal profile image
RoestVrijStaal

But why choosing the non-LTS version of Ubuntu (19.10) over the LTS-version 18.04?

Being close to upstream is nice, but being forced to do (not always successful dist-upgrades) isn't.

Collapse
 
mendoza profile image
David Mendoza (He/Him)

I always like To have the latest and greatest hahaha, and I like to test things so if I see a problem I send it down to canonical

Collapse
 
demkantor profile image
demkantor

I've played around with a ton of distros over the years, recently came back to Ubuntu and am really happy with it. I don't always use the latest on any of my PCs, but 19.10 on my main home PC is just plain fantastic even though I'm not using ZFS. But my laptop is for my main development and there I have 18.04, I'm excited in a few months to switch it to 20.04

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

You know I actually heard that they are asking people to wait before using zfs, I'm using ext4 since Ubuntu 16.04 hahahah well I changed to arch then to budgie and then back to Ubuntu on 19.04 but actually 19.10 is running like a charm on my laptop and it's like 4 years old hahaha so yeah I love it

Thread Thread
 
demkantor profile image
demkantor

Exactly, Linus is against putting ZFS in the Linux kernel due to oracle's tendency toward litigation. So I'll stick with etx4 unless given a real solid reason. 19.10 without ZFS is still one of the best Ubuntu updates I've used in years, real happy with it for home use, but I don't want to update to frequently on my laptop as that's for work and I can't afford to waste time with any hiccups. Good write-up by the way, I'm always happy to see people supporting Linux as their development box, always feels strange to me how many developers choose ios over it

Thread Thread
 
mendoza profile image
David Mendoza (He/Him)

Exactly that's why. You know my laptop is my work and school machine hahaha so I'm kinda playing with fire, thanks for the compliment its my first "long" post and I'm super glad everyone liked it, you if I could afford a Mac I might buy it to install a Linux on it hahahaha

Collapse
 
itjusthitme profile image
Donald W Norman

David,
First of all, my wife is Honduran and was a lead QA tester before retiring. She is from Tegucigalpa as well and grandparents were in Trujillo. I appreciate that you put yourself out there with your "first long post". Most people allow fear to hold them back from doing something like this. I've never written a post to any tech site. I don't think I have anything to offer as I am just now, at 60 yrs old, teaching myself to code. So good job!!

Collapse
 
bilalelreda profile image
Bilal Elreda

This is a nice, concrete, and sensible list. Thanks for sharing.

Collapse
 
mendoza profile image
David Mendoza (He/Him)

thank you for reading it, i hope it came handy to you!

Collapse
 
rubiin profile image
Rubin

I advice against installing nodejs directly. It becomes a hassle to switch between node versions so instead using a nvm for managing nodejs looks a better alternative

Collapse
 
moopet profile image
Ben Sinclair

Transmission isn't illegal, or indeed for anything illegal.

However, I wouldn't promote the illegal use of anything here, especially not software or content piracy as with Popcorn Time.

Collapse
 
mendoza profile image
David Mendoza (He/Him)

I know it's not illegal but I have used for downloading games and movies that are paid...

Collapse
 
aniganesh profile image
Aniganesh

What does libresprite do?

Collapse
 
mendoza profile image
David Mendoza (He/Him)

It's an opensource version of asesprite a pixelart editor

Collapse
 
ajboni profile image
ajboni

I started using fish shell and it's really great at remembering commands and suggesting options/parameters for commands

Another great tool I use is exa. It's like ls on steroids

Collapse
 
mendoza profile image
David Mendoza (He/Him)

Nice, if I have to choose other shell I actually like zsh it's beautiful and I love the interactive parameters and or programs, it's awesome and is not hard to install