sudo bash -c 'cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup && sed -i "/AllowTcpForwarding/c\AllowTcpForwarding yes" /etc/ssh/sshd_config && sed -i "/GatewayPorts/c\GatewayPorts yes" /etc/ssh/sshd_config && sed -i "/PermitTunnel/c\PermitTunnel yes" /etc/ssh/sshd_config' && sudo systemctl restart sshd
sudo bash -c '
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup &&
sed -i "/^#\?AllowTcpForwarding/c\AllowTcpForwarding yes" /etc/ssh/sshd_config &&
sed -i "/^#\?GatewayPorts/c\GatewayPorts yes" /etc/ssh/sshd_config &&
sed -i "/^#\?PermitTunnel/c\PermitTunnel yes" /etc/ssh/sshd_config
'
# … then restart (or reload) the correct service
sudo systemctl restart ssh
black .
autoflake --remove-all-unused-imports -i ./*
isort .
lsof /dev/nvidia* | awk '{print $2}' | xargs -I {} kill {}
du -h | awk '$1 ~ /G/ && $1 > 1' | sort -h
: over 1gb of current disk
git config --global init.defaultBranch main
git config --global user.name "Simo Ryu"
git config --global user.email "[email protected]"
#!/bin/bash
cd
# Prevent interactive prompts
export DEBIAN_FRONTEND=noninteractive
# Update package lists and add repository without prompts
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
# Install all required packages without prompts
sudo apt install -y \
pdsh \
tmux \
htop \
git-lfs \
ffmpeg \
python3.11 \
python3.11-venv \
python3.11-distutils \
libpython3.11-dev \
python3.11-dev
# Setup git-lfs
sudo git lfs install --skip-repo
# Create Python virtual environment
python3.11 -m ensurepip --upgrade
python3.11 -m venv ~/py311cuda
# Add environment activation to bashrc if not already present
if ! grep -q "source ~/py311cuda/bin/activate" ~/.bashrc; then
echo "source ~/py311cuda/bin/activate" >> ~/.bashrc
fi
# Activate the environment for the current session
source ~/py311cuda/bin/activate
# Upgrade pip and install packages
pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir \
torch \
tqdm \
click \
transformers \
datasets \
wandb \
plotly \
pandas \
torchvision \
openai \
backoff
# Reload bash configuration
source ~/.bashrc
echo "Installation complete! Python environment is activated and will auto-activate in new shell sessions."
python -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}\nCUDA device count: {torch.cuda.device_count()}\nCurrent device: {torch.cuda.current_device()}')"
wandb login
git config --global user.name "Simo Ryu"
git config --global user.email "[email protected]"
ACTIVATE_CMD="source ~/py39cuda/bin/activate"
# Check if the command is already in .bashrc
if grep -Fxq "$ACTIVATE_CMD" ~/.bashrc
then
echo "Virtual environment activation command already in .bashrc"
else
# Add the command to .bashrc
echo "$ACTIVATE_CMD" >> ~/.bashrc
echo "Virtual environment activation command added to .bashrc"
fi
$ACTIVATE_CMD
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC57w2K4gr9f+kpctuIZTGe1m+YC+5evJLc0igLs9MZ1zmBEHGqVmgtaWzuAunHqyRa2p64Wjv4OZ5i7qKb601ZU3uFtGkK9MxL1K6VvNC7HRr27chgs7nIc5/ZAslQoquPzbssOcRR/DTqKdfeb6l76ZkE7ZyXlVzX5JFRbPuUK4po7rtHPb0bE51dkFNyBqPLCidfY/+OuXMs1EXoH+n+TFfiXE/i5Ec5Zo9gvSuntiBewH+QFsozYItGEFKiodT40TuAZkHGqXydIzB+dc7NcL2ZAJsPebnuxolD3IE3tdticy/E/WlBfdCIeJsLS56lOUkSSzHf3dWzlw9cu2kH8XhfxfgE70z62NdFMNDih7AUoFovfHx42F5yEsr2kQSPZQXdwCvRauZ36Mu4u8t1yF8//GiY9ZNX+7SArE2eImo86nHPMGohn8ofVvWhGvhQP+tlUEdwdG2YMiCR5socBj8WLLFFITOo671IfXCcGMMeQJaom3+AoYo8g6irPvM= clone@BOOK-2UT1U9LBLL