@blog@shkspr.mobi avatar

blog

@blog@shkspr.mobi

This profile is from a federated server and may be incomplete. Browse more on the original instance.

blog, to Untappd
@blog@shkspr.mobi avatar

Untappd to Mastodon - Updated!
https://shkspr.mobi/blog/2024/05/untappd-to-mastodon-updated/

A few years ago, I wrote some code to post Untappd check-ins to Mastodon. I've recently updated it to also post a photo of the beer you're enjoying.

First up, you'll need a file called config.py to hold all your API keys:

instance = "https://mastodon.social"access_token          = "…"write_access_token    = "…"untappd_client_id     = "…"untappd_client_secret = "…"

Then a file called untappd2mastodon.py to do the job of grabbing your data, finding your latest check-in, then posting it to the Fediverse:

#!/usr/bin/env python# -*- coding: utf-8 -*-from mastodon import Mastodonimport jsonimport requestsimport config#  Set up accessmastodon = Mastodon( api_base_url=config.instance, access_token=config.write_access_token )#       Untappd APIuntappd_api_url = 'https://api.untappd.com/v4/user/checkins/edent?client_id=' + config.untappd_client_id + '&client_secret='+ config.untappd_client_secretr = requests.get(untappd_api_url)untappd_data = r.json()#       Latest checkin objectcheckin = untappd_data["response"]["checkins"]["items"][0]untappd_id = checkin["checkin_id"]#       Was this ID the last one we saw?check_file = open("untappd_last", "r")last_id = int( check_file.read() )print("Found " + str(last_id) )check_file.close()if (last_id != untappd_id ) :        print("Found new checkin")        check_file = open("untappd_last", "w")        check_file.write( str(untappd_id) )        check_file.close()        #       Start creating the message        message = ""        if "checkin_comment" in checkin :                message += checkin["checkin_comment"]        if "beer" in checkin :                message += "nDrinking: " + checkin["beer"]["beer_name"]        if "brewery" in checkin :                message += "nBy: "       + checkin["brewery"]["brewery_name"]        if "venue" in checkin :                if "venue_name" in checkin["venue"] :                        message += "nAt: "       + checkin["venue"]["venue_name"]        #       Scores etc        untappd_checkin_url = "https://untappd.com/user/edent/checkin/" + str(untappd_id)        untappd_rating      = checkin["rating_score"]        untappd_score       = "🍺" * int(untappd_rating)        message += "n" +  untappd_score + "n" + untappd_checkin_url + "n" + "#untappd"        #       Get Image        if checkin["media"]["count"] > 0 :                photo_url = checkin["media"]["items"][0]["photo"]["photo_img_lg"]                download = requests.get(photo_url)                with open("untappd.tmp", 'wb') as temp_file:                        temp_file.write(download.content)                media = mastodon.media_post("untappd.tmp", description="A photo of some beer.")                mastodon.status_post(status = message, media_ids=media, idempotency_key = str(untappd_id))        else:                   #       Post to Mastodon. Use idempotency just in case something went wrong                mastodon.status_post(status = message, idempotency_key = str(untappd_id))else :        print("No new checkin")

You can treat this code as being MIT licenced if that makes you happy.

https://shkspr.mobi/blog/2024/05/untappd-to-mastodon-updated/

blog, to blogging
@blog@shkspr.mobi avatar

It was twenty years ago today
https://shkspr.mobi/blog/2024/05/it-was-twenty-years-ago-today/

I wrote my first public blog post on 2004-05-111. I immediately followed it up with a brief review of my BlackBerry2.

Heavily pixellated image saying "I Power Blogger".

I kept up the blogging for a few months, then it trickled off. I preferred posting on Usenet and other primitive forms of social media. But, by 2007, I was back to blogging on my own site again, and I never really stopped. This blog fluctuates between being a diary, an excuse to rant, and technical writing. It's my site and I can do whatever I want with it. That's rather freeing.

I have an "On This Day" feature of my blog. Every morning I check what I was writing about on this day in years gone by. I find it informative and meditative to see how much I've grown3 and what topics I keep returning to.

I'm not big on milestones or anniversaries. But it does feel rather nice to know that I started something a few decades ago that is still a going concern.

Here's a little treat to thank you for reading:


  1. Since then, I've imported it to this site
  2. If memory serves, I found the BlackBerry in a colleague's drawer, asked to borrow it, then used social engineering to get the IT team to set it up for me. Fun times!
  3. And how little I've changed.

https://shkspr.mobi/blog/2024/05/it-was-twenty-years-ago-today/

blog, to HowTo
@blog@shkspr.mobi avatar

link rel="alternate" type="text/plain"
https://shkspr.mobi/blog/2024/05/link-relalternate-typetext-plain/

Hot on the heels of yesterday's post, I've now made all of this blog available in text-only mode.

Simply append .txt to the URl of any page and you'll get back the contents in plain UTF-8 text. No formatting, no images (although you can see the alt text), no nothing!

This was slightly tricky to get right! While there might be an easier way to do it, here's how I got it to work.

Firstly, when someone requests /whatever.txt, WordPress is going to 404 - because that page doesn't exist. So, my theme's functions.php, detects any URls which end in .txt and redirects it to a different template.

//  Theme Switcheradd_filter( "template_include", "custom_theme_switch" );function custom_theme_switch( $template ) {    //  What was requested?    $requested_url = $_SERVER["REQUEST_URI"];    //  Check if the URL ends with .txt    if ( substr( $requested_url, -4 ) === ".txt")  {            //  Get the path to the custom template        $custom_template = get_template_directory() . "/templates/txt-template.php";        //  Check if the custom template exists        if ( file_exists( $custom_template ) ) {            return $custom_template;        }    }    //  Return the default template    return $template;}

The txt-template.php file is more complex. It takes the requested URl, strips off the .txt, matches it against the WordPress rewrite rules, and then constructs the WP_Query which would have been run if the .txt wasn't there.

//  Run the query for the URl requested$requested_url = $_SERVER['REQUEST_URI'];    // This will be /whatever$blog_details = wp_parse_url( home_url() );  // Get the blog's domain to construct a full URl$query = get_query_for_url(     $blog_details["scheme"] . "://" . $blog_details["host"] . substr( $requested_url, 0, -4 ));function get_query_for_url( $url ) {    //  Get all the rewrite rules    global $wp_rewrite;    //  Get the WordPress site URL path    $site_path = parse_url( get_site_url(), PHP_URL_PATH ) . "/";    //  Parse the requested URL    $url_parts = parse_url( $url );    //  Remove the domain and site path from the URL    //  For example, change `https://example.com/blog/2024/04/test` to just `2024/04/test`    $url_path = isset( $url_parts['path'] ) ? str_replace( $site_path, '', $url_parts['path'] ) : '';    //  Match the URL against WordPress rewrite rules    $rewrite_rules = $wp_rewrite->wp_rewrite_rules();    $matched_rule = false;    foreach ( $rewrite_rules as $pattern => $query ) {        if ( preg_match( "#^$pattern#", $url_path, $matches ) ) {            $matched_rule = $query;            break;        }    }    //  Replace each occurrence of $matches[N] with the corresponding value    foreach ( $matches as $key => $value ) {        $matched_rule = str_replace( "$matches[{$key}]", $value, $matched_rule );    }    //  Turn the query string into a WordPress query    $query_params = array();    parse_str(        parse_url( $matched_rule, PHP_URL_QUERY),         $query_params    );    //  Construct a new WP_Query object using the extracted query parameters    $query = new WP_Query($query_params);    //  Return the result of the query    return $query;}

From there, it's a case of iterating over the posts returned by the query. You can see the full code on my GitLab.

https://shkspr.mobi/blog/2024/05/link-relalternate-typetext-plain/

#HowTo #php #WordPress

blog, (edited ) to wordpress
@blog@shkspr.mobi avatar

A completely plaintext WordPress Theme
https://shkspr.mobi/blog/2024/05/a-completely-plaintext-wordpress-theme/

This is a silly idea. But it works. I saw Dan Q wondering about plaintext WordPress themes - so I made one.

This is what this blog looks like using it:

Screenshot showing my blog rendered just as text.

The Code

You only need two files. An index.php and a style.css. The CSS file can be empty, but it needs to exist - otherwise WordPress won't let you activate the theme.

The index file displays the requested post, or front page, in plain text. It isn't the most sophisticated code I've ever written!

header('Content-Type: text/plain; charset=utf-8'); bloginfo( 'name' );echo "nn";if ( have_posts() ) {    while ( have_posts() ) : the_post();        if ( get_post_type() == 'post' ) {            the_time( get_option( 'date_format' ) );             echo "n";        }        the_title();        echo "n";        echo strip_tags( apply_filters( 'the_content', get_the_content() ) );         echo "nnn";    endwhile; }

Obviously, there are no links - so you can't navigate. There are no images - but there's also no alt text. There are no embeds, scripts, styles, or other fancy things. Just plain text.

Enjoy!

https://shkspr.mobi/blog/2024/05/a-completely-plaintext-wordpress-theme/

blog, to feminism
@blog@shkspr.mobi avatar

Book Review: The Doors of Opportunity
https://shkspr.mobi/blog/2024/05/book-review-the-doors-of-opportunity/

Did you know that a Suffragette invented the UK's electrical plug?

Dame Caroline Haslett was an electrical engineer who foresaw the way that electricity could be used to remove domestic drudgery from women's lives. There is a slim biography of her, written by her sister, which is sadly out of print.

Book cover featuring a portrait of Dame Caroline.

Luckily, the book is available for free on Archive.org.

It is a curious book. It dwells on her faith as much as her technical prowess. Her waistline is the subject of wry amusement. There's also the (naturally) dated views of the day to contend with along with an odd segue into spiritualism.

And, of course, you'll see nothing much has changed in the last 100 years.

With the Women's Engineering Society safely launched, Caroline found that she had two recurring types of problem with which to contend. The first was to deal with the difficulties that arose at factory floor level from the intrusion of women into what had been traditionally a masculine preserve, difficulties which she herself had area to admirably tackled by the enlightened management of the Cochran Boiler Company.
The second, and probably the more important task, was dealing with the problem posed by the steadily increasing number of highly trained women competing with men for managerial posts in the world of engineering. She was not interested in the problems merely for their own sake, but in the people behind the problems and in the whole field of industrial relationships.

It isn't enough to merely launch a product or service. It takes years to embed knowledge, experience, and desire into users. Haslett's power was recognising that the advantages of electricity weren't self-evident. It took a sustained campaign of education to get the public to understand the why and how of a new invention.

There's also some delightful name-dropping:

Inevitably she met some of the most famous people of the day, among them Professor Albert Einstein at the World Power Conference in Berlin in 193o. My sister was in fact the first woman to "defile" the rostrum that Hitler had used. The Berliner Stedtblatt, under the headline, "Frau and Technik", printed an interview that one of its reporters had had with her. It described her as a likeable and intelligent woman and quoted her as saying that brilliant inventors were the worst possible instructors and that there was a real need for women to explain to women in simple language how to use the brain children of these inventors.

If you want to understand how the development of domestic electricity use in the UK happened, this is an interesting and useful book. It perfectly demonstrates how one headstrong person can influence the world.

It is a stunning look at how feminism directly influenced industrial policy.

Caroline herself wrote a book - "Problems Have No Sex" - which is completely unavailable as far as I can see. If any readers know where I can obtain a copy, please leave a comment.

https://shkspr.mobi/blog/2024/05/book-review-the-doors-of-opportunity/

blog, to DigitalNomadHub
@blog@shkspr.mobi avatar

Pushing The Button
https://shkspr.mobi/blog/2024/05/pushing-the-button/

This is a retropost. Written contemporaneously in 2020, but published four years after the events.
It's May 2020 as I write this. I'm typing to capture the moment. Right now, I've no idea what the impact is.

This is the exact moment, on Thursday May 7th, I hit the Big Red Button - three of them! - to open source the UK's COVID-19 Beta test app.

https://shkspr.mobi/blog/wp-content/uploads/2020/05/Open-Source-NHSX.mp4

It was thrilling and terrifying. We'd spent the last few weeks getting ready to open source the repos and then, at the last minute, it all went wrong. The plan was to launch on Tuesday - but fate conspired against us.

The problems fell into three main areas:

  1. Threats and personal safety. This was probably the highest profile code release that we'd ever done. There were already people grumbling online that the people writing the code were "traitors". Did we want to expose our people to that sort of personal abuse? What if they were targets of phishing attempts?
  2. Redacting history. Probably the most contentious issue. We all wanted to release everything from the very first commit. Would that reveal anything dangerous? Had someone slipped and accidentally committed an API key they shouldn't?
  3. Communications. The other most contentious issue! The department were in "crisis comms" mode. Everything was delayed. No one had reviewed the blog I'd written, there was no pre-arranged plan in place for this sort of thing. Understandable really - this was a tiny piece of a much larger puzzle. But it was still frustrating to wait for people to be ready for us to publish.

We took the pragmatic approach. We took a snapshot of the code, thoroughly scrubbed it of all identifying information and secrets, and prepared to release it. Then we waited. And waited.

Every time we thought we had the go-ahead, there was another delay! There was a strict comms schedule. We couldn't launch now; it would interrupt that other announcement!

I was asked to help rewrite bits of the announcements. This led to some memorable questions from the comms squad. How can you explain to the average user...

  • what "Source Code" is?
  • why the Android code is different from the iPhone code?
  • who are "Git Hub"?

And, the kicker? All these questions came in while I was on a conference call with a bunch of government ministers! The joys of multiple monitors!

It was interminable. I sent texts which went unanswered. Emails. Phone calls. Just a few minutes more. Any moment now. We need to wait for...

And then!

"Can we launch ASAP?"

Yes! The email I was waiting for. But I am a paranoid and cautious Fraggle. Was that "Launch now!" or "Can we launch now?"?

So I sent a reply. "Just to confirm - do you want me to publish now?" And waited.

And waited.

I got an email from my boss "Launch now!"

And a second later, from comms: "Please hold off - no go. Will call you shortly."

How I longed to press that button. I could say that I only saw the first email... No. Maybe. No.

An eternity. During which time I casually glanced at Twitter and read all the angry messages from people demanding the release of the code.

The call came. "Publish it - but don't tell anyone." Weird flex, but OK.

I called my very-patient wife into my home office. I wanted the moment captured. She opened her camera. A few clicks, and it was done.

pic.twitter.com/3WQGhy6Ctm

— Terence Eden is on Mastodon (@edent) May 7, 2020

I did a little dance. Let all of the tension out of my body. And waited for the hate to roll in.

It didn't. The response was... positive! Yes, there were grumbles, but so many people were fulsome in their praise that it was overwhelming. Congratulatory tweets and emails did the rounds, and I had a nice cold ale.

I took the bank holiday weekend off. Well, I obsessively read all the tweets, answered questions about my blog post, and kept half-an-eye on GitHub. I'm not good at relaxing.

Has it worked? Did we make the NHS more open and transparent? Did open source win the day? Did the beta test work? Were lives saved? Or was it a damp squib?

As I write this, we're still in the eye of the storm. Perhaps, when this post is published, we'll know the answers.

https://shkspr.mobi/blog/2024/05/pushing-the-button/

blog, to random
@blog@shkspr.mobi avatar

Inside the Plume SuperPods
https://shkspr.mobi/blog/2024/05/inside-the-plume-superpods/

I few years ago, Virgin Media sent me their "Intelligent WiFi Plus Pods". They're part of a mesh network which is meant to improve WiFi coverage around your house.

They were basically fine, but they are hardcoded to your Virgin Media service so can't be used for anything else. I eventually swapped to a different router and they became useless. Virgin refuse to collect them (despite repeatedly promising to) so I decided to crack one open.

I was hoping there would be a reset pin or something in there - but I can't find any easy way to jailbreak them. Anyway, here are the photos.

A spludger around the edges was enough to pop off the plastic cover.

Circuit board covered with a heatsink and a small fan.

There's a huge heat-sink and a small fan. The plastic casing comes away easily.

Industrial metallic fins.

The fan is easy to unscrew and the power connector pops off.

A circular hole in the case.

Once that's off, the heatsink can be removed by unscrewing it and prising it off.

Pink goo on some components.

Splodges of pink gunk - which I assume is thermal paste rather than reconstituted meat - is present. Pulling the main circuit board out shows the power board.

Small circular circuit board.

That's tough to remove without damaging the live and neutral contacts. Once done, you can see the capacitors.

A circuit board with lots of capacitors.

There you go. Nothing stunningly interesting or useful for debugging.

https://shkspr.mobi/blog/2024/05/inside-the-plume-superpods/

blog, to random
@blog@shkspr.mobi avatar

Book Review: The Glass Hotel - Emily St. John Mandel
https://shkspr.mobi/blog/2024/05/book-review-the-glass-hotel-emily-st-john-mandel/

Book cover for the glass hotel.This book didn't really resonate with me. I enjoyed both Station Eleven and Sea of Tranquillity, so I think I was expecting something in a similar vein. Instead of ethereal sci-fi, this is a tangled tale which feels like a mish-mash of half a dozen movies.

The central premise of a Ponzi scheme which warps the lives of those around it - which leads to a jumbled cast of characters, none of whom really get a chance to be fleshed out. The pivotal mystery at the start of the novel is resolved in such an inconsequential way that it feels mostly pointless to include.

It is beautifully written, charmingly constructed, but I felt like I was reading too many stories weaved together without a definable purpose.

https://shkspr.mobi/blog/2024/05/book-review-the-glass-hotel-emily-st-john-mandel/

blog, to Theatre
@blog@shkspr.mobi avatar

Theatre Review: Pippin - 50th Anniversary Concert
https://shkspr.mobi/blog/2024/05/theatre-review-pippin-50th-anniversary-concert/

The cast of Pippin.This has to be the campest, most ludicrously sequinned, joyous shows I've seen in quite some time.

I knew nothing about Pippin, but my dad saw it back in the 1970s and loved it - so I snagged us a couple of tickets. The story itself is fun enough; an over-privileged princeling goes off to find his purpose and finds himself waylaid by vices, murders, and ducks. It's a silly, wry, and self-knowing show. More like Into The Woods than anything else.

As this was an "in concert" production, I was kind of expecting the cast to just come out, sing into a microphone, and wander off. Instead, choreographer Joanna Goodwin treated us to the full "saucy-Fosse" - all bowler hats, shoulder jerks, and shimmying. The singing was, of course, divine. Alex Newell (Unique from Glee) was fabulous and soaked up the whooping and cheering from the audience like the star they are. Patricia Hodge - who was in the original 1972 production - returned and was obviously having a whale of a time prancing around with the dancers.

Half the audience remembered the original production, the other half were fresh-faced drama-school kids who relished the bedazzling displays of terpsichorean delights. Has Pippin got a cult following on TikTok or something?

I can't quite understand why this was only on for two nights. A dozen case members, a twenty-piece orchestra, and a 50-strong choir can't have come cheap. Are they prepping for a tour? I can only hope so!

https://shkspr.mobi/blog/2024/05/theatre-review-pippin-50th-anniversary-concert/

blog, to Cybersecurity
@blog@shkspr.mobi avatar

Bank scammers using genuine push notifications to trick their victims
https://shkspr.mobi/blog/2024/05/bank-scammers-using-genuine-push-notifications-to-trick-their-victims/

You receive a call on your phone. The polite call centre worker on the line asks for you by name, and gives the name of your bank. They say they're calling from your bank's fraud department.

"Yeah, right!" You think. Obvious scam, isn't it? You tell the caller to do unmentionable things to a goat. They sigh.

"I can assure you I'm calling from Chase bank. I understand you're sceptical. I'll send a push notification through the app so you can see this is a genuine call."

Your phone buzzes. You tap the notification and this pops up on screen:

https://shkspr.mobi/blog/wp-content/uploads/2024/05/chase-fs8.png

This is obviously a genuine caller! This is a genuine pop-up, from the genuine app, which is protected by your genuine fingerprint. You tap the "Yes" button.

Why wouldn't you? The caller knows your name and bank and they have sent you an in-app notification. Surely that can only be done by the bank. Right?

Right!

This is a genuine notification. It was sent by the bank.

You proceed to do as the fraud department asks. You give them more details. You move your money into a safe account. You're told you'll hear from them in the morning.

Congratulations. You just got played. Scammers have stolen your life savings.

How the scam works

This is reasonably sophisticated, and it is easy to see why people fall for it.

  1. The scammer calls you up. They keep you on the phone while...
  2. The scammer's accomplice calls your bank. They pretend to be you. So...
  3. The bank sends you an in-app alert.
  4. You confirm the alert.
  5. The scammer on the phone to your bank now has control of your account.

Look closer at what that pop is actually asking you to confirm.

We need to check it is you on the phone to us.

It isn't saying "This is us calling you - it is quite the opposite!

This pop-up is a security disaster. It should say something like:

Did you call us?
If someone has called you claiming to be from us hang up now
[Yes, I am calling Chase] - [No, someone called me]

I dare say most people would fall for this. Oh, not you! You're far too clever and sceptical. You'd hang up and call the number on your card. You'd spend a terrifying 30 minute wait on hold to the fraud department, while hoping fraudsters haven't already drained your account.

But even if you were constantly packet sniffing the Internet connection on your phone, you'd see that this was a genuine pop-up from your genuine app. Would that bypass your defences? I reckon so.

Criminals are getting increasingly good at this. Banks are letting down customers by having vaguely worded security pop-up which they know their customers don't read properly.

And, yes, customers can sometimes be a little gullible. But it is hard to be constantly on the defensive.

Further reading

You can read the original story from the victim on Reddit. See more comments on Mastodon.

https://shkspr.mobi/blog/2024/05/bank-scammers-using-genuine-push-notifications-to-trick-their-victims/

blog, to blogging
@blog@shkspr.mobi avatar

https://shkspr.mobi/blog/2024/05/49911/

While attending IndieWebCamp in Brighton a few weeks ago, a bunch of us were talking about blogging. What is post? What should it contain? What's optional?

Someone (probably Jeremy Keith said:

A blog post doesn't need a title.

In a literal sense, he was wrong. The HTML specification makes it clear that the <title> element is mandatory. All documents have title.

But, in a practical sense, he was right. This blog post has an empty <h1> element - the document might be semantically invalid, it might reduce accessibility, but the post is still available.

A blog post can be a plain text document uploaded to a server. It can be an image hosted on a social network. It can be a voice note shared with your friends.

Title, dates, comments, links, and text are all optional.

No one is policing this.

Go create something which doesn't fit properly with the rest of the world.

https://shkspr.mobi/blog/2024/05/49911/

blog, to markdown
@blog@shkspr.mobi avatar

WordPress GeSHi Highlighting for Markdown
https://shkspr.mobi/blog/2024/05/wordpress-geshi-highlighting-for-markdown/

I've launched a WordPress Plugin for an extremely niche use-case.

WP GeSHi Highlight Redux works with WordPress's Classic Editor to convert Markdown to syntax highlighted code.

That allows me to write:

php$a = "Hello";$b = 5 * 2;echo $a . str($b);

And have it displayed as:

$a = "Hello";$b = 5 * 2;echo $a . str($b);

I've previously written about the WP GeSHi Highlight plugin. My plugin is a fork of that. It has the following changes:

  • RSS & Atom feeds - disable code highlighting
  • Remove extra style wrappers
  • Markdown support
  • Remove line-numbers
  • Remove escape option (escape now permanent)
  • Remove TinyMCE changes
  • Remove custom CSS options
  • Improve default CSS
  • Improve HTML detection

These changes work for me, with my weird blogging set-up. If they work for you, feel free to use it. If they don't work for you, please fork and write your own code.

You can download WP GeSHi Highlight Redux or get the original plugin.

https://shkspr.mobi/blog/2024/05/wordpress-geshi-highlighting-for-markdown/

#markdown #php #plugins #WordPress

blog, to Theatre
@blog@shkspr.mobi avatar

Theatre Review: Opening Night
https://shkspr.mobi/blog/2024/04/theatre-review-opening-night/

Poster for Opening Night.Opening Night is complex, fascinating, and flawed.

It is baffling that this is somehow less than the sum of its parts. The acting and singing are incredible - Nicola Hughes in particular has a magnificent stage presence. The directing and staging is wonderfully innovative - giving even the most distant seat a close-up view. The songs are all great - with "You gotta make magic" a standout hit. The whole ensemble comes together in a perfect display of a what a West End musical is supposed to be.

And yet... there's nothing there. Part of the problem is the paper-thin and scattershot story. An actress doesn't like her part because... ummm... she's not old enough? She sort of manifests a younger version of herself, but that's never really explored. There's a bit of sexual tension which doesn't really have an emotional arc.

The use of handheld cameras to project the action on screen (similar to The Mind Mangler down the street) makes the whole thing feel more cinematic. When people are paying a fortune for nose-bleed seats, they deserve a decent view of the action. But, like any gig, I sometimes felt I was watching the screen more than the stage. At which point I might as well have been home watching it on Netflix rather than paying a tenner for a glass of wine. It also suffers from the same problem as the movie version of Les Mis; the actors are doing stage acting - designed to project emotions to vast distances - when caught on camera it can look like a little ridiculous.

There's very little space for audience appreciation, which is weird. In most musicals, there's a suitable pause after each big number so the audience can applaud. Due to the naturalistic way the show is presented, many songs immediately segue into dialogue - which means a smattering of applause quickly withers on the vine.

Sheridan Smith dominates the stage. She is an utter powerhouse, giving it her all. The rest of the cast - including a tragically underused Amy Lennox from Cabaret - are spectacular. The various background players make for an impressive Greek Chorus. It is impossible to fault their performances.

It's just their performances are in service of such a mediocre and incoherent story. Even at the end I was left confused about what I'd just seen. There's no particular resolution, the characters aren't especially sympathetic, and there's nothing interesting to be said afterwards.

If you're happy to be swept along by the spectacle, and don't want to think too hard about the plot, characters, or meaning, then it is a fine night out. I just found it a bit incoherent.

But, at the end, the rest of the audience rose for a standing ovation - so what do I know?

https://shkspr.mobi/blog/2024/04/theatre-review-opening-night/

blog, to Catroventos
@blog@shkspr.mobi avatar

Do That After This
https://shkspr.mobi/blog/2024/04/do-that-after-this/

I was building some flatpack furniture the other day (my life is so glamorous) when I came across an interesting example of how not to write technical documentation.

Drill a hole in part A and insert part B once you have ensured part C has been aligned after its connection to A.

Most people can handle reading a whole sentence to figure out what's going on. But, after a tiring day of building, it is somewhat annoying having to juggle instructions into actions.

Most readers will assume that instructions are written in linear time. Do this, then that. But that example is non-linear. What it is trying to say is:

Connect part C with part A. Then align part C and part A. Then drill the hole in part A. Then insert part B into part A.

It is slightly less interesting writing. But it presents all the actions in the order they need to be taken.

I see this temporally-mixed anti-pattern all the time. A typical example of this in technical documentation is:

Select Print from the File menu.

A simpler, clearer, and less ambiguous way of writing that is:

Open the File menu. Select Print.

Another similar example of confusing writing is:

Go to File → Print → Settings if you need to change the paper size.

Again, this places cognitive burden on the reader. If they want to understand if the instruction is relevant to them, they have to read the entire sentence. When faced with dozens of sentences, this can become confusing. The solution is:

If you want to do X, then do Y...

Immediately the reader knows that they can skip this sentence because they don't want to do X.

As technical writers, we sometimes want to craft eloquent prose. We long for glorious and intricate sentences. We tire of the monotony of linear writing.

Tough. We need to get over ourselves. Go write that epic fantasy novel you've been thinking about. The job of a technical writer isn't to entertain, enliven, or delight the reader. The job is to give them instructions in an easy to follow format, reducing the amount of cognitive burden they have, and making it quick to find the information they need.

https://shkspr.mobi/blog/2024/04/do-that-after-this/

#documentation #English #language

blog, to Starwars
@blog@shkspr.mobi avatar

Book Review - Star Wars Propaganda: A History of Persuasive Art in the Galaxy
https://shkspr.mobi/blog/2024/04/book-review-star-wars-propaganda-a-history-of-persuasive-art-in-the-galaxy/

Book cover for Star Wars Propaganda.This is a weird book. The politics of the Star Wars universe are rarely deeply examined. The various tax-related shenanigans of The Phantom Menace were derided by geeks but here become a potent source for art as a dozen artists reimagine classic propaganda posters from Earth and remix them with pop-culture.

There are some stunning pieces of art - with a real feel of history. Here's a typical sample:

Group of posters with fine artwork.

Others just look like they were stitched together from clipart.

Crappy looking clipart poster featuring cut outs of various Star Wars aliens.

The images are a decently sized - but could have been a bit higher resolution for viewing on a tablet.

The textual content is mostly unserious filler. It is a weird pastiche of history books, going through the purported story of the artists and circumstances behind the propaganda. It is further padded with low-resolution screenshots from the movies.

It might have been better if this were a proper art book - showing the human-world's propaganda and how a series of artists adopted and synthesised it for Star Wars. If you aren't familiar with 20th Century poster art, some of the significance will be lost on you. One nice touch is that the book prominently lists the human artists behind each work.

You'll flick through the book in about 20 minutes. It's the sort of thing which could have been a BuzzFeed listicle. It's further cheapened by the adverts for OpenRoad Media's book giveaways. Beware, if you sign up for them, you'll find it difficult to remove yourself from their endless mailing lists.

https://shkspr.mobi/blog/2024/04/book-review-star-wars-propaganda-a-history-of-persuasive-art-in-the-galaxy/

blog, to Futurology
@blog@shkspr.mobi avatar

Universal Basic Website
https://shkspr.mobi/blog/2024/04/universal-basic-website/

Many years ago - when I was very young and you were even younger - it was standard for an ISP to provide all their users with a small amount of webspace. Both Pipex and Demon offered webspace back in 1996. If my hazy memory is correct, they offered a few megabytes - more than enough for a fledgeling website1.

But, over the years, ISPs shut down their bundled web offerings. Even their bundled email services went on the chopping block. This is sad, but understandable. Most people unbundled their email so they didn't need to stick with the same ISP. Why have user@isp.example when you could have a GMail address?

And, indeed, why host data with your ISP when you could just use Facebook?

For most people, Facebook is a pretty good personal website. You can post your photos and have your friends & family see them. You can write long heartfelt rants about your teenage melodrama. You can put up the opening times of your new business. You can even host a discussion board around a specific topic.

Now, don't get me wrong, there are a few problems with Facebook2. All your faves are problematic. But I think it shows that people want the benefits of personal websites, even if they don't want the hassle of running those websites.

What does the world look like if a country offers its citizens a Universal Basic Website? Similar to Universal Basic Income, a no-questions asked entitlement to a chunk of the Web. Perhaps a generic subdomain, some storage space, and an easy to use interface?

Oh, sure, there are lots of technical issues. You'd probably have to make sure people weren't running unapproved scripts. Moderation of prohibited content would be contentious. Tech support would be a nightmare. Some corrupt company would get billions to run a sub-standard service. A failed backup or a hacker would wipe out your bakery's recipes.

But...

We accept that there are common spaces in the real world3 where people can have fun without paying. Anyone can go to a park. Anyone can stick a flyer up on a community notice board. We let kids ride the bus for free.

Can we do the same in cyberspace?

You can read some other peoples' thoughts on this Mastodon thread.


  1. With background MIDI music, as was the fashion of the day.
  2. This is an understatement.
  3. AKA Meatspace. AKA AFK.

https://shkspr.mobi/blog/2024/04/universal-basic-website/

blog, to Theatre
@blog@shkspr.mobi avatar

Theatre Review: The Mind Mangler
https://shkspr.mobi/blog/2024/04/theatre-review-the-mind-mangler/

Photo of a man standing on a stage with an illuminated sign reading "Mind Mangler".This is a blast from start to finish. I haven't heard such screams of laughter since, well, the last Mischief production I saw!

The Mind Manger is a crap magician dealing with his shitty home life, a tosspot stooge, and an audience full of idiots. Naturally, everything that can go wrong does go wrong. Imagine a very grumpy Tommy Cooper who despises his audience and, against all the evidence to the contrary, is convinced of his own mesmeric ability.

It's a fully interactive show - the whole audience become part of the act in various misconceived ways. Of course, when the magic does work, it is spectacular.

If you can, get front row seats. We had a close up view of all the mishaps and were drawn in to some of the tricks. Joyous to peek just a little bit behind the curtain.

The London run ends in a few days, and then it is off on tour. Absolutely worth grabbing a ticket. Positively daft fun for all ages.

https://shkspr.mobi/blog/2024/04/theatre-review-the-mind-mangler/

blog, (edited ) to videos
@blog@shkspr.mobi avatar

Gadget Review: KAIWEETS KTI-W01 Thermal Imaging Camera
https://shkspr.mobi/blog/2024/04/gadget-review-kaiweets-kti-w01-thermal-imaging-camera/

The good folks at Kaiweets have sent me their KTI-W01 Thermal Camera to review. You can use coupon code TEB15 for an exclusive 15% discount.

Let's get this unboxed and working!

Demo

Photos

The photos are stored as JPGs which can be read by any normal graphics program. They also contain the thermal metadata which you can extract with specialist tools.

Here's the full photo taken with the camera. It shows the interior of an office with some computer equipment on a shelf.

Infrared photo.

You aren't going to get high-resolution photos out of this - 256x192 is what the thermal sensor provides. That's overlayed on a graphic.

It includes different filters so you can see just the thermals, the real image, or a mix of the two.

A thermal selfie.

Because the optical camera is quite some distance from the thermal camera, it doesn't cope well with close ups - as you can see. Luckily, this can be adjusted in the UI by pressing the up and down keys.

Videos

As well as static shots, it will take video - 240x320 resolution and 25fps - well, ish. It looks a bit jerkier than that to me. But it is good enough to see what's going on.

In this video, I've recorded a bath filling up. Towards the end, I've changed the settings so it shows more of the real-colour video with the heat overlayed.

https://shkspr.mobi/blog/wp-content/uploads/2024/04/bathtub.mp4

Filesize is about 1.5MB per minute - I've recompressed it for upload. I couldn't see any specific thermal metadata in the video.

Linux

Amusingly, it shows up as 1f3a:1000 Allwinner Technology Prestigio PER3464B ebook reader (Mass storage mode). Nevertheless, the 30GB volume was mountable and had an IMGS/ directory full of JPGs.

There is a Windows app, which I was able to run in PlayOnLinux. It offers a few features, such as being able to change the colour scheme of the photo, and pick out specific temperature points.

What's Great

The integrated lens-cap is is a thoughtful touch. As is the hand-strap and included padded case.

The trigger action feels great and is instantly responsive. There are a bunch of menu options if you like to fiddle with things.

Oh, and it is USB-C! So it will take the same charging and data transfer cable as all your other gadgets.

Overall, a nice package.

Downsides

The button layout is a little odd. The buttons feel nice and are responsive. But I would have expected the "Enter" button to be in the centre of the directional buttons.

It is a little slow booting up - but then, this isn't designed for quick action shots.

After taking a photo or a video, it asks if you want to save it every time. That's a little annoying. There's 30GB of storage and photos are only about 300KB - so it should be good for about 100,000 photos.

The videos are recorded without sound. A cheap microphone would make it easy to narrate what's going on in a shot.

Weirdly, the bundled app doesn't work on videos.

There's no expandable storage - the 30GB is plenty, but sometimes it is easier to shove an SD card into a computer.

Finally, there's no mounting point. Other cameras I've tried have a connector so they can be attached to a tripod. This is strictly hand-held only.

Verdict

This costs £200 - £250 depending on whether the algorithm likes you. Astonishingly, that's cheap for a thermal camera of this quality!

If you're into DIY, or you want to check the thermal efficiency of your home, or you just want to see how hot things are - this is a useful bit of kit. It's sturdy and well built. Dragging images and videos off it is a breeze - even if you don't use the official app.

The interface isn't the greatest thing in the world. But all you need to do is point and click. It's the sort of thing that's unexpectedly handy around the house with all sorts of tasks - from checking if the radiators are balanced, to seeing if a hidden plug is spewing heat.

£200ish isn't cheap cheap. But it is cheap enough that most geeks should have something like this. Also worth buying for community groups who want to check for heat leaks in their properties.

If you are happy with the slight user-interface oddities, and don't need a tripod mount, this is an excellent gadget.

Readers of this blog can use coupon code TEB15 for an exclusive 15% discount.

If you're American and would prefer to buy from Amazon.com, get 10% off with code E5W6NW8V until 2024-06-30 https://www.amazon.com/dp/B0CB7Q6J79

https://shkspr.mobi/blog/2024/04/gadget-review-kaiweets-kti-w01-thermal-imaging-camera/

#gadget #infrared #review #thermal #usbC

blog, to random
@blog@shkspr.mobi avatar

Book Review - Systems Ultra: Making Sense of Technology in a Complex World by Georgina Voss
https://shkspr.mobi/blog/2024/04/book-review-systems-ultra-making-sense-of-technology-in-a-complex-world-by-georgina-voss/

Book cover for Systems Ultra.Every technology is a transitional technology. This book makes the case that the complexity of modern technology is, well, complex! Systems are designed by so many people that their outputs are an utter mystery to anyone - even those deeply enmeshed within them.

It is somewhat scattershot - leaping between sextech, payment processors, architecture, and half a dozen other subjects. Each chapter is a worthy examination of a complex technology - but I felt it would have benefited from being a little more focussed.

‘what happens when systems break?’ is that they become visible.

This, I think, is the crux of the book. We don't notice the systems around us until they no longer work. That might be because a power cable is severed, or it might be because we as individuals are rejected from it. There's a long discussion about accepting payment for adult services. It turns out that payment processors who refuse to serve that market aren't making a moral judgement - the economics of constant chargebacks and fraud simply make it unprofitable.

To invent the sailing ship or the steamer is to invent the shipwreck. To invent the family automobile is to produce the pile-up on the highway. Every technology carries its own negativity, which is invented at the same time as technical progress.

  • Paul Virilio

Every system creates its own waste-product. To invent Internet tracking is to invent the data breach. To invent the password is to invent the cracker. It was Katherine Myronuk who said "All complex ecosystems have parasites" - but I think it is more pervasive than that. Complex systems have inherent flaws which reveal themselves in disturbing and unexpected ways.

Systems are both structure and behaviour.

If we engage with systems, it is our reaction to them which often shapes how they behave. Technology isn't just action, it must also be reaction.

‘In the future . . .’ is rife at CES. It smooths the gap between the cracked asphalt on the roads outside the convention centre and the promise of new sensor-embedded freeways that autonomous cars can navigate. ‘In the future . . .’ offers a familiar world with the same old culture but now, we have jetpacks.

This is the key misunderstanding that technologists have. We point to the future without ever explaining how on Earth we get there! Transitional technology is everything. And yet, we cannot invent a new system without creating a failure mode with severe ramifications.

The book is a little meandering and could do with some phones to illustrate the subjects it is talking about. But it is certainly an intriguing ramble through the complexity of the modern systems and some of the implications those complexities impose on our future.

https://shkspr.mobi/blog/2024/04/book-review-systems-ultra-making-sense-of-technology-in-a-complex-world-by-georgina-voss/

blog, to hardware
@blog@shkspr.mobi avatar

Review: WAVLINK DisplayLink - Dual HDMI/DisplayPort adapter
https://shkspr.mobi/blog/2024/04/review-wavlink-displaylink-dual-hdmi-displayport-adapter/

The good folk at WAVLINK have sent me their Dual-Screen USB-C adapter to review. Plug it in to a USB-C socket and you now have two extra monitor ports. It'll even work on a USB-A socket, if it is USB 3.0.

But is it any good? No. Not really.

Hardware

It's a fairly chunky hub, with a tragically short USB cable.

Chunky silver unit with a short USB cable.

The USB cable has a dongle which converts it from C to A. That's handy if you don't have enough C ports. But the cable being so short means it is sort of awkward to place. If you're on a narrow desk, the weighty adapter will just be left swinging.

On the back are four ports - two DisplayPorts and two HDMI.

Output device with four ports.

But you can only use two at a time. I stuck a DP in the left and an HDMI in the right and (eventually) it worked! I was able to get 4k @ 60Hz and 1080p @ 60Hz on my screens.

Three screens with the content spread across them.

It also passed through audio, although I couldn't find a way to select which monitor received the output.

There's also the requisite blue LED to let you know it is working.

Sadly, it is a bit of a faff to get set up because it is a DisplayLink adapter, rather than a USB-C hub. The manual spends 11 pages talking about driver installation!

Linux

Plugging it in to Linux shows 17e9:6000 DisplayLink USB3.0 5K Graphic Adapter - so it was detected without issue. That said, there were some warnings in dmesg:

Warning! Unlikely big volume range (=672), cval->res is probably wrong.[7] FU [USB Audio Playback Volume] ch = 6, val = -10752/0/16

But plugging it in doesn't give you extra screens. Instead, you need to visit DisplayLink.com to download the drivers. They are only available for Ubuntu Linux. There are also drivers for Windows, ChromeOS, Mac, and Android.

Despite my best efforts, I couldn't get them to work. It looks pretty buggy. Instead, I downloaded a random GitHub repo which installed the right drivers and got it working.

Once that was done, my laptop happily detected both external screens - one HDMI, one DisplayPort. It was able to change resolution, rotation, and refresh rate using Wayland. It even worked through the USB-A socket as well as the C.

Verdict

It's hard to know who this adapter is for. On the one hand, it does its job brilliantly. It turns your USB3 / USB-C port into a dual output device for two 4k monitors. On the other hand, that's all it does.

It costs £80 - which is a large chunk of change. Especially considering you can get USB-C hubs with dual DisplayPort for literally half that price - and most of those also come with extra USB ports, Power Delivery, Ethernet, audio etc.

Installing the DisplayLink software is a pain. USB-C means that I should be able to plug in an adapter and have it just work. With this, you have to manually install drivers and reboot before it will work. Good luck getting those drivers installed on a corporate laptop!

In theory, it can go up to 5K (5120x1440) on each DisplayPort - but I don't had a screen to test it on. If you need that sort of resolution, that's the only reason I can think for buying this.

It works - but it isn't plug-and-play, the drivers are a pain, USB cable is too short, it has limited functionality, it is too bulky, and is over-priced.

https://shkspr.mobi/blog/2024/04/review-wavlink-displaylink-dual-hdmi-displayport-adapter/

blog, to android
@blog@shkspr.mobi avatar

Software I Miss from Earlier Versions of Android
https://shkspr.mobi/blog/2024/04/software-i-miss-from-earlier-versions-of-android/

My love of Android waxes and wanes according to how much the software feels like it is fighting me. On a good day, I can flash the OS and install whatever apps I want. On a bad day, I can't remove bloatware and I'm forbidden from changing the internals.

I started using the latest Google version of Android on their Pixel 8 Pro. I say "their" because it never really felt like the device was mine. Google kept popping up and asking me to do things which were clearly in their interest; not mine. There was very little way to remove Google's features. I was beholden to them. Forget that noise! I flashed GrapheneOS and regained some control.

But there are still some things missing from the modern Android experience. Things which I'm sure used to exist on earlier versions, but have since been scrapped or severely restricted.

Here's what they stole from us.

Customised Fonts

I can't remember which version of Android I first had which let me change the font to Comic Sans. But that ability doesn't exist any more - not without rooting your phone and severely monkeying with its internals.

Google's Noto font is, sadly, abandonware. Aside from new Emoji, Google show no interest in putting a modern font stack into Android. So we're left with a fairly dull and incomplete corporate font.

Button Swapping

Android originally had the back button on the right of the screen. Then, in Google's infinite wisdom, it was swapped to the left. Why? Fuck your muscle-memory, I guess?

Nevertheless, Android used to let you swap the order of the on-screen keys. This is not a particularly challenging software requirement - yet seems beyond modern Android.

Call Recording

Google is indecisive on whether call recording should be allowed. It is legal in most parts of the world, and used to be well supported by Android.

Nowadays you have to flash a ROM to get this basic functionality back.

SIP Built-in.

You used to be able to add VoIP / SIP calls to Android for free! But the latest version doesn't let you do that any more.

Custom Ringtones and Vibration Patterns

I'm sure that I used to be able to set a different vibration pattern for different sorts of alerts. But I can't find that functionality anywhere these days. Same for different alert tones for different people.

Task switcher clear-all button

If I want to close all my open apps, I have to go to task switcher then scroll all the way across. It was handy when there was a "close all" button at the bottom of the screen.

Data SIM switcher

I have multiple SIMs. They can both receive calls and texts, but only one can be used for data. There used to be a button I could press to flip between the two. Now I have to go into the settings, and fiddle with a bunch of options. Annoying!

And the rest

What software do you miss the most from old versions of Android?

https://shkspr.mobi/blog/2024/04/software-i-miss-from-earlier-versions-of-android/

blog, to Theatre
@blog@shkspr.mobi avatar

Theatre Review: The Divine Mrs S
https://shkspr.mobi/blog/2024/04/theatre-review-the-divine-mrs-s/

An outstanding and joyous show. Through Rachael Stirling we catch a glimpse of Sarah Siddons - the acclaimed 18th/19th century actress. Stirling - and the entire cast - are exceptional. They transport us backstage with a dazzling array of characters. Every single actor gets a scene-stealing moment - it's lovely to see a cast having so much fun.

It is Noises Off versus The Patriarchy as we discover how hard it is to be a actress (and authoress) in a world where female celebrity was only just beginning. It bounces between high drama and farce effortlessly. There are some very "actorly" mditations on what it means to be a performer, the price of fame, and how to handle a truculent audience.

The show runs for another week and is exceptional.

https://shkspr.mobi/blog/2024/04/theatre-review-the-divine-mrs-s/

blog, to php
@blog@shkspr.mobi avatar

Where you can (and can't) use Emoji in PHP
https://shkspr.mobi/blog/2024/04/where-you-can-and-cant-use-emoji-in-php/

I was noodling around in PHP the other day and discovered that this works:

<?php$🍞 = "bread";echo "Some delicious " . $🍞;

I mean, there's no reason why it shouldn't work. An emoji is just a Unicode character (OK, not just a character - but we'll get on to that), so it should be fine to use anywhere.

Emoji work perfectly well as function names:

function 😺🐶() {   echo "catdog!";}😺🐶();

Definitions:

define( "❓", "huh?" );echo ❓;

And, well, pretty much everywhere:

class 🦜{    public int $🐦;    public ?string $🦃;    public function __construct(int $🐦, ?string $🦃)    {        $this->🐦 = $🐦;        $this->🦃 = $🦃;    }}$🐓 = new 🦜(1234, "birb");echo $🐓->🐦;

How about namespaces? Yup!

namespace 😜;class 😉 {    public function 😘() {        echo "Wink!";    }}use 😜😉;$😊 = new 😉();$😊->😘();

Even moderately complex Unicode sequences work:

echo <<<🏳️‍🌈Unicode is magic!🏳️‍🌈;

I've written before about the Quirks and Limitations of Emoji Flags. The humble 🏳️‍🌈 is actually the sequence U+1F3F3 (white flag), U+FE0F (Variation Selector 16), U+200D (Zero Width Joiner), U+1F308 (Rainbow).

Take a complex emoji like "Female Astronaut with Medium Dark Skin Tone" - 🧑🏾‍🚀 - that also works!

$🧑🏾‍🚀 = 1;$👷🏻‍♂️ = 2;echo $🧑🏾‍🚀 + $👷🏻‍♂️;

Probable the most complex emoji has 10 different codepoints! It looks like this - 🧑🏾‍❤️‍💋‍🧑🏻

And it works!

$🧑🏾‍❤️‍💋‍🧑🏻 = "Kiss Kiss. Bang Bang!";echo $🧑🏾‍❤️‍💋‍🧑🏻[-1];

There are some emoji which don't work;

$5️⃣ = "five";

The 5️⃣ emoji is U+0035 (Digit Five), U+FE0F (Variation Selector 16), U+20E3 (Combining Enclosing Keycap). PHP doesn't allow variables to start with digits, so it craps out with PHP Parse error: syntax error, unexpected integer "5", expecting variable or "{" or "$" in php shell code on line 1

You also can't use "punctuation" emoji as though they were normal characters:

echo 5 ❗= 6;

And, while not strictly emoji, you can't use mathematical symbols:

echo 5 ≤ 6;

So, there you have it. Is this useful? Well, probably. It is easy to get lost in a sea of text - so little pictograms can make it easier to see what you're doing. If the basic ASCII characters aren't part of your native language, perhaps it is useful to make use of the full range of Unicode.

Does your favourite programming language support Emoji?

https://shkspr.mobi/blog/2024/04/where-you-can-and-cant-use-emoji-in-php/

#emoji #php #unicode

blog, to random
@blog@shkspr.mobi avatar

Toilet Review! Better Bathrooms Smart Toilet Seat
https://shkspr.mobi/blog/2024/04/toilet-review-better-bathrooms-_27403/

I want to make one thing very clear. Despite my propensity for IoT gadgetry, I did not connect my toilet to the Internet!

It's 2024. Why are you still scraping your arsehole with paper like some kind of 20th century throwback? A decade ago, I got a cheap bidet attachment. It wasn't great. The water was cold, the fittings leaked, and the plastic was creaky.

For our recent bathroom renovation, I decided that I wanted to get a proper Japanese style toilet with integrated bidet and all the technology I could find.

That didn't quite pan out. You can pay literally thousands of pounds for a "smart" toilet. And if you want the seat separately, that can cost several hundred quid as well. As much as I value my posterior, I didn't fancy paying through it!

But, with diligent research, I found one for £300 - that included the toilet, cistern, and smart seat.

It has blinkenlights!

What it does

Oh! A whole bunch! It offers rear and front wash - with an adjustable angle. It warms the water to your preferred temperature. While it is washing, it can oscillate and massage. And the whole thing can be controlled by a couple of built-in buttons, or a relatively simple remote control.

Wireless remote. Control your smart toilet using the handy integrated control buttons, or the wireless magnetic remote. The remote also comes with a convenient holder that attaches to a wall. Self-cleaning hose. This intelligent toilet is incredibly hygienic. It automatically cleans itself before use or every 72 hours when not in use to eliminate bacteria. Set your ideal hose position to one of five angles. The hose is concealed within the toilet seat when not in use. The white nightlight automatically turns on when low light is detected. This means you’ll find it easier to fall asleep after a night-time trip to the loo. Enjoy a hygienic cleaning experience choose from a front, rear or front and rear wash. The built-in sensor ensures wash and dry functions will only occur while you're seated. In a power cut, this toilet will function like a regular toilet. Choose between five water temperature settings (31-39°C). Then, select one of five spray wash modes to find your preferred level. Enjoy maximum hygiene and easy installation with a quick release seat. This design is quick and easy to remove and to aid easy cleaning of the seat and toilet itself.

There's also a little hatch for putting in some limescale remover, and a drain hole if you need to empty the bidet's tank - so should be pretty good for maintenance.

The remote has a magnetic holster which can be stuck to a nearby surface.

Oh, and there's a handy night-light.

A dark room. An ethereal glowing light emanates from the bowl of a toilet. Possibly leading sailors to their doom.

What it

At this price, there are limits to the technology. The seat isn't heated. The toilet lid doesn't automatically open or close. It doesn't play a little tune while you're going about your business. There's no air-dryer to remove excess water from your botty. No UV light sterilisation. The flush is manual - although it is dual control. It won't spray perfume into the water after a particularly troublesome dump.

Although there's a remote, the number of buttons build in to the seat are limited - front, back, and stop.

And, crucially, there's no Internet or Bluetooth connectivity.

Look, I know you think I'm stupid. But I would have like to control it from my phone. I'm going to be taking it in there with me anyway, so why can't I open an app to load my water temperature preferences?

The tech

The remote control operates at 2460MHz - which should keep it safe from naughty reprobates who have a Flipper Zero. But I doubt it offers any significant protection against a determined hacker. If you have multiple loos, is possible to set the remote to a different ID to prevent accidental interference.

The main protection seems to be the buttock detection software. Using a small camera presence sensor, the bidet refuses to operate until you have wedged yourself on the throne.

The pump and heater aren't overly powerful, so I'm not too worried about a hacker blasting a jet of boiling hot water up where the sun don't shine.

Downsides

There are a few minor annoyances. The pump is a little on the noisy side. It is quieter than a flush, but the whirring is noticeable.

The plumbing is somewhat complicated. Our bathroom fitter said it wasn't the neatest design to fit. The water hose juts out a little from the side, as does the power cable. They then wrap behind the unit.

It does feel a little narrower than other loos I've used. But it is plenty big enough for me.

Verdict

I can't find anything online about the "Purificare" brand. I suspect this is a white-label product; there seem to be several similar variants around. So I've no idea how reliable they are.

I wasn't expecting miracles for £300 - but I'm pretty impressed! As a toilet, it does the job. It is solid and the flush is powerful enough for my vegetarian diet.

The bidet is delightful. I mean that sincerely! Having a pulsing jet of moderately warm water, washing away the shameful filth of your pitiful human body, is a sensory delight. My tush has never been cleaner and my toilet-paper bills are much reduced.

If, like me, you spend more time on the bog than is strictly necessary, this is a reasonably priced accessory and will make even the most urgent visit to the smallest room a relaxing and pleasant experience.

https://shkspr.mobi/blog/2024/04/toilet-review-better-bathrooms-_27403/

blog, to python
@blog@shkspr.mobi avatar

Server-Side Rendering of Embedded Markdown Code Snippets in WordPress
https://shkspr.mobi/blog/2024/04/server-side-rendering-of-embedded-markdown-code-snippets/

Because I'm a grumpy old man, I don't use Gutenberg or Block themes on my WordPress. Instead, I write everything in Markdown.

When I write code snippets in Markdown, they look like this:

php$a = 1;echo $a;if ($a < 5) { // Do Something return thing( $a, true );}

But I want to render that with code highlighting. I was using the Prismatic Plugin. It is excellent and very customisable. But it uses JavaScript to do the code highlighting. I want to respect my readers' time and battery life; so I'm trying to reduce my dependency on Client-Side rendering.

I've switched to a modified version of WP-GeSHi-Highlight. That turns the above Markdown into:

$a = 1;echo $a;if ($a < 5) {   // Do Something   return thing( $a, true );}

Necessary Changes

When the JetPack Markdown pre-processor encounters a code block, it changes:

```php

into

<code class="language-php">

This means the WP-GeSHi-Highlight detection needs to be changed.

Old version:

return preg_replace_callback(    "/s*".    "(.*)</pre>s*/siU",   "wp_geshi_store_and_substitute",   $s);

New version:

return preg_replace_callback(    "/s*".    "(.*)</code>s*/siU",   "wp_geshi_store_and_substitute",   $s);

One of those matches looks for escaped= which can be true or false. I always want this to be true so, later in the code, I change a variable from:

$escaped = trim($match[3]);

To:

$escaped = true;

Style Changes

By default, everything looks pretty good - but there are a few changes I found necessary to make.

Firstly, there was something weird going on with the line-heights of my style, so I added this to my site's CSS:

/* GeSHI Highlighter Fixes */pre:has(> .wp-geshi-highlight-wrap5) {    line-height: 0;    padding: 0;    background: none;    filter: invert(1);}

The invert gives it a dark mode.

Secondly, in order to make any changes to the default styles of the highlighter, you need to add the bundled wp-geshi-highlight.css file into your style directory. The plugin will use that if it exists - so you can change font size and padding to be the same as your main theme.

Limitations

There are a few limitations with this approach.

No line-numbers. The plugin looks for something like line="13", but there's no way to add that in Markdown.

GeSHi hasn't received style updates on some languages for quite some time. It hasn't received any significant update since 2019. Which means bugs and security issues are likely.

Language definitions are quite strict. You can use javascript but not json.

The plugin doesn't have any options - nor an easy way to override its settings. So I've monkeypatched everything above. If the plugin updates, I'll need to change my code.

Demos

A few demos - just so you can see what it looks like.

Python

#!/usr/bin/env pythonfrom datetime import datetime, timedeltafrom mastodon import Mastodonfrom bs4 import BeautifulSoupimport config#  Set up accessmastodon = Mastodon( api_base_url=config.instance, access_token=config.access_token )#  Get user's infome = mastodon.me()my_id = me["id"]year_joined = me["created_at"].year

Bash

if [ "$(basename $2)" = "Image.gz" ] || [ "$(basename $2)" = "vmlinuz.efi" ]then# Compressed install  echo "Installing compressed kernel"  base=vmlinuzelse# Normal install  echo "Installing normal kernel"  base=vmlinuxfiif [ -f $4/$base-$1 ]; then  mv $4/$base-$1 $4/$base-$1.oldfi

Rust

// This is the main function.fn main() {    // Print text to the console.    println!("Hello World!");}

JavaScript

if (hour < 18) {  greeting = "Good day";  alert( greeting );} 

https://shkspr.mobi/blog/2024/04/server-side-rendering-of-embedded-markdown-code-snippets/

#HowTo #php #programming #WordPress

  • All
  • Subscribed
  • Moderated
  • Favorites
  • tester
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • Youngstown
  • slotface
  • hgfsjryuu7
  • mdbf
  • vwfavf
  • kavyap
  • tsrsr
  • ngwrru68w68
  • PowerRangers
  • DreamBathrooms
  • Leos
  • everett
  • Durango
  • osvaldo12
  • khanakhh
  • ethstaker
  • rosin
  • cubers
  • tacticalgear
  • GTA5RPClips
  • normalnudes
  • cisconetworking
  • modclub
  • anitta
  • All magazines