Skip to content

Instantly share code, notes, and snippets.

@zuyu
zuyu / ubuntu-install-gcc-6
Last active June 30, 2024 11:38
Install gcc 6 on Ubuntu
sudo apt update && \
sudo apt install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt update && \
sudo apt install gcc-6 g++-6 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \
gcc -v
@zuyu
zuyu / disable-node-1-cores
Created February 19, 2018 18:12
Disable cores in Node 1.
#!/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
@zuyu
zuyu / switch-hyper-threading
Created February 19, 2018 18:13
Switch on / off hyper threading.
#!/bin/bash
typeset -i core_id
typeset -i sibling_id
typeset -i state
for i in /sys/devices/system/cpu/cpu[0-9]*; do
core_id="${i##*cpu}"
sibling_id="-1"
if [ -f ${i}/topology/thread_siblings_list ]; then
@zuyu
zuyu / GLIBCXX-missing-version-fixing
Last active May 29, 2024 19:37
Fix missing GLIBCXX versions by upgrading libstdc++6 in Ubuntu
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt upgrade libstdc++6 -y
sudo apt dist-upgrade
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX