(
    curl -s http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types \
    | tail -n +16 \
    | sed -r \
        -e 's!^(# )?([a-zA-Z0-9+._-]+/[a-zA-Z0-9+._-]+)(\s+[^ ]+)*\s*$!\2!g' \
        -e t -e Q1
    
    cat /etc/mime.types \
    | sed -r \
        -e '/^#/d' -e '/^$/d' \
        -e 's!^([a-zA-Z0-9+._-]+/[a-zA-Z0-9+._-]+)(\s+[^ ]+)*\s*$!\1!g' \
        -e t -e Q1
) \
| sort -u \
| tee /tmp/mime.txt \
| sed -r -e 's!^(.*)$!\1; x-open %s %t!g' \
| cat >/tmp/mailcap.txt