Disabling NAT and Host-Only Adapters in VMWare Fusion 3.x

 I use VMWare Fusion on my Mac to run Windows on occasion, and hate having the extra 'vmnet1' and 'vmnet8' interfaces active even when I'm not running VMWare.  It causes all sorts of weird problems with Bonjour when the wrong interfaces start responding to requests.  In addition, VMWare uses the 172.16.0.0/16 network for their private interfaces -- which also happens to be the main network at my office.  This is a bad thing.

I don't need the NAT and Host-Only interfaces, because I use bridged networking. If you are using NAT or Host-Only, you need these interfaces -- although I do recommend switching to bridged networking, if only so your Windows instances will show up on the same network as your Mac and you don't have to deal with port forwarding. Of course, having Windows on the same network as your Mac could be dangerous -- so unless you understand the security risks involved with Windows... you should probably stick with NAT.   more...

Adding missing GPG keys to Ubuntu

When you add external repositories to your Ubuntu /apt/sources.list, you will sometimes get errors such as:

W: GPG error: http://dl.google.com stable Release: The following signatures couldn't be verified
because the public key is not available: NO_PUBKEY A040830F7FAC5991

This simply means that apt-get/aptitude cannot find the external GPG key in your keychain.  This is not a big deal, as long as you are sure the sources you have added are legit.

Just run this command, and it will automagically add every missing GPG key to your keychain:

1
sudo apt-get update 2&> /tmp/keymissing; for key in $(grep ¨NO_PUBKEY¨ /tmp/keymissing |sed ¨s/.*NO_PUBKEY //¨); do echo -e ¨\nProcessing key: $key¨; sudo gpg --keyserver subkeys.pgp.net --recv $key && sudo gpg --export --armor $key | sudo apt-key add -; done

Mac: Add additional "Recent Items" stacks to the Dock

By default you only get one, and you can select Recent Applications, Recent Documents, Recent Servers, Favorite Volumes or Favorite Items. Leopard forces you to pick one. Well, I wanted more than one, so I ran the following command in Terminal:

1
2
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }'
killall Dock

And a new Recent Items stack appears. Just right click and set it to whatever you want it to be. To delete it, just drag it off the dock.

Splitting up an IP address in bash

I wanted to split up an IP address in BASH so I could use it in my pppd ip-up script to check for a certain DNS server. Because the DNS server itself seemed to change a lot, I just wanted to check on the first three quads.

Assuming the IP address comes in on $DNS1 (as it does in /etc/ppp/ip-up):

1
2
DNSIP=(${DNS1//./ });
#IPADDRESS=${DNSIP[0]}.${DNSIP[1]}.${DNSIP[2]}.${DNSIP[3]}

Mac OS X + Bonjour + Apache = Developer Bliss

I always forget about Bonjour. It's one of those neat little Apple technologies that would really make the world a better place if more systems supported it.

What is it?

In a nutshell, Bonjour lets your computer see all available services on all other computers in your local network. This information doesn't go out on the internet (although there is a thing called Wide Area Bonjour which I haven't looked into much yet).

Example of Bonjour + Apache   more...

Clearing the Mail.App "Recently Sent" address list on Mac OS X Leopard

Over the past few months, several of my friends have changed their email addresses. Even though I updated the address in my Address Book, the old address still shows up when I try to write an email -- autocomplete pulls up the old address. So how the hell do I delete those old addresses?

This is one of those stupid little annoyances that I've been trying to find an answer to.. and like most Apple things, the solution is glaringly obvious.   more...