amd on software

Minimalist WordPress Theme

Reading Tim’s post about default WordPress themes and bloat, I thought I’d experiment with creating an absolute minimalist WordPress theme, which you can see live here on here at the time of writing.

I want a single, functional barely styled skeleton theme a default theme that no one will ever use – Tim Nash

The theme is true minimalist: there is no styling. All you get is your browser default styles and barebones html WordPress needs to display content. Actually, scratch that, I’m going to add a line to centre images, as WordPress functionality is technically missing/broken if this is missing.

Minimalist WordPress Theme

It’s 2 files totalling ~30 lines of code or and about 1.1kb in size unzipped. I could have gotten it down to half the size but I’ll leave that as an experiment for someone else. Also I’m sure someone has done something similar out there, and by its nature it’ll be similar, so apologies if I’ve replicated something else out there closely, send me an email to amd at this domain and I’ll link anything similar here.

Download here or see entire code listing:

Updated WP-CLI backup script

Here’s a new version of the wp-cli backup script mentioned previously. This adds a check that it’s running as a user, and backs up the upload directory too.

You need to have wp-cli installed and run this in your WordPress root, as a regular (non-root) user.

If you use this I’d love to hear from you in the comments.


Fix for WordPress unable to create uploads directory or not writable by server

This is a note to future self as much as anything, but hopefully useful for someone out there.

Situation: uploads are failing with “Unable to create directory uploads. Is its parent directory writable by the server?”

Unable to create directory - is its parent diectory writable by server?

Yeah this screenshot is from an older WP version :)

Check the following:

  1. wp-content/uploads is chmod -R 777 (for testing, switch to something more secure after you get this sorted)
  2. You’ve got the correct userids (you tested both chown -R www-data:www-data and userid:userid).
  3. You don’t have UPLOADS defined in wp-config
  4. Did you move this database from another server?

This last was the one that got me today. So:

Check the database:

wp db cli (I use wp-cli)
mysql> select * from wp_options where option_name like ('%upload_path%');

Is your upload_path set up for the old server filesystem? If not, sorry you need to check something else.

If so,  update it with this:

mysql> UPDATE wp_options SET option_value = replace(option_value, '/old/path/to/wp-content/uploads', '/new/path/to/wp-content/uploads') WHERE option_name = 'upload_path';

I hope that helps save someone an hour or so of head-scratching. Don’t forget to set your permissions back to something reasonably secure afterwards.

Please let me know in the comments if this helped you out.

Quick backup script with WP-CLI

Quick backup script for WP-CLI users. This just grabs the DB, active theme, a list of plugins and the wp-config file.
This isn’t meant to replace a daily backup of all DBs and changed files, but it is the kind of thing that I find handy to run just before I attempt something stupid on my live site.

This is probably a little bit too far down the techie spectrum for my WebsiteDoctor blog so posting here.

Any suggestions for improvement welcome. I’ve updated this a couple of times since I originally posted it.

Useful Software for Windows

Updated Aug 2013

This list was created for my own reference to keep all the links in one handy location. It might be useful for ideas for you too when you’re installing a new Windows PC or laptop. Not all of these are free, but the vast majority are.

Event Elephant Review

I almost recommended Event Elephant to a charity event organiser last week. Having read this thread of EventElephant reviews and Event Elephant complaints I’m very glad I didn’t recommend them in the end!

That thread is also a super example of how not to do public relations and social media.

Good luck to all those attempting to get their money back from Event Elephant.


iPhone DCIM empty in Windows

Here’s what I recently thought was a technical problem: I was using my iPhone to record video and transferring it to my PC using the USB connector, when suddenly the DCIM folder was empty.

I checked the phone and all the photos and videos were there, but in Windows Explorer they were missing.

However, the cause and solution were both easier than expected: it’s a security feature enabled when the iPhone is initially connected when locked, and all you need to do is:

  1. disconnect the USB connection,
  2. unlock the iPhone, and then
  3. reconnect to USB.

Your iPhone DCIM should no longer be empty!

A Memory of Light – Review

A Memory of Light cover
My rating: 6/10

A Memory of Light is quite a good read and leaves me reasonably satisfied at the conclusion of an epic 14-book fantasy series that I have been reading for nearly 20 years.

I know that “quite a good read” and “reasonably satisfied” sound like damning with faint praise, so let me clarify that I think Brandon Sanderson has done an amazing job with his contributions to the Wheel of Time series – it was a huge ask to pull that entire thing together even in 3 books and he’s done a super job for the fans.

Robert Jordan created an awe-inspiring world in writing Wheel of Time, and he also left a massive amount of plot lines to be resolved in the final books. Added to that he even wrote the entire epilogue of A Memory of Light ~7 years ago.

With these restrictions and limitations for Sanderson to deal with, it’s astonishing how well he did with the last three books. (more…)

Understanding Inherited Code

Understand Inherited Source Code
Understanding unfamiliar source code can be difficult for programmers. I took on a software porting project in my first job, and this is how I dealt with getting to grips with the large, unknown codebase. I hope this is of use to any software developer trying to understand source code written by others.

It is harder to read source code than to write it.

Take Your Time

Take plenty of time to become familiar. It’s far more valuable to learn and understand the codebase at this point than to jump in and potentially add incorrect code.

Take a Copy

Before you do anything else, take a snapshot of the code you receive in a source control system (SCCS/RCS/CVS/Git/Mercurial/Subversion – whatever your fancy). Include the documentation and any binaries too.

Use the software

Forget the source code for a bit. Just use the software, over and over, as many different options and set-ups as possible. Try to understand it fully from a user perspective.



Fix for Firefox Graphics Problems in Windows 8

Mozilla Firefox - disable hardware acceleration in Win 8If you’re using Firefox on Windows 8, particularly on an nVidea graphics card, you may have seen a lot of graphics problems, glitches where images are blurry or even completely unrecognisable.

Here’s a possible fix for that which has worked for me and quite a few folks online: disable Hardware Acceleration in Firefox.

Here’s where to find it:

The broken images problem should now be gone – if it’s still there then it’s another problem – please let me know in the comments if you know of any other potential cause and/or solution for that!

Next Page »