My Cure For Insomnia

Recently I've experienced one of the worst sleepless nights, due to disrupted bedtime regime. I was laying in bed for 7 hours and only slept for an hour or so, it was torture. The main problem is that I tend to code or play games for too long or watch something long into the night. Night owls get insomnias, it turns out. The first part of the solution that came to my mind is to automatically shut down the PC at midnight. Here's the Windows command: schtasks /create /tn ShutdownNightly /tr "shutdown -s -t 360" /st 00:00 It works perfectly, I've tested it at least two times. Now, in the bedroom a new enemy awaits - a smartphone. A friend of mine suggested that it might be useful to set up parental controls on the router so that any device on the network doesn't get internet after midnight, so I did that... From my phone. In bed. Oops... I've set it up so that network goes back online just before work, so that I have plenty of morning time to make a good breakfast, exercise, etc without much distractions. I might tune it down, but we'll see. In my case, the router solution works (for now), because I use a spare phone in the bed, which doesn't have a SIM card in it. Otherwise, I don't have hopes. No WiFi? Pff. "Hey Siri, turn on 5G... OK Google, open YouTube..." You get the gist. Nothing stops me from accessing the router settings from my SIMless phone though but we'll see. There's still room to improve. It would be better to lay in bed without a phone, and better than that, with no devices at all. I'm not on that level yet: I can only sleep if I'm listening to music. I know that's not great, but oh well... One step at a time. I have a bonus tip for you: Set up an alarm which will ring in the other room, so you'll have to stand up and walk in order to disable it. It really works. Well, to a certain extent... Nothing stops you from going back to bed after standing up, walking and disabling the alarm, but hey! It really is better than just hitting snooze without even opening your eyes. I did that countless times in my life. Good night and sleep tight!