WordCamp Providence 2012 Presentation

Thanks to everyone who attended my talk at WordCamp Providence! Here is a screencast which mirrors my presentation as well as some notes and links:

Screencast

Notes/Links

 LAMP Stack on CentOS for WordPress:

yum update
yum install httpd httpd-devel
/etc/init.d/httpd start
yum install mysql mysql-server mysql-devel
/etc/init.d/mysqld start
mysql
> UPDATE mysql.user SET Password=PASSWORD('################') WHERE user='root';
> CREATE DATABASE wordcamp;
> GRANT ALL PRIVILEGES ON wordcamp.* TO wcuser@"localhost" IDENTIFIED BY '##########';
> FLUSH PRIVILEGES;
> exit
yum install php php-mysql php-common php-gd php-mbstring php-devel php-xml
/etc/init.d/httpd restart
yum install git mod_ssl
/sbin/chkconfig httpd on
/sbin/chkconfig mysqld on
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 443 -j ACCEPT
/etc/init.d/httpd reload

Install WordPress in the current directory:

curl http://wordpress.org/latest.tar.gz | tar -xz && mv wordpress/* . && rm -rf wordpress

Useful Links (mentioned in the screencast or presentation):

Plugins Referenced:

UPDATE:

I put together a ref-based deployment script to accompany this talk. Check it out on GitHub.

My Singing Dog

My dog Boomer, a 4-year-old Australian Shepherd, has a funny parlor trick: he sings happy birthday. One day, when we were singing it for someone’s birthday, he just started singing along. It’s the darnedest thing, and he only does it with Happy Birthday. Pretty quirky. Anyway, here he is singing to one of my best friends for his 30th birthday.

Fun with probability

This graph shows the probability that there is...

Photo credit: Wikipedia

At Union Street Media, we have a support ticketing system that uses ticket IDs of the form ABC-123456. That gives a total range of 17,576,000,000 possible ticket values, roughly (I’m sure they removed some dirty words from the three-letter combo). Today, we had a ticket ID collision (where a new ticket has the same ID as an old one) and I thought, “wow, what are the odds of that happening?” Well, it struck a chord in me so I decided I’d figure out exactly what the odds were!

Essentially, this is the birthday problem on a much bigger scale. We have about 26,000 tickets in our system. Here’s the math:

\left ( \frac{17576000000 - 1}{17576000000} \right )^{26000\times (26000-1)/2} \approx 0.019

The result? At 26,000 tickets, there’s about 2% chance of a collision. Those odds may be low, but they are considerably higher than I was expecting!

The take-away here is that as a software developer, you need to know that you can’t depend on variability to prevent collision. Kayako should have been checking to see if a ticket ID exists in the database before assigning it to a new ticket*. I’m sure there are people using their software who have many more tickets in their system than we do. At 157,000 tickets, there’s a greater chance of having a collision than not having a collision.

*To be fair, we’re using an old version of Kayako’s software. I would expect that they’ve since fixed this bug.

Update: Here’s a great article about the birthday paradox in the NY Times

Stack Exchange, or “How to master a topic overnight”

The brain

Image via Wikipedia

I’ve been spending a lot of time on WordPress Stack Exchange lately and I’ve really fallen in love with it. I’ve always been a moocher of Q&A sites (always the Q and never the A) and decided it was time to give back. I also wanted to give back to the WordPress ecosystem (and along these lines, I have a few “game-changing” WordPress plugins I’ll be releasing soon as well), so I started with their forums, which are terrible — lousy organization, no “preview”, lack of alerts, etc. I then moved over to StackOverflow and then onto it’s WordPress sister site.

While my intentions going into this were selfless, I’ve found a tremendously selfish reason to continue contributing to Q&A sites like this: you learn fast. Continue reading