This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TimeSpanExtensions | |
{ | |
// Inspired by @Peter answear from https://stackoverflow.com/questions/842057/how-do-i-convert-a-timespan-to-a-formatted-string | |
public static string ToReadableAgoString(this TimeSpan span, double justNowSecondsThreshold) | |
{ | |
if (span.TotalSeconds < justNowSecondsThreshold) | |
return "just now"; | |
return span switch | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
## ZFS health check script for monit. | |
## v1.0.2 | |
# | |
## Should be compatible with FreeBSD and Linux. Tested on Ubuntu. | |
## If you want to use it on FreeBSD then go to Scrub Expired section and Trim Expired section | |
## and comment two Ubuntu date lines and uncomment two FreeBSD lines in Scrub Expired section. | |
## In Trim Expired section adjust the date format directly in the for loop's awk parameter. | |
# |