Monday, June 24, 2013

Northeast PHP Conference 2013

This is me, telling anyone who cares that the Northeast PHP Conference is set to run again this year from August 16-18.

This year is a little different, though, in that as well as the two days of talks, there's also a day of workshops. The line up for speakers is looking awesome and as a way of testing my typing fingers, I'll probably start writing about which talks I'm most interested in... just to keep myself excited :)

The thing I love about this conference is that it has a focus on inclusion: the talks are ranging from beginners to advanced, and there is an entire track dedicated to User Experience, which I think is sorely lacking in our industry.

If anyone else is going to be in Boston for the conference let me know, as I think it'll be an awesome opportunity to catch up or meet for the first time!

Monday, June 10, 2013

Backing up from Plesk to S3

Recently I went looking for a solution for backing up from a Plesk server to S3: what I settled on was surprisingly simple.

I started with a simple list of criteria, but as I went looking for a solution, and as I continued to find no good ones, my list got longer. I have a tendency to be quite OK with the bare bones if I'm going to be using an existing system, but if I have to build it myself, I'm normally happy to add more features.

I started with basically "I want to be able to backup files and databases", but the solution I ended up with also gave me the following features:
- backup multiple domains
- along with files and databases, backup the actual domain configuration and mail if required
- rotate backups automatically
- define the frequency of backups and the number of backups to keep before rotating
- open source
- a simple interface right in Plesk

So what did I do?

I don't know, really, if this is a super smart way to do it, or just a cop-out, but basically I realised that hey, the Plesk backup manager already let's us do all of the above... except for the S3 part. All that I ended up doing was installing s3cmd from http://s3tools.org and setting it up to do the syncing to S3, looking at the location on the server that Plesk puts it backups.

So basically, users (or I) define backup rules for each domain as needed (via the Plesk UI) and then s3cmd runs with the sync option once a day.

With s3cmd located in my /root/cli-tools directory, and assuming s3://example.com is the name of the bucket I will use, the actual cron tab entry I use is as simple as:
cd /var/lib/psa/dumps; /root/cli-tools/s3/s3cmd -c /root/cli-tools/s3/s3cfg --delete-removed -H --no-progress sync domains s3://example.com/backups

UPDATE: as per a comment by Rutger below, you may actually want to use:
cd /var/lib/psa/dumps; /root/cli-tools/s3/s3cmd -c /root/cli-tools/s3/s3cfg --delete-removed -H --no-progress sync clients s3://example.com/backups
instead of, or possibly in association with, the above line.

When I commission a new Plesk server, I just copy the s3cmd directory over, create a new bucket and I'm done.

The only downsides I see, really, are that if I wanted to just have a single rule for all of the domains, I couldn't. Also, I'm assuming that all of the backups have been run when the cron job runs once a day. Not that that matters too much, as I could just bump the cron job up to hourly if I liked and I wouldn't see much difference.

I think the biggest negative to this approach is that I'm pushing backups explicitly even if what has been backed up actually hasn't changed. That is to say, if Plesk does a backup everyday, then I push a new backup every day... even if nothing has changed since the last backup.

Anyway, I hope this helps someone as for me it was completely obvious once I realised it, but it took me an embarrassingly long time to get to it.

Sunday, June 9, 2013

On having nothing to hide...

Obviously, there's a lot of discussion right now about what information should be considered private, and whether or not people really have nothing to hide. I believe that people have a lot of information that they want to keep private: even when they say they don't.

When I meet people that say they have nothing to hide, I 'play' one (or more) of three cards.

The first thing I will do is ask them how often they masturbate. I know it's a fairly taboo question, but that's the point. It's not illegal, it doesn't hurt anyone, but not many people want to answer the question and I will push them a bit before I change tack. A lot of people think that this is a stupid question because it doesn't make a difference and that it's meaningless. Apparently that makes it somehow mean that they still have nothing to hide, but anyway.

Sometimes I choose to play the "we don't know the future" aspect. One of my cousins is gay. That is not illegal where we live, but there are places where it is and let's face it, there are no doubt people even in our community that would prefer for it to be illegal. In the future, what if it became illegal? All of a sudden, all of that knowledge of what I didn't need to hide becomes a problem.

Let me reiterate that: right now, my cousin has nothing to hide, and I have nothing to hide in knowing that they're gay. In the future, if it became illegal, there's a ton of information that suddenly we may wish to have been kept secret. Unfortunately, that stuff that we didn't have any reason to hide suddenly becomes something we may wish we were able to.

Finally, depending on who I'm talking to, sometimes I will play the family card. If the person I'm talking to has a child (especially a daughter) I like to ask them how they would feel if in the future that child was dating a good government employee that had access to all sorts of information. Then I begin to wonder, what would happen if they went through a messy break-up? I wonder, what if that ex turns out to be a little jealous and maybe a bit of a stalker? Would you support, then, there being a heap of information on your child, being easily accessible to this ex?

I guess a lot of my arguments come down to this: you don't know the future. In this, you have no idea what you do at the moment that may be considered dodgy behaviour in the future.

Even if you think that that's not a problem, there's a very good chance that right now, you do stuff that you don't want people to know and as far as I'm concerned, the very fact that you haven't considered that means that you haven't spent nearly enough time thinking about it. And to be honest, that frightens me just as much.