Unleashing SecretSantaBot

2

About two years ago the occasion arose for a Secret Santa with people who, for whatever reason, couldn’t find themselves in the same room to draw names from a hat. Determined, I soldiered on and wrote a script to email all parties with a randomly selected name. It worked, it drives a slow trickle of traffic to the site every December.

I decided to give it a bit of an OOP makeover this year and go ALL-OUT and get in on the git action, too. What I have ended up with is bizarrely tacked-on front-end to an otherwise super straightforward SecretSantaBot class.

I’m going to set up a site in the future to forgo the need to have a web server in order to use the script. That’s not as fun, eh? For now, it’s targeted at the developer.

Source @ Github | Demo

Oh, I should mention that before you ream me — this is the first PHP class I’ve written, and I’m sure it’s not the most optimally written thing out there. That’s what forking is for! Forking and reaming in the same sentence …

Takedown

2

I’ve tried a couple times this year to participate in “Make Something Cool Every Day” (it’s pretty self-descriptive, flickr set here)  but despite my best efforts I haven’t been able to do it successfully. There was a time back in February-April where I was getting close to making something every week, but even that slowly faded away. To help get around the issue I thought I’d challenge myself to a one-hour exercise: 30 minutes to sketch, 30 minutes in Illustrator. That didn’t quite work out, but the result was a tentacled monster taking down a ship. Yup.

Oh, I guess it should go without saying that I was largely unable to adhere to my rules. The sketch was done in under 10 minutes — so I shifted the other 20 minutes to Illustrator time. Then came 30 minutes of Photoshop time … which came about after my time in Illustrator was up and I wanted to keep going; I figure switching programs and setting a new time limit is fair, no?.

What can I say, the system isn’t perfect yet.
The process is too lengthy to do one per day. Balls. It’s got to fit into 30-45 minutes.

Mustaches for Kids

0

Mustaches for Kids Pin

Huge Mistake

2

Ah. I had a little downtime recently … or … three days of downtime, actually. It seems as though I did ’something to something’ a long time ago that I didn’t test, so when I rebooted the server it decided to curl into a ball and rock back and forth.

Oops!

Worse, the last (and only) daily and weekly backups did nothing. I was screwed.

I thought it would be straightforward to get nginx, php, mysql running again, considering this is the third time I’ve set it up. How wrong I was. My first attempt was met with bad gateway errors, it didn’t seem like fcgi processes were spawning. Even the generally quiet mysql was complaining about about sockets.

My next rebuild I tried to get PHP-FPM working, but I quickly realized that I had no idea what I was doing and that patching and building php would probably be the death of me later on.

Three tries later and I was back up and running:

  1. Initial Setup
    Slicehost articles: Intrepid setup articles (one, two)
    I’m running 9.04 (Jaunty Jackalope) but it all worked splendidly.
  2. Installing nginx
    Slicehost articles: nginx setup from source (one, two, three)
    I grabbed the latest stable release of nginx, not the one used in the article.
  3. PHP + nginx
    Then came the dilemma of how to spawn FCGI PHP processes. Having completely forgot how I did it previously, I decided to go a route I know I didn’t take — using the lighttp fcgi launch script thing. (this article helped immensely with that).

Overall, things appear to be running smoothly now. Fantastic.
I’ve had it with server admin for the time being.