Phillip Pearson - Second p0st

tech notes and web hackery from the guy that brought you bzero, python community server, the blogging ecosystem, the new zealand coffee review and the internet topic exchange

2010-4-25

SF apartment bureaucracy

So, I'm in this temporary apartment, which is amazing, but way too expensive to live in for more than a couple of months. In the same building there's a much larger and nicer unit, which is also cheaper (by virtue of being unfurnished and requiring a 6-month rental). I'd like to move into the other unit, except that (a) I need to give 30 days notice to vacate my current rental and (b) the management company has an immediate move-in policy, which means that you have to start paying rent as soon as you sign a lease -- and the leasing agents seem to be very adamant that they never bend this rule. They also seem to be big fans of raising the rent between when you tour a unit and decide you want it, and three weeks later when your notice period at your old place is up.

As such, saying "I'd like to move into that other unit - how about I move right now but keep paying the higher rent until my notice period is up, so you get the same amount of money out of me except have a pricier unit free to re-lease earlier?" appears to be pointless, and so instead I'm going to have to go apartment hunting in a few weeks so that I'm not at the mercy of whatever random price increase they decide to enact. More work for me, less certainty for them. Yay big company policy.

2010-4-20

Recruiter storm!

Wow. So, I moved to San Francisco in February, and the company I work for just did a round of layoffs. This isn't my first such experience (and thankfully I wasn't affected this time, which was a bit of a relief as my right to stay in the country is tied to me being continuously employed here), but what's different this time is that I'm actually living in the Bay Area, which means I come up when recruiters do LinkedIn searches for hiring leads. So far I've received 41 messages from recruiters - 23 on Thursday, 9 on Friday, 5 over the weekend, and 4 today. Crazy!

This is really interesting, because it's the opposite of the usual situation, where you put out a job offer and get a bunch of resumés. Now I see where people are coming from with their job application advice posts; there are some things you can do to really make your e-mail stand out a lot. Several recruiters have sent me vague "Job Opportunities in the Bay Area!" posts, including one who wrote today asking for a phone number where he can call me about some undisclosed position. These probably work OK when generally fishing for people to shop around to companies, but at times like this when everyone's getting dozens of messages, putting specific information in your messages would make it much more likely to get responses. If I'm ever sending out recruiting messages, they'll be titled something like "Web Developer (PHP/JS/CSS) opportunity at Fictional Software Company, Palo Alto, CA". Title, tech, company name and location. That sort of thing would seriously stand out.

(Just to be clear, I'm staying at Ning for now. Recruiters, thanks for your e-mails, though; they would have been great if things had turned out differently! Keep 'em coming; I won't be replying myself, but I'll summarise them and pass them on to the people I know who are on the job market.)

2010-1-4

2009 - 2010

Well. I've resurrected my old blogging tool and blog data from my last laptop, so, prompted by Ben Ward's 2009 retrospective, here goes the first post of the new year. 2009's been... interesting. This time last year, I was interviewing with Ning, after Yahoo! closed the Brickhouse team/project/experiment that I'd been part of for just over a year, since late 2007. Brickhouse (and Fire Eagle, the project I spent most of my time working on there) was an incredible environment, where I met some very cool people and made a couple of close friends. I'm glad I had the chance to be part of it.

So, Ning offered me the job, and my priorities abruptly switched from trying to extend my Yahoo! contract to trying to wrap up and hand over Friends On Fire, the Fire Eagle Facebook app that I'd been working on, before taking off for the year's first trip over the Pacific, to meet my new coworkers and learn about the software I'd be working on, in late January. That all worked out well, and I had a great time in Palo Alto.

I returned home, had a crazy week trying to be productive on this codebase I'd barely scraped the surface of at the same time, after which my appendix gave up the ghost, putting me in hospital for the next three weeks, then off work for another three!

The rest of the year has been a bit of a blur. I've travelled a lot: Wellington, Auckland, Adelaide, San Francisco, Munich and London, plus a couple of smaller trips inside Canterbury: Peel Forest, Loburn, Hanmer Springs, Arthur's Pass. Reconnected with a bunch of old friends, and made many new ones. Spent a lot of time at the Christchurch Creative Space and with the people who hang out there. Visited almost all of my family living outside Christchurch; in five different cities: my brother, two cousins, an aunt, and an uncle and his family!

At some point in August, I mentioned to my boss that I'd just booked flights for a visit to San Francisco, and was planning to drop by once every few months, and she asked "well, how about moving here instead?". I slept on it, and took her up on the offer the next day. The process of getting a working visa was surprisingly smooth, and in November I found myself the proud holder of a passport with a US H1B visa sticker, and a whole set of new things to do to tidy up my life in New Zealand for easy transport (or storage).

Another notable thing to mention is that I picked up an old hobby: DJing. I dragged my turntables, mixer, stereo and records down to the Creative Space every week for a little while, then took the whole rig out to the Melting Man outdoor dance party, where I met the Mystiq Catalysts, who introduced me to drum & bass and the Serato line of digital DJ equipment. Since then, I've played several times at their Thursday night jam sessions, and have started running my own dance music club night, "Midweek Mix", on Wednesday nights at Foam, the same club. I suppose you could call it my first DJ residency? Now, with the move date getting closer, I've been spending the last few weeks trying to digitize as many of my 12" vinyl records so I can take the music with me and DJ in America without having to carry the (rather heavy) physical media. It appears that the type of music I used to DJ (or "spin", which seems to be what people in SF call it) from 1999-2002, trance and progressive trance, has fallen out of favour at home but still has a bit of a following in SF, so it'll be interesting to see how things go when I make it over.

So, now, all the Christmas and New Year celebrations are over, and it's back to work! 2009's been a transition year for me -- between one stage of my life that ended with the hospital stay, and another, that'll start when I arrive in California -- and the best year I've had in a long while. I'm excited to see what 2010 will bring ...

Some more 2009 retrospectives from friends: Laurie, Greg, Soo, Marc.

(No comments here any more, but you can comment on this on Facebook, if you're my friend there.)

2009-4-28

Fixing backspace when ssh'ing to Linux servers in OS X 10.5 Terminal.app

For some reason the default OS X terminal program, Terminal.app, sets TERM=xterm-color but doesn't send the correct keycode that a colour xterm would send when you hit backspace. The solution is to set TERM=rxvt.

The instructions at the end of that link are a bit out of date; here's how to do it on OS X 10.5.6:

- Open Terminal.

- Hit Cmd-, or select Terminal > Preferences from the menu, to bring up the Preferences.

- Click Settings (the second icon from the left in the bar along the top).

- Click Advanced (rightmost tab).

- Select 'rxvt' after 'Declare terminal as'.

- Uncheck 'Delete sends Ctrl-H'.

... and you're done. You might also want to click through to the Keyboard pane and select 'Use option as meta key', which is useful (although I wish I could use Command as the meta key).

2009-3-21

Reading while recovering

A couple of good books I've read over the past week:

- "Imperium" by Robert Harris.

- "The Bourne Identity" by Robert Ludlum (I've never seen the film, but the book was good).

Following that, I'm just starting on "Zen and the Art of Motorcycle Maintenance".

2009-3-14

Minor happenings

I've been away for a bit. My appendix started playing up on Sunday 23 February and sometime between then and Wednesday 26 February, when I was admitted to Christchurch Public Hospital, it burst, resulting in a full blown case of peritonitis. There was a pretty nasty week in hospital while I was recovering from the operation, and also dealing with pneumonia (a surgical complication, I think) and the rotovirus stomach bug (which I guess I caught in the Emergency Department). Since then it's been pretty much waiting for things to straighten themselves out, and finally today (after 2.5 weeks in hospital) I've been pronounced stable enough to go home for the weekend. Thanks so much to everyone who e-mailed or twittered their well wishes - it really made the time pass much more quickly.

[Update: There was some other news here, which is still valid but probably doesn't need to be recorded in perpetuity on my blog.]

2009-2-6

[Minimal] pure PHP Subversion client

Something interesting I did back in 2006 was write a pure PHP parser for the Subversion REPORT XML format, which is what a Subversion server sends in response to a checkout or update request. The code could check out a fresh copy of a repository, and also handle the XML well enough to update from revision to revision. I did this to implement the auto-update process for PeopleAggregator, for Broadband Mechanics.

It's worked pretty well, and I'm pretty proud of the code... not its beauty, because it's fairly inscrutable, but in that it worked at all, and that it was as reliable as it was. I think it took a few days to write, and after a couple of minor bugs found over the next week or two, we didn't find anything wrong with it until much later, when we shipped an update which deleted a file, which was a case I hadn't considered when writing it. After fixing that it worked just fine from then on.

Anyway, Marc gave me permission to release this as open source under the MIT license (like CC-BY: fairly unrestricted use, with attribution) a year or two back, and people have asked me about it from time to time, but I've never actually put up an official copy with the MIT license on it. So, here you go:

pure-php-subversion on GitHub.

I never spent the time to properly extricate it from PeopleAggregator, so you'll need to hack PAStateStore.php into something that fits your own database, and figure out the schema. If someone wants to write a pure-PHP handler for .svn directories, or even a generic state store which stores hashes like PAStateStore (but maybe in a flat file rather than a database), that would be brilliant. Fork and enjoy!

... more like this: []

2009-2-2

Clever things about the MacBook that other laptop makers should steal

I've been using a MacBook Pro for a week now, and here are some of the things I'm surprised nobody appears to have cloned.

- Giant touchpad with multi-touch gestures. Two finger scroll that works both vertically and horizontally is excellent, and the three finger page up/down is good, if not something I need as often.

- Power indicator that tells you how long it will be before the battery is fully charged.

- Fans that vent through the top of the case rather than the bottom/side, so you can put it on a soft surface without it overheating (any more than it normally does).

- The ability to act like a wifi base station and share an internet connection from a wired ethernet connection out via wifi.

- Autosensing ethernet, so you don't need crossover cables.

- Good keyboard shortcut to eject a volume, which also tries to close windows using the volume so you don't get an error about something being in use.

There are some things that could be improved.

- The not-so-often-used function key is off in the bottom left hand corner of the keyboard, which is prime real estate. My Windows laptop puts the Control key there.

- Home/end/pgup/pgdn would be nicer as separate keys -- this makes me much slower editing text in OS X than Windows.

- A lot of apps use similar-but-different keyboard shortcuts. Lots of things use shift-cmd-[] to switch tabs, but I've also seen cmd-left/right and shift-cmd-left/right.

- I haven't figured out a good way to completely wrap up the power brick yet. My Toshiba has a velcro strap I can use to secure everything. The thin cord coming out of the brick wraps nicely around the little hooks, but the big cord that plugs into the mains needs a bit of velcro.

2009-1-23

Small-scale revision control

Here's something I'd like: revision control that stores *ALL* its (required) working-directory metadata inside the actual files.

This would be a godsend for when you have to work with people who don't grok the revision control religion and like to do things like copy scripts around the place and make many small untracked modifications. The idea would be to have a comment somewhere in the file pointing to the repository, path, and version. The RCS could have a temp folder somewhere else on the system to cache revisions for fast local access.

Then, wherever you are, you could run $RCS <status|commit|update> on any file containing a magic metadata block connecting it to the repository. I guess you could write this as a frontend to any current revision control system; the metadata block could refer to a Subversion or Git repository path, and operations on it would set up a working directory with just that file and the appropriate metadata, then act as usual.

Locking down a MediaWiki

I know, it's a crime against wiki nature, but sometimes you want to lock down a MediaWiki install so only certain people can edit it. To do so, put this in LocalSettings.php:

  $wgGroupPermissions['*']['edit'] = false;
  $wgShowIPinHeader = false;
$wgGroupPermissions['*']['createaccount'] = false;

Then, to create someone an account, you have to log in, then return to the login page and click 'Create account'. The flow is a bit weird; the best I can recommend is to bookmark the 'Create account' page, which will be something like this for a wiki on http://example.com/:

  http://example.com/Special:UserLogin?type=signup