I’ll be on vacation Wednesday December 4 through Friday December 13, returning Monday December 16.
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]Shifted Passwords
Does it make sense to require capital letters in passwords?
[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.
Reasons to Avoid Google's Advanced Protection Program
Google’s Advanced Protection Program is intended for often-attacked accounts like journalists, activists, political campaigns and such but it’s free and available for anyone. There are many security benefits but here are some reasons I’ve found that you may not want to enable it.
[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]Processing squeue JSON output
squeue
can produce JSON output with squeue --json
.That could be processed with a script but you can do some quick hacks with jq.
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.
Powers of Two Cheatsheet
Cheatsheet for approximations of powers of two. See also Powers Of Ten.
[Read More]