| Function | Code |
|---|---|
| Check storage | df -h |
| Check storage | du -hs foldername |
| Physical volumes | pvs |
| Remove | rm -rf sth |
| System usage monitor | htop |
| CPU information | lscpu |
| Check drives | lsblk |
| Check GPU | sudo lshw -C display / lspci | grep -e VGA |
cd software mkdir build cd build cmake -D BUILD_WITH_PYTHON=ON -DCMAKE_INSTALL_PREFIX=<install_path> .. sudo make install export LD_LIBRARY_PATH=<install_path>/lib/:$LD_LIBRARY_PATH export PYTHONPATH=<install_path>/lib/python3.11/site-packages:$PYTHONPATH
To kill everything listening to a port: sudo fuser -k 2121/tcp
Create a hidden file called .bashrc in your home folder and add aliases for different commands as:
alias something='ssh -Y [email protected]'
So something will always execute the command ssh -Y [email protected].
screen -S namectrl+a dscreen -lsscreen -r namescreen -d -r namessh -Y [email protected] # login ssh -N -f -L localhost:8889:localhost:8889 user@address # tunneling
Login to server using private key:
~/.ssh/sudo chmod -R 700 ~/.sshssh -Y username@server| Check permissions of a folder | ls -ld foldername |
| See all users of a group | grep groupname /etc/group |
| Give a user write permission to a folder using acl | setfacl -m u:username:rwx foldername |
| Change owner group of a folder | chown -R :groupname foldername |
| Change owner user of a folder | chown username: foldername |
| Change permissions of a folder | chmod -R u+w foldername / chmod -R 770 foldername |
sudo adduser username sudo deluser username sudo addgroup groupname sudo delgroup groupname sudo adduser username groupname getent passwd | cut -d: -f1 getent group
sudo mount -t auto /dev/sdb /media/plato/
sudo apt autoremove nvidia* --purge sudo /usr/bin/nvidia-uninstall sudo /usr/local/cuda-X.Y/bin/cuda-uninstall sudo apt update sudo apt upgrade lspci | grep -e VGA ubuntu-drivers devices sudo ubuntu-drivers autoinstall reboot nvidia-smi
ip link sudo nano /etc/netplan/*.yaml
Create the yaml file the following way:
# This is the network config written by 'subiquity' network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no addresses: [10.50.255.33/27] gateway4: 10.50.255.62 nameservers: addresses: [8.8.8.8] eno2: dhcp4: no version: 2