ChatGPT wrote a script

If you ask ChatGPT to write a script to do some computer operation, it will.

It will write an actual script with an actor and narrator and then add a Python script to do what you wanted in the middle of it.

[INT. COMPUTER SCREEN – DAY]

A computer screen displays a folder containing a motion JPEG file named “Samsung_Camera.mjpeg”. The folder also contains various other files.

[INSERT: CLOSE-UP of the “Samsung_Camera.mjpeg” file]

NARRATOR (V.O.) Motion JPEG files are typically created by Samsung cameras and consist of both video and image frames interleaved together.

[INSERT: CUT TO a programmer, JAMES, sitting at his computer desk, wearing glasses and typing on his keyboard.]

JAMES (to himself) I need to separate the video and image frames from this motion JPEG file.

[INSERT: CLOSE-UP of James’ computer screen, showing a code editor open with a Python script.]

JAMES (V.O.) I can use Python to extract the video and image frames from the motion JPEG file.

[INSERT: CUT TO the Python script on James’ computer screen, showing the following code:]

……

[INSERT: CUT BACK TO James, who is now running the Python script.]

JAMES (excited) There we go! The video frames are saved as “Samsung_Camera_video.avi” and the image frames are saved as “Samsung_Camera_image_xxx.jpg” files, where “xxx” represents the frame number.

[INSERT: CLOSE-UP of the folder, now showing the extracted video and image files alongside the original motion JPEG file.]

NARRATOR (V.O.) James successfully separated the video and image frames from the motion JPEG file and saved them as separate files.

[FADE OUT.]

[END OF SCRIPT]

I asked ChatGPT asked to write a script to perform a task on my computer.

I asked ChatGPT to “Write a script to separate out the video and image from a motion Jpeg file created by a Samsung camera.” As you may guess from reading the “script”, the Python script it generated didn’t do quite what I had in mind. It created separate Jpeg files for each frame of the video.

Further prompts to produce a BASH script that did the same produced attempts that came close, but failed to extract the video, even when I used exiftool -b -EmbeddedVideo. That did work with motion photos from older phones, but maybe they changed something in the S23U.

So, unless you’re a budding movie producer, be exact when you ask ChatGPT to write you a script to do something.

The One-Minute Time Machine

You have probably seen the short film, One-Minute Time Machine already as it was originally released in 2014, but the YouTube channel it was on closed earlier this year. The creator of the film, Devon Avery, uploaded it to his own channel last month, and I think it’s worth another watch.

I’d love to comment on it but then that would spoil the whole thing. Go watch it!

Try the tiny 8bit emulators in your browser

Even if you’ve never been curious about what computers in the 80s looked like, you might like to see all the emulators on this page.

Multiple computers are covered here, including the Commodore 64, Amstrad CPC, the Spectrum 48K and a few others I’ve never heard of.

The nice thing about these is that they run in the browser, so nothing else to install. The files are tiny by today’s standards, and they run immediately. No need to learn an arcane set of commands to load and run your programme.

It’s also given me a whole new appreciation for the Amstrad CPC and Speccy as demoscene platforms. The graphics and sound of the Amstrad platform are quite impressive!

Three years ago the schools closed

I was reminded by this Reddit thread that it was three years ago today that schools closed in Ireland because of a new virus that caused an illness called COVID-19.

Later that week I started posting some of the news here in a series of blog posts. It didn’t last of course but here’s the first one, shared on St. Patrick’s Day 2020.

The pandemic isn’t over. I got COVID last year in November but I was vaccinated. Who knows what the long term effects of this disease will be? Long COVID is a horrible, debilitating disease that strikes at random.

But we live on. We pretend the virus isn’t around any more. “Ha! Ha! If I don’t get the virus in this busy pub I’ll never get it!” We’re social animals. We crave company, and chat, and friendship.

Let’s hope the virus doesn’t mutate into something we have no resistance to, again.

Open Cubic Player and Mods

Oh dear. This will be so niche that nobody is going to read. Anyway.

Long before MP3 files were a thing, the world had mod files. It had s3m, xm, and it music files. There was a thriving scene of musicians creating music for the love of it. Files were distributed on bulletin boards, by swapping disks and in the early internet of the mid to late nineties, by downloading from Hornet or ftp.cdrom.com.

Before I was really online I frequented BBSes in Ireland and every Sunday morning I’d download the latest week’s worth of new scene music from a BBS in Northern Ireland. Luckily, the telephone system here was loosening up, and we had pretty cheap rates at the weekend and in the evenings. There was a huge amount of rubbish there but some classics too, all sadly rotting away on some long forgotten hard drive.

The days of using a modem meant a slow connection to the world. Thankfully, the files weren’t huge. Unlike MP3 files, mod files were instructions on using embedded samples to play the music. The samples were short 8 or 16 bit sounds that were used over and over to make the music. That resulted in tiny files. For example, the title music to Cannon Fodder, a piece of music that is over 2 minutes long, is only 245Kb, and that was a fairly large file for the time.

Want a taste of amazing mods without doing any work? Many years ago I purchased a compilation CD called Freedom with some remarkable tracks. Here are a few songs from it. YouTube really doesn’t do them justice, however. You can grab MP3 rips of the CD from scene.org or look for the songs on The Mod Archive.

How do you play mod files today? The simplest way is by using VLC player. That player natively supports several mod formats. Install it and double-click your mod files to load them. Another option is Open Cubic Player. You’ll find the original DOS version on that site, but a separate Unix port is now maintained on this GitHub repository. Opinion on how good a player it was is divided in the community, but I loved it.

It’s a command line application you can install on macOS with brew install ocp or grab the Linux version from the GitHub repository. A DOS version is available from their homepage, which might let you run it on Windows. I created a macOS application using Automator. I had it “run shell script” and entered the following to change the directory to where my MOD files are stored and then launch the player:
cd ~/retro/MODS/ && /usr/local/bin/ocp

Save that as an application and copy into Applications. I couldn’t get it to load mod files by associating them in Finder but it’s possible to use the file navigator built into the player.

If you were active in the PC demoscene in the 90s, you’ll probably remember this player, and I think you’ll enjoy revisiting some of your old mod favourites. You can download mod files from a few sites listed on the Open Cubic Player GitHub page, but the best place to look is The Mod Archive. Best of all, you can play the mods in your browser, so you don’t need to worry about this ancient player at all. Their “About Modules” page lists other players for Linux, macOS, and Windows too.

Godox TT685s and X1Ts for Sony Mirrorless Cameras

A few years ago, I invested in a Godox TT685s flash unit, a TT350s flash unit and X1Ts transmitter for my Sony A7III camera. Despite their potential, I rarely use them, leading to some forgetfulness about configuring their wireless transmitters. A helpful YouTube video brought back memories of the necessary settings, including the requirement that the channels used for communication between devices must match. I also remembered there was an irritating issue about them, but I couldn’t quite recall what it was.

Before a party, I tested the flashes on our Chihuahua, Diego, placing one on the floor and the other on a window sill. Both worked flawlessly, and I was excited to use them that evening. Diego is a very patient subject, sometimes anyay.

My willing test subject, Diego.

Later on, I got my camera out, successfully made a photo or two of one group, then headed to the kitchen. However, while trying to photograph the beautiful desserts there, the flash refused to fire, even after several attempts. I resorted to aperture priority mode with auto ISO, managing to snap a few shots without the flash’s assistance. Despite the hiccups, I was able to capture images.

I went around to different groups to take photos, but to my dismay, the flash wouldn’t fire as expected, leaving me to apologize for my failed attempts. Fortunately, after numerous attempts, the flash worked, but the experience was disconcerting. Eventually, I resorted to attaching the flash to the camera and was relieved when it worked perfectly. Because of the complications, I was grateful to have captured some memorable shots.

While troubleshooting why my Godox TT685s flash didn’t fire, I scoured the internet for answers. Amidst various suggestions, I stumbled upon a StackExchange post that revealed the true reason behind the problem: the Godox X1Ts transmitter and the TT685s flash were positioned too closely to each other. I remembered it was the same vexing issue that had slipped my mind earlier!

Godox added a “close mode” to their transmitters to address the issue of the X1Ts transmitter and the TT685s flash being too close to each other. While it’s unclear to me why this would affect radio signals, it’s good to know there’s a solution. A firmware update may be needed for the X1Ts, but my device has the latest one (v18). To activate this feature, hold down the TEST button while powering on the transmitter until the status light blinks for 2 seconds. The setting will reset when the device is turned off. After trying this out, I can confirm that it worked flawlessly.

I don’t use flashes much. In the future, if I encounter that same non-firing issue with my Godox X1Ts transmitter and TT685s flash, I hope I’ll remember to check my own blog first to avoid the hassle of researching it elsewhere. Hopefully, my own documentation will come in handy and save me time in the long run!

Uh oh. Is adobeyourshotyourstory.com gone astray?

This morning I saw a notification on the Adobe “Creative Cloud” app I can get pro tips for photographing people…. etc etc. I thought it was the usual material Adobe brings out, which to be fair, is quite good, so I clicked it.

It’s odd that the news item is from a week ago, but I only saw the notification now, but that happens. The page loaded in the background while I checked other things in another window. I glanced back and saw the ublock origin was stopping a tracking redirect. Uh oh. The only thing I had loaded was that Adobe link. Curious, I let it through until it redirected to a spam page on iyfbodn.com.

I was expecting something that looked more like the website that was archived last year. A quick whois of adobeyourshotyourstory.com shows it was updated in October last year, but the domain now appears to be owned by someone in Tbilisi, Georgia!

I am very interested to hear how this happened. It’s one thing to take over a prominent domain (Adobe last mentioned the domain on Twitter in June 2022) but to get a notification in the Creative Cloud app that redirects to a spam site is quite an achievement. Unfortunately.

Redirecting ?replytocom so bots go home

Earlier this month I noticed that a particular bot that likes to visit my website, “MJ12bot/v1.4.8” seems to be particularly attracted to the “reply to comment” links generated by my blog. Those are links that bots see, but we see the “Reply” button that uses JavaScript to reply to a comment.

To be honest, it’s pretty annoying to see a bot constantly fetching those URLs from my website. Earlier this month, it was on a roll and grabbing several dozen at a time. While my server can handle the traffic without any issues, who wants a bot trampling over their server?

I decided to stop them in two ways:

  • Redirect them back to the post in a mod_rewrite rule.
  • Block them in robots.txt and hopefully the bots will go away.

Coming up with a mod_rewrite rule was surprisingly hard, but after mentioning this on Mastodon I received a reply from Jos Klever who figured out I needed the QSD flag. So, to spare you the hassle of researching it, here are the mod_rewrite rules that worked for me. It causes a 301 permanent redirect to the anchor tag of the comment. Add this to your .htaccess file.

RewriteCond %{QUERY_STRING} replytocom=(.*)$
RewriteRule ^(.*)/          $1/#comment-%1 [NE,QSD,L,R=301]

Blocking requests like this in the robots.txt is much simpler. WordPress can generate the robots.txt file for you using the robots_txt filter. Add the following to a mu-plugin PHP script.

function disallow_replycom_urls( $output, $public ) {
    $output .= 'Disallow: ?replytocom';
    return $output;
}
add_filter( 'robots_txt', 'disallow_replycom_urls', 10, 2 );

I haven’t received many comments on my posts lately. However, I stumbled upon some interesting posts by clicking the RANDOM link above, which I decided to examine as part of my research. During my search, I delved deep into the blogosphere of the past, almost like being an archaeologist, because some links were no longer available, and I had to search for them on archive.org. I was also pleasantly surprised to find that a link to a GIF from 2005 was still alive!

How to: a keyboard shortcut to lock your Mac

For many years, I was using a hot corner to lock the screen of my Mac, but I always wished there was the equivalent of Windows-L in Windows to do it.

I have no idea when this keyboard shortcut was added, but tapping the CTRL-CMD-Q shortcut will lock your Mac screen. Apparently, if you have a small magic keyboard, then CTRL-Shift-Eject will do the job too. This Stack Exchange Question shows the shortcut wasn’t available in 2015. Users had to resort to all sorts of tricks to lock their screen with the keyboard. An updated answer from 2019 reveals the shortcut, so I guess it’s at least four years old.

An apple on the side of the road
An apple on the ground. Like shortcuts, you never know what you’ll find.

Hot corners are great and all, but I’ve had so much trouble making sure the cursor stayed in the corner. I’d watch to make sure my mouse didn’t move, and the screen remained locked. Otherwise, I turn my back, I’m heading out the door and the screen lights up again!

Loads more keyboard shortcuts here if you’re interested in that sort of thing. That page may also explain why something strange happened on your computer while you were typing into the wrong window and changed a Finder setting, for instance.

Have fun getting locked.