Category Archives: Scripts

Automating Backups to Amazon S3

My Setup & Prerequisites

I’ve got a LEMP stack, that is Linux (ubuntu), Nginx, MySQL, and PHP. It’s pretty common, but this should also work just fine for other LAMP stacks.

I want to backup some databases as well as web files, including some non-WordPress stuff.

There are tools out there like BackupBuddy that might be perfectly sufficient for your needs, especially if you want access to support forums and such.

But I like to dig into server-y stuff. Doing it this way will require a few things

  • ssh access to your server
  • sudo permissions (usually…)
  • amazon s3 account
  • some basic familiarity with the command line

(more…)

Image Browser

Sometimes a client will provide a bunch of photos – which is great – but when they’re in a bunch of different folders, it can be hard to sort through and find the right one. So, just toss your web-friendly photos into a directory on their website, and use the script below to nicely display all the photos. (more…)

Previous/Next Links for Pages in WordPress

If you ever need previous/next links for pages in WordPress, you may have noticed that it’s not a built in feature like it is for posts – at least as far as I can tell.

I suppose it’s understandable since pages don’t really have linear organization, but every now and then, the ability to simple click ‘next’ ‘next’ ‘next’ to cycle through some pages would be really handy. For instance, I work on a lot of sites for bed & breakfasts and they inevitably have a landing page for their rooms, then child pages for each individual room. These individual rooms pages often have “next room” and “previous room” links, plus one back to the main page. (more…)