Category Archives: OS X

Thanks, Steve

Steve Jobs passed away today at age 56 after a battle with cancer.  Here’s a few random thoughts…

On this day, I own a buttload of Apple gear: iPhone, iPod, iPad, MacBook Pro, Apple TV, Apple TV 2, Time Capsule, Mac Mini… I’m planning on getting an iPhone 4S as soon as possible.

I was (and am) a big open source dork at heart, but Apple’s simplicity and ease of use, especially the past 7 years really spoke to the pragmatic side of me.  It turned me into a fan boy, I guess.  It didn’t hurt that OS X is NeXTStep is UNIX… I touch OS X and Linux every day.

One of Dinah’s first words was iPod which she taught herself so she could ask me to turn on music for her.

In college, I loved using the NeXT computers we had. My first class in college used scheme on the NeXT’s. The NeXT is one of the first places I played Doom.  I took calculus using Mathematica on the Mac in college.

Steve also touched my kids’ lives via Pixar. (Okay, my life too, I saw Toy Story in the theater first run, long before I had kids.) Also through their first computer, a Mac Mini.

There were too other public figures who’s lives and deaths touched me the way Steve’s passing is touching me today: Jim Henson and Fred Rodgers.

OS X 10.7/Lion attemping to mount a Windows 2008 file share: WTF?

Overall, I’m happy with the changes that Lion brings.  I was a bit thrown off by some of the changes that happened as Spaces got folded into Mission Control, but once I found out how to assign apps to desktops in the new style I calmed down.

We’re stuck with one vexing problem at work that’s Lion related:  We have all of the work Macs tied into Active Directory and that’s working pretty well.  However, we can’t seem to mount a Windows 2008 file share if it has access permissions on it.  This worked fine in Snow Leopard, but I’m getting an error dialog with “You do not have permission to access this server” when I use the “Connect to Server” GUI box.

However, if I go to the command line and issue a mount -t smbfs cifs://server/path/to/share /some/path it mounts just fine.  I’m not sure what the command line is doing different from the GUI, but seriously WTF?

Its holding us back from doing wider deployment.  I can live with doing a manual command, other users, not so much.

[Update: I’ve opened a bug with Apple.]

[Update 8/24/2011: Apple has put up a Knowledge Base article addressing this at http://support.apple.com/kb/HT4829 which explains the behavior differences. I don’t have a great workaround yet but we know the why now.]

[Update 2/15/2012: 10.7.3 is still showing this behaviour]

[Update 9/14/2012: I should have posted this awhile ago, but Mountain Lion continues the trend of the behavior change.]

Tivo2Podcast update

I’ve made a few updates since my last release a few weeks ago. I thought I’d toss an updated version out there.  What’s new in this version:

  • Duration is no longer hard-coded to 32:00 and actually reflects the duration of the show
  • The script will attempt to find the TiVo via Bonjour/mDNS/ZeroConf/DNS-SD/whatever unless passed a -t flag with the TiVo’s IP address. If you have more than one TiVo, it will go with the first one it finds.
  • Moved the stuff in lib to lib/tivo so the package is more easier sucked in by something like encap or stow

Download: tivoscripts-20100314.tar.gz

When I get some motivation later in the week, I’ll put the git archive online, incase anyone wants to clone it and do some development on it.

TiVo -> Video Podcast

Previously on “You can imagine where it goes from here”: We released a script to download stuff from the tivo, and then made some improvements to it.

After two years of saying I was going to fully automate the process of downloading and transcoding shows for my iPhone, I finally got off my ass and did it.  The script is called TiVo2Podcast and it not only does the downloading and transcoding, but it stuffs the resultant video into a an RSS feed for easy consumption/playback by a podcatcher such as iTunes. I’m now automatically getting the shows off my TiVo and onto my iPhone for easy commute-time consumption. (I commute by train, I do not recommend commute-time consumption if you are driving.)

The ruby script wraps tivodecode, HandbrakeCLI, and AtomicParsley and is intended to be run from cron.  I’ve tested this on Linux, but it should run on any UNIX-alike, but it won’t run on windows since I make liberal use of the system() call. Also, this is intended for PERSONAL USE ONLY, do not set up podcast feeds and violate the ethics (and also the laws) of copyright left and right.

This is a very early version and can certainly use some tweaks and enhancements, primarily in configuring the shows you want to capture.  Right now, configuration is in the form of doing INSERT statements in SQLite.  Not very friendly, but it gets the job done until I can make a quick and dirty question based TUI. Here’s an example of setting up getting the best fucking news team on the planet:

INSERT INTO configs (config_name, show_name, rss_filename, rss_link,
                     rss_baseurl, rss_ownername, rss_owneremail, ep_to_keep, encode_decomb)
            VALUES ('tds', 'The Daily Show', 'tds.xml', 'http://www.thedailyshow.com/', 
                    'http://example.com/podcasts/', 'Keith T. Garner', 'kgarner@example.com', 4, 1);

Download tivoscripts-20100304.tar.gz and let me know what you think. Make sure you read the README!

[Update 3/5: Forgot to add that all the code I wrote is under the Simplified BSD License, so have at it.]

Build libcurl as a universal binary

I release one of the projects from work as a universal binary on OS X.  Up until tomorrow that mean just i386 and ppc.  With snow leopard, it looks like it’ll be a good idea to support the 64-bit architectures as well, especially considering its an ODBC driver I’m working on and the native apps running at 64-bit will want to talk to it that way.

Since we used a lot of open source libraries to save us time, I need to have those built super-universal as well.  The first one I tackled was curl, which had some issues due to configure, so I had to write a shell script to do the hardwork for me.  It needs to run configure three times, and I got a lot of the information for it from http://curl.haxx.se/mail/lib-2009-05/0000.html.

#!/bin/sh
export CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch ppc"
./configure --prefix=/usr/local/encap/curl-7.19.6 --with-ssl=/usr --without-ca-bundle --disable-dependency-tracking

cp include/curl/curlbuild.h include/curl/curlbuild32.h

make distclean

export CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch x86_64 -arch ppc64"
./configure --prefix=/usr/local/encap/curl-7.19.6 --with-ssl=/usr --without-ca-bundle --disable-dependency-tracking

cp include/curl/curlbuild.h include/curl/curlbuild64.h

make distclean

export CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64 -arch ppc64"
./configure --prefix=/usr/local/encap/curl-7.19.6 --with-ssl=/usr --without-ca-bundle --disable-dependency-tracking

cat > include/curl/curlbuild.h <

There will be more of these as I build the other dependencies.

Place shifting action 3: Revenge of the Sith

tivo.jpgPreviously I put out an early version of my ruby based command line oriented tivo download script.

I’ve had a patch from MARK NOTARUS to make the menu have some more options and I’m using Console::ProgressBar from facets now.

It works well enough for my needs, but let me know if you hit any roadblocks. Just as a reminder, my target was to download stuff off my tivo on one of my headless Linux boxes for batch encoding for my iPhone and/or PSP.

Download tivo-ruby-0.2.tar.gz

Dave Dribin once again rocks

qlscreenshot.jpgDave is having a rocking week.  He started with the 1.0 version of his QLEncript plugin to get QuickLook to show color syntax highlighted code files.  Here’s a quick screenshot of it in action on my laptop.

Today, to continue his rocking, Dave posted on Leopard’s ssh, ssh-agent, keychain interaction and ways to make it a bit more secure.  I was confused about this and he took the time to figure out.  I think, though, I will probably stick with using SSHKeychain for now.

Place shifting action 2

tivo.jpgI’ve been working on a command-line oriented TiVo2Go downloader so I can automate getting items off my tivo, or at least do it when I’m on the road via ssh (and then kick off that other script…)  I’ve written a quick and dirty TiVo library, and a sample script called TiVo2Disk which uses the library.

On its own, the TiVo library stuff I whipped up will just download the content from the TiVo still locked up in TiVo’s DRM.  If you pair it with tivodecode (like the sample script does) you can get the video as an MPEG-2 stream.  Beware, HD content is HUGE.

I’ve only tested with my Series 3, and I’ve run it under both OS X and Linux, but it should work on any .  The UI on the sample script is pretty bad, but its an early version.  I’m interested in an feedback, patches, etc anyone might have.  I still need to do some rdoc as well.

This works for me, but I’d like it to be more useful for more people.   In any case, feel free to checkout tivo-ruby-0.1.tar.gz.

Parallels Desktop is smart

Click for Full size!I’ve been using Parallel’s Desktop for OS X since it was first available. I just got my upgrade to the latest version. One of the things this version includes is the ability for the Mac to have the C: of windows (when running in a virtual machine) shared to the Mac like any other shared drive.

It looks like Parallels really has a good handle on code resuse since they based it on MacFUSE (which is based on the ideas and API of Linux’s FUSE. Its great to see cool open source technology being used like this rather than companies reinventing the wheel. Anyway, that was my geek excitement of the morning.

CMake so far

I’ve been investigating cmake at work as a better build system for our cross platform C based projects. I’m thinking about starting up a third one, so now is the prefect time to really go after this as for one project we have a build system per platform and on the other we have two build systems. When you mix in wanting to make universal binaries on OS X its yet another wrinkle. cmake was recently chosen by KDE to be the build system for KDE4 since KDE4 will be fully supporting Windows and OS X, as well as the other unicies via X. I used a small convenience library as the test piece as it was only two files big, but it had the requirement of at least two external libraries.

Some pros for cmake that I’ve found so far (compared to what we’ve been doing):

  • support a big number of build environments on the different platforms. On windows it sports 11 different build environments, OS X 3, and Linux 2. For OS X and Linux, you only really need those two or three, but on windows it supports 4 different versions of visual studio as well as Borland, Watcom, and gcc.
  • Takes care of the flags needed to build executables and libraries on those supported platforms.
  • Does out of source builds on windows.
  • Tracks dependences on all platforms without an external application
  • Does search and replacing on things like .in files without having to call out to external applications

Some cons I’ve found so far:

  • The documentation on the web page is pretty horrid. The book is pretty bad too, especially when compared to other technical books I’ve read recently, but its much better than the website. When combined with the book and experimentation, the FAQ is helpful.
  • Doesn’t really have the concept of convenience libraries. This will result in common files being built multiple times. I don’t like this, but its not fatal.
  • The CMakeCache is getting in my way more than being a help, but that might be the side effect of my learning process right now.
  • I haven’t yet figured out how to make it query the person compiling the app if it can’t find something. This may not be possible. At the very least I want to make it bitch and bomb out if a required dependency isn’t there. I just haven’t found it yet, I’m thinking.

This isn’t an exhaustive review yet, but I wanted to get down what was in my mind before I forgot. I had just found the convenience library thing and that’s what inspired the post. My next step is to move a full existing project over to being built with cmake. This is a library that depends on expat, boost, curl, antlr, and (optionally) swig. Should be a good challenge.

[Update 11:58: I found an answer to my “bomb out if the dependencies are missing” question. Thanks, devchannel!]

[Update 2:51: No this isn’t here just for g0ff. Turns out the latest cmake has modules to Find Java, Doxygen, Boost, Curl, Expat, and Swig already. It looks like just custom items for antlr and cppunit will be needed. Also, it only ever wants to link against dynamic libraries, not static ones. That’s a PITA.]

[Update 5:52: Okay, the convenience library thing is upsetting.  The output of what I was working on is a static library and there are same example command line tools that link against it.  From my reading of the cmake stuff, I should just include the library source files to the target for the executables being created.  The problem with this is for n example programs, I’m compiling librets n times.  This doesn’t seem very optimal.]