Everybody Staze...

Nobody leavz...

  • Home
  • About Me
    • LinkedIn
    • Lab
  • Contact
  • Links
  • Reviews
  • Sitemap
  • Weather

Just in case anyone didn’t know…

2010/03/10 By staze

My favorite XKCD, probably ever.

Filed Under: Sys Admin Tagged With: xkcd

Fun with iCal Server

2010/03/10 By staze

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.

#!/bin/sh

#This users caldav directory. Something like:
#/Library/Calendar/calendars/__uids__/7E/1B/7E1B373E-8F22-469F-8BDF-5C3ECB996156/calendar
INPUT=""
TEMP="/tmp/temp.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.

Good luck.

Filed Under: Sys Admin Tagged With: .ics, iCal Server, merged, outlook, subscribe

Bootcamp Assistant Nightmare

2010/03/07 By staze

So, I recently got accepted into a beta program for a popular game. The problem is, there’s no Mac version of the beta yet. So, I had to get a windows machine up and going. All the PCs in my home, and at work, aren’t really capable of playing modern games. So, I had to get bootcamp working on my laptop (which is still fairly old, but at least is a C2D Macbook Pro (2006)).

So, I started with just trying to run bootcamp assistant. It failed saying “cannot move files”. Great. So, looking online, I found that it can be caused by insufficient space on the HD. So, I removed some data from my laptop. Ran the assistant again, and got the same result. Moving on, I tried using the work copy of iDefrag. I did both the “compact” option, and the “full optimize” option. After both, the result of the bootcamp assistant was the same: “unable to move files”.

So finally, after spending probably 16 hours on this problem, I “Target Disk Mode” booted my MBP, and hooked it up to my Mini Server, and ran Carbon Copy Cloner to backup my MBP to a disk image. Then, repartitioned the drive on the MBP as 1 partition, HFS+ Journaled. Then, ran CCC and restored the disk image back to the MBP HD. (Total time for backup, then restore, about 2 hours for 50GB (about 1 hour for each direction). I then booted the MBP back up, and ran the Bootcamp assistant. It worked!

So, while iDefrag SHOULD have been enough to move everything up to the start of the disk, it didn’t seem to be enough. CCC does file level copies, so wiping the drive, then restoring it, basically moved everything to the start of the drive, and all non-fragmented. Who knows, maybe the bootcamp assistant just looks at the age of the partition and decides to fail based upon it’s age. *shrugs*

Anyway, I installed XP SP3 since I couldn’t get Win 7 64-bit to install. I’m going to give it another shot when I have some time, given this link that seems to address the issue I saw when I tried booting from the Win 7 DVD.

So, all told, 18-20 hours (with some sleep in there) to install XP to play one game that’ll probably have a Mac version of the beta out in a couple weeks. But, it was worth it after playing 3 hours tonight, and probably playing more tomorrow.

All that said, Apple really should allow running the Bootcamp assistant from another machine while the “target” is in TDM. Or, run it from single user mode. The former should allow everything to be moved, and the latter should allow moving of just about everything but the kernel. *shrugs* Bit annoying. But, it’s really a “corner case” for those of us that want/need to install windows after the initial computer setup. The CCC route seems like the most easy, fast, and logical option. If only I’d thought of it to begin with.

Filed Under: Apple Tagged With: Bootcamp, CCC, iDefrag, Target Disk Mode

« Previous Page
Next Page »

Weather

Categories / Archives

  • Apple
  • Coding
  • Electronics
  • Energy
  • Home Ownership
  • Miscellany
  • Politics
  • Prius
  • Sys Admin
  • Travel
  • Uncategorized
  • Work
  • April 2026
  • August 2025
  • April 2025
  • January 2024
  • February 2021
  • July 2020
  • January 2020
  • April 2019
  • March 2018
  • February 2018
  • June 2017
  • February 2017

Copyright © 2026 · Staze On Genesis Framework · WordPress · Log in