Micro and nano patternable magnetic carbon