We run an iCal Server at work, and the mandate has been handed down that everyone needs to be subscribed to a “Vacation Calendar” that a couple people in the building maintain (my boss, the head of Operations, and the Dean’s assistant). For the most part, this has been really easy. We just created a “Vacation” user, and subscribed people to it’s calendar on the server with iCal. However, we have a couple PC users in the building that use Outlook, and Outlook wants an ICS file to subscribe to… not a directory. It seems like iCal Server is supposed to (or at least version 1 did) give the client a combined ICS file if you just hit the directory of the user’s calendar without specifying anything else. This doesn’t appear to work though.

So, as a work around, I wrote up a very simple shell script that concatenates all the ics files for the vacation user into one ICS.

#Where you want the combined ics file to go. Should be a web hosted directory if you expect to have clients subscribe to it. Something like:

#OUTPUT="/Library/WebServer/Documents/vacation.ics"

OUTPUT=""

echo"BEGIN:VCALENDAR

PRODID:-//Vacation Merge//example.com//

VERSION:2.0

X-WR-CALNAME:Vacation Calendar">$TEMP

cat$INPUT/*.ics|grep-v"BEGIN:VCALENDAR"|grep-v"END:VCALENDAR">>$TEMP

echo"END:VCALENDAR">>$TEMP

tr-d'\r'<$TEMP>$OUTPUT

The big points here are, while you can just do cat *.ics > /some/place/merged.ics the “BEGIN:VCALENDAR” and “END:VCALENDAR” are still in there, which end up at the start and stop of each of the events in the calendar. Calendar software will stop reading once it hits one of those “END:VCALENDAR”… so the grep -v just removes those, and we add an end at the very end, just as we added a begin at the start.

The last line is to add unix line endings… because for some reason, this script is producing DOS line endings. *shrugs* Probably just the beginning block that has the wrong line endings. Anyway, it works.

That pretty much does it. It’s very simple. I have it run with cron every hour.

A while back, when 10.5 first shipped, my boss and I were intrigued by iCal Server. And after getting it going, we found that for some reason, we couldn’t set a calendar server for our users. We’d set the calendar in Workgroup Manager (WGM hereafter), hit save, and right after that, WGM would uncheck the box, and set it back to none. Something was weird with our accounts. My boss deleted his account and recreated it, and that fixed it. So, the problem was obviously something with the “old” accounts on the system (e.g. the accounts that had been migrated from 10.1 -> 10.2 -> 10.3 -> 10.4 -> 10.5. Some attribute didn’t get added.

At first glance, the obvious missing one was there was only one authAuthority entry in our user accounts. Just the ApplePasswordServer entry, no Kerberosv5 entry. And deleting and recreating his account remedied that. So, I put it on the back burner because we figured out that iCal Server was kinda buggy, and later found out that the iPhone couldn’t write to it, just read (no good). When 10.6 was announced, and we heard that iCal Server 2 supported read/write from the iPhone (with version 3.x+ of the iPhone software), I started thinking about it again. So, I looked at the attribute, and figured out that a single “sed” would create the attribute I needed. So, I coded up this. And figured, problem solved.

Alas, it was not. While testing a migration of 10.4 email (cyrus) to a 10.6 server (dovecot) using the migrate_mail_data.pl script, I noticed at the end, the script renames the imap spool folders after the user’s UUID. It failed to rename them for several users (like me) because we didn’t have a UUID. Then it hit me, iCal Server’s URLs contain the UUID for the user. No UUID, no iCal Server calendar. DOH! So, I took the Kerberos script, changed it a bit (using uuidgen), and batch added UUIDs for all the users that didn’t have them (Script here. Re-ran the migrate_mail_data.pl script, and viola, all the spools got renamed. Now, I’m not sure if this really fixes the iCal Server 1 problem, since I don’t have an iCal Server set up, but iCal Server 2 works (though, it works differently, so this issue doesn’t occur). I also got word from a bug I filed about the initial issue, that Apple thinks 10.6 fixed it, so I’d imagine when you upgrade your OD server to 10.6, it adds missing attributes.

Today at work was fairly boring, save the fact that at 4:30am this morning, a drive died in one of the arrays. So it’s been rebuilding with the spare since then. Should be done by about 8pm tonight. It’s a 3.6TB array with 750gig PATA drives, so rebuilds take a while.

Thankfully, we have an extended service contract with the Apple on the array, so a replacement is free, and was shipped from either Portland or Seattle today. Should be able to replace it tomorrow. Turns out, these can be ordered from the campus repair shop, which is an Apple Authorized Service Center. Otherwise, Apple wanted to put a $1070 hold on my Credit Card until they got the old one back. =[

More work with ACE today. Again, can’t comment on much. But, progress is being made. =) Otherwise, no comment. =)

Today we also moved over a server from another department that we’re now hosting their hardware, which hosts their website(s). Pretty easy move. It’s a G5 tower, so the hope is to migrate it to something in the rack, or better, migrate it to our primary web server. Least we have the power and space in the room. Worst case, I might just put the tower on top of the rack.

Word on the street is the state legislature is going to approve our $7.5 million in bonds which will match the private donations we’ve gotten at work. This will give us a building expansion, remodel the remainder of the 2nd and 3rd floor, and replace all the windows with double glazed windows (our current windows are circa 1950, so the building leaks like a sieve, and dust builds up everywhere). Interesting part, the bonds would need to be used by the end of the 2009-2011 fiscal year. So, construction is probably going to need to start by next summer at the latest. Next summer and year is going to be… “fun”, but well worth it.

I’ve added a couple sections to the site. I hope to open up the Code section when I have something there, and to populate more of the “Plants” section. Basically I just excluded that category from the front page with a single line of php () in the post loop of the index_template.php (link). Here’s hoping. I have a couple other sections I need to start populating as well. Think I’ll do the same for the reviews section.

Also been playing with the iPhone Configuration Utility 2 for our faculty/staff that have iPhones. Overall, it’s extremely cool. We can create a template for each user, or just a generic one that sets up LDAP for an email directory, as well as set up a calendar server. Once 10.6 is out, we’re going to set up iCal Server 2, and get everyone onto that. Then we’ll finally be able to kill MeetingMaker. Once we can kill the Quark License Server (i.e. once we get rid of Quark), and we get rid of the APWire Satellite feed (which the software that parses the feed runs at 100% CPU, all the time), I might be able to basically decommission a server due to lack of services, rather than consolidation.

Alright, that’s it for now. Again, hope to post some about home in the next few days. But not a whole lot has gone on, so it’s kinda difficult to write about.