From 48096577f3c8bf6228b1c69f51a1482f87cda20c Mon Sep 17 00:00:00 2001 From: xiaosuGW Date: Tue, 3 Aug 2021 12:35:13 -0400 Subject: [PATCH] upload scripts --- no_hyperthread.sh | 20 ++++++++++++++++++++ remember_git_password.sh | 2 ++ 2 files changed, 22 insertions(+) create mode 100755 no_hyperthread.sh create mode 100755 remember_git_password.sh diff --git a/no_hyperthread.sh b/no_hyperthread.sh new file mode 100755 index 0000000..c510ea5 --- /dev/null +++ b/no_hyperthread.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# DISCLAIMER: +# Script taken from http://askubuntu.com/questions/201937/ubuntu-detect-4-cpus-and-i-have-only-2-cpus + + +echo "Disabling hyperthreading..." + +CPUS_TO_SKIP=" $(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list | sed 's/[^0-9].*//' | sort | uniq | tr "\r\n" " ") " + +# Disable Hyperthreading +for CPU_PATH in /sys/devices/system/cpu/cpu[0-9]*; do + CPU="$(echo $CPU_PATH | tr -cd "0-9")" + echo "$CPUS_TO_SKIP" | grep " $CPU " > /dev/null + if [ $? -ne 0 ]; then + echo 0 > $CPU_PATH/online + fi +done + +lscpu | grep -i -E "^CPU\(s\):|core|socket" diff --git a/remember_git_password.sh b/remember_git_password.sh new file mode 100755 index 0000000..57ef43a --- /dev/null +++ b/remember_git_password.sh @@ -0,0 +1,2 @@ +#!/bin/bash +git config --global credential.helper store