Linux: wake up from suspend only via Power Button

Please note: I’ve tested it only on Debianb GNU/LINUX.
I didn’t liked the default suspend waking up settings (wake up by keyboard, mouse click or power button) but fortunately changing it to power-button-only is quite simple:

  • Login as root:
  • Check your current wake-up settings:
  • You will see something similar to:

  • Power Button is named PWRB here
  • Important note: /proc/acpi/wakeup is not a config file! In order to change it, you need to execute:

    where PS2M is the name of the input that has been *enabled so far.
  • After leaving only PWRB *enabled you can re-execute:

    to make sure it is indeed so
  • Reboot should not be necessary – after this, you should be able to suspend your system and to wake it up exclusively by pressing Power Button on your computer.

Counting numerals/digits and letters in PHP

A friend of mine asked me about this, so here it is: