Skip to content

Instantly share code, notes, and snippets.

@thomsh
Last active July 15, 2020 02:01
Show Gist options
  • Save thomsh/c93581fcb9f50275140d05a200f31973 to your computer and use it in GitHub Desktop.
Save thomsh/c93581fcb9f50275140d05a200f31973 to your computer and use it in GitHub Desktop.
Desktop kernel settings WIP
#!/usr/bin/env bash
# Enable all sysrq https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html
sysctl -w kernel.sysrq=1 # 1 mean all
# Ask the kernel to keep 3% of the ram free
sysctl -w vm.min_free_kbytes="$(grep '^MemTotal:' /proc/meminfo |awk '{print int($2*0.03)}')"
# Ask the kernel to keep 3% of the ram for admin things
sysctl -w vm.admin_reserve_kbytes="$(grep '^MemTotal:' /proc/meminfo |awk '{print int($2*0.03)}')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment