Mario Obejas on “a replacement for bash?” and on writing production-grade code in any language.

Recently Yves Dorfsman asked on the lopsa-tech mailing list:

A lot of people love to hate bash, and there are good reasons for it, but it
seems that there isn’t an obvious replacement for it.

[…]
What do you use? Do you see any clear winner to replace it on the horizon?

Mario Obejas, a popular occasional Instructor for Vertical Sysadmin, and living proof that there is life after system administration, answered with this gem. This is the voice of 34 years of Software Development, Infrastructure, and Information Security experience, folks. (Thanks for allowing us to re-post it here, Mario!)

bash replaced sh the same way vim replaced vi, for many of the same reasons. They took what was working, kept the solid parts of the base and improved it. The jury is back – bash works well enough for a lot of production work.

My prediction, Yves, is that the only thing that will replace vim and bash to the same degree will similarly be another iteration that improves upon the already existing widely installed vim and bash base, and leverages the same widely held skill sets.

Some things, like a Ted Cruz, no language can deal with. The last production bash scripts I wrote were to provide data traffic management between the VIIRS satellite ground station and NASA’s net, through their itty bitty data pipe. Our requirements were to be able to recover from up to a catastrophic three day data clog or outage, without losing any of the satellite data. We did very well through 2013 until Ted affected us. Nobody expected a 17 day US government shutdown …..

I’m an odd data point with respect to languages. I loved PASCAL and ADA. But here’s some heresy – I hate C. That’s probably due to the way a lot of people write C, which I characterize as, “as obfuscated and comment free as possible”. I think most people write C with speed in mind (filling in the diamond or checkbox on the schedule) versus maintainability (write like you will not see the code for a year, and then you will have to come back and upgrade/extend it).

We wrote Theater High Altitude Air Defense in Ada. When the day came to integrate our code (including that of our partners and contract vendors) in the lab, we were all shocked to find the system cycling, acquiring and tracking targets, not crashing as expected. We had to go back to our offices and retrieve the formal tests, nobody expected that level of robustness the first week, much less the first 15 minutes.

For longevity, my oldest production code is the Jovial and assembly I wrote for three Middle East mountaintop radars. I participated in the customer selloff in 1984, and 29 years later I received a call in December 2013 – no kidding – about helping the team to do an upgrade in 2014. It was still working(!). The only other longer lived code I know about is off world (satellites) or in the “Don’t touch it!” holy COBOL shrines.

Tangential moral of the story: regardless of language, put some damn comments in the code, like you are talking to somebody years later and explaining what the code does. That somebody might be you, years later.

Ansible now available as an RPM

Ansible is now available as an RPM from the EPEL repo. It pulls in all the dependencies needed by Ansible (Python libraries, libyaml and sshpass). The RPM provides Ansible version 2.0.2.0 which includes a number of bug fixes including a security one (CVE-2016-3096). This is a lot easier to handle than fiddling with Python’s package manager of the day.

$ sudo yum install ansible
...
=============================================================================================================
Package                         Arch                 Version                       Repository          Size
=============================================================================================================
Installing:
ansible                         noarch               2.0.2.0-1.el6                 epel               2.9 M
Installing for dependencies:
PyYAML                          x86_64               3.10-3.1.el6                  base               157 k
libyaml                         x86_64               0.1.3-4.el6_6                 base                52 k
python-babel                    noarch               0.9.4-5.1.el6                 base               1.4 M
python-crypto                   x86_64               2.0.1-22.el6                  base               159 k
python-crypto2.6                x86_64               2.6.1-2.el6                   epel               513 k
python-httplib2                 noarch               0.7.7-1.el6                   epel                70 k
python-jinja2-26                noarch               2.6-3.el6                     epel               527 k
python-keyczar                  noarch               0.71c-1.el6                   epel               219 k
python-paramiko                 noarch               1.7.5-2.1.el6                 base               728 k
python-pyasn1                   noarch               0.0.12a-1.el6                 base                70 k
python-simplejson               x86_64               2.0.9-3.1.el6                 base               126 k
python-six                      noarch               1.9.0-2.el6                   base                28 k
sshpass                         x86_64               1.05-1.el6                    epel                19 k

Transaction Summary
=============================================================================================================
Install      14 Package(s)

Total download size: 6.9 M
Installed size: 33 M
Is this ok [y/N]:

Key references for various tools

The following post was contributed by Mike Weilgart who has recently joined the ranks of Linux system administrators.

For bash and POSIX shell scripting:

Variable quoting

Miscellaneous

For vi and Vim:

For git:

cgroups:

Training program to make a Novice System Administrator

I’ve put together a program to make entry-level Linux system administrators because we need more to maintain the IT fabric of modern civilization.
 
The program is self-paced, using online resources.  This is not training I deliver personally, rather I will guide you to quality training resources, in the correct sequence, and work with you to debug any stops. There is no fee to me for this program. The training takes 2-3 months full-time and costs about USD 1,000 for the online training courses and books. You’ll need a practice computer you can install Linux on.
 
Pre-requisites: Aspirants need to know how to use a computer for basic tasks (e.g., Web, email, word processing).
 
Part I – Linux Essentials
 
342 pages
$25.80
 
Online course
40-60 hours
Free
 
Part II – The Linux Command Line
 
537 pages
Free
 
Part III – Linux System Administration
 
Online course
40-50 hours
$499 (includes certification exam)
  
Do Cricket Liu’s DNS course from the Linux Sysadmin Basics
Video training from oreilly.com
Free with a 10 day Safari trial
 
 Part IV – Certification (optional) 
  
 
 Part V – Introduction to Computer Science (can be done after starting work) 
  
 
Introduction to Computer Science (CS50x) online training from edX.org
100 – 200 hours
Free
  
Professional Library
 
In addition, I recommend the following professional library (you can build it up as you start earning in your new profession):
 
 
Total: $229.43
 
Summary of All Costs
 
Total cost: $1029.72
Time investment needed: 2-4 months full-time or 6-12 months part-time
 
Code of Ethics
  
As a professional system administrator, study and commit yourself to our Code of Ethics.
 
Tips for Success
   
Mike Weilgart completed the program and adds:
And a crucial ingredient to success (and I’m being entirely serious): Spend plenty of time during your training reading up on what you’re studying on the Unix & Linux Stack Exchange.
 

Elective – Learn How to Make a Web Site

Exercise: Setup a personal site, e.g., like Mark Burgess has

There is an excellent WordPress tutorial at http://websitesetup.org/

To learn the underlying technology, HTML/CSS, I recommend http://websitesetup.org/html-beginners-guide/

Also, you can write in Markdown and use pandoc to convert to HTML. Try it!

 

Elective – Learn How to Use strace to Spy on Your Programs

Click to access strace-zine-unfolded.pdf

 

Elective – Postgres Database Administration

“The Accidental DBA” (or, Administering PostgreSQL When It’s Not Your Job) to those just getting into Postgres database server administration. Josh Berkus, from the PostgreSQL Core Team, presented it in 2015 (https://www.youtube.com/watch?v=qoQRGl_P2aQ (2.5 hour video)) and the original (2012) slides by Christophe Pettus at http://thebuild.com/blog/2012/06/04/postgresql-when-its-not-your-job-at-djangocon-europe/