Experimental APC Binary Dump Support

November 12, 2007 – 11:16 pm

I’ve put up the Experimental APC bindump patch here.  This allows users to dump an architecture specific version of the APC cache and load it back up later on the same or identical machines.  I’d love to get feedback from people regarding bugs and use cases!

DC PHP 2007

November 7, 2007 – 11:50 am

Just finished my talk on APC at the DC PHP 2007 conference.  Added a couple new slides and some patches I’ve released for APC, PHP and Apache.  You can download the slides here.  Thanks to all who attended!

Japan: Tokyo to Hakata (東京から博多まで)

October 20, 2007 – 12:32 am

10月5日

The plan was to take the overnight train from Tokyo to Hakata on Friday (10/5) night and end up in Hakata by morning. This saves on hotels, but also if I can get sleep allows for more use of the daytime. Unfortunately when I tried to book my seat on this train, I was unable to. It was made to seem like this isn’t covered by the JR Rail Pass, so I that option was gone. This is where my Japanese classes helped, given it was *really* rough, but it would have been really bad without it. Seeing as I couldn’t get the overnight train, I asked what the next train would be. She set me up with the next train to Hakata, which was just enough time for me to walk out of the ticket office, ask someone which platform it was on, and go to my seat on the train. About a few minutes later I was on my way to Shin-Osaki with a connecting train to Hakata. I have no hotel booked, but Hakata should have plenty of options assuming they haven’t all gotten booked up (which I know at least one of them is). There’s supposed to be a nice capsule hotel with an open air bath so maybe It’ll be another night in a capsule hotel, but we’ll see. Because I’m arriving a little early I’ll probably get a train to Beppo tomorrow too. A touristy little town with a lot of onsen, should be nice. I also want to checkout an internet cafe in Hakata that you can crash at if things get really bad for about $20. Has a shower and all the internet you want/need. (I’m sure there’s some manga and video games to keep you busy as well).

PS: the people working on the train all bow whenever they enter or leave one of the cars. Seems like a bit much, but also seems very Japanese.

Japan: Tokyo Capsule Hotel (東京のカプスルホテル)

October 15, 2007 – 6:40 am

10月4-5日
After a couple nights in NihonBashi Villa and exploring Tokyo it was time to try out a capsule hotel I had picked out in Akihabara. They had a full website in english and sounded like they where trying to pull in some tourists who wanted to have a night in one of these hotels, but it seemed nice and they said they had internet access in the lobby which is a big plus. When you enter the building you leave your shoes in a locker and turn in the key to the front desk, which you can then use to get a key to a locker which is also associated with a capsule. The cost was 4,000yen or about 40usd. I had a special I was paying at NihonBashi Villa which was about 50usd, so not much of a save but it’s the experience that counts. The receptionist spoke excellent english so I guessed she had helped foreigners through this a couple times. Later on I met a man from france and about 5 others who where from England. There where several of the expected Japanese visitors and business men as well though, so at least it wasn’t all a tourist trap. The bathroom and washing facilities could have been better, a lot of the showers looked like they had been broken and refixed a couple times and the washroom was so small it made dressing/undressing a little difficult (but I managed not to rub anyone too much so all is well). The locker room also has about 8 video cameras, which is great for security, but these feeds are fed directly into the lobby behind the reception desk where any customers can see. This could provide for some slightly revealing shots if you time it right, so it’s probably good that they where the really small black and white screens that you couldn’t make out much in anyways.

Once in the capsule you could watch TV or listen to the radio. The controls looked like they where taken straight out of the 60’s but after a little tinkering I managed to figure everything out. There where about 10 channels and one playing my favorite “human tetris” game you can see on youtube. The worst thing in the capsules (assuming you have no problem with tightly enclosed areas), is that whenever you or someone else accidently hits a limb against the side of the wall it gives a nice hollow *thud* which at least a few of your neighbors away can hear. I did this a couple times and I can’t imagine what it must be like to be a big foreigner trying to lumber around in there. I’m 5′7” and I fit almost exactly head to toe in the capsule. (If they did this in America they’d need to size it for different people and charge accordingly).

I’ll probably try another capsule hotel to compare with but I think I can probably do better than this one. It is nice that you can come and go from this capsule after checkin, as I’m not sure if other places offer this or not.

PHP MySQL “typed” functionality

October 9, 2007 – 3:53 am

If you’ve ever wanted to have the PHP MySQL functions return back PHP variables cast to something other than strings this patch is for you.  It’s useful for decreasing memory usage if you’re pulling down integer values for example, especially if you’re then storing them in a cache such as APC or MySQL.  Read the patch for details, download page is here.

PHP INI Includes

October 9, 2007 – 3:35 am

I’ve posted a patch that should allow you to use include statements in PHP’s INI files similar to Apache.  This is useful when you have complicated server configurations that can be managed better via linked include files rather than a scan directory.  Let me know if you have any problems, the patch page/download can be found here.

Japan: Around Tokyo (近く東京)

October 5, 2007 – 3:05 am

10月3−4日
The plan was to stay in Tokyo a couple days and explore while I got oriented a little bit. After I felt comfortable I could take the Shinkansen to Hakata to see Kyushu. One of the first things I did after getting into my hotel was to go find a nice bowl of Ramen in Akihabara. I found a tiny little shop outside the train station and after staring at the menu long enough, a nice gentleman from behind gave me a hand figuring things out. I didn’t know that you ordered your dish via a vending machine by the door which would give you a ticket, that could then be given to the cook for a meal. I think it’s an excellent system and thoroughly enjoyed my ramen (although it’s always *so* much to eat I have trouble finishing).

Taking Cyan’s advice I checked out the Shibuya crossing, which was impressive. Full of hip young kids going everywhich way. Definitely my favorite area so far. I also checked out the emporor’s garden in Tokyo which is also very impressive in a completely different way. Deciding what to eat and do has also been a difficult point. There’s so much that it’s a bit overwhelming. I’ll also be coming back in a few weeks with David so I don’t want to do a lot of things that I might want to enjoy with him later. That being said, one could probably spend months (probably years) in Tokyo alone and still have many new things to do. Getting used to the subway and train system is both amazing and difficult. I think I’m getting the hang of it, but it’s definitely an adventure. So many people all going in different ways about as fast as they can. Cramming into trains, falling back out of them at the next stop. It’s a challenge to just not be in the way.

Japan: San Francisco to Tokyo (東京)

October 3, 2007 – 2:51 am

10月 1−2日

For the most part my flight from San Francisco to Tokyo was uneventful. We did hit some turbulence which was pointedly marked by the pilot telling everyone to buckle up and hold your babies to your chest (I had forgotten mine so I made due by clutching my laptop, same thing really). This prepared me for the worst, but it only turned out to be a few little bumps.

My first task was to recharge the minutes on my loaned phone and make sure it was in good working order before leaving the airport (Kudos to Cyan for getting me a phone). The lady attending the counter spoke english very well and asked me if she could see the phone. Hesitating a bit I agreed after she said she just wanted to see if it was activated. The next question of course was how I was able to get a phone and get it activated, which i simply stated that it was a friends phone for whom which I was adding minutes. This seemed completely reasonable to her and I had a working phone in no time.

The seconds stop to get a train ticket to Ueno via the Kesei Skyliner was a little more difficult as she spoke considerably less english, but again we made it through with little to no trouble. At this point I’m really nervous about using any Japanese so I’m pretty much going with the point and talk in broken words method. It’s not very elegant but it works ok.

Finding my hotel was by far the worst part of getting settled, I had reservations but finding the hotel was a complete mess. This was completely due to my own incompetence while navigating around town and failure to prepare printed maps in advance. I was going entirely off of memory of where I thought it was supposed to be on my Tokyo atlas and the street address I had printed out. To start with I got off at Akihabara station and started walking to Asakusa, when I really should have just transfered to a train to Asakusa. Walking the completely wrong direction also didn’t help much. After a couple hours I wandered into the hotel, feeling pretty exhausted and not very capable of making it anywhere in the next month.

NihonBashi Villa (my hotel) was a nice, small business hotel with private bath/toilet. The bed was a little hard, but it didn’t really matter because I couldn’t seem to get any rest anyways. I had expected staying awake on the plane to help me fall asleep but it didn’t seem to do the trick. I’ll try Lucas’ method of fucking up my schedule before I leave next time.

Apache UnsetErrorDocument

September 27, 2007 – 5:40 pm

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

September 24, 2007 – 11:22 pm

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