TarPit not working in Mavericks
I have this alias in my ~/.bash_profile:

alias tarc='COPYFILE_DISABLE= tar --exclude .DS_Store -c'


It can be used like tarc -zf directory.tgz directory or tarc -f directory.tar directory.

Setting COPYFILE_DISABLE tells tar to remove extended attributes, ACLs, resource forks, and Finder information. tar uses AppleDouble files (the files that start with ._) to store metadata by default, and it also knows how to convert metadata stored in AppleDouble files back to the native formats, but unarchiving applications on other platforms usually keep the ._ files.

$ touch a;xattr -w key value a;tar -cf a.tar a;tar -tf a.tar
./._a
a
$ COPYFILE_DISABLE= tar -cf a2.tar a;tar -tf a2.tar
a