The following are examples of my bash coding skills.
-
add_instance.sh - A script to add a new EC2 instance, and remove the old (if an old one exists under the same DNS name). This script automates every step except for the actual editing of the DNS entry. Out of a sense of caution, I instead configured it to print out the replacement line entry just before opening the zone file for editing. There are even built in wait segments while the instance comes online, and laiter while the DNS entry updates. Like most of my scripts, I incorporated logging and idempotency for robustness.
-
dse_rolling.sh - A script to manage and orchestrate cassandra instances in various clusters. I created this script before I learned ruby, and so stored host names and attributes in hand-generated table files. This script performs tasks like upgrade, remove instance, rolling restarts etc, all without causing any downtime. There is a built-in feature to ensure that a restarted node is fullly functional before moving on to the next host in the ring.
-
assign_backups.sh - A MySQL table defined which C* clients were scheduled for backup and on which days. This script would re-generate the table when I wanted to make changes such as a different set of "every third node" or a new set of storage servers (our datastore is massive and backup capacity limited, so every-third-node was chosen as a method to get just primary data rather than RF=3 data. I included this script to demonstrate my skill with nested logic and creative use of MOD to solve a technial challenge (identifying every third node in the cluster).
-
cassandra_backup.sh - Due to limited diskspace and high volume, I configured this script to create snapshots one CF at a time. It creates a snapshot, rsync's it then clears the snapshot before moving to another node.
-
version_by_model - Threatmetrix uses Foreman as a opreational database of hosts with puppet facts provding additional host information. At one point I wanted to identify all of the servers with outdated firmware. But there was no easy way to make such a query with the Foreman GUI or 'hammer' command line tool, so I created this. This script is here to demonstrate my SQL skills.