Score:2

What does 176 mean in Linux magic SysRq key

bw flag

Here is the value set in Ubuntu 22.04:

root@test:~# cat /proc/sys/kernel/sysrq
176

I can't find the value from this link:

https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html

What does it mean?

guiverc avatar
cn flag
The link you provided has the table; read 176 not as a *decimal* number but as a *binary* number using the table you provided (ie. each *bit* has that option turned *ON* or *OFF*).
Score:3
ca flag

For interpretation of the SysReq value you need to convert it into binary,
then check which 'bits' are 1 telling whether the corresponding function is enabled.

Typing e.g.

$ python -c 'print( bin(176) )'
0b10110000

... at the bash prompt will tell the bits prepended with a 0b (for "binary").
Note: start from the right with the value 1 for the first bit, then 2 for the next, doubling the value for each step left.

If you wish to have the actual bitvalues printed, then it requires some more code;

$ cat cvt.py 
#!/bin/env python

import sys

b=bin(int(sys.argv[1])).replace("0b","")
v=2**(len(b)-1)
for bit in b: 
  print( f"{v:>4}", "bit" if bit=="1" else "bit, not included" )
  v=v//2

which executed shows this:

$ python cvt.py 176
 128 bit
  64 bit, not included
  32 bit
  16 bit
   8 bit, not included
   4 bit, not included
   2 bit, not included
   1 bit, not included

So, 176 means that

 16 =  0x10 - enable sync command
 32 =  0x20 - enable remount read-only
128 =  0x80 - allow reboot/poweroff

... functions are enabled.

Note: 16+32+128 = 176

$ echo ' 16+32+128' | bc
176
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.