At home I have an APC Back-UPS CS500 UPS (BK500) to ensure my systems have just enough time to power down gracefully when a poweroutage occurs (or keep working until the battery runs out). It includes a USB cable which you can connect to a machine (works perfectly with apcupsd) so the Operating System knows that the power is gone and you are running on battery power.
A few weeks ago I heard an unknown beep when I got coffee. Being curious I followed the sound and it was the UPS. We had bad weather and it included lightning. I didn't notice the power outage yet, because only 1 power group was out and it was the one connected to the UPS. I reset the power breaker and everything was good.
Sitting behind my desk again, I noticed my Raspberry Pi's were rebooted, so my irssi instance was gone. It is not a big deal, just annoying. So next time a power outage happens, I want the Pi's to power down gracefully as well.
The challenge is that the UPS has IEC 60 320 C14] (C14 is female) connectors and Raspberry Pi's need 5V of power. Since I don't want to lose flexibility, but want a cheap solution, I thought of a simple solution. Cut open a normal C14-C13 cable, cut open a power strip and wire the C14 plug and the powerstrip together. That way, I can use normal (and already owned) 220V to 5V adapters and have multiple normal 220V power sockets available. A little time, some soldering and a bit of insulating tape later, it was done. Profit :)