Google Cloud Storage and WordPress

I am trying out a system that puts my media files onto Google Cloud Storage, which is much cheaper than using increasingly huge VPS instances.

I am trying WP-Stateless, and I will post a photo as a test.

Well, it works – you can absolutely do this. However, it only works if you have a public-facing bucket. The flow I was hoping for is for a password-protected site, and that does not work with a public bucket. I also explored using a FUSE-based setup, where I use SSH for a virtual link between my filesystem and a non-public bucket.

That works OK in a test, but if you add 40Gb of data, the FUSE link just fails to work – you can’t manage the throughput for even the ls command, let alone working as a high-latency-localish filesystem. Oh well.

Changing WordPress Settings Directly

A recent update of PHP broke one of my oldest WordPress blogs. It was set up with an offset for the timezone, which is no longer supported. What it looked like was the white screen of death, but enabling debug mode in my wp-config.php gave me some hints.

The first hint that it was something weird is that all of my other blogs, which all run off of the same database, were all fine. I can look at their settings, log into their administration interfaces, change their settings, but my old blog would not load.

After considerable DuckDuckGo-ing, I figured out the setting that needed to be fixed, but because I couldn’t load the administration interface, I could not fix the setting. Access to all of your WordPress settings is inside the database, so I had to figure out how to change that setting directly in the database, preferably without ruining everything.

The option was timezone_string, but if you don’t know how the database is laid out, you have to do some poking before you can get yourself sorted.

All of the options are in a table called options, or in my case, since I have multiple WordPress blogs in the same database, there is a prefix underscore first. I found this by logging into the database engine, navigating to the correct database, and then using the show tables; command.

show tables;
show columns from $BLOGNAME_options;

The next wrinkle was interpreting the results – they lay out the columns vertically, which isn’t very intuitive, since we definitely asked for columns, and they are shown as rows. Still, it is standard, and looks like this:

option_idbigint(20) unsignedNOPRINULLauto_increment

I was then able to figure out that I need to change the option_value for the row with the option_name timezone_string. Since I want to figure out what to change it to, I tried this:

select option_value from $BLOGNAME_options where option_name='timezone_string';

That showed me the problem that I was seeing in the debug messages. Then I looked at the timezone_string from one of the blogs that wasn’t broken, which in that case was “America/Toronto”. Then I finally had enough information to update the option_value to (hopefully) fix my ailing blog. So, I ran this:

update $BLOGNAME_options set option_value = 'America/Toronto' where option_name = 'timezone_string';

And it worked! It took too long, and was stressful and annoying, and made me wish that all of these options were in a flatfile, ’cause doing this with no interface is annoying, and completely beyond the average blog-haver, I think.

If the whole blog is going to go down from a borked option, maybe the blog should load a default set of options and then tell the user which options to fix.

Flights of fancy – part 5

In previous posts I has imagined the possibilities of high-strength carbon-based nanomaterials on various industries, and a variety of currently impossible applications.  In this post I imagine some (to me anyway) interesting applications of these tools in times of crisis.

I will start with a small-scale crisis dismayingly common in the Canadian north, but it is the sort of thing that happens anywhere that is hard to get to via regular transit channels; an unexpected medication shortage.

Imagine a small community in the Northwest Territories beset with the unfortunately common problem of diabetes and hypertension.  Both diseases can be mitigated by medication, but that medication is needed regularly or the health consequences are disasterous.  A fire in winter in the clinic could easily destroy a six-month supply of life-sustaining medication in minutes, and while the medications are not hugely expensive, getting them to the people that need them is.  However, imagine the difference if a hospital pharmacist in Edmonton gets a call from a satellite phone while the clinic is still burning from the local band leader – they could outline their urgent medication needs to the hospital, and the pharmacist could make up a one-month supply of vital medications, and pack them in an insulated box and take them up to the roof, where a dozen medi-drones are housed, charging their batteries for just this moment.  The medication box gets locked with a code and clipped to a small, wing-shaped dririgible of perhaps four by two metres, which immediately lifts off and heads north.  During the day the solar cells on the top of the drone charge the batteries, and it travels day and night at a modest top speed of 180 kms per hour, fast enough to make headway against even strong winds, and reaching the remote community in 10-20 hours.  It drops to the local basketball court/landing pad after receiving the coded signal from the local nurse’s phone, unclips the medication box which they have received a code for unlocking, and then the drone heads back to Edmonton.

It sounds like science fiction, but the technology exists today to do this.

Also imagine a popular hiking trail in a remote area like the Grand Canyon.  At any given time there are a few dozen people exploring an amazing landscape with significant challenges.  However, instead of each person or group carrying everything they might need, each group has a small, solar-powered blimp following them as they explore the trails.  Capable of carrying 100 kgs of gear the hikers can travel more lightly, with more gear, than ever before.  Buy floating 20-1000 metres above the hikers, their personal blimp can provide hyper-local terrain information and access cellular data networks not reachable from the canyon floor for weather prediction and network access.  If someone falls or is bitten by a snake, instead of having to split a party up or hike out in extreme discomfort or die, their blimp can rise to the level where it can contact the blimps of other hikers or park rangers in the area and summon help to the exact spot needed.

On a larger scale, imagine a massive, aircraft-carrier-sized dirigible, housing a 1000 aid workers, doctors and nurses, engineers and rescue workers, hundreds of tons of emergency food, shelter and medical supplies.  These disaster response teams already exist and are deployed by goverments, but if they had the ability to deploy anywhere, and were mobile enough to get people and equipment exactly where they are needed in the event of an earthquake, flood or other disaster the reduction in suffering could be huge.  Any dirigible large enough to provide the personel, equipment and supplies needed for major disaster relief would also be large enough to generate and store significant power to help light, heat and shelter people in the affected area.

The research and development of the central technologies is already well underway  – we just need to flex our imaginations to what is possible tomorrow, rather that what is immediately profitable today.