Make any printer AirPrint compatible

At home, we were missing the ability to print from our iPad or iPhones. While I’m not an OS zealot (anymore), I did upgrade to an iPhone last month, and have had an iPad for a while now. They’re very useful for casual computing, checking email, browsing. But if we needed to print something, it was a hassle to fire up a laptop or desktop computer to use our networked printer.

It turns out that Apple’s AirPrint uses DNS Service Discovery, an open standard.  There are programs out there for Windows and Mac to let you share a printer attached to that OS via Airprint.  It turns out, you can use it on Linux if you run the Avahi daemon and CUPS. Of course someone has already figured out how to do it: CUPS with Apple AirPrint, using a python script airprint-generate.

I was following the instructions, but the program would not generate the XML file to make it all work. Diving into the code, I saw that the printer had to be configured as a shared printer in CUPS, which makes total sense. I didn’t have it configured that way, since its a network printer, any other device could connect directly to the printer server. The setting can be changed through the cups web interface or by adding the line below to your printers.conf file. will now find your printer and generate the configuration file to add to your avahi services directory.

Shared Yes

The one downside to this setup is that the computer running cups + avahi has to be on for this to work. But, you could buy an inexpensive ARM device, like the upcoming Raspberry PI or another one listed here and build yourself a custom, Airprint compatible printer server.


HOWTO: Use VirtualBox to setup an Internet Explorer testing machine

There are a lot of cases where having one computer just isn’t enough. If you’re a web developer or webmaster, you’ll want to view your website in more than one browser. If you’re a PHP programmer, you may be itching to check out the new 5.3 release and test your web applications on it. Using virtualization, you can set up self-contained instances of any Operating System configured to your heart’s content on your computer.

There are a lot of virtualization environments out there. VirtualBox is an Open Source virtualization solution from Sun. I particularly like that it runs not only in Linux, but also on Mac OS X and windows. In this post I’ll show you how to set up VirtualBox with disk images supplied by Microsoft for testing Internet Explorer compatibility in OS X. The instructions are based on this article for setting up VirtualBox in Ubuntu.

Download supporting files and utilities

To get each environment setup, you’ll need a few files and tools installed to get everything working.

1. Install RAR

Download the RAR Utility for Mac OS X, as of this writing its labeled RAR 3.90 beta 3 for Mac OS X. The download file is a .tar.gz file. In OS X terminal you can use tar -xvzf rarosx-3.9.b3.tar.gz to extract the files. Next, you’ll want to copy the extracted files to /usr/local/bin/ or anywhere else that is in your $PATH.

2. Install Burn

We’ll need to create an .ISO file for the networking drivers expected by the Windows images. Burn 2.3u is a free and straightforward tool for burning disks or creating disk images. Simply download it and drag it into your Applications folder.

3. Download PCNET Drivers and create ISO file

Since we’ll want our virtual Windows machines to get on the Internet, you’ll need to download the correct drivers from AMD. Download the ZIP file labeled NDIS5 Driver dated August 2004 and unzip them somewhere. Launch the Burn application and drag the PCNET files from where you extracted them into the Burn app. To create the ISO file, select "Save Image" from the File menu. Save the ISO file somewhere where you’ll remember it, as you’ll need it later.

4. Install VirtualBox

Head on over to the VirtualBox downloads page and download the binary for OS X hosts. Double click on the disk image (dmg) file to mount it, and double click on VirtualBox.mpkg to run the installer. Once installed, VirtalBox will be in your Applications folder.

Setup Windows XP Images in VirtualBox

If you’ve made it this far, you should have VirtualBox installed and all the tools for setting up a Windows XP or Vista image. Repeat this part for each XP Image you want to install, MS provides a number of images combining XP/VISTA with IE6/IE7/or IE8.

5. Download a Windows Image.

Select an image to download from the Internet Explorer Application Compatibility VPC Image page. These images are fairly large, the smalles is 465MB.

6. Extract the .vhd file from the image

Microsoft’s VPC images are mean to be used with their own VirtualPC technology. Luckily, VirtualBox can read VirtualPC’s .VHD files. Use rar to extract the files from the .exe or .rar file you download, as follows.

unrar e IE6-XPSP3.exe

7. Create a new VirtualBox machine

Now that you have the disk image, launch VirtualBox and create a new machine. Make sure you select Windows XP as the Guest OS, and give it enough memory to run well. This depends a lot on how much memory your Host OS has, you can get away with 256MB but I like to give them 512MB if possible. When it asks you

When the new machine wizard prompts you for the hard disk image to use, select the .vhd file extracted in step 6.

8. Launch the new machine and install Guest Additions and network drivers

If you have your new machine setup, click on the green start arrow to boot it. You should see the Windows boot sequence and eventually you’ll get to the Windows desktop. You’ll get prompted a hundred times to install new hardware and connect to Windows update, but just hit cancel until Windows stops trying to be helpful.

First, install the Guest Additions which provide a more seamless transition between Host and Guest OS by clicking on "Install Guest Additions" in the Devices menu

Next, mount the ISO image created in step 3 as a CD. Click on Devices, then Mount CD/DVD-ROM and CD/DVD-ROM Image. Selct the ISO image and then you should see its contents in the virtual CD-ROM drive.

Finally update the network drivers to get the network card working. Select My Computer, click on View System Information, Go to System > Devices, Click on Hardware tab, then Device Manager button. Select ethernet device under Network Adapters and then right click, select Update Drivers, say no to Windows Update, then click Next. Windows should find and install drivers from the CD.

Gotchas and where to go from here.

At this point you should have a working virtual machine with network access. You can repeat steps 5-8 for other Windows images to have one or more environment for testing each version of Internet Explorer. If you do install other Windows images, be aware that the supplied MS Images may all have the same disk UUID, in which case VirtualBox refuses to add them to the Media list. Use VBoxManage to clone the disk image and generate a new UUID. You’ll have to remove the conflicting disk from the list first, and to remove it the virtual machine must be powered off. From the command line, the following will clone a drive:

VBoxManage clonehd XP SP3 with IE7 2009-Apr.vhd IE7_XPSP3.vhd XP_SP3_IE7.vhd

If you’re setting up IE testing environments, I highly recommend that you install the MS IE Developer toolbar too. It’s very helpful in diagnosing Internet Explorer behaviors.

Now that you have VirtualBox running, you’re not limited to Windows images. You can also setup your Linux distribution of choice in a VirtualBox machine. You could setup a copy of your LAMP environment for testing and expirementation.


Playing divx avi files on an Apple Mac

For a while now, digital cameras have been able to record movies along with just taking photographs.  Camera vendors use different video codecs to compress and save the video you take.  Common codecs include one of Apple’s quicktime codecs (usually saved as a .mov file) and a variety of codecs with the .avi extension.  AVI files are commonly associated with Windows Media Player.  To make the situation more confusing, movies encoded with the popular DivX codec might be saved by your camera as a. .avi file.  Unfortunately, if you’re a Mac owner, if your .avi movies won’t playback, its likely that you need to install DivX.

The X Lab has a whole page on why some .avi files may not play on Max OS X, and suggestiong for how to play them.

To further confuse the issue, many DivX-encoded files carry the .avi extension. QuickTime does not include native DivX® support, even though QuickTime 6 and later support the ISO Standard MPEG-4 media compression format and DivX is based on the MPEG-4 standard.

DivX also makes their codec available as a free download, and it can be used from any application with QuickTime exporting capabilities.

Play DivX videos in QuickTime, Front Row and many other 3rd party media players

If installing the codec solves this problem for you, please leave a comment to let me know!


Windows Vista security is a joke

You might think that apple is poking fun at windows in this latest Mac advertisement, but you’d be fooling yourself.  But judging by the comments in Very Severe Hole" in Vista UAC Design, its really a documentary, not an ad.  What’s the giant security hole – oh yeah – any installer automatically runs with administrator privileges, any installer.  Did it really take Microsoft 6 years to figure this out when both Mac and Linux already work their way?  Or is this how they innovate?


Desktop Upgrade Choices

I stayed up way too late last night researching a potential desktop replacement. I’m torn between a DIY AMD64 PC vs an Apple. Up front, the biggest decider will be price, as I want to keep the price at or below $1,000. That rules out iMac’s and MacPros, leaving the Mac Mini as my choice from Apple. That fits nicely with my plans to keep my current LCD displays, and keyboard and mouse. The only other real requirement, is that World of Warcraft has to run nicely on it. I’ve picked out the parts on NewEgg and also looked at the Apple Store, here’s how they stack up. Where possible, I’ve tried to keep the configurations as similar as possible.  On the PC parts, I did steer towards parts that got good reviews for operating quietly and coolly (is that a word), that’s why I chose the lower poer consuming AThlong 64X2 and a passively cooled video card.  I don’t want a computer that sounds like, in Staci’s words, "You’re running a jet engine".

2.2 GHz Athlon 64X2 1.83GHz Intel Core Duo
1GB 800 DDR2 1GB 667 DDR2
Hard Drive
250GB Serial ATA 160GB Serial ATA
nvidia 7600GS Intel GMA 950
Other Components
  • Re-using my current DV Dreader/CD burner
  • Bluetooth & Wifi
  • Superdrive DVD Writer
None, I’ll dual boot ubuntu and windows on it.
  • OS X 10.3
  • iLife Suite
Price (not including shipping) $755 $1,074

Is this a fair comparison? Clearly, if I can’t reuse my existing Windows license, I should factor in the cost of Windows XP ($90 OEM version), that bumps up the price to $840. Still a $200 difference. And that’s not factoring in the time to put it all together and the potential driver hunt, configuration issues, etc. On the Max side of thing, not having iLife means no iMovideHD, which has been real easy to work with. It would be nice to edit my home movies on a desktop with more diskspace and display space instead of on the powerbook. But the hardware available on the PC side, especially more hard disk space and a much, much better video card, is more compelling to me. I’m leaning towards the AMD system, but would appreciate any insight to the contrary.


Open Source Apple software on its way?

Jason says that the most interesting announcement from Apple today was the inclusion of a calendar server based on iCal. As Sandy points out in Jason’s comments, Apple will also make the code available under the Open Source Apache 2.0 license. While there have been other attempts to make group calendaring for those of us who don’t need it or really use it, one that’s centered on the iCal format may just work, given its relative ubiquity. There are other calendaring standards being hashed out, like CalDAV, but none in use. The 2-ton gorilla in this space is still Exchange, with its closed, proprietary application that works only with Exchange.

Other open source calendaring options include Scalix server and Zimbra, both provide community editions for free and special connectors for Outlook users. Scalix even works with Evolution, so I’ve been told, but I haven’t installed that yet. We’ve switched to Scalix at work and all the managers seem happy enough that they can set up meetings directly in people’s calendars and don’t have to go through the pain of coordinating schedules over email. I guess its the nature of my work that I never saw the productivity gain from a shared scheduling application. A simple calendar is usually good enough for me.

I need to go in and at least put in my telecommuting days in there to remind people that I work from home. On a side note, I’ve been telecommuting every Wednesday for well on three years now. I understand being surprised when I show up at work in the middle of the week but not the other way around. But, it did give me a chance to make people walk over to my desk when I wasn’t there, and that’d usually make Sandy laugh too. Good times …


Apple: 1 in 9 laptops sold

Lots of good numbers in today’s reuters story about Apple profits. I want to focus your brian on the fact that Apple;s share of the US notebook market had "doubled to 12 percent" in the last half of 2005. This means that 1 in 9 new laptops out there is not running Windows. More importantly, 1 in 9 new laptops is not running Internet Explorer. Think HTML and CSS standards will matter much in the near future? Discussion on Slashdot.


Mac Virus Threatdown

Mossberg answers a question in his mailbox column today, including the security threat posed by viruses to Apple’s computers (unless you choose to run Windows on it, then you’re just as vulnerable).  His assessment also applies to computers running Linux.  The common misconception is that virus writers don’t target these platforms because they are not very popular.  While this is true to an extent, it’s a disingenous argument because it ignores the fact that Unix-like systems (Max OS X is based on BSD) it’s much harder to run malicious code because the computer by default does not  use the super-user or Adminstrator account.  Its also harder to have a program execute without user intervention or permission, and even if a user does run a malicious program, it’ll only have limited access to the system and its files.

As of today, there have been exactly two documented, successful pieces
of malicious software — viruses, trojan horses, worms — that affected
users of the Mac OS X operating system, since it was released in 2001.
And these two failed to spread much, affecting probably a few dozen
people, and doing no harm. I expect there to be a small number of
additional Mac viruses this year. 


Another faithful disciple

Preach it Patty!


MacSFTP got Sandy banned

Sandy’s use of MacSFTP to connect to our server, for some unknown reason, was causing a PAM authentication failure – even though it would log him in fine.  Since I installed fail2ban to protect the server against SSH script-kiddie attacks, he got banned a couple times since a line that said "Authentication failure" popped into the log everytime MacSFTP connected to the server.  He’s switched to fugu, which didn’t cause an authentication error in the logfile.