php 5.3: short_open_tag default has changed!

Snow Leopard Server includes an upgrade of PHP to version 5.3. This version has a changed default for the “short_open_tag” option as compared to the version that shipped in Leopard server. The difference is that short_open_tag is now disabled by default, which means that the following will not work:

<?
phpinfo();
?>

The problem is the opening <?, which is in ‘short’ form. The long / normal form of the open tag would be <?php. If you don’t feel like editing all your scripts, you can simply declare the following in your /etc/php.ini:

short_open_tag = On

To further illustrate the change, consider the following command results, produced on a Snow Leopard Server that was upgraded from Leopard:

bash-3.2# grep 'short_open' /etc/php*default*
php.ini.default:; short_open_tag
php.ini.default:short_open_tag = Off
php.ini.default-5.2-previous:short_open_tag = On
php.ini.server-default:; short_open_tag
php.ini.server-default:short_open_tag = Off
Posted in bit bucket | 2 Comments

Blog Post

Hi again. Been a while…

After about a year on Apple’s customer software seeding team, I scooped up an opportunity to move to software engineering proper, and now work in Apple’s Mac OS X Server organization on the iCal Server team. My role is not a full-time software engineering role writing code all day every day, but rather more like a mix of software engineering, IT, and QA. This suits me well, and so far it’s good times.

San Jose has been particularly awesome this summer in terms of climate enjoyability, and we’ve been BBQing a lot in celebration. Normally I’m not one to host gatherings, but fortunately my roommate is, so I’m social by inheritance, which might sound annoying but actually suits me perfectly.

About a month ago (as I was between jobs), I spent a few days in Vegas hanging out with a bunch of online buddies in person for the first time, and that was a hoot. Normally we just yell at each other over ventrilo (voice conferencing software) as we continue our shared and endless quest to make progress and have the funs in the world of warcraft. We’ve been improving lately, and as of this writing are ranked 512th worldwide and 238th in the US out of something like 10k guilds.

Let’s see… been listening to:

  • The new Vibert release.
  • Isolee (which used to be available on bleep… a couple EPs on itunes though. Each of the 3 full length albums are great.)
  • Boxcutter, still. The Glyphic release, in particular (watch out for the rock group called Boxcutter – totally different, but unfortunately they are grouped together on the itunes store:)
  • Finally got around to picking up Cylob’s Bounds Green.
  • Still lots of Zappa. There’s so much material… Still eagerly awaiting the possible eventual release of the full-length Roxy concert video. The portion that has been released is pretty much fully epic, and I can and do watch it over and over (though I usually start at about 11 minutes in ;)
  • Other stuff, but I think I’m tired of listing and linking for a while…

What else… well, back in June, I participated in Apple’s yearly Worldwide Developer Conference. This year as with last year, I presented demos for the session about upgrading and migrating Mac OS X Server. The purpose of that session is to cover best practices and shed light on edge cases for people who have existing Mac OS X Server deployments and wish to upgrade them to the forthcoming release (in this case, Snow Leopard Server). My methodology (much to the chagrin of server engineering) is usually to pick on the parts of upgrade and migration that are broken, to make sure our customers know about these things, have an appropriate workaround, and just generally don’t get burned.

This year it was a big hit – even more so than last year. OS X Server admins love seeing the process of finding and working around real-world problems (i.e. software bugs), because that’s usually the hardest part of their workflow. This time around I did three demos: the first demonstrated things to do and check before an in-place upgrade; the second demo covered how to asses the correctness of an in-place upgrade after the fact, and deal with a couple specific kinds of fallout (due to known bugs that existed at the time, but which have since been fixed); the third demo covered migrating data from a 10.5 server to a different 10.6 server. Doing all of this live on stage with an actual running server presents some logistical challenges. For example, it takes a bit of time to actually perform an installation of the OS… so I used VMWare Fusion to create multiple virtual machines, each one with snapshots of just where I need to be in order to perform the salient portions of the demo for a live audience. It was really fun and well-received, and the cherry on top is that it wasn’t even obvious that I was using VM software :) This session is available on iTunes, but unfortunately not ala-cart… you kinda have to buy the whole Mac sessions track to get it. Mine was session #622.

In closing, I’d like to also say a few words about the current political climate as it relates to another of my traditional axes for grinding: religion. For the most part, I see people becoming increasingly more disconnected from the world around them – at least in the United States. Folks are able to go about their lives, sliding along nicely in the groove that is presented to them, without really knowing or caring what’s going on elsewhere. Traditional communities built around locality are being replaced by virtual communities that span the internet, and I think that has a significant effect on how people process and reconcile information about things outside their immediate purview. Additionally, it’s pretty hard for a person to keep up with current events around the world, and what they might mean for us here – I certainly don’t purport to be any kind of expert here, though I do try to pay attention and think about such things (typically via public radio and various podcasts). Finally, consider the difficulty in fully understanding things that happen in our own government. The new health care legislation makes a good example, because few people will read the entire (thousands of pages of) text of the proposed solutions. The point behind all of this is that there is lots of room for doubt and uncertainty. One might even say it’s the logical and necessary conclusion, because it’s probably impossible for most average folk to have well-informed opinions about all the important matters in life – not because they aren’t smart enough, but because they’re busy living their lives.

Unfortunately, lots of humans react very poorly when presented with uncertainty and doubt. They would much rather be certain than uncertain, even if that certainty is formed through a less than rigorous thought process. Humans have an amazing capacity to abandon logic and reason in favor of self-supporting belief systems, because people don’t want to be wrong about what they believe – I mean they REALLY don’t want to be wrong – to the extent that the support system becomes incredibly elaborate, perhaps even incorporating elements which are impossible to disprove.

In my own humble opinion, while I think sometimes certainty can be a comfortable feeling, I also recognize it as a potentially dangerous thing. Very dangerous. If you combine the human desire for certainty with the human desire to not be wrong about beliefs, things begin to get dark and nasty. The world is constantly changing – the same goes for the people living on it. Things that were held to be true decades ago may not be considered true today – perhaps because of scientific advances (e.g. genetics), perhaps because of cultural advances (e.g. abolishment of segregation, women’s lib, etc).

All of this comes together in quite a frappe when you mix the suggestible masses who want to be certain with con artists who wish to obtain support or buy-in from people, most of the time for selfish reasons. The skepticism and distrust that should be applied universally is typically only applied to those on the ‘other side’ of the issue at hand, as if important issues have two sides. This theme is stronger than ever in many of today’s mass media news outlets. Everybody has to pick a side, and not only that, they have to burry the other side. The whole business is sustained quite nicely here via a two party political system that seems to be fueled primarily by atrociously bad memories on the part of the constituents.

I humbly suggest that doubt and uncertainty are not scary things, but rather wonderful things. There is so much in the world to know and do, that if you’re not curious about things, you aren’t asking very good questions of yourself. The hilariously ironic part about all of this to me is that it’s much easier to achieve ‘not being wrong’ by simply limiting the number of declarative statements that are made than it is to build and defend an elaborate support structure. This probably sounds a lot like full-on Nihilism, but that’s not my intention… though I think it would be nice if folks were *more* Nihilist than self-righteously assured that their belief system is The Way. Thanks for listening :)

Posted in bit bucket | Tagged , | 1 Comment

eggdrop1.6.19+ctcpfix

Not exactly new, but since I’m the eggdrop maintainer for macports, and since I haven’t updated this port for almost 3 years… here ya go!

Macports users may sudo port -d selfupdate to retrieve the updated Portfile (and new patch file).

Details: https://trac.macports.org/ticket/20198

Posted in development, OS X | Leave a comment

4870: why aren’t you supported on MacPro1,1?

UPDATE: This is no longer a mystery. If you want the punchline, please proceed directly to the comments at the end of this post.

The ATI HD 4870 video card is a nice upgrade from the NVidia 8800 GT (my current card), however it’s not supported on the first generation Mac Pro (my current Mac Pro). Apple’s site states:

Compatibility:

  • Requires Mac Pro (Early 2009 with 1066MHz DDR3 memory) or Mac Pro (Early 2008 with 800MHz DDR2 FB-DIMM memory) with PCI Express 2.0 slot

(The MacPro1,1 has 667 MHz DDR2 memory). I heard a rumor on the internets that this card DOES in fact work on a MacPro1,1 – with no issues or weirdness, so I had to try. My card arrived yesterday, and I’m here to report that indeed, it seems to work fine!

So far, I’ve only tried it in WoW and Motion, but so far so good… Well except for the fact that the ATI driver in 10.5.7 breaks 3d acceleration in VM guests… oh wells.

The question remains: why is this card not supported on the first-gen Mac Pro?

asp

Posted in mac pro | 1 Comment

The Problem With Twitter

The Problem With Twitter is that the concept of ‘signal to noise ratio’ is an intensely personal thing. It varies greatly with mood, activity level of people being followed, current political events, weather, appetite, what’s on sale this weekend, presence of television ‘marathons’ of popular shows, etc, etc, etc. Even that one sentence has nearly depleted my desire to continue writing. I promise I won’t be talking about those things here. Suffice to say that the single linear stream of messages ordered by age is completely and utterly wrong.

I’ve seen people tagging twitter messages with things like #foo or #bar. I haven’t read the RFCs on this behavior (heh), but I’m guessing that these are really just tags, used to create relationships between twats (that’s right). I have NOT seen any notion of verbosity level, which is the one thing that twitter desperately needs. Just for you, here’s my million dollar idea. Please, take the challenge. I can’t do it cause I have handcuffs… but really, I wouldn’t even if I didn’t. I think the trickiest part of all this is that many of the people who would fix this are themselves the worst offenders, so performing my suggestion would constitute an admission that they themselves are often uninteresting. If that’s you, please understand that I mean no offense… I’m mostly uninteresting as well (the difference is that I don’t share it with the world). Just think of this as a way to refrain from driving users off your ‘platform’.

All twitter clients should support tagging outbound messages with a ‘priority’ of 0 through 9. Twitter users are not required to tag their twats (that’s right) with a verbosity level, but they are encouraged to do so.

All twitter clients should support a verbosity filter for the main messages view. I would implement this as a slider that effects the UI as you drag it up or down from 0 to 9. This would easily allow a reader to start at 9 and slowly drag down, seeing messages appear in order from most to least ‘important’ (still sorted by age).

Now, here’s the key. It is only natural that many or most of your followees (leaders?) will use what you consider to be an incorrect verbosity level for some or all of their messages. That’s why the client supports the notion of TwatFactor, a per-user setting which is a simple mathematical function applied to the verbosity level of all inbound messages from a given user. This could be as simple as “whatever that guy set, minus 3”, or something more debonaire like some kind of non-linear scaling factor that gets more or less ‘sensitive’ as you approach the extremes of the scale.

Extra credit: anonymously publish and consume TwatFactor settings from other users, the end result of which could be a bona-fide self balancing system where all users get just the amount of content they want.

Go!

Posted in You Do It | Leave a comment

Thanks Rachel!

 http://www.msnbc.msn.com/id/26315908/#29171520

She’s the most adorable newscaster of our time because:

* She is either genuine, or good enough to fool me. Either way, I’m satisfied in this respect.
* She’s one of the very few in the mainstream who attempts to distinguish between what’s worth reporting and what’s not. I’m sure she still has to report what she’s told to report, but I’ve heard her openly question the worthiness of reporting something she’s about to report. It’s something.
* She’s female
* She seems to completely avoid the vitriol which plagues mainstream ‘analysis’.
* Not afraid to poke fun at religion

Posted in bit bucket | Tagged | 1 Comment

When your seagate 1.5 TB hard drive begins to fail…

you might say to yourself, “yes, that’s definitely busted up. I can tell by all the fsck failures, and how sometimes it’ll spin up and down a bunch of times all anxious-like, right before a nasty kernel panic.”

perhaps you look into it, carefully examining logs, and suspect that this is probably related to time machine backups (which is the exclusive use of this disk, and which surely does involve a lot of disk activity), and think you can be clever by simply turning off Time Machine and unmounting this volume to work around those unsightly panics. but no. no, I say.

Any time I had to reboot, I would always make sure to unmount this volume immediately. With it unmounted, I reasoned, the disk should just sit there unused… defective, but dormant.

This is wrong. I would still hear this disk spin up and down followed by kernel panics. The volume was not actually being mounted, according to the kernel… so who knows what was making it spin up and down. Something.

So, when your seagate 1.5 TB hard drive begins to fail: take the 3 minutes to shut down and disconnect it from your computer.

Posted in Pro Tip | Leave a comment

Winterland wondertime

It’s not snowy or anything in San Jose, however I still present to you the following, in celebration of the times:

http://dreness.com/media/winter_wonderland.m4a

This is a cut from a collection of live sets from Wynton Marsalis (and several variations on his septet) that was recorded over the course of 5 years at the Village Vanguard in NYC. As if to demonstrate that this is a live show, Wynton chips the first note, causing a brief stop in the music and a bit of playful banter among the band… These cats are all amazing technicians and musicians, and pretty much the whole thing is a treat. It’s a seven CD box set for $40, hard to beat that!

http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?id=191011602&s=143441

Cheers!

Posted in bit bucket | 1 Comment

Cross-application URL cache searching!

I was out taking a (filesystem) walk, and wandered into /var/folders. Not remembering where / when this came from, I was pleased to find that the hier(7) manpage is aware of this directory, describing it as ‘per-user temporary files and caches’. More research reveals that this directory structure is created as defined by some code in Apple’s Libc as of Leopard. Some of the constants are defined in dirhelper_priv.h, and the corresponding _dirhelper.c does the creating and locating of directories – note the fancy two-level hashing.

Walking around more, I find that I’ve got a directory for myself (as observed via the file permissions) with the following contents:

drwx------  35 andre  staff  1190 Oct 27 19:34 -Caches-
drwx------  12 andre  staff   408 Oct 27 21:03 -Tmp-
drwxrwxrwx@  3 andre  staff   102 Oct 27 20:42 Cleanup At Startup
drwxr-xr-x   2 andre  staff    68 Oct 27 19:26 TemporaryItems

The -Caches- folder contains application directories in the reverse domain notation, e.g. com.apple.Safari, or com.apple.mail or com.blizzard.worldofwarcraft. All of these directories seem to have at least one file: Cache.db. hmm… ok, database. fun. Let’s see what’s in it!

{56} andre@gyro [-Caches-/com.apple.Safari] % file Cache.db
Cache.db: SQLite database (Version 3)

Cool! I can do sqlite3…

{74} andre@gyro [-Caches-/com.apple.Safari] % sqlite3 Cache.db
SQLite version 3.4.0
Enter ".help" for instructions
sqlite> .tables
cfurl_cache_blob_data       cfurl_cache_schema_version
cfurl_cache_response     
sqlite> .schema cfurl_cache_response

(this produces output with really long lines, so let’s hop back to the shell right quick)

sqlite3 Cache.db ".schema cfurl_cache_response" | fold -s
CREATE TABLE cfurl_cache_response(entry_ID INTEGER PRIMARY KEY AUTOINCREMENT
UNIQUE, 		     version INTEGER, hash_value INTEGER,
storage_policy INTEGER, request_key TEXT UNIQUE, 		     time_stamp
NOT NULL DEFAULT CURRENT_TIMESTAMP);
CREATE INDEX request_key_index ON cfurl_cache_response(request_key);
CREATE INDEX time_stamp_index ON cfurl_cache_response(time_stamp);

ok, back in sqlite3 interactive mode now:

sqlite> .mode line
sqlite> select * from cfurl_cache_response where entry_ID=1;
      entry_ID = 1
       version = 0
    hash_value = -1475899696
storage_policy = 0
   request_key = http://i.cdn.turner.com/cnn/.element/css/2.0/pgaleader.css
    time_stamp = 2008-10-28 01:55:10
sqlite>
sqlite> select * from cfurl_cache_response where entry_ID<4;
      entry_ID = 1
       version = 0
    hash_value = -1475899696
storage_policy = 0
   request_key = http://i.cdn.turner.com/cnn/.element/css/2.0/pgaleader.css
    time_stamp = 2008-10-28 01:55:10

      entry_ID = 2
       version = 0
    hash_value = -763438389
storage_policy = 0
   request_key = http://i.cdn.turner.com/cnn/.element/css/2.0/main.css
    time_stamp = 2008-10-28 01:55:10

      entry_ID = 3
       version = 0
    hash_value = 1822950361
storage_policy = 0
   request_key = https://www.cnn.com/
    time_stamp = 2008-10-28 01:55:10

Neat! Ok ok, here’s the cross-app url cache searching code:

#!/bin/bash
# Here's a little ditty that does keyword searching across all the URLs in your
# /var/folders caches directory - the one returned by
# /usr/bin/getconf DARWIN_USER_CACHE_DIR

# Search term comes in as first command line argument
# -v is an optional second argument to list databases are they are searched
SEARCH=$1
VERBOSE=0

if [ ! $SEARCH ]
then echo "Usage: $0 [search term] [-v]"
exit
fi

if ( [ -n "$2" ] && [ $2 == "-v" ] )
then VERBOSE=1
fi

CACHE=`getconf DARWIN_USER_CACHE_DIR`

ls -1 $CACHE/*/Cache.db | while read db
	do
	echo -n ""
	if [ $VERBOSE == "1" ] ; then echo "   Searching $db" ; fi
	sqlite3 $db "select request_key from cfurl_cache_response where \
		request_key LIKE'%$SEARCH%';"
	done

Probably safe to not depend on any of this being available or staying the way it is in future versions of Mac OS X… but for now at least, it’s here and contains data. In case you were wondering, Safari doesn’t log here when private browsing is enabled :)

Posted in OS X, scripts, The More You Know | 3 Comments

oops

I forgot to localize an image in this post, instead linking directly to it… I know better, but I guess not that time. Anyway, of course now it’s gone… and so I’ve had to delete it and then retroactively re-title this post. It was a dilbert cartoon about sucking at business and getting government bailouts. Anyway, on with the original content:

The united states might be on the fast-path to badness, but personally I’m doing well with my no debt, no stock market holdings, and fun job in sunny california. I can’t tell you how much I’m enjoying being seduced by "the left coast", blaming america first, and hanging on obama’s every inspiring and hope-laden word. Of course, I must vote for him as dictated by the intersection of my age, state of residence, and industry of occupation. I mean, that’s just how it works, right!? Or maybe I must vote Democrat because it’s the opposite of voting Republican? No, it’s because I’ve voted democrat in the past… wait, no… it’s because… I HONESTLY BELIEVE the statements of a politician, but only if it’s a democrat? hmm…

Pardon my indignant french, but this is all bullshit. Personally, I don’t expect a critical mass of people to realize the bullshit, given how stupid this country’s population is. Yeah, maybe that makes me an elitist prick, but I won’t apologize for it! Wake me up when half the nation realizes that the earth wasn’t created in its current form 10,000 years ago by a god.

Seriously though… why does any thinking person trust any politician who doesn’t legitimately earn that trust? Stockholm syndrome, anyone? I abstain!

In other news, these things are amazing!

Posted in bit bucket | Tagged | 2 Comments