Earth Notes: On Website Technicals (2022-05)

Updated 2024-03-26 08:02 GMT.
By Damon Hart-Davis.
Tech updates: timing tweets, energy stats insert, explosion, defer/async again, Airogram, off-grid, lowpowermode, stats fiddling, synthesis.
MacBook Air M1 accessories 20220704 packshot
Re-timing and adding to my auto-tweets, catching up on some ambient field-recordings, and lots of normalised uniform 16WW energy statistics! Oh, and a new shiny (MacBook Air) toy and accessories...

2022-05-28: Energy Stats Synth

Today I added the ability to synthesise energy stats from across multiple data sources, in this case heat from Eddi.h1 and meter.gas

There are some things to think about still in terms of coverage computation, but that's a good start!

2022-05-22: Energy Stats Fiddling

I have improved the per-page energy stats insert (hidden most of it away behind <details>). I also now highlight any data row that is a superset of the page's temporal coverage if present and simple (eg not an interval).

Over the last few days I have been broadening the range of energy stats consolidated. The next challenge is to create synthetic values such as 'heat' being gas + h1d + h1b.

2022-05-20: Monterey lowpowermode

Well, part of my plan to reduce grid power demand from laptops at peak times and flatten the duck may finally come to pass!

sudo pmset -c lowpowermode 1

should reduce power consumption of my new MBA when on charger/mains power.

A little root crontab to engage that regularly through peak times (eg from 4pm) and leave lowpowermode again later (eg randomly after ~8pm) might do the trick.

I have manually engaged lowpowermode for all battery operation, via the UI.

Here's what the root crontab entries look like:

8-58/10 16-19 * * * pmset -c lowpowermode 1
9-59/10 20 * * * pmset -c lowpowermode 0

Note that I am not enabling/disabling this on the hour or half hour: too many devices switching at exact half-hour boundaries may itself give the grid indigestion!

This lowpowermode has become available with macOS Monterey (12.x). My MBA is currently on 12.4.

2022-05-19: Air x2 Off-grid

As of ~3pm, I am running both old and new MBAs off-grid while various backups etc continue!

2022-05-18: Air Arrived

MacBook Air Intel and M1 20220704 side by side
The new M1 on the right is about 1cm less deep and less wide, double the linear screen resolution and storage size, and ~20h (3x?) battery life.

My new M1 MacBook Air arrived at around noon. It left Chengdu in China on the 13th, so will have accrued "Air miles" and an associated extra carbon footprint...

Transfer

Physically the new MBA is ~1cm shorter front to back and left to right.

To transfer my life from my old MBA to the new one, while still leaving a working clone on the old one, I did the following:

  1. Backed up the old one to Time Machine fully.
  2. In Internet Accounts turned off all mail connections (I do not want a mess of mail randomly across the MBAs) but left calendars on so I can use them everywhere.
  3. Backed up again with Time Machine.
  4. Used the new MBA's migration assistant to restore from the old MBA's Time Machine backups; that took all night.
  5. (The new MBA will get a new 4TB Time Machine external HDD.)
  6. In the morning complete the set up of the new MBA, starting with turning back on the mail in all the relevant accounts and all the re-authentication that that implies...
  7. Trying to run EOU scripts on the new MBA, but clearly some of the binaries are not "fat" since I get env: node: Bad CPU type in executable and script/get_img_XxY: line 16: /usr/local/bin/identify: Bad CPU type in executable; items installed by brew are clearly going to have to be discovered and reinstalled (and indeed brew itself):
    • imagemagick
    • npm
    • ...

Firefox picked up where I left off! And ssh is all working as intended.

On opening, mail tells me that it will spend a few minutes importing my (236,093) messages.

On opening Skype I am asked to enable Rosetta to emulate/run Intel (x64) apps. That also lets my brew apps run, it seems! Though I should try to move to native binaries when I can, for speed. (Skype seemed to have forgotten me when it ran: I have reinstalled native.)

Pretty darn smooth so far...

A brew upgrade caused me to uninstall a couple of things that it was getting stuck on and that I no longer need (eg rstudio).

Signal reported its database corrupt. Having cleared it, and (re-)linked with my phone all seems fine.

(I note that the new MBA does not seem entirely flat: the front LHS rocks down a bit when I rest on it, so I have slipped a few bits of paper under that foot for now.)

I have followed instructions on How to migrate to native Homebrew on an M1 Mac to set up the new /opt/homebrew and gradually populate it.

% /opt/homebrew/bin/brew install zopfli
% /opt/homebrew/bin/brew install jpeg-xl
...

I may not need to be in a huge hurry to get the native versions. Running emulated x64 in Rosetta may only have a ~20% speed penalty:

% time /usr/local/bin/zopflipng img/2022/20220218-high-winds-screenshot-BBC.png ...
5.634u 0.022s 0:05.66 99.8%	0+0k 0+0io 0pf+0w
% time /usr/local/bin/zopflipng img/2022/20220218-high-winds-screenshot-BBC.png ...
5.635u 0.022s 0:05.66 99.8%	0+0k 0+0io 0pf+0w
% time /opt/homebrew/bin/zopflipng img/2022/20220218-high-winds-screenshot-BBC.png ...
4.479u 0.065s 0:04.83 93.7%	0+0k 0+0io 0pf+0w
% time /opt/homebrew/bin/zopflipng img/2022/20220218-high-winds-screenshot-BBC.png ...
4.473u 0.017s 0:04.49 99.7%	0+0k 0+0io 0pf+0w

Google Drive just silently failed to do anything when I tried to launch it on the new MBA, so I am doing a fresh install...

2022-05-22: mail dance

I have re-enabled email on a couple of core accounts on my old MBA, but I have now adjusted settings for those not to delete mails from the server when the MBA downloads them. That way my new MBA should always see (and eg can archive) new mails.

MacBook Air M1 accessories 20220704 packshot
Add-ons for the new M1 including USB-C to USB-A etc adaptors, car/off-line power adaptor, and 4TB of backup storage.

2022-05-23: Google Drives me mad

Yet again the Google Drive experience has been pointlessly well sub-par.

Unlike other apps which "just worked" over on the new MBA, Google Drive just did nothing when I tried to run it. Not even an error.

When I re-installed it from Google it seemed to have forgotten all about its Google Drive folder, and had introduced a new 'virtual drive' (that is not there at all under /Volumes/ unless GD is running. Not good for working off-line, not good for snooping paranoia.

The way it was working was fine...

(Plus somehow signing in from the new MBA was a messy broken pain, and I have been randomly forced to sign in again repeatedly for no good reason.)

I thought that after several days of apparent slow syncing I had it sorted, but this evening it seemed that I had not achieved anything at all.

Reconnecting GD to Google Drive now appears to be syncing everything again because obviously I have time and bandwidth to spare. And because I want to pay twice for my Google storage. Obviously.

I had already sent off an angry missive about making pointless breaking changes because someone in marketing is under-occupied, but another one may be required.

Thank goodness I do not actually need this backup right now, and I shall be at home for several more days to have time to try to sort it out again.

And actually thank goodness that EOU Towers is now on FTTC, sustaining ~20Mbps sending everything back to the cloud again...

2022-05-16: Async Desktop Again

WebPageTest is now complaining that my share42 JS script is render-blocking, even though it is loaded very late and updating stuff generally out of sight. So for desktop only I have made it async again. This seems to allow it to be discovered faster and loaded in parallel with other objects. I would still prefer it not complete for bandwidth and CPU, but if WPT says async is better, then it must be right!

2022-05-13: Energy Stats Explosion

I made lots of progress on stats: extracting more of them, consolidating from multiple sources into one CSV/table, displaying them as tables, etc.

Yesterday I decided to auto-insert a selection of energy stats rendered this way into any page spatially marked as at 16WW, tagged microgen, but not marked dataset so as not to pollute other data pages that have their own data to showcase!

2022-05-11: Energy Stats Insert

I'v started a semi-automatic mechanism to insert relevant 16WW energy stats into pages' codas.

Initially the pages will be explicitly selected with a head directive, but that might broaden automatically to TECH pages with 16WW location and a simple temporal coverage for example.

Pages that are inappropriate (eg error or lite) will not get the insert.

This page has been marked up to include such stats as of writing.

To start with this will be placeholder text, and may fall back to that when, say, stats for the specified time are not available.

The intention is for this content to be static tables and/or text, extracted quickly on the fly, and will not force a page update. This will only be updated (eg stylistically) if all pages are, or the particular page is naturally rebuilt for some other reason. It is possible that live graphics and page-type-specific content will be included.

2022-05-08: Tweet (Re)Timing

I have been pushing out automated EOU tweets in the wee hours (for AU/NZ) and noon-ish. The former is nominally good for UK interaction too because there's not much else going on at that time.

There are suggestions that around the start of the business day, and in the early evening, are when many people are dipping into social media.

So I have doubled up on my 'daytime' posting to be two: mid-morning and mid-evening.

Exceeding five (automated) postings on weekdays (three on weekends) is said to be overdoing things, so this will not be. Any excess will be my human wit and charm: what is the worst that could happen?

Oh, and I visited a music festival yesterday and did a field recording.

I also updated the reutils library to allow 280 character tweets. I saw that the old 140 limit had stopped at least one of these EOU tweets from being sent.

~1684 words.