Live data from Hacker News

Show HN: Universal Pause Button

github.com

51–60 of 174 posts

Re: Show HN: Universal Pause Button

#51
post #46

Indeed some deep nesting here. You made me remember a quickbasic program I wrote for a class back in early 90s, where I packed the whole program in a single do-loop with about 20 indent levels at it's deepest, and I loved it. But... the prof told me to never do that again :( Anyway, thanks a lot for the flashback :)

Deep nesting always bugs me too. It's so much cleaner and easier to understand (for me anyway) to identify the else case ahead of time and stop processing immediately.

http://refactoring.com/catalog/replaceNestedConditionalWithG...

Re: Show HN: Universal Pause Button

#53

Now if only there was a Universal Skip Button for those games with unskippable credits, intros or cutscenes!

One can usually just rename/delete the intro videos (*.bik) or replace them with 1s bik video file or add a commandline flag to the desktop link or a setting in the config text file. But, an universal fixing app that has some heuristics would be more convenient.

Re: Show HN: Universal Pause Button

#54

This is nice! On OSX, processes can be paused and continued too (by name via killall, and by PID via kill): kill -STOP 1234 kill -CONT 1234 killall -STOP -c "Pandora" killall -CONT -c "Pandora" A more nuanced control is to throttle down the CPU, via cputhrottle[1]. If I'm running a CPU-intensive calculation and don't want to bog down the rest of my system I will use it to give me enough cycles for Sublime Text to wor…

SIGSTOP and SIGCONT are generic Unix signals.

Where it gets more interesting is using elaborate checkpoint/restore [1] mechanisms for processes to serialize their state (open fds, watches, IPC, etc.) into an image that can then be overlayed, remotely executed, debugged and so forth.

[1] https://en.wikipedia.org/wiki/Application_checkpointing

Re: Show HN: Universal Pause Button

#56
post #34

I love this!!! The pause button was incredibly useful when trying to figure out what went wrong with DOS boot sequence. I wonder if it would be possible to include support for it in Linux kernel? Sometimes I would like to read those messages that fly over the screen (no, dmesg is not enough)...

This program doesn't pause the kernel, just the game's process. Other people in this thread have given equivalent solutions for un*x.

If you want to actually pause the linux kernel you'll have to use something like the magic SysRq: https://en.wikipedia.org/wiki/Magic_SysRq_key

Alternatively you can run the operating system in an emulator like qemu.

Re: Show HN: Universal Pause Button

#57
post #44

This is nice! On OSX, processes can be paused and continued too (by name via killall, and by PID via kill): kill -STOP 1234 kill -CONT 1234 killall -STOP -c "Pandora" killall -CONT -c "Pandora" A more nuanced control is to throttle down the CPU, via cputhrottle[1]. If I'm running a CPU-intensive calculation and don't want to bog down the rest of my system I will use it to give me enough cycles for Sublime Text to wor…

On debian the program is cpulimit.

The kill -STOP command works on linux too

Re: Show HN: Universal Pause Button

#58
post #23

Earlier quoted context omitted.

Magic SysRq-F

Wooow, thanks a lot! I'm going to test it now. Edit: Not working as expected :( Run python script that allocated a couple of gigabytes of RAM effectively causing my machine to freeze. And OOM killer figured out the best thing it can do is this: [2889118.406439] Out of memory: Kill process 11878 (SpotifyHelper) score 302 or sacrifice child [2889118.406442] Killed process 11878 (SpotifyHelper)

Such are the ways of the OOM killer: http://lwn.net/Articles/104185/

Re: Show HN: Universal Pause Button

#60
Win10Phone/Android/iOS apps are suspended and restored the same ways too. Only the visible app (and some system processes) is running in iOS1-8 (in iOS9 iPadAir2 two apps). It's usually unused in desktop OS (except for universal apps in Win10).
Post reply on HN