Boxee and Apple TV
I have been running Boxee beta on my AppleTV v3.0.1 for a few weeks now. It has been great… until this morning, while up soothing a screaming child and watching The Guild. The AppleTV reset itsef and came back up running AppleTV v. 3.0.2 with no more Boxee. Sad day.
Using Directory Services information to generate a Telephone List
Using Directory Services information to generate a Telephone List
My organization creates a list of four digit extension numbers of all the employees in the organization, every year or so. The purpose of course is to provide a quick reference list, next to every telephone in the building. Until recently, the list has been maintained manually, and over time it has become an unruly mess of fonts, tabs and various styles. I have found it to be quite useless for some time.
Last year I decided to tackle this issue, and automate the list generation. My first attempt, was significantly better than the original manually generated list, but was less than ideal. It boiled down to running csvde with a long list of arguments on one of my domain controllers in order to generate a .csv file that contained more information than I needed. Then I moved that file to my mac, and through the use of some shell scripting I was able to trim the un-needed information out of the file and create a new, filtered, .csv file Following that, I was able to take the filtered .csv and run it through a mail merge document that I created in Word.
It worked, it generated the document exactly the way I wanted it. However, there were a few things I didn't like. My biggest gripe was that I had to use both the Win 2K3 Domain Controller (to generate the first file) and then had to use my Mac to process that file and ultimately generate the word document.
Over Christmas break this year, I set out to resolve that issue, and do some learning on a couple of topics that have interested me for a while now.
Apple has provided a command line utility called dscl (Directory Services Command Line) for at least the last two major releases of OS X. I have only just learned what it can do for me. I found it to be quite useful in pairing down the number of steps required to generate the telephone list.
Here is a copy of the script, fairly well commented, for ease of understanding.
#!/bin/bash
# Phone List Generator v. 2 by bill_wellington at aw.org
# This script will pull live data from Active Directory and output a .csv
# file (named as an argument) including first name, last name, department,
# phone ext. and mobile phone ext. It goes through a strips out all
# constituents who are students, members of the "Class of...", or who do
# not have a 4 digit extension listed in either their phone number or
# their mobile number. The list can then be used to generate a phone list
# using MS Word's mail merge functions.
# create file
touch /tmp/$1.csv
echo > /tmp/$1.csv
# pull a plist for every user in AD
for i in `dscl /Active\ Directory/All\ Domains/ -list /Users` ; do
dscl -plist /Active\ Directory/All\ Domains/ -read /Users/${i} FirstName LastName Department PhoneNumber MobileNumber | \
# remove lines matching following regex - these extra xml delimiters that we will not use
grep -v '^<?xml.*$' | \
grep -v '^<!DOC.*$' | \
grep -v '^<plist.*$' | \
grep -v '^</plist>' | \
grep -v '<key>.*$' | \
# remove xml tags around the data we want to keep, insert commas between fields
sed -e '/<dict>/d' -e 's@</dict>@@' \
-e '/<array>/d' -e 's@</array>@@' \
-e 's/<string>//' -e 's@</string>@,@' | \
# remove tab characters (0x09) from original xml output
sed -e 's/ //g' | \
# clean up ampersands
sed -e 's/&/\&/g' | \
# remove line breaks
sed -n -e ":a" -e "$ s/\n//gp;N;b a" | \
# remove students and all other without 4 digit extension
grep -v "Student" | \
grep -v "Class of " | \
grep '^.*[0-9][0-9][0-9][0-9].*$' | \
# ok, now we have the data we want, let's put the fields in the right order
sed -e 's/\([0-9][0-9][0-9][0-9],\)\([0-9][0-9][0-9][0-9],\)/\2\1/' | \
sed -e "s|\([a-zA-Z \&'/-]*,\)\([a-zA-Z ]*,\)\([a-zA-Z '-]*,\)\(.*\)|\3\2\1\4|" | \
# remove trailing commas from lines with a cell number
sed -e 's|\(.*,.*,.*,.*,.*\),|\1|' >> /tmp/$1.csv
done
# prepare final .csv
echo "Last Name, First Name, Department, Ext., Cell" > $1.csv
sort -f /tmp/$1.csv | \
#remove blank lines
sed -e '/^$/d' >> $1.csv
# add in static numbers
echo "Activity Bus 1,,,,5448" >> $1.csv
echo "Activity Bus 2,,,,5449" >> $1.csv
echo "Auction Office,,,5454," >> $1.csv
echo "AWSPA Office,,,5454," >> $1.csv
echo "Bishop's Suite,,,5409," >> $1.csv
echo "College Counseling,,,4339," >> $1.csv
echo "Courtesy Phone,,,8604," >> $1.csv
echo "Dorm Parent Office,,,5423," >> $1.csv
echo "Dorm Parent Cell 1,,,,5446" >> $1.csv
echo "Dorm Parent Cell 2,,,,5447" >> $1.csv
echo "Extended Day,,,8627,5445" >> $1.csv
echo "Front Office,,,8642," >> $1.csv
echo "HelpDesk - Tech,,,8999," >> $1.csv
echo "Housekeeping (Daytime),,,,5438" >> $1.csv
echo "Kitchen,,,4153," >> $1.csv
echo "Meeting Rooms,,,," >> $1.csv
echo "Conference Room,,,8893," >> $1.csv
echo "Cottage 1st Floor,,,8894," >> $1.csv
echo "Cottage 2nd Floor,,,8895," >> $1.csv
echo "Huston Room,,,8891," >> $1.csv
echo "Sutton Room,,,8892," >> $1.csv
echo "Security,,,5426,5444" >> $1.csv
# Future Plans This scrpt perhaps through some fancy "osascript" commands
# should be able to launch MS Word, and perform the mail merge. I need to
# check and see if Word's Mail Merge functions are scriptable using
# AppleScript.
“Good Fences Make Good Neighbors”
With the fall of the Berlin Wall in 1989, it is amazing to me that all around the world we are still living with wall that are built to keep people separated. In some cases we are building new walls, in many cases we are still living with the old walls.
BBC Special Report
3Com can’t document their ass from their elbow.
When I inherited the network I administer, I inherited a bunch of 3Com switches. Over time I have swapped them out with other 3Com products. I find that switching is one of those things where everything works so much better if you use one vendor’s products… and since I didn’t change out all of the switches at once I continued purchasing 3Com products. 3Com fucked me today. I got no courtesy reach around, it was rough, and horrible. As a result I will never purchase another 3Com product.
I am setting up a vSphere cluster with a bunch of Dell R710 servers and an EqualLogic PS4000 SAN. The recommendation is to use Jumbo Frames on the switch that connects the SAN to the servers. I have a 3Com Baseline Switch 2948-SFP (3CBLSG48), actually I have several of these, but only one that matters in this case. If you follow the previous link, you will notice that in the center column, ninth bullet point, it says “Jumbo Frame support for reduced network load.” Well let me tell you, there is absolutely zero documentation on how to activate Jumbo Frames on this switch. Let’s take a look at the user manual. Search for the word “jumbo” in the user manual and you will find exactly one entry, on page 2 (or 13, depending on how Acrobat numbers the pages.) It is a bullet point that says “The Switch 2948 features the following advantages: ... Jumbo frames”
All of this indicates to me that the switch supports Jumbo frames in some shape or form, but since the guide has only this entry, I have absolutely no idea how to configure them. Going through 3Com’s bastardized web interface didn’t help either, nothing in there to suggest Jumbo frames. the CLI offered little more than configuring the IP address, or resetting the entire config. In short, completely useless.
But wait. Jumbo frames are also called 9000 byte MTUs. A search through the manual for “MTU”, “9000”, and “Maximum Transmission Unit” revealed absolutely nothing. Basically you can’t configure them… and let me tell you, if they are “automatically configured” they sure don’t work worth a shit.
A call to 3Com resulted in no answer, but it is Labor day today, so I will give them that.
Searching through their knowledge base and their user forums, gleaned not a clue.
Most maddening of all, was a google search for “3com 2948 jumbo frames” reveals everybody who is trying to sell one of these switches, but doesn’t come up with anybody who is trying to make Jumbo frames actually work on this switch.
Basically, what should have been a 10 minute config issue has turned into hours of fruitless labor.
3Com, I hate you.
Deploying Mac OS X 10.5.x With BootCamp - Part 1
Recently we deployed 110 MacBooks to faculty and students in our school. We did not escape the process unscathed, and instead came away with a few process items that I want to pass along to others. We looked at using Deploy Studio to automate our imaging process. We also looked a Clonezilla which has worked really well on our Windows deployments in the past. Clonezilla will take an exact copy of your drive, and replicate it of other drives of similar size, as you might expect. We chose Deploy Studio for the additional post imaging scripting that was available. You can build up a workflow that will automatically bind the OS X partition to AD, and to OD, reset the LKDC, and deal with the byHost preferences, along with numerous other thngs.
Setting up Deploy Studio was fairly straight forward. We have an OS X server that was able to perform the role of our NetBoot server. From there, Deploy Studios setup assistant pretty much configured everything cleanly for us.
We built up our perfect image, with OS X 10.5.8 and BootCamp providing us with a Windows XP SP3 partition. Capturing that data with Deploy Studio was simple, and we were off to the races. Or so we thought. Off our 110 machines, all of them had “dirty” NTFS partitions pushed down to them by Deploy Studio. About one-third of those machines ran ChkDsk in less that a minute and then booted up into Windwos Setup with no issues. The other two-thirds of our machines had issues with security descriptors. After more than an hour of ChkDsk repairing these descriptors, the machines would beet into setup and complain that ther were missing or corrupt files. I spent an additional hour with 2 machines and some XP SP 3 CDs trying to locate missing files. I never got the Windows partition into a fully bootable state. Clearly something was very wrong, but what was it, and why was it affecting us so inconsistently?
We found that if we reimaged the failed machines, we would have roughly the same failure rate, but we would have more machines done. We also at this time employed Clonezilla to bang out a number of machines, that would need subsequent handling from us to perform all that we were asking Deploy Studio to script for us.
Ultimately we got the image deployed to all 110 machines, but ended up with a great number of problems with our workflow (particularly on the manually configured Clonezilla machines) We also had a disaster of a time getting the students logged in to the machines, which ultimately led us to a second imaging which I will talk about in Part 2 of this article.