DEV Community

Cover image for How I set my Linux computer for coding
David Mendoza (He/Him)
David Mendoza (He/Him)

Posted on • Edited on

How I set my Linux computer for coding

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 talking about a full flesh developer's pc, for this example I'm using a computer with ubuntu 19.10 installed.

Most of this are just small lists so you know what they are, and I will add a command or two while write them (Most how to install them)

Packages

Here you will see some programs that they are easily installed with apt, that is why i decided to separate packages and software.

build-essentials

If you didn't knew, build-essentials is literally what it says, the essentials to build a lot of software, mostly I use it to install g++ and gcc, c++ and c compiles and make, software used to make a compilation more human.



sudo apt install build-essential


Enter fullscreen mode Exit fullscreen mode

python3 and pip3

When i finnished my programming course on college, the first thing I tried to learn was python (I did good i think), and looking that python2 is getting deprecated this year, why not python3? Mostly I use it when I'm trying to learn ML and Django (never quite understood Django)



sudo apt install python3 python3-pip


Enter fullscreen mode Exit fullscreen mode

Node.js and npm

I mean... come on? node.js and npm are like the heart of tons of projects now a day, with web development trying to replace software development, I use this two for most of my web projects.



sudo apt install nodejs npm


Enter fullscreen mode Exit fullscreen mode

Expo

I use expo for quick and dirty react native apps, for me is the best absolutely, you should give it a try if your pc isn't really powerful but you want to make apps.



sudo npm install -g expo-cli


Enter fullscreen mode Exit fullscreen mode

CRA (create-react-app)

I Know its not the best, but it makes the cut plus is kind of fast, but I use it to make my react project templates



sudo npm install -g create-react-app


Enter fullscreen mode Exit fullscreen mode

Git

I don't even know why i left this for the last... I mean... git man, is like the most used command I have on my pc, I dont even need to let you know what i use it for.



sudo apt install git


Enter fullscreen mode Exit fullscreen mode

Vim

I like to experiment with server and stuff, and most of the times they have a "sudo protected" file and I need to edit it, so I just use vim, it can be a B!tch but I like it.



sudo apt install vim


Enter fullscreen mode Exit fullscreen mode

Fonts

If you are new to coding, you might be thinking "WHY THE F!@K do I need a font for?"
Well let tell you that fonts are really important, you wouldn't like stare at a ugly font for 5+ hours right?

Fira code

So give fira code a chance, here is the GitHub page, since it depends on every OS, how to install them.
Fira Code

Edit
A good friend of mine did this tutorial

Software

VS code

I use vs code as my main code editor,I think I don't need to elaborate. I installed it from the Official Site

Thunder bird

I use thunder bird obviously for my emails, It was my first email app, and its still going, you can actually install this one with a command.



sudo apt-get install thunderbird

Enter fullscreen mode Exit fullscreen mode




Random programs I use (You might like one)

  1. Popcorn Time - I Love watching movies (not while coding though...)
  2. Transmission - Illegal stuff you know... movies hahaha.
  3. Gimp - Simple to use image editor.
  4. Libresprite - Ok so this one my first program compiled by myself, let me know if you would like to learn to do so.

So this was my first actual "long" post, if you liked it please let me know. That way I might Start making more "long" posts

Top comments (81)

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