Surprisingly Functional

Functional programming is a surprisingly useful programming paradigm. The best aspects of functional programming have this odd habit of showing in places you would never expect. The Shell and Endomorphisms Arguably one of the most powerful features of the Unix shell is the pipe. It is one of the core building blocks of the Unix philosophy of many small tools working together each doing one thing well. However, long before Unix, the idea of the endomorphisms was developed....

February 23, 2017 · 3 min · 632 words · Robert Underwood

Poor Man's Parallelism

I really like orchestration tools such as Ansible or SaltStack. They can make running tasks on a group of machines a breeze. But sometimes you can’t or don’t want to install these tools on a machine. In cases like these, it is helpful to know how to parallelize some tasks in the shell. You can do this via Unix/shell job control: cmd="systemctl enable --now docker.service" hosts=(host{1..4}) for host in ${hosts[@]} do ssh & $host $cmd done However from experience, this can be very error prone....

January 8, 2017 · 3 min · 462 words · Robert Underwood