NVidia Web Driver Headless Update

I upgraded my graphics card in my 2008 MacPro to an Nvidia 950. This of course requires the Nvidia WebDriver since Apple doesn’t offer built-in support. I installed the driver, swapped my cards, and it worked like a charm.

Today I had a security update from Apple and thought nothing of it. Unfortunately, after the chime, the video never showed up! I didn’t panic immediately. I SSHed into my computer, and told it to reboot just to see if it was a glitch. No luck… I also tried using screen sharing, alas screen sharing doesn’t work without a GPU.

Luckily it is possible to fix this problem with nothing more than an SSH connection to the troubled Mac. I logged in, and ran the command, system_profiler SPSoftwareDataType, to determine which OS Release I have so I can choose the appropriate WebDriver package.

$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: OS X 10.11.6 (15G20015)
      Kernel Version: Darwin 15.6.0
      Boot Volume: Macintosh SSD
      Boot Mode: Normal
      Computer Name: MikePro
      User Name: Michael Caldwell (michaelcaldwell)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 3 minutes

The helpful people at MacVidCards.com keep a handy list of all the up-to-date releases of the WebDriver. I selected the appropriate one and was able to install it over SSH using the installer command (which I didn’t know existed before today!).

$ sudo installer -pkg WebDriver-346.03.15f13.pkg -target /
Password:
installer: Package name is NVIDIA Web Driver 346.03.15f13
installer: Upgrading at base path /
installer: The upgrade was successful.
installer: The install requires restarting now.
$ sudo reboot
Connection to 10.0.1.12 closed by remote host.

After the reboot, the display popped on just like it used to. Crisis averted!

More Time Machine Surprises


Another HDD bites the dust… I thought I was prepared. It turns out that there are always unexpected roadblocks when dealing with digital data.

Most recently, I decided to use a RAID 1 scheme (mirroring) as an additional piece of my data security plan. I then have a remote time machine backup. The Time Machine disk is smaller than my RAID, and as such, I only backup  irreplaceable data, like photos and documents to Time Machine. The remainder, like MP3s and DVDs I left to the RAID for protection. In the worst case scenario, I can always re-rip a CD or DVD.

Lesson 1: RAIDs aren’t backups!

Things have been going fine, and I’d been living happily with this setup for about 3 years before disaster strikes. My disk disappeared while I was working, which causes all sorts of weird behaviors. One of the RAID slices failed. The failure was so bad that I couldn’t even read any smart data from the disk. I also couldn’t remount the RAID for some reason. I shut down, removed the failed HDD, and rebooted. The RAID disk reappeared!

But there’s a catch… I did a quick check to see if the data on the disk looks accurate. It turns out that it is not. In fact, it is 6 months out of date! How did that happen?? The only explanation is that RAID failed silently 6 months ago. I’ve been operating on only one disk this whole time!

Lesson 2: Mac OS doesn’t inform of RAID failure!

In fact, disk utility (in El Capitan) doesn’t even show problems with RAID sets at all. The only way to verify a RAID set’s health is to check manually using a command in the terminal, or use the Yosemite Disk Utility.

$ diskutil AppleRAID list

I promptly ordered a new HDD. My plan for recovery is to rsync the data from the out-of-date disk to the new disk, and then rsync the more recent backup from Time Machine on top of it. That will ensure that I have the most coverage of my data.

$ rsync -aPE /Volumes/Old\ Volume/ /Volumes/New\ Volume

When rsyncing, I use the options ‘a’, ‘P’, and ‘E’. The ‘a’ is for ‘archive’ and enables a lot of good switches. ‘P’ is so progress is displayed. This is helpful for gauging how the copy is going. ‘E’ is for extended attributes. I use this because I still have OS 9 files hanging around with resource forks that I am trying to preserve.

The plan goes accordingly, and all my data is merged onto the new HDD! I reboot, login, and then discover the new hiccup; I can’t write anything to my user folder. I can’t load preferences, save anything. I can’t even touch a file!

$ touch ~/test.txt
touch: ~/test.txt: Permission denied

I look at the permissions of my folder to make sure everything looks fine, and indeed it does!

$ ls -ld ~
drwxr-xr-x@ 99 michael staff 3366 13 Sep 14:47 /Users/michael/

I can’t wrap my head around what possible be wrong! If the permissions are right, and the user settings are right? What could the problem be?? My brother is smart enough to have me try listing with the ‘e’ option which shows extended attributes.

$ ls -lde ~
drwxr-xr-x@ 99 michael staff 3366 13 Sep 14:47 /Users/michael/
0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown

Lesson 3: Time Machine puts protective ACLs on everything!

Access Control Lists (ACLs)… I hate ACLs… A wonderful combination of events led to every file being completely protected from all users via ACLs. First of all, I didn’t know this, but Time Machine protects all the backed up files using ACLs. This keeps users from unwittingly deleting things from their backups. It makes sense, but isn’t something I would have expected to be done on a file level. The second ingredient in this predicament is that I used the ‘-E’ option in rsync which copies the extended attributes. If I had left that off, this wouldn’t have been an issue…

Fortunately, there is an easy solution. Remove all the ACLs from everything! This is done with chmod.

$ sudo chmod -RN ~

This takes a while, but works as expected. My user folder is now working as expected, I can write and save documents. I can read my Photos library, etc. But there’s one more issue… I notice that my homebrew is acting funny. I look at my homebrew directory, and discover that none of the symbolic links have had the ACLs removed.

$ ls -le libpng-config 
lrwxr-xr-x+ 1 michael  501  41 Aug 16 22:50 libpng-config@ -> ./Cellar/libpng/1.6.31/bin/libpng-config
 0: group:everyone deny write,delete,append,writeattr,writeextattr,chown

Lesson 4: ACLs can’t be removed from Symbolic Links!

It turns out that using chmod to remove the ACLs from symlinks doesn’t work. The man page suggests that the -h should be used to remove the ACLs.

-h If the file is a symbolic link, change the mode of the link itself rather than the file that the link points to.

But that doesn’t work either.

$ sudo chmod -hN libpng-config 
$ ls -le libpng-config 
lrwxr-xr-x+ 1 michael 501 41 Aug 16 22:50 libpng-config@ -> ../Cellar/libpng/1.6.31/bin/libpng-config
 0: group:everyone deny write,delete,append,writeattr,writeextattr,chown

Searching online yields similar stories. It sounds like this is a long standing bug. Time to pull out the big guns… A one line bash script to erase and recreate all symlinks!

$ find . -type l | while read link; do echo $link; dest=$(readlink "$link"); sudo rm "$link"; ln -s "$dest" "$link"; done

It works like a charm. I run that across all the data that came from Time Machine, and it looks like I am back in business. Full recovery!

I need to change my way of protecting my data. 2 things I am going to do differently going forward:

  1. I won’t rely on RAID 1. The lack of notification if there is a slice failure is unacceptable. I will now use a weekly rsync chron job to sync my data to a second drive in my computer. Having a fully duplicated drive is handy because you can switch to it immediately in the event of a failure, and not have to go through a lengthy restoration process.
  2. Full backup to Time Machine. Although I didn’t suffer (major) data loss, I think it’s worth buying a larger HDD to create a full Time Machine backup, and not just the irreplaceable documents.

So, there you have it. Hopefully this will answer questions for other people out there, especially about ACLs!

Lego CAD

My first introduction to Lego CAD was an old program I used as a child on Mac OS 7 called Gryphon Bricks. While interesting, it didn’t captivate me very much. I was old enough that I was more interested in the Technic type of Lego set, and there were limitations to the program that I found off-putting.

Since then, I haven’t delved into the world of Lego CAD until this month. I bumped into Bricksmith while searching for something, and decided to download it. Brick Smith is an unofficial Lego CAD program. I read about it  years ago, but never gave it a chance. I downloaded the newest version and was blown away. It uses an extensive library of Lego pieces (from ldraw.org) which include pretty much every Lego piece I’ve ever seen as well as the various prints for these pieces dating all the way back to the 70’s.

As an exercise, I built a T-16 Skyhopper. It went together pretty easily. Bricksmith has some convenient features, as well as some limitations. Everything is grid aligned, and you can move and orient pieces along these divisions. There doesn’t appear to be any concept of mating and piece intersection (which could be seen as a good thing or a bad thing). There is certainly lots of freedom. Once you pick a part, you place it, and you can move it using the arrow keys and rotate it, and select a color. You can copy and paste pieces too.

I’m not enamored with the coloring process. In this case, the problem is that there are so many colors to choose from, that finding them can be tedious.

What I found really neat was the concept of grouping. The pieces can be grouped into steps. Once you complete your model, you can then print the steps out. Step reordering and modification seemed pretty straightforward too.

As a whole, this program is pretty amazing.

While playing with Bricksmith, I spent some time googling to find out more about it, and ran into Lego Digital Designer (LDD), the official Lego CAD system. I somehow had never heard of it even though it was introduced in 2004, so I decided to give it a whirl as well. I played around doing some free builds, and then built a MicroFighter X-Wing.

The experience was very different from Brick Smith. At first, I was annoyed that all the color variation of pieces are displayed as separate pieces int he parts bin, but it actually made getting the correct pieces faster and easier. The other thing I love is that pieces automatically mate to each other. By dragging the piece around with the mouse, the piece automatically snaps to surfaces that are appropriate for mating. This can be faster. Unfortunately, I haven’t found a way of moving a piece directly with the arrows as one can do in Bricksmith. Generally, the auto snapping works well, and if you can’t get it to snap right where you want, usually rotating the camera can do the trick.

The program also knows when two pieces can hinge. The hinge tool is very impressive! After getting comfortable with that, I decided to do a bigger build to put LDD through it’s paces.

The Millennium Falcon. This is one of the larger Lego sets, at over 5,000 pieces. It is no longer sold, and as such, I never had the opportunity to build it in real life. This seemed like a fun way to dive in and see how the program handled. I had the PDF instructions and LDD on screen side by side.

I began constructing this set investing bits of time here and there. Along the way, I fought with some apparent limitations of the program (or it’s user).

However, I did finally complete the model within about a week’s time.

The automatic mating of pieces is a huge time saver when it works. Unfortunately, when there is an intersection problem, the selected pieces are transparent indicating that they can’t be placed. I wish it would highlight the intersection problems in red as it can be difficult to discern where problem areas are. When there are alignment issues, the program is very strict. There are no integrated physics, so hinged pieces don’t fall into place, but stay wherever they are placed. All of the exterior sheets of the Falcon had to be hand adjusted in place to make it fit together.

In some cases, the strict alignment prevented me from following the instruction precisely. In the example above, the hinge pieces are not allowed to bend beyond 90 degrees. In real life, you can forcibly bend them a bit further allowing this configuration shown in the instructions on the left. On the right, you can see that the holes are just barely misaligned, preventing the axle from being inserted.

In other case, I was probably too hasty in finding the proper alignment for elements, and improvised modifications to the model. In the above image, you will note that the angled wing shapes had to be shortened because they were interfering with the adjoining side. This could probably have been resolved by manipulating all the joint angles.

Overall, the tool seems very powerful, and fun. LDD is easy enough to use, that my seven year old can build things on his own, for example, this small Millennium Falcon. The hinging tool and part placement is intuitive enough that he only needed to observe me using the tools a few times to get it, and then be able to do it on his own.

One thing to note though is that some of the part categorization in LDD seems illogical (or at least, not how I would do it). There is a category that appears to be the catch-all for hard-to-classify pieces, and I find myself sifting through there quite often for specific things. Also, one category with an icon of a small wing is in fact home to flat angled, round, and curved pieces, and not just wing shapes which I find bewildering. They were kind enough to include a search feature that lets you filter by part number, size or description. I have had multiple instances where searching by part number provided by the instruction yields no result, yet I could find the part by visual searching through each category.

It’s also been fun using these programs to be able to build sets that are no longer available. While LDD has an easy-to-use UI, and fancy mating and hinge logic, Bricksmith has a superior part catalogue and flexibility for piece placement.

© 2007-2015 Michael Caldwell