Monthly Archives: April 2009

Upgrading Ubuntu Server 8.10 (Intrepid) to 9.04 (Jaunty)

Now that Ubuntu 9.04 (Jaunty Jackalope) is out I decided to upgrade a few of my servers from 8.10 (Intrepid Ibex) to the latest release. To upgrade via the command line follow these steps (as root or via sudo):

aptitude update
aptitude safe-upgrade
aptitude install update-manager-core

This will get your system upgraded to the latest packages of 8.10 and install the scripts to move to Jaunty. Be sure you have screen installed as well — Ubuntu does not like having upgrades interrupted so you want to be able to resume if your session is interrupted for any reason.

screen do-release-upgrade

It will download and check a few things and then warn you about operating an upgrade over ssh (along with starting an extra ssh daemon on port 9004). Simply follow the instructions from there and you’ll have a fully upgraded server!1

cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.04
DISTRIB_CODENAME=jaunty
DISTRIB_DESCRIPTION="Ubuntu 9.04"
  1. Bear in mind that during the upgrade you will occasionally be asked questions about config files, so don’t try to run this upgrade unattended.

RAM Disks in OS X

If you’ve ever wanted to set up a ramdisk in Mac OS X, here’s a quick script you can use. Simply invoke it with a size in MB and the name for your volume and it will create and automount it for you. It also won’t leave any dangling directories in your /Volumes/ when you eject it! Be sure to chmod the file you place the script in to make it executable (755 or likewise).

#!/bin/bash
if [ -n "$3" ]; then NUM_ARG=ERR; fi
if [ -z "$1" ]; then NUM_ARG=ERR; fi
 
if [ -n "$NUM_ARG" ];
then
echo 'Usage: ./ramdisk <size in MB> <name, optional>'
exit
fi
SIZE=$1
NAME='my_ramdisk'
let "SIZE *= 2048"
if [ -n "$2" ]; then NAME=$2; fi
diskutil erasevolume HFS+ "$NAME" `hdiutil attach -nomount ram://${SIZE}`
echo 'Done'

Subversion Global Ignores

If you’re a Mac OS X user running Subversion on the command line and mounting remote disks you may have run into instances where you want to globally ignore ._*, .AppleDouble, and *:2e_* files. To do this simply open your Terminal and edit your ~/.subversion/config file and look for the line below.

#global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store

Uncomment it by removing the # and add the necessary additional exclusions and it will now look like this.

global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store ._* .AppleDouble *:2e_*

Save it and you’re all set. Now you won’t need to edit your svn:ignore property for every project!

,

Firefox Autoenrollment With A Microsoft CA

If you’re running a Microsoft CA and you want to be able to accept enrollment requests from clients supporting keygen (Firefox, Safari, Opera, et cetera) you’ve probably found that the /certsrv/ page allows enrollment, but the requests fail when you attempt to issue the certificate.  This is because the server is not parsing the subject attributes from the request.  To fix this, run the following on your server as administrator on the command line.

certutil -setreg ca\CRLFlags +CRLF_ALLOW_REQUEST_ATTRIBUTE_SUBJECT

You can also set your server to auto-issue on request for certain certificate profiles.  To do this add the CA snap-in and get properties of your CA. Under the policy module tab click properties again and click the “Follow the settings..” radio button.
add-snapinmmc

propertiesrequesthandling

MLB.tv NexDef On OS X

I have found myself growing tired of paying for cable TV, so this year I wanted to see if I could use MLB.tv as a replacement. One of the major new features MLB is marketing for MLB.tv in 2009 is called “NexDef” and purports to provide an HD stream along with DVR functionality. How could I go wrong?

As it turns out, NexDef runs as a daemon on both Windows and Mac (it uses Autobahn). There is a shell app that launches at boot and invokes a Java http server. Leaving aside the ugliness of the whole solution, having it running constantly in the background is beyond obnoxious. Plus, even when you’re not watching a game it will occasionally consume large quantities of CPU and bandwidth.1

With that in mind I decided to tear apart the installation on OS X to find the jar it uses. If you already have the app installed, check in ~/Library/Application Support/Swarmcast (that’s your home directory’s library directory) and find autobahn.jar. Pull this out and then run the uninstall command located in the same directory to remove the launchd agent and other garbage it has placed on your system. At this point you can now just invoke the autobahn.jar with Terminal.app. As soon as the Jetty server comes up MLB.tv will detect it and everything will work.

java -jar /path/to/autobahn.jar

When you’re done just hit ctrl-c in your terminal window and it will stop!

Update: For those of you finding this page searching for Linux NexDef support, you can invoke the autobahn jar on the command line in Linux and (provided that you have Java 1.4.1 or later installed) it should work properly.

  1. Of course, Flash (even 10) on OS X is miserable, so NexDef at maximum quality takes all of one core on a 2.4GHz C2D MBP

Ubuntu 9.04 (beta/RC/final) In VMware Fusion

Update 10/26/09 Ubuntu 9.10 (Karmic Koala) is about to be released, so check out the new guide for that version.

Update 4/25/09 Ubuntu 9.04 (Jaunty Jackalope) final was released a few days ago so I grabbed it and rebuilt my VM. I don’t recommend using the “easy install” option at this time, so uncheck that and run through the Ubuntu installer by hand. There are only 7 steps and you can leave everything default if you want. Once installed you can follow the instructions below (including the vmmouse install) to get it all up and running.

Update 4/21/09: RC is now out and to get mouse ungrab working you can simply run this command:

aptitude install xserver-xorg-input-vmmouse

Be sure to aptitude update to get the latest package lists. I’ll do a new post when Ubuntu 9.04 is released in a few days. Be sure to check the comments of this post for other takes on getting this working properly!

Now that Ubuntu 9.04 has gone into beta I decided to build up a quick VM for random testing purposes.  Installation is very straightforward: simply download the x86 or AMD64 CD image and install. However, since this is a beta things are in heavy flux — I would highly recommend upgrading to the latest packages before installing the VMware Tools since several bugs (like the infinitely multiplying window when mounting the VMWare Tools image) have been fixed.

Select “Install VMware Tools” from the Virtual Machine menu and then copy the tar to your Ubuntu desktop.  Running the vmware-install.pl as superuser will net you a mostly functional system, but drag/drop files and mouse ungrab will not work.1

To get VMHGFS working (drag/drop file sharing), you will need to follow these instructions:

  1. Navigate to vmware-tools-distrib/lib/modules/source and untar vmhgfs.tar.  Inside the vmhgfs-only directory that is created there is a file called page.c.
  2. Edit this file and do the following2
    -    page = __grab_cache_page(mapping, index);
    +    page = grab_cache_page_write_begin(mapping, index, flags);
  3. Move the vmhgfs.tar file to vmhgfs-old.tar and create a new tar with the modified file
    tar cvf vmhgfs.tar vmhgfs-only
  4. Run the vmware-install.pl script (as superuser)

At this time I haven’t managed to get mouse ungrab working, but let me know if you figure out a way! The vmmouse driver for X.org is available via apt-get install xserver-xorg-input-vmmouse, but does not appear to work any better than the one that comes with VMware Tools 7.9.3. Hopefully a driver compatible with X.org 7.5 shows up soon.

  1. You may need to run sudo apt-get install build-essential to get the basic build environment. I don’t remember if I did this when building mine.
  2. For those unfamiliar with diff syntax, remove the first line and replace it with the second line.