Enterprise PHP Development

While working at EZYield, we’ve come across a shortage of qualified Enterprise Level PHP Developers. While that term might sound a bit nebulous, there’s really just a handful of things that separate the men from the boys in PHP. Honestly, those traits really aren’t even that hard to learn. They’re contradictory to the “rockstar” persona so commonly heralded by developers though; which is likely why there aren’t enough good developers around.

Basically, there’s 4 things that make a developer ready for the big leagues: design patterns, unit testing, versioning systems, and experience.

Design Patterns can’t be emphasized enough. Almost every situation a typical developer has encountered, someone else has already solved. While the solution was likely in a different language, the concepts are universal. If a candidate cannot answer questions about basic design patterns like Singleton and Factory, they’re ability to adequately handle the responsibilities of a large scale application is seriously in question.

Unit Testing is an equally critical skill for any developer to understand. 90% of developers I interview typically work alone on small projects. this scenario doesn’t reveal the necessity for unit testing. Imagine that you work with 50 other developers on a project that’s hundreds of thousands of lines (if not millions) of code that’s distributed across hundreds of servers over multiple continents. Your amazing class that handles some unique circumstance will be modified by someone else who didn’t know you’re awesome intentions. How will you ensure your code works as intended without automated testing? Unit testing ensures that the concepts that sparked the intent of some software are held for posterity

Versioning systems are another area of knowledge that are surprisingly deficient in PHP Developers. CVS, SVN, Perforce, Mercurial, and (preferably) Git are software packages that any software business relies on. Not knowing the concepts of distributed software versioning software is like not knowing how to push the brake pedal on your car. You might get pretty far without needing it, but eventually you’re going to get into a situation which will crush you.

Experience. Nothing substitutes this. The brilliant young developer can make an awesome idea for his own company. He cannot serve a large company with existing ideas any better than a mediocre developer that listens to what he’s told to do. Software development is still more of an art than a science. Actually, it might be better denoted as a trade. Experienced artisans are able to accomplish things that younger folks cannot.

To re-iterate the point. Know design patterns, know unit testing, know version control software, and keep doing it. If you’ve been developing for years and are short on some of these points, take the time to learn. These skills are paramount and no one skill makes up for another. They are all indispensable in separating junior developers from enterprise level developers.

Keep Your SSH Identity

So, I’ve been doing a ton of stuff lately on a ton of servers. Almost all of this involves using git to clone repositories into a multitude of servers. The problem with this, is that I’m limited to a single SSH key for all of my git clones. This is tricky, since shelling into a remote box doesn’t give you access to your remote key by default. But you can still keep your SSH identity …

There’s two ways to go about keeping the identity you require through multiple single-level-deep connections. That basically means, you can keep your SSH identity from one box to another. If you hop from one box to another and another, I can’t help you. There’s probably a way to do it. I don’t know it.

Anyways: TWO ways to do this. Both of these options assume you’ve got ssh-agent running on the machine you wish to transfer your identity from. To get this running, do the following:
eval `ssh-agent`
ssh-add

This ensures the ssh-agent daemon is running, to provide an identity when you request it to be forwarded. This also assumes you’ve created a public key to transfer your identity.

So, the ways to do this are:
1. Use the -A flag when you shell into a box.
This basically means whenever you shell into somewhere, you add -A to your ssh command. An example would be:
ssh -A username@awesome.server.com

2. Set the ForwardAgent flag to “yes” in your ~/.ssh/config file.
This is a synonym for the -A flag in an ssh command

Both of these options allow you to transfer the key you hold on one machine, to another. Don’t try to use ssh-agent on the machine you connect into though. If you do, you’ll lose your original identity.

So, all together now:

eval `ssh-agent`
ssh-add
ssh -A username@awesome.server.com

Questions are always welcome ;)

Spam Links in Head Tag of Drupal 5

Recently while at work at Phase2Technology, we got a report of bogus links being returned when searching for their site.  After doing a quick search of the terms that should return their site, I got confirmation the issue was legit:

What was weird though, was that when I went to the page and viewed source, there was nothing to indicate the issue. None of the links appeared at all. A coworker noted that it might only be occuring for bots, and not for regular users. After installing User-Agent Switcher for Firefox, I could confirm that this only happened when the user-agent was a known spider:

So I dumped the database to a flat file and started regex searching for script tags, base64_encode, or anything that seemed out of the ordinary for a Drupal 5 site. Nothing came up. Finally, I did an svn status on the site itself, and noted that one file was shown as modified, that should not have been:
includes/cache.inc

I did an svn diff on that file and noted the following:
+error_reporting(0);eval(base64_decode(

Basically, someone was able to modify the cache.inc file to run foreign code. I would have just done an svn revert on the file, but sometimes developers will make local modifications to core (bad, I know, but it’s uncommon). So, instead I merely deleted that line in the file with vim.

I would have left this up to google for folks to find an answer to, but apparently I’m the only one who’s posting the answer to this.

What I Use

It occurred to me recently, that there’s a bit of variance in what developers use. For many folks not used to writing code, the availability of software to help write software can be a bit overwhelming. For that reason, I’m writing the stuff that makes me tick.

A disclaimer: I primarily use Mac OS X (Leopard). I love using Ubuntu, but it’s not where I get the bulk of my work done. So, here’s my Mac apps:

Coding:

Eclipse PDTEclipse PDT. I write primarily in PHP, and there’s just no better app out there for big PHP development. Something to note about Eclipse though, don’t use more than what comes out of the box. Eclipse can be buggy as hell, so don’t add all the plugins you can find to it. Eclipse is for writing code, not for committing SVN updates. Remember that, and you’ll love Eclipse as much as me.
TextMateTextMate. After having said all of that, there’s some times when I want a text editor that’s light, and gets the code updated quickly. Eclipse is a memory beast, and if you’re strapped for RAM, you won’t be able to run Photoshop, Illustrator, AND Eclipse at the same time. For that reason, TextMate is awesome.
vimvim. Finally, the most lean of all editors is vi. I use vim, since it has a few extra things I really appreciate. The learning curve on vim is hell, but once you’re used to it you won’t look back.

Graphics:

IllustratorAdobe CS 4. I’ve tried all of the substitutes out there. But none of them hold a candle to Adobe’s mismanaged, bloated, overpriced Creative Suite. Photoshop and Illustrator are indispensable tools if you’re doing web graphics (or any other graphics for that matter)

Communication:

AdiumAdium. I don’t know of an IM client that comes close to Adium. I can be logged into all of the social networks I use at one time, in one window, and it doesn’t cost me anything to do it. That beats the hell out of anything else out there. Hopefully, there will be some challenges to this in the future. But for now, this Mac-only app is the definitive way to do IM.
TweetDeckTweetDeck. Twitter is definitely mainstream these days. TweetDeck lets me create groups out of the people I follow, see replies to me (public and direct), search terms, and see whats trending on Twitter, all in the same window. That’s pretty awesome too. **NOTE** I’m starting to try out Seesmic, and it’s pretty good too. Both of these apps are built on Adobe’s AIR platform, so everyone can get a taste.
Apple MailApple Mail. This might seem a bit obvious, but I wanted to give Apple some credit here. Apple Mail is an awesome mail client that meets almost every need I have, out of the box. I use the WideMail app to give it just the right tweaking I need out of it.

Local Server Software:

MacPortsMacPorts. I tend to need some esoteric stuff from my LAMP environment, so I use MacPorts as a package manager to customize the variables of my development environment to my liking. With MacPorts its usually a trivial issue to install Memcache, Apache, MySQL, PostgreSQL, PHP, etc.. I’ll usually even change the version of rsync and vim using the MacPorts package manager. If you don’t know about MacPorts, you’re definitely missing out.

Miscelaneous:

QuicksilverQuicksilver. Whenever I setup my Mac, Quicksilver is always the very first thing I install. Once you’ve got a mind for using the shortcuts in Quicksilver, you will never ever ever go back to the old school hunt-and-peck way of lanching apps, and performing tasks.
Visor. Another gem from Blacktree: Visor allows the terminal to always be quickly available to me, but also not intrude on the desktop. A lot of times, I don’t even change the default terminal theme (just change the font to Monaco 12pt Anti-Aliased).
TransmissionTransmission. Transmission is the greatest bit-torrent application around. It’s light and gets to the point. Other apps try to push content and channels. Transmission just downloads the torrents. Awesome.

Updates From The Free World

I’ve been a freelance web developer for a week now. There’s been some ups and downs about it all. I still haven’t gotten any money, but I also haven’t head to deal with rush hour traffic either. I’ve had a few opportunities that look promising, but I’m still trying to be careful about how I spend money, and take work.

I filed for unemployment last week. Being a conservative guy, I can’t tell you how humbling a process that was for me. Politics aside, I do have a family to provide for. So, if President Obama is handing out money, I’ll take it until I can get stable cash flow back in the house.

I have a few opportunities though. Pretty quickly after being laid off, I picked up some work from Eric. The initial project has been a bit of a learning curve about each other, but I’m pretty excited to be working with him. He’s a super smart guy who’s been around long enough to spot bullshit in advance. With my penchant for security, that’s a great trait in a partner.

So now I’m able to wake up and go to bed on my own terms. This week was a bit different than most though, since I managed to get my ass over to FOWA Miami. So, on Monday I was scrambling to get my shit together in advance, and drove to Miami that night. Tuesday and Wednesday were a total crap-shoot. I was out of town, working on an odd traveler’s schedule. Anyways, I guess it’s a little early to make assumptions on how the day to day things will change. 

One of the cooler things to happen since I’ve been an independent contractor, was being approached to speak at Ignite Orlando (Thanks Gregg!). The ignite concept has been floated in Orlando for a while now, and I’m glad that Dan’s finally making it a reality. If you don’t know about Ignite, it’s definitely something worth checking out.

As cool as everything is, the one thing that still looms heavy over me now is money. I guess it’s pretty obvious. Melissa and I have no savings and we hold a good amount of debt on credit cards. One slip up, and we’ll be in a whole lot of trouble. I think there’s a lot to be said about living within your means. Lately that’s come to have a lot more meaning than it did before.