Certain scriptures address Lord Hanuman as Ekadash Rudra. He is an Ansh Avatar of Lord Shiva. This avatar took birth to aid Lord Rama, an avatar of Lord Vishnu to slay Ravana. Ravana was a Shiva devotee and the grandson of Lord Brahma. Since Lord Shiva could not slay his devotee, he took Ansh Avatar of Hanuman.
Although there are many legends associated with Lord Hanuman being a form of Lord Shiva, legend as per the Devi Bhagavatam goes like this.
After Sati gives up her life, Lord Shiva ‘s anger knows no bounds. Shiva's rage became so intense that he took the corpse of Sati and wandered around the universe. To reduce Shiva's grief, Shri Vishnu cuts Sati's corpse into different pieces. When Shiva realizes that his beloved wife is cut to pieces by Lord Vishnu, in his anger he curses Lord Vishnu to suffer the same fate.
Later Shiva realizes his mistake and feels regretful. He assures Shri Vishnu that when he would suffer the same fate which Shiva had to go through, he would take a form (Lord Hanuman) to reunite Vishnu (Lord Rama) with his beloved wife Sita, which actually takes place in the Ramayana.
This is how Shiva himself took the form of Hanuman to help Sri Rama in his battle with Ravana to rescue Sita and reunite her with Sri Rama.
Ganesha, also known as Ganapati, is immediately recognisable as the elephant-headed god. He is the god of wisdom and learning, as well as the remover of obstacles, and consequently the sign of auspiciousness. It is customary to begin cultural events, for example, by propitiating Ganesh, and older Sanskrit works invoked his name at their commencement. Ganesh is said to have written down the Mahabharata from the dictation of Vyasa. He is the lord (Isa) of the Ganas or troops of inferior deities, but more well-known as the son of Shiva and Parvati. He appears as a pot-bellied figure, usually but not always yellow in color. In his four hands, he holds a shell, a discus, a club, and a water lily; his elephant head has only one tusk. Like most other Indian gods, he has a ‘vehicle’, in his case a rat: this rat is usually shown at the foot of the god, but sometimes Ganesh is astride the rat.!