A small portable generator is one thing but linking into your fixed wiring is another - its very complex and specialist work.
Buy a small UPS for the PC - it will allow the PC to shut down gracefully. (Most UPS do this automatically too). Torches, Wind up radios, candles, camping stoves...