Raspberry Pi video art installation

My daughter makes video art and needed a simple solution for showing one of her pieces continually in a loop.

I used an old Raspberry Pi model B for this. I just realised that the only place I had documented this was on my now-deleted Twitter account, and I can’t recall where I learned about this method, so I just had a quick look at the machine in question to try and work out what I did to make it. I’m recording it here in case it’s useful to anyone else or, more likely, me.

The Pi has Raspbian Buster on it, no GUI/desktop, just the command line stuff. It needs omxplayer, which I think was installed by default.

I put the source video MP4 file in the default pi user’s home directory. (I may have transferred the file from a USB stick using fdisk to identify and

sudo mount /dev/sda1 /media/usb-drive/

to mount the drive, but you could also probably transfer the file using SFTP, FTP over SSH).

I also doubtless used raspi-config to force the audio to either HDMI or the 3.5mm audio jack, and maybe alsamixer to set the volume level.

The magic happened by editing rc.local:

sudo nano /etc/rc.local

Then I added some lines so it looked a bit like this:

# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi
omxplayer -o local --loop /home/pi/video-art.mp4 &
exit 0

Now when the Pi reboots, after quite a lot of boot-up text scrolling, the video plays and loops automatically. Connect to your monitor or projector and install in your art gallery!

Posted in Raspberry Pi | Tagged , , | Leave a comment

Why did 1973 matter to Classic Mac OS?

So I was clearing off an old 350MHz graphite Apple Macintosh G4 Server which had OS 10.4.9 on it, and decided to put Mac OS 9.2 on it for the lolz.

This was a mistake, as I had been intending to sell it, but now I am discovering old software, games and artwork I made many many years ago.

One thing that intrigued me was this dialogue box that popped up:

Mac OS 9 error message that the clock is set to a date before 1973

The motherboard’s battery long since died and I removed it, so the system clock goes back to its default setting. But why does Mac OS care if the clock is set to a date before 1973? Why 1973 specifically?

1970 is a significant date in computing – midnight UTC on 1 January 1970 is ‘the UNIX epoch‘ base. Time in Unix is measured from this point.

But 1970 is not 1973, and OS 9 is not Unix. (Its successor Mac OS X was, of course, built on Unix.)

I did a bit of digging into dates in HFS+, the Macintosh file system widely in use around the time this machine was made, around the turn of the millennium. Or Y2K if you prefer.

HFS Plus stores dates in several data structures, including the volume header and catalog records. These dates are stored in unsigned 32-bit integers (UInt32) containing the number of seconds since midnight, January 1, 1904, GMT. This is slightly different from HFS, where the value represents local time.

The maximum representable date is February 6, 2040 at 06:28:15 GMT.

The date values do not account for leap seconds. They do include a leap day in every year that is evenly divisible by four. This is sufficient given that the range of representable dates does not contain 1900 or 2100, neither of which have leap days.

So its timestamps start in 1904. And end in 2040. So, some more dates – but neither of them is 1973!

I tried searching the internet for anything about Mac OS and 1973, about the text of the dialogue box and found almost nothing. I did find a TikTok about an old clamshell iBook and this poem by Jeffrey Joe Nelson:

System Note

Your Macintosh’s clock is set to a year before 1973.

This may cause certain of your pomes to behave erratically.

So then I asked around at work, and after kicking around a few ideas, a colleague has, I think, probably solved it.

Look at the wording of that dialogue box very carefully…

Network time error

Your Macintosh’s clock is set to a year before 1973. This may cause certain applications to behave erratically.

[my bold]

Now my colleague reasoned thus:

Counting seconds in a 32 bit number gives you 136 years’ worth of counting.

If the classic Apple Mac OS epoch (zero time) is indeed 1904,  then 1973 would be precisely half way through that range.

If for reasons of temporary insanity, say, a third party developer held that as a signed 32 bit number, anything before 1973 would look negative. Negative time sounds like a dangerous concept. Certainly one that could cause applications to behave erratically.

No-one inside Apple would be so foolish.

But the developer of certain applications might!

I think he’s cracked it! What do you think?

David Tennant in Doctor Who saying wibbly wobbly timey wimey stuff

Updates!

@prozacchiwawa@functional.cafe on Mastodon adds this intriguing comment:

If an app cheaply checked whether subtracting two dates yielded a positive or negative result in signed space, moving the two dates farther apart than half the unsigned space could fool it. I’m wondering if that’s what they had in mind.

For example, 2023 (0xdfeb9580) – 1941 (0x4599a080) yields 0x9a51f500, which might mean to some apps that 2023 is before 1941.

 

 

Posted in Apple, lowendmac, operating systems | Tagged , , , | Leave a comment

This link may be unsafe

Or: The Straw That Broke This Camel’s Back

Screenshot showing how an https link to my Mastadon page was changed to http by Twitter, triggering a security alert

Elon Musk changed Twitter bio links to Mastadon to http instead of https – or blocked them.

He is a free speech absolutist free marketeer who doesn’t believe in free speech he doesn’t like, nor does he believe in free market competition.

Effectively he changed users’ profiles to make it look like they are scammers.

An insane way to treat users, aside from the many other, probably more important, reasons to quit Twitter.

Anyway, I’ve deleted my Twitter account now.

I know there are reasons to keep your account live, but, if you’re a journalist, I ask you especially to consider ceasing to post on Twitter and only use it for passive research, out of solidarity with your colleagues on The New York Times, Washington Post, CNN, Voice of America and other outlets who had their accounts suspended by Elon Musk for reporting on him.

  • Your DMs are not secure and may be used against you, just as he has used internal private messages against people
  • Your account could be suspended at any time and you won’t be told why
  • Posting on Twitter is providing free content on a toxic platform whose owner is using it to suppress journalism and spread disinformation, for example about COVID

twitter is over if you want it

Posted in internet | Tagged , , | Leave a comment

A Christmas Ghost Story: The Tedious Case of Room 623

The Tedious Case of Room 623 cover art

Had an idea for a story while walking the dog. I was going to abandon it, or at the very least change the narrator’s preposterous name, when I discovered that Agatha Christie wrote over a dozen stories about a man called Quin, Harley Quin and I thought, well I won’t let the stupid name put me off.

I probably should have let the rest of the story being poor put me off, but hey I didn’t. I just wrote this for my own amusement while avoiding writing a novel, and to see where it goes, if anywhere.

Ironically, given the narrator’s views, my original idea for this was as a podcast, or just some audio posted on Mastodon. I might still do that, but it would probably force me to reveal something about the narrator I’d rather leave ambiguous for now.

Download the story as a free PDF here.

Bonus marks will be awarded for spotting any of the popular culture references used in the story.

Merry Spookmas!

Posted in fiction | Tagged , , | Leave a comment

Social migration

twitter is over if you want itThis is not intended to be another long take on Elon Musk’s Twitter takeover, heaven knows enough has been said about that, but a few thoughts as I mothball my Twitter account…

  • I have long-disliked Musk. He’s not a good role model for young people, he’s not a genius, he didn’t invent rockets or the electric car – he inherited an emerald mine and made some good purchases.
  • I am very uncomfortable with a major social media platform being owned by someone who is, at best, soft on Putin and Trump, and I don’t like the look of some of his other financial backers either.
  • I’m mothballing my Twitter account, not deleting it. For now. I think it’s likely that Musk will wreck Twitter and sell it for much less than he paid for it, or advertisers will force him to U-turn on all his big talk about absolute ‘free speech’. So I may go back.
  • Some people I know would love to leave Twitter but can’t because their jobs require it. There could be a trend for Twitter to become (even) more corporate, with a smaller number of accounts broadcasting. Conversations between non-blue-ticked humans (‘real people’) might move elsewhere.
  • Because of not-unrelated concerns, I’m not on any other major social media platform either (unless you count GeoCities or Firefly*) so I am going to feel very isolated.
  • I’m trying Mastodon.social. I’m totally new to it but I know it’s not Twitter and it’s a mistake to think it is. Find me at https://mastodon.social/@blogmywiki – come and say hello!
  • There’s lots I will miss about Twitter. Folk live-tweeting along with Top of the Pops. Keeping in touch with friends and former colleagues. I can’t imagine Eurovision without it. Interactions with admired celebrities. Disposable tweets from funny, clever people. The way it allows you to create a ‘rich mix’ feed of interests: in my case subjects as diverse as Python programming, education, music, 20th century literary fiction, typography, architecture, design, podcasting, radio, TV, journalism, British politics, the BBC micro:bit. I miss my pinned thread about the life I found in a skip, which I can’t recreate.
  • There are things I won’t miss. Twitter is too negative, too addictive, too much of a time sink (let that sink in!) and a slower, more positive pace would be better.
  • Without Twitter I think I’ll probably blog a bit more – more thoughtful, slower posting might be good.
  • Not checking my phone all the time may allow me more time to read. That’s got to be a good thing.
  • Mastodon, understandably, seems to be heavily geared towards the tech community. It would be great if more literary, radio, journalism and general political and cultural commentators and academics would try it too. I’d be very grateful if anyone can point me to other Mastodon instances where I might find people interested in these topics too.

* I’m joking, of course. Nobody remembers Firefly. I may even have dreamt it.

Posted in Uncategorized | Tagged , , | Leave a comment