Archive for September, 2007

Apache UnsetErrorDocument

Thursday, September 27th, 2007

Apache-1.3.x doesn’t provide a way for you to “Unset” an ErrorDocument directive to it’s original value.  I’m providing a patch that will add a “UnsetErrorDocument” directive to reset the value.  This could happen when you have multiple configuration files that need to override each other.  You can find more information and a download here.  (Credit for the initial idea goes to Lucas)



Apache Source Defense

Monday, September 24th, 2007

I’ve released a small patch (read hack) that can help to prevent source code from being displayed by Apache. In theory this will work for any handler, but in specific it was designed with PHP in mind. The patch is intended to be a last line of defense if Apache attempts to display code with it’s default handler say due to a misconfiguration. It essentially filters out files with the defined extensions so that they cannot be handled by Apache’s default handler. This means you’ll have to hardcode your extensions into the patch. Please feel free to use this, but I’m not responsible for it not working as advertised. Lucas has posted a blog post a blog post about how we use something similar at Facebook. I’ve modified it for public release so hit me up with any problems.
Available via the MIT License

Download: ap_source_defense.patch



Delta runs on Linux

Thursday, September 20th, 2007

On the flight back from the PHP Works conference in Atlanta they had to reboot the screens on the back of everyone’s seats. This caught my attention when I saw the words “RedBoot” followed by the familiar Linux penguin. I would have liked to report that this was normal, but apparently they where having some “technical difficulties”, luckily for us we got an old fashioned demonstration of how to use a seat belt. Damn good thing too, as I really was having trouble figuring out how one end went in the other.



日本へ行きます!

Thursday, September 20th, 2007

My first really long vacation in two years since working at facebook will be hapening this October as I spend the time exploring Japan. I will be doing some work, which hopefully means I’ll get to get some ground on the things I’ve been wanting to do. This also marks my graduation from my beginning Japanese course into intermediate classes!



PHP Works 2007

Saturday, September 8th, 2007

I’m excited to be speaking the PHP Works 2007 conference this year in Atlanta. I’ll be giving my updated “APC @ Facebook” talk which will hopefully be of interest to the performance/scalability minded peeps out there. My cohort in all things PHP, Lucas, is also also giving a talk titled “Facebook Performance Caching“. I have to take the last all night flight after my Japanese Language test on Wednesday, so hopefully I won’t be too out of it for the talks that day!

I’m also interested in hearing “7 (or more) PHP Myths Defused” by Derick, “How PHP Ticks” by Sarah, “Graph-Oriented Programming with PHP” by Sebastian, “PHP::$unicode->i18n()” by Sarah…. ah crap those last two are both at the same time…. it always comes down to this….



Battery Woes

Thursday, September 6th, 2007

About 6 months ago I purchased a new FastMac extended battery for my MacBook Pro, I was really happy with the little bit of extra time it gave me on my power hog of a laptop, but lately it would barely last the 45-minute trip on Caltrain from SF to Palo Alto. So I hooked up the miniBatterLogger app. According to this great bit of software, it seems the battery capacity is at about 50%. Not a very good life expectancy, considering the original batter which is at about the same number of cycles is at 90% and about twice as old as well.

My conversation with FastMac then went something like this….

——- (contents dumped from memory, so this isn’t the exact conversation)

FastMac: Well for a MacBook Pro this sounds like a reasonable reduction.

Me: [pause] 50% in 6 months is reasonable?

FastMac: Well yes… well let me ask someone in tech support please hold.

Me: [hold]

FastMac: I’ll tell you what’s happening. The software you’re using to measure the cycles in the battery isn’t changing from one batter to another. The cycles listed is what was on your original battery. Yep that’s definitely what’s happening.

Me: The software is telling me my battery cycles have changed when I switch out the original and the new one, so I’m pretty sure it’s counting the cycles correctly. If you want to tell me that 50% over 6 months is reasonable,

FastMac: please hold

Me: No wait! Let me finish… If you say it’s reasonable then we can forget this RMA but I won’t be buying any more of your batteries in the future.

FastMac: Oh, well these batteries are funny things. I mean the numbers and everything are really just jibberish… hold please….

Me: [hold]

FastMac: Sorry about that…

Me: Well the battery life is pretty much half of my original batter, that’s why I started measuring the capacity in the first place.

FastMac: Right, that’s exactly what we where going to ask you. … Well again it’s really hard to tell with these batteries, but it does sound like you actually have a problem here….

Me: [continues with RMA]

——-