Update (2019): While this approach still works, it is more common to use other file formats for website icons, such as png's.
To create favicon.ico, you don't need anything other than ImageMagick.
brew install imagemagick
sudo apt-get install imagemagickUse it to convert .png's into .ico (use 32px and 16px sizes for retina compatibility).
convert favicon-32.png favicon-16.png favicon.icoYou can even use it to generate a 16px version from a 32px:
convert favicon-32.png -resize 16x16 favicon16.png