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

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

Day One Encryption

TL;DR the Day One local database is not encrypted.

After my last post on querying the Day One database, I was asked the question: what happens if you have your journals encrypted?

Before we get into that, let’s look at the Day One encryption options. You can turn on encryption on a journal-by-journal basis and it is on by default. This must have changed at some point as my original journal is not encrypted and newer ones are. Despite being able to choose which journals are encrypted and which aren’t selectively there is only one encryption key meaning that … Read the rest

The Move from LastPass is Complete

In December 2022 LastPass announced to their users that they had been subject to a data breach. This led me to consider moving to another password manager which I did, settling on 1Password.

I transferred over 1,700 passwords and I calculated that changing an average of three a day was going to take me a year and a half to change them all. Well, it has been somewhat quicker than that as I have finished! In doing so I have reduced the number from 1,700 to 677.

I thought that it might be useful to know what I did … Read the rest

Transitioning from Twitter API v1.1 to v2 (Part 1)

As part of The Twitter Debacletm I have spent the last few weeks trying to get my Twitter bot working again which has taken quite a bit of effort.

I thought it might be worth looking at what I did to get my bot working again once access to the API was cut in February. As there is so much in this I have broken it down into two parts:

  1. setting up your project and getting the keys you require to use the API
  2. calling the API from PHP

Getting the keys

I struggled to find which keys to … Read the rest

How to Restore Twitter to Something Useful

Since the takover of Twitter by Elon Musk changes have been coming thick and fast. Some, such as Twitter Blue, have been well reported and endlessly debated. Others, such as the change to the timeline, less so. It is the latter that I am going to concentrate on today.

Twitter has long tried to encourage behaviour that it wants rather than what the consumer might want. This means pushing tweets from people that you might not follow but others you follow do, in the hope that you will build your own followers. The problem with this is that you end … Read the rest

Mastodon and verifying websites

Mastodon is all the rage at the moment as Twitter is driven into the ground in full public view by new overlord, Elon Musk. I’m not going to go into the pros and cons of Mastodon here but looking at one specific thing that is different to Twitter – the automatic validation of websites.

Getting your verification link

In the profile section Mastodon allows you to record up to four pieces of metadata. This can be anything you want, such as location or pronouns, and you can also record your website addess here too. You can put any link … Read the rest

Accessing Local Resources over the Internet with Packetriot

When I am doing any development, such as for PostRecycler, I do the coding on my laptop running Apache, PHP and MySQL locally via MAMP. This is fine until I need to share work with others which means I have to either upload the work onto a public server or do it via screen sharing. Neither are particularly ideal.

I was vaguely aware of the service ngrok which allows you to expose your local services on the web and then, via Reddit, saw the similar service Packetriot which does a similar thing so I thought I would give … Read the rest

How to store UNICODE in a non-UNICODE database

For a side project I am working on (Glad you asked! PostRecycler which makes the most of your social posts) I needed to all entry of unicode characters for just one field.

This left me in a bit of a quandary as I really didn’t want to have to convert the whole of my database to UTF-8 just so I could have this one column accept unicode characters.

Then I remembered something I had discovered in our companies web app which accepted unicode characters but I knew the database wasn’t unicode enabled. However, I knew that this column was encrypted … Read the rest

Here’s a Question that Pains me… Is Evernote Dying?

It really pains me to say this but I am worried about the longevity of Evernote, a tool that I have been using for many, many years. So long in fact that I now have well over 30,000 notes stored in it.

Evernote co-founder Phil Libin always said that his aim was to create a “100-year startup” meaning that it’s “a company that’s around in 100 years, which means Evernote’s product needs to be durable.” Right now I cannot see them achieving that aim. Of course that aim could have been ditched when Libin left in 2016.

Why have … Read the rest