Live data from Hacker News

How to programmatically find out if computer is on

haiku-os.org

181–190 of 197 posts

Re: How to programmatically find out if computer is on

#181
post #180

Impl code here[1]: int32 is_computer_on(void) { return _kern_is_computer_on(); } double is_computer_on_fire(void) { return 0.63739; } [1] https://github.com/haiku/haiku/blob/master/src/system/libroo... Was used by the Haiku doc, namely "System calls"[2], as an example. [2] https://www.haiku-os.org/documents/dev/system_calls/

Leh, 0.63739 means "on fire"? Any conversions?

Re: How to programmatically find out if computer is on

#183
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.

look into tang and clevis.

Re: How to programmatically find out if computer is on

#185
post #113

Earlier quoted context omitted.

I admire for how you nerdsniped several other comments without anyone noticing the platform, or how "halt" would drop you into console monitor on said platform. My standing ovation to you :D (The platform is Alpha, right? Given the prompt and name for the console, though it was SRM, not SRE) :)

SRM it is. Thanks! (Alpha) System Reference Manual: https://en.wikipedia.org/wiki/System_Reference_Manual Funny thing, for some historic reason, the system terminal attached to cabinet with those memorable Alpha Servers was of the monochrome lineage, but the phosphors color was orange. So the >>> prompt was unmistakably a carrot one! However it would rarely be seen, as bulk of the time the console would busily beep a…

Orange, or more specifically Amber, was one of the popular options for monochromatic terminals from Digital and not only. Personally I had an amber VT510 attached to my AS255/233, and that one was essentially a budget model (effectively a slightly upgraded VT220 with PS/2 keyboard) and was apparently common choice for system console with Alphas. Unfortunately from what I heard default text mode on colour displays when using them instead of serial console was apparently white-on-blue (familiar from winnt BSOD among other things).

Interestingly enough, there are few systems in Alpha lineage that have what's known as "external console", meaning that instead of running SRM on the normal CPUs, they had separate frontend processor and main cpus only had shims to communicate with it. Marvel was one of those, but apparently there were older ones as well.

Also, if you had partition-capable Alpha, the carrot prompt would be made into Pxx> where xx referred to currently selected cpu. With VMS, you could then boot into "VMS Galaxy" mode where you had multiple VMS systems running without hypervisor, just with all of them carefully avoiding stepping on each others' resources.

Re: How to programmatically find out if computer is on

#186
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.

I have followed this guide: https://blog.buettner.xyz/luks-verschlusseltes-ubuntu-20-04-...

Re: How to programmatically find out if computer is on

#187
post #164

Earlier quoted context omitted.

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

Store the LUKS crypto key in the TPM, and make sure secure boot is used so the TPM will only reveal the key if the systems boot chain is verified.

Nope. That's dangerous, TPM keys can be sniffed on the bus: https://trmm.net/tpm-sniffing/

Re: How to programmatically find out if computer is on

#188
post #89

While this is a joke, there are some contexts in which it does make sense to ask whether the computer is on. For instance, most laptops have an embedded controller which runs all the time, even when the laptop is powered off, and manages things like battery charging and the power state. Within that embedded controller, an is_computer_on() function could legitimately return "false".

Sure. Every Dell server's iDRAC and every Oracle's ILOM has this functionality.

Re: How to programmatically find out if computer is on

#189
post #171
post #164

Earlier quoted context omitted.

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 can embed a minimal ssh server (like dropbear or tinyssh) in your initramfs to remotely enter the passphrase. There are some guides for that online

Yes, this works. I have it set up for some servers that have encrypted hard drives.

Re: How to programmatically find out if computer is on

#190
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.

If you can fiddle around and get the VNC functionality working, then as long as you have it behind a bastion host you basically have insta-BMC.

I kneejerk-recommend a bastion host because a) Intel ME, and b) there was that all-0 password bypass a while back and uhhh yeah who knows what other "sneeze correctly and the leaf falls over" knock sequences there are.

SSH port forwarding, VPN, RPi running the remote-access AMT web UI thingy (runs on Linux, forget what it's called) behind nginx with authentication... you get the idea.

Post reply on HN