This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
condenser=`pacmd list-sources | grep name: | grep -o "<.*Condenser.*>" | awk -F'[<>]' '{print($2)}'` | |
condenser_default=($condenser) # get first item | |
pacmd set-default-source $condenser_default | |
pacmd set-source-volume $condenser_default 0x10000 | |
pacmd unload-module module-echo-cancel 2>&1 > /dev/null | |
pacmd load-module module-echo-cancel | |
condenser=`pacmd list-sources | grep name: | grep -o "<.*Condenser.*\.echo-cancel>" | awk -F'[<>]' '{print($2)}'` | |
pacmd set-default-source $condenser | |
pacmd set-source-volume $condenser 0x10000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo 0 | sudo tee /sys/devices/system/cpu/cpufreq/boost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nameserver=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}') # find nameserver | |
[ -n "$nameserver" ] || "unable to find nameserver" || exit 1 # exit immediately if nameserver was not found | |
echo "##### nameserver found: '$nameserver'" | |
localhost_entry=$(grep -v "127.0.0.1" /etc/hosts | grep "\slocalhost$") # find localhost entry excluding 127.0.0.1 | |
if [ -n "$localhost_entry" ]; then # if localhost entry was found | |
echo "##### localhost entry found: '$localhost_entry'" | |
sed -i "s/$localhost_entry/$nameserver localhost/g" /etc/hosts # then update localhost entry with the new $nameserver | |
else # else if entry was not found | |
echo "##### localhost entry not found" | |
echo "$nameserver localhost" >> /etc/hosts # then append $nameserver mapping to localhost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install system prerequisites | |
sudo apt update | |
sudo apt install -y software-properties-common apt-transport-https | |
# install docker-ce | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Create `.so` package from Python3 package or module. | |
- Put this script outside working directory. | |
- Compile package: `cd /path/to/src/folder && python3 /path/to/py3compile.py` | |
- Compile module: `cd /path/to/src/folder && python3 /path/to/py3compile.py FILE1 [FILE2 ...]` | |
- Output: `/path/to/src/folder_so` | |
''' | |
from distutils.core import setup | |
from distutils import sysconfig |