Show HN: Twitch Installs Arch Linux – A cooperative text-based horror game
141–150 of 266 posts
Re: Show HN: Twitch Installs Arch Linux – A cooperative text-based horror game
#142If you want an easy to understand video on Installing Arch Linux in 15 minutes: https://youtu.be/_fBIeKQSiAc
Re: Show HN: Twitch Installs Arch Linux – A cooperative text-based horror game
#143If you want an easy to understand video on Installing Arch Linux in 15 minutes: https://youtu.be/_fBIeKQSiAc
Re: Show HN: Twitch Installs Arch Linux – A cooperative text-based horror game
#144Earlier quoted context omitted.
It looks like there is a system reset command that can be voted for.
What's the worst that could happen?
Re: Show HN: Twitch Installs Arch Linux – A cooperative text-based horror game
#145This is brilliant - I imagine they'll have to hope the incessant "rm -rf *" commands don't get spammed, if they are running under root. Looking forward to it.
...
This will be fun.
Re: Show HN: Twitch Installs Arch Linux – A cooperative text-based horror game
#146Re: Show HN: Twitch Installs Arch Linux – A cooperative text-based horror game
#147Earlier quoted context omitted.
Why would it have to be the exact millisecond? "$(date)" will have that value for 1 second, assuming the format is correct. There is some very small timespan in which it could fail, but the chances are very much in favor of successfully exiting the loop.
`sleep` sleeps for seconds.
`time sh -c 'if [ "$(date)" != "Sat Oct 31 16:00:00 EDT 2015" ]; then sleep 1; fi'` took around 1.010 seconds on my machine, but that includes starting a new shell, so there's probably a much smaller than 1% chance that that particular second will be missed.
EDIT: here's a little program to test this:
#!/usr/bin/env bash
while true; do
target=$(expr $(date +%s) + 2)
while true; do
now=$(date +%s)
if [ "$now" != "$target" ]; then
if [ "$now" -gt "$target" ]; then
echo "FAIL :("
break
else
sleep 1
fi
else
echo "OK! :)"
break
fi
sleep 0.1
done
done
Adjust the "sleep 0.1" to increase or decrease the perecentage of failures. Remove to see that it (almost) never fails.Re: Show HN: Twitch Installs Arch Linux – A cooperative text-based horror game
#148Re: Show HN: Twitch Installs Arch Linux – A cooperative text-based horror game
#149Earlier quoted context omitted.
Why would it have to be the exact millisecond? "$(date)" will have that value for 1 second, assuming the format is correct. There is some very small timespan in which it could fail, but the chances are very much in favor of successfully exiting the loop.
`sleep` sleeps for seconds.
Re: Show HN: Twitch Installs Arch Linux – A cooperative text-based horror game
#150Earlier quoted context omitted.
What's the worst that could happen?
This is a good point. When I first got dropped to a shell in a broom/IT closet, I thought gees I hope I don't accidentally fuck anything up. 4 days later I had to acknowledge I could barely intentionally fuck anything up.