I’m one of SHARCNET’s systems administrators based at the University of Western Ontario in London, Ontario, Canada, part of the Graham system team and also responsible for the contributed cluster Dusky and much of SHARCNET’s infrastructure (DNS servers, email, web services, Ansible configurations) as well as Alliance infrastructure as a member of the Infrastructure Operations National Team.

If I am busy with something then context-free synchronous communication requests on Slack will probably be ignored.

Awk by Example

Here are some examples of GNU Awk, re-implementing common command line tools in Awk code one-liners to illustrate how Awk works. First line is the original tool, second line is the Awk equivalent. Obviously you would not do these tasks in Awk, rather you would combine these techniques into more complex actions difficult or impossible in the shell.

[Read More]

Choosing a Random Command Line Argument

The shuf command normally generates a random permutation of its input lines. However with the -e (echo) and -n 1 (show only 1 output) arguments you can make it choose a random command line argument.

[Read More]

Working with the newest or oldest files

I recently wanted to delete all but the most recent 3 daily backup files. Deleting based on timestamp isn’t safe in this case; if you delete files older than 3 days then you’ll lose all backup files if the backup stops creating new backups for some reason. It’s relatively easy to work with files older or newer than a particular date but it’s less obvious how to deal with the N oldest or newest files, regardless of absolute timestamp, without writing a script.

[Read More]

Data Weights

Maximum physical weight of storage media required to hold 1TB.

[Read More]

Multi Stage LDAP Searches With Awk

Problem: query LDAP for all users in a particular group, when LDAP is set up in POSIX style (memberUID: in each group record instead of memberOf: in each user record) without writing a script.

[Read More]
awk  noscript  ldap