Germany - Ottoman Alliance
No, German-"Otto" alliance was not the result of a single "unexpected" event, organized by a small cadre through the bombing of a Russian port. Otto had no other choice. See here
If the Germans had reasons to look glum in 1914, the Ottomans were even more justified to be disheartened. The Empire appeared in the process of dissolution... Balkan Wars of 1912-1913 had almost terminated Ottoman presence in South-Eastern Europe — which in some places had lasted well over 500 years. The Ottoman government was well aware that for much of the 19th century Great Power rivalry, not Ottoman military and diplomatic strength, had maintained the Empire. The reckoning was simple: as long as the “Concert of Europe” existed, in the sense of an equilibrium between the Great Powers, the Empire was reasonably safe. Should war break out, the future was bleak: regardless which camp (Triple Entente or Triple Alliance) would emerge victorious, the Empire’s days would be numbered: the victors would share the spoils among themselves. Thus it was vital for the Empire to conclude an alliance with a strong industrial and military power, which would serve as a protector after the war.
Finding allies was easier said than done: the Empire seemed to have nothing to offer either economically or militarily. Russia declined the offer; France did likewise. Germany, however, accepted: alliance was concluded on August 2, 1914.
The reason wasn't an ideological similarity that all of a sudden changed from one regime to the next either, just plain ol' need and desparation..