Skip to content

Instantly share code, notes, and snippets.

@MgaMPKAy
Created October 22, 2013 15:10
Show Gist options
  • Save MgaMPKAy/7102420 to your computer and use it in GitHub Desktop.
Save MgaMPKAy/7102420 to your computer and use it in GitHub Desktop.
Toggle ptrace by setting /proc
toggle_ptrace() {
local enable
mapfile -t enable < /proc/sys/kernel/yama/ptrace_scope
enable=${enable[0]}
if [[ $enable == '0' ]]; then
enable=1
else
enable=0
fi
sudo sh -c "echo $enable > /proc/sys/kernel/yama/ptrace_scope"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment