Live data from Hacker News

How to programmatically find out if computer is on

haiku-os.org

161–170 of 197 posts

Re: How to programmatically find out if computer is on

#161

While it is clearly a joke, it has a legitimate use as a syscall that does nothing so can be used to test the syscall process itself [1]. (Its cousin `is_computer_on_fire` is not a syscall.) [1] https://github.com/haiku/haiku/commit/ccaac177f64038c160de6f...

Why isn’t is_computer_on_fire a syscall? That’s fascinating that two joke functions differ so dramatically.

Re: How to programmatically find out if computer is on

#164
post #135

Earlier quoted context omitted.

I think the parent means that you should be able to talk to the NIC about the computer, without the NIC needing to get the CPU powered on so that the CPU can tell the NIC what to do. Like a very-minimally-functional BMC.

That's AMT, provided by Intel ME. As far as I'm concerned ME-equipped NICs should unconditionally be behind VPNs, but the AMT functionality itself is really cool. Even the 10+ year old machines that don't support VNC let you remotely hit CTRL+ALT+DEL, issue an ACPI shutdown, perform a hard reset (equivalent to hitting the reset button on 486-era boxen), etc. So basically you can do either soft or hard shutdowns or re…

Can it enter the password required to decrypt my LUKS partition?

Lately this has been my biggest barrier to leaving a computer fully remote.

Re: How to programmatically find out if computer is on

#165

// power cycle computer bool was_on = set_computer_on(true); // returns prior value if (was_on) { set_computer_on(false); set_computer_on(true); } else { // was previously off, is now on: nothing to do! }

Have you tried turning it off and on again?

Re: How to programmatically find out if computer is on

#167
post #164

Earlier quoted context omitted.

That's AMT, provided by Intel ME. As far as I'm concerned ME-equipped NICs should unconditionally be behind VPNs, but the AMT functionality itself is really cool. Even the 10+ year old machines that don't support VNC let you remotely hit CTRL+ALT+DEL, issue an ACPI shutdown, perform a hard reset (equivalent to hitting the reset button on 486-era boxen), etc. So basically you can do either soft or hard shutdowns or re…

Can it enter the password required to decrypt my LUKS partition? Lately this has been my biggest barrier to leaving a computer fully remote.

You could use a Mainboard with an IPMI module and KVM-over-LAN functionality. This way your are able to do everything remote, including mounting isos to install a new system and ofc you could use it to enter your password for the encrypted partition.

Re: How to programmatically find out if computer is on

#168

Earlier quoted context omitted.

It looks like you haven't heard of quantum computing

The computer is only on or off when you measure it.

I propose to optimize it so that it's off all the time. And switches on and does something only when measured.

(And please stop calling me lazy.)

Re: How to programmatically find out if computer is on

#169
This is actually a good example to explain the concept of undecidability in computation theory. If you get a True you know for sure that the computer is on. If you don't get anything immediately, it may be that the computer is on but really slow to answer or it may be off and never going to answer. But you'll never be sure, thus its state is undecidable in this case.

Re: How to programmatically find out if computer is on

#170

Why would is_computer_on_fire() return a double and not true/false? Even for a joke function, this seems like bad practice. If the function is named is_state(), I expect a boolean return. > Returns the temperature of the motherboard if the computer is currently on fire. Smoldering doesn't count. If the computer isn't on fire, the function returns some other value.

Maybe it’s a probability function. Something like “hey there’s a .7 percent chance your computer is engulfed in flames”

Constant probability function. (Please be precise!)
Post reply on HN