Skip to content

Instantly share code, notes, and snippets.

@zuyu
Created February 19, 2018 18:12
Show Gist options
  • Select an option

  • Save zuyu/16a1fdbcec0e59395717959af996c898 to your computer and use it in GitHub Desktop.

Select an option

Save zuyu/16a1fdbcec0e59395717959af996c898 to your computer and use it in GitHub Desktop.

Revisions

  1. zuyu created this gist Feb 19, 2018.
    10 changes: 10 additions & 0 deletions disable-node-1-cores
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/bin/bash
    typeset -i state

    for i in /sys/devices/system/cpu/cpu[0-9]*; do
    if [ -d ${i}/node1 ]; then
    state="$(<${i}/online)"
    echo -n "$((1-state))" > "${i}/online"
    echo "switched ${i}/online to $((1-state))"
    fi
    done