Here is every last thing you could ever possibly want to know about email: Email explained from first principles.
I love being a programmer
My ZFS RAID array is resilvering. It’s a long recovery process. A report on progress looks like this:
Every 10.0s: zpool status love: Tue May 4 22:32:27 2021
pool: data
state: DEGRADED
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scan: resilver in progress since Sun May 2 20:26:52 2021
1.89T scanned out of 5.03T at 11.0M/s, 83h19m to go
967G resilvered, 37.54% done
config:
NAME STATE READ WRITE CKSUM
data DEGRADED 0 0 0
mirror-0 ONLINE 0 0 0
sda ONLINE 0 0 0
sdb ONLINE 0 0 0
mirror-1 DEGRADED 0 0 0
replacing-0 DEGRADED 0 0 0
4616223910663615641 UNAVAIL 0 0 0 was /dev/sdc1/old
sdc ONLINE 0 0 0 (resilvering)
sdd ONLINE 0 0 0
cache
nvme0n1p4 ONLINE 0 0 0
errors: No known data errors
So that 83h19m to go wasn’t in units I could easily grok, what I wanted to know was how many days. Lucky for me, I’m a computer programmer!
First I wrote watch-zpool-status.php:
#!/usr/bin/env php
<?php
main( $argv );
function main( $argv ) {
$status = fread( STDIN, 999999 );
if ( ! preg_match( '/, (\d+)h(\d+)m to go/', $status, $matches ) ) {
die( "could not read zpool status.\n" );
}
$hours = intval( $matches[ 1 ] );
$minutes = intval( $matches[ 2 ] );
$minutes += $hours * 60;
$days = $minutes / 60.0 / 24.0;
$report = number_format( $days, 2 );
echo "days remaining: $report\n";
}
And then I wrote watch-zpool-status.sh to run it:
#!/bin/bash watch -n 10 'zpool status | ./watch-zpool-status.php'
So now it reports that there are 3.47 days remaining, good to know!
Data Visualization With Matplotlib and Seaborn
I was referred to Data Visualization With Matplotlib and Seaborn on #lobsters today.
Zeal
Today I discovered Zeal. Looks like it’s gonna come in handy…
This is Why Learning Rails is Hard
There’s a cool mind map covering all the things a rails developer needs to know over here: This is Why Learning Rails is Hard.
explainshell.com
I found this great web site: explainshell.com. It explains shell commands, check it out.
Camel case
Today I read up on Camel case over on Wikipedia.
CSRF, CORS, and HTTP Security headers Demystified
This on Hacker News today: CSRF, CORS, and HTTP Security headers Demystified.
The above article referred to OWASP SameSite doco, and you can read about how to implement that with PHP.
136 facts every web dev should know
I found this fun list of things to know: 136 facts every web dev should know before they burn out and turn to landscape painting or nude modelling.
I particularly liked these points:
124. Web dev frameworks are for organisations, not small software teams or individual developers. The value frameworks provide lies in bridging team boundaries: they create a shared understanding that aids in collaboration across groups, simplify messaging, and establish clear conventions. Frameworks turn teams in large organisations into service interfaces.
125. Individual teams or individual developers don’t have that problem, so they get less value from a web dev framework. The more opinionated the framework is and the more of the web platform it abstracts away, the more its value proposition skews towards solving organisational problems and the less value it provides to individual teams.
An Interview With Linus Torvalds: Linux and Git
This was fun: An Interview With Linus Torvalds: Linux and Git. I will check back next week for the second part!