Zend certified PHP/Magento developer

Get used and unused attributes

I want to get list of attributes (not only products or catagories) that are used and that are not use.
I try this Delete unused attribute values one but it’s only for product attribute, this is for delete but I don’t confirm it’s working correctly and it’s also a simple SQL query but I want Magento orm query.