Forcing a Reboot (or Shutdown) with Linux

  • September 10, 2015
  • Linux

If you’ve ever had to reboot (or shutdown) a Linux system but the normal methods (reboot/shutdown/init) were not working (typically due to hanging processes) you can use the sysrq method instead: To reboot: echo 1 > /proc/sys/kernel/sysrq echo b > /proc/sysrq-trigger To shutdown: echo 1 > /proc/sys/kernel/sysrq echo b > /proc/sysrq-trigger

Quickly change a files encoding using vi

Ever needed to change a files encoding? One example would be to display characters in other languages properly on a website. Here’s a simple vi trick to do just that: vi filename.php :set bomb :set fileencoding=utf-8 :wq   Note: to find the encoding of a file: file -bi <file name>

Discover hidden processes and listening ports

If you ever suspect your system has been hacked, one of the first tools I check against is unhide. It will let you know if any processes (or ports) are hidden from the system. It can be installed with all major package systems (apt/yum/ports/etc) or you can download it directly from the developers website @ To use the application: unhide proc unhide sys unhide brute   also bundled with the application…