Posting to Bluesky via the API from PHP – Part One

With all the uncertainty surrounding the future of X (née Twitter), I decided to take a look at Bluesky which somewhat ironically has its roots in Twitter where it was started as an internal project. Bluesky is still in beta and is invite-only. I worry about its long-term given that ultimately it too has to make money, something that Twitter has singularly failed to do. None of this, of course, affects the topic today which is posting to Bluesky via the API.

Basic Concepts

The first thing to say is that I am using the following library to actually post … Read the rest

Automatically Restarting Unresponsive MySQL Service

This blog and others that I run are all hosted on a cloud server with MySQL installed locally. Occasionally MySQL becomes unresponsive and I have to login to the server to kick it back into life by restarting msqld.

The most likely reason for MySQL becoming unresponsive is lack of resources so the best solution would be to increase the size of the server – however, that requires money that I don’t want to spend. Therefore, the next best option was to write a script to detect when MySQL was unavailable. Enter mysqladmin.

mysqladmin — A MySQL Server Administration Program

Read the rest

PiHuts Maker Advent Calendar “unboxing” Video 2023

Last year for the first time PiHut released an advent calendar called “The 12 Projects of Codemas!” which included 12 projects based around a Pico covering such things as temperature sensors, switches and the like. I did a series of unboxing and project videos covering their content. I had great fun so I was pleased to see that PiHut have brought them back for this year too.

This time there are not one but two advent calendars to get stuck into. This year alongside “The 12 Projects of Codemas!” is a second one called “Let it Read the rest

Leaving the MacBook at Home

I’ve recently returned from holiday and for the first time in a while, I travelled without a laptop. I wanted to return to the question of whether it was possible to do a trip without one. My requirements while I am away are pretty light: blogging and editing photos to go with the posts – not too much to ask surely?

Heading Out

I left my MacBook Pro at home and in its place I took my iPad Mini, a Bluetooth keyboard with the same footprint as the iPad and a Magic Mouse.

The immediate advantage of this was a … Read the rest

Simple Remote Wake on Lan with Raspberry Pi Zero W

As part of my drive to help the planet, I am trying to use less electricity. We have a Windows machine in the lounge that acts as a Plex media server. This works very well but I realised that it was only being used at certain times of the day, usually in the evenings, meaning that it was running for hours on end unnecessarily. Therefore, the plan was to have the machine automatically turn off each night at midnight when I knew we would definitely not be using it, but what about turning it on?

If I was at home … Read the rest

Working out my credit card statement date in Excel

This might be the most niche post I have ever done but I hope that it might prove useful to someone.

My credit card bill gets made up on or around the tenth of each month but, for reasons I won’t go into here, I needed to much more accurately predict when it was actually going to be created. Through a combination of searching and testing, I discovered that in my case it is always made up on the sixth working day of the month. Turns out that there is an Excel (and Google Sheets) function that can help with … Read the rest

Update to WordPress Posts to PDF

A few weeks ago I released a tool that allows you to export your WordPress posts to a nicely formatted PDF file. I have today pushed some changes to the code which you can find on the GitHub page. This includes the following:

  • Heading (H1, H2 & H3) tags are all now supported
  • List (ordered & unordered) tags are now supported
  • Inline images (not supported) captions are silently dropped
  • A new command line parameter to choose the order of output
  • Progress now shows the number of posts out of the total processed (see image below)
  • Improvements in the
Read the rest

Maco Go 2: Apple Watch Charger

Back in February 2020, I backed the Maco Go project on Kickstarter. This tiny, portable, USB-C Apple Watch charger arrived in September 2020. While I was impressed with its size and portability I was less impressed with its charging speeds.

In my tests, shown below, the Maco Go took roughly twice as long to charge as the standard Apple Watcher charger cable in the same charging plug.

Apple Watch cableMaco GoApple Watch cableMaco Go
18:25 22%
19:25 92%
+70%
13:19 28%
14:19 58%
+30%
18:25 33%
19:25 96%
+63%
16:51 15%
17:51 44%
+29%

In the end, … Read the rest

Creating a Word Cloud from Your Day One Entries

A while back I wrote a post about querying the Day One database in which I teased more to come with this statement:

I wanted more detail than Day One offered and had ideas of how I could mine my entries in cool ways (more on that in a later post).

Well, this is that “later post”! I wanted to visualise my entries as a word cloud.

Massaging the data

In order to produce the cloud I needed to do two things: extract the data and then display it. Sounds simple doesn’t it? I quickly found that there were a … Read the rest

Exporting all WordPress Posts to PDF

I had a requirement to export all my WordPress blog posts into a nicely formatted PDF file and so I looked at plugins that were available to do the job, of which there are a few. I tried some and none worked for me giving no output at all so I decided I would roll my own. Here’s how you can use that code to download your posts to PDF too. You can see an example of the output at the bottom of the post.

To do this required two things: accessing my posts via the WordPress API and … Read the rest