Fluffy; chrony; Iceland's Purple Deserts
Fluffy "watches, reports Linux on-disk filesystem events faithfully," and is both a command line utility and a library you can use in your own projects.
Performing a task when something happens to a single file or a directory tree of files is a pretty common idiom. In fact, we've covered it before!
What makes Fluffy worth covering? For one thing, it is very opinionated.
The utility only works on Linux systems and uses the Linux native inotify kernel subsystem, so you can trigger actions on all types of events — open, access, close, no write, delete, move, etc. — vs just plain "file was changed" actions. Here's a more complete list (from the fluffy CLI help):
all: Watch all possible events (this is the default mode)
access: Watch file access
modify: Watch file modifications
attrib: Watch metadata change
close-write: Watch closing of file opened for writing
close-nowrite: Watch closing of file/dir not opened for writing
open: Watch opening of file/dir
moved-from: Watch renames/moves: reports old file/dir name
moved-to: Watch renames/moves: reports new file/dir name
create: Watch creation of files/dirs
delete: Watch deletion of files/dirs
root-delete: Watch root path deletions
root-move: Watch root path moves/renames
isdir: Watch for events that occur against a directory
unmount: Watch for unmount of the backing filesystem
queue-overflow: Watch for event queue overflows
The output is also super-easy to parse, as it's just tab-separated event/path pairs (don't let all those commas fool you into thinking it's a CSV file):
IGNORED, /var/log/tor CREATE,ISDIR, /tmp/test ACCESS,ISDIR, /tmp/test CLOSE_NOWRITE,ISDIR, /tmp/test
Many similar tools require a static configuration file and must be restarted if you want to change the configuration. Fluffy has no such limitation.
Finally, you can build your own super-custom event-driven executable with
libfluffy and not worry too much about heavy C library dependencies.
It is highly likely that the device you're reading this section on has a clock that is synchronized to some authoritative "time" source. Unless you've deliberately modified it, Apple xOS users query
time.apple.com for clock synchronization, Ubuntu folks hit
ntp.ubuntu.com, and Windows slaves have
time.windows.com. (You should consider changing those defaults to a more trusted source and stop giving away your telemetry).
For ages, ntpd was the queen of Network Time Protocol implementations. It was (and still is, to a large degree) everywhere. But, it's also not the NTP implementation around, and there are new default timekeeping tools for environments like Systemd (i.e. timesyncd). However, you don't have to settle for either new defaults or an old standby.
…a newer [NTP] implementation, which was designed to work well in a wider range of conditions. It can usually synchronise the system clock faster and with better time accuracy. It has many features, but it does not implement some of the less useful NTP modes like broadcast client or multicast server/client.
If your computer is connected to the Internet only for few minutes at a time, the network connection is often congested, you turn your computer off or suspend it frequently, the clock is not very stable (e.g. there are rapid changes in the temperature or it is a virtual machine), or you want to use NTP on an isolated network with no hardware reference clocks in sight, chrony will probably work better for you.
Chrony has a solid control and monitoring interface (there's a Rust crate that works well with it), and the binaries are smaller than ntpd's and use less memory; plus the chrony server only wakes up the CPU when necessary (yay power savings!). It also provides support for isolated networks where the only method of time correction is manual entry (yes, that means it can figure out the rate of time gain/loss by your hand-entered measurements).
You can check out the extensive tables that compare
openntpd, and install it via your fav repository (on linux) or Homebrew (for macOS folks).
Iceland's Purple Deserts
We'll close out today's drop with some Earth-science in the form of a ~9 minute mini-documentary on why Iceland's deserts are turning purple:
I tweeted this yesterday, but felt compelled to share in a more permanent form on a less toxic platform: your clipboard contents are no longer safe [from being overwritten] on the web. ☮