mastodon warning! may contain trace amounts of Lisp

Linux

Table of Contents

1. Resetting

Under certain conditions, it is possible to reset a linux machine by force just by echoing commands to the file /proc/sysrq-trigger. Check the output of cat /proc/sys/kernel/sysrq to see what is possible:

Table 1: (source)
base 10 base 16 effect
2 0x2 enable control of console logging level
4 0x4 enable control of keyboard (SAK, unraw)
8 0x8 enable debugging dumps of processes etc.
16 0x10 enable sync command
32 0x20 enable remount read-only
64 0x80 enable signalling of processes (term, kill, oom-kill)
128 0x40 allow reboot/poweroff
256 0x100 allow nicing of all RT tasks

Sadly Arch linux seems to allow only for the sync command.

Sources differ on if one needs the panic set or not. If so:

echo 1 > /proc/sys/kernel/panic

And then

echo c > /proc/sysrq-trigger

Some of the commands:

command effect
b Immediately reboot the system without syncing or unmounting disks.
s Shut the system off (if configured and supported).
o Attempt to sync all mounted filesystems.

Written after reading this blog post.

2. networking

  • How to see how many sockets a process is using

watch -n 1 "netstat --all --program | grep 'sbcl'"


· © Edgard Bikelis (eſb) created using Emacs 29.0.50 (Org mode 9.5.3) ·
· created: 2020-03-18 last modified: 2020-05-23 ·