Introduction
I read a lot of blog posts and guides about DevOps, most of these tend to cover specific tools, languages, and concepts but do not really give you any guidance on where to start on that journey, and what essential skills an engineer should have.
When I was first starting out as a Software Engineer on Linux, I was fortunate enough to work with some great people who taught and imparted me with some really good, useful words of wisdom - things that have been instilled into me and I rely upon to this day.
Through this series of blog posts, I’m going to give you an introduction to what skills I think you should have in order to make a success of your role as a DevOps engineer and to share with you some of those words of wisdom.
What advice was given to me
When I first started out as a Software Engineer, there was no concept of DevOps, neither was a “fullstack developer” a thing, you were an engineer that was concerned with literally everything, front-to-back, you concerned yourself with how to install, configure and package your applications, how to operate your custom built software in all environments including production. It was interesting and fun times and the technology world is embracing this again with “DevOps”.
So, going from writing Windows based software to client/server web applications on RedHat Linux was going to be a bit of a learning curve. I learnt a lot in a short space of time and these were the starting advice given to me:
- Learn the basics, grow from there
- Learn to use a text editor, and learn it well
- Learn a shell, and master it
Learn and understand the basics
The topics here are intended to give you gentle introductions, to point you in the right direction from where you can springboard to more advanced scenarios and use cases.
Learn to use a text editor
As any kind of engineer you’ll be working with plain text files a LOT, they’ll be YAML or JSON, or INI, or some weird and wonderful format. These file formats often govern how an application is configured.
What all these file formats have in common is that they are in plain text - easily readable and editable from any text viewer/editor, you do not need to install some proprietary software to view/edit.
So, one of the very first things you should learn is how to use a text editor - preferably through a terminal, something like vim.
Why in a terminal? Well, you’ll often find that you’ll be jumping into different servers ( even containers) examining their configuration files, tweaking them, restarting the services that are attributed to them. These files, for the most part, are out of reach of your favourite locally installed editor (e.g. VS Code, Atom and the like).
What you can almost always rely on being available on a remote machine is vim - learn it, use it every day, and when some service breaks in production and you need to tweak a few configuration lines, have the confidence to use vim instead of rushing to install some random text file editor that you probably do not have permissions to install, or pulling the manual out to figure out how to edit a file with vim.
As a minimum, learn how to do the following:
- Create and edit a file (Yes! Really!)
- Navigating a file, e.g. finding words, moving up, down, left and right, jump by word
- Copy (words / lines / blocks) and paste
- Displaying line numbers, jumping to specific lines in a file
- Closing the editor
- Opening multiple files, in tabs, in split planes (horizontal or vertical)
- Navigating from one buffer to the next in tab mode, in split panes
For me, these are the basic actions that I tend to do on a daily basis:
- I like to open multiple files to compare / contrast, so I like to see more than a single file displayed at a time in a single vim session
- I need to be able to jump from one “buffer” to the next, making edits where required
- I see some warning/error about some line of text being syntactically incorrect, e.g. syntax error on line 212, so I’d want to be able to open up the file and jump directly to that line - can you imagine scrolling down to line 1053 with the ‘j’ key?
Admittedly, as a beginner with vim you will find it convoluted and overly complex to use, but there’s a reason why it’s loved by many - persevere with it, and you will be rewarded.
Learn the basics and be comfortable with them, resisting the urge to customise it too much as you learn the basics. Customising it too much and introducing plugins may mean that you become too reliant upon them and be stuck without them on a remote machine where you do not have the same level of freedom.
Resources:
Vim has been around for many, many years and fortunately, there is a lot of literature and guides on learning, using and customising vim, checkout some of the links below:
As an engineer, you’ll be spending probably 90% of your time in a terminal interfacing with some computer through commands in a shell via a terminal session; the other 10% will probably be checking your emails via an email client, chatting to colleagues via Slack / Teams etc., or searching for a fix for a problem that you’ve encountered via your favourite web browser.
The shell is a very powerful tool, used properly and as your comfort level and experience increases it can be massively productive.
It is critical that you familiarise yourself with a shell.
There are a multitude of shells that are available for you to use, the most popular and common is bash. There are others such as ksh, csh and zsh.
But which one should you learn and use? Well, we can apply the same logic as we applied to learning a text editor ... learn bash as a priority, you can quite safely assume that bash is going to be available on almost any Unix/Linux installation.
Basic things you should be able to do on the shell (with Bash) include:
- Navigating the folder structure, e.g. changing from one directory to another
- Finding files and searching for files with specific lines of text
- Opening files for reading, either in a program or output to your terminal session
- Searching through your command history
- Chaining commands together (e.g. the output of one command, is the input of another)
Again, these are basic interactions that I have through the shell on a day to day basis:
- Navigating the folder structure
- Searching for files where I know its name, but not its location
- Searching for files that include snippets of text
- Opening files to read and/or edit
- Repeating a long command again that I’ve executed previously
Resources
The below is a helpful place to start to learn about bash, giving you a gentle introduction before jumping in to a bit more advanced topics
Summary
As the first post on this subject, it was my intention not to overload you too much with information and not to give you too many pointers - yes, some of it was a bit vague, but it was done so as to wet your appetite and to give you a good foundation from which to springboard into more advanced topics.
Understanding these basics techniques will be the building blocks as you become more proficient. Then, when you hit problems you are more likely to be comfortable looking up solutions online and understanding the answers that people give.
The rationale for this post was mostly because I’ve worked with a large number of engineers who are great at their job, do great work, but sometimes they can get stuck with the most basic of things such as editing a configuration file on a remote machine as the only editor available is vim, not knowing where a configuration file is and not knowing how to locate it.
It is amazing how much of a superhero you can be just by knowing these basics.