Skip to content

Instantly share code, notes, and snippets.

@remohoeppli
remohoeppli / venv_cheat_sheet.sh
Last active January 22, 2024 17:16
Venv Cheat-Sheet
# venv cheat sheet
# creating a venv
# this creates a venv with the name 'venv' in the current directory
python3 -m venv venv
# activate the newly created venv
. ./venv/bin/activate
# now the venv can be used like we would use the normal Python installation
@remohoeppli
remohoeppli / pyenv_cheat_sheet.sh
Last active December 29, 2023 12:02
Pyenv Cheat-Sheet
# list installable python versions
pyenv install --list
# install version 3.12.0
pyenv install 3.12.0
# uninstall version 3.7.17
pyenv uninstall 3.7.17
# show all installed versions
@remohoeppli
remohoeppli / always_use_python3.sh
Last active December 29, 2023 11:44
Always use python3
# on macos
echo '# Python3 to default' >> ~/.zshrc
echo 'alias python="python3"' >> ~/.zshrc
echo 'alias pip="pip3"' >> ~/.zshrc
# on ubuntu
echo '# Python3 to default' >> ~/.bashrc
echo 'alias python="python3"' >> ~/.bashrc
echo 'alias pip="pip3"' >> ~/.bashrc
@remohoeppli
remohoeppli / pyenv_install_ubuntu.sh
Created December 29, 2023 11:27
Install pyenv on ubuntu
# install pyenv on ubuntu
sudo apt update -y
# install dependencies
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
# install pyenv
curl https://pyenv.run | bash
@remohoeppli
remohoeppli / pyenv_install_macos.sh
Created December 29, 2023 11:22
Install pyenv on macos
# install pyenv on macos
brew update
brew install pyenv
# configure .zshrc file
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
# start the bluetooth control application
bluetoothctl
# list all paired devices
paired-devices
# remove the paired device that is causing problems
# bluetooth mac is a that looks like this AA:AA:AA:AA:AA:AA
# use command like this
# remove AA:AA:AA:AA:AA:AA
ssh root@hifi02.local
stressberry-run out.dat
stressberry-plot out.dat -o out.png
@remohoeppli
remohoeppli / install_stressberry.sh
Created May 29, 2022 13:33
install_stressberry
sudo apt install stress
# only needed if we don't have pip3 already
sudo apt install python3-pip
python3 -m pip install stressberry
# at this point a logout and login might be needed
@remohoeppli
remohoeppli / update_raspberry_pi_4_firmware.sh
Created May 29, 2022 13:18
Update raspberry pi 4 firmware
sudo rpi-eeprom-update -a