436 words
2 minutes
Ubuntu Common Commands
Network Training Commands
# Trainingtorchrun --nproc_per_node 1 --master_port 12364 train.py --gpus 1 -o ./logs/test-unet/ --conf_path ./conf/conf.yml
# Predictiontorchrun --nproc_per_node 1 --master_port 12365 predict.py --gpus 0 -o ./results/unet_still_work/ --conf_path ./conf/unet.yml -k ./logs/unet_still_work/tar xvf work.tar # Extract tar filetar -cvf FileName.tar DirName # Package DirName and all its files (folders)
Ubuntu System Commands
tar xvf work.tar # Extract tar filetar -cvf FileName.tar DirName # Package DirName and all its files (folders)
watch -n 2 --color gpustat --c #Monitor GPUsudo chmod 0750 /home/username #Set other users unable to accessubuntu-drivers devices #View available driversuname -a #View system informationuncompyle6 -o DataManage.py .\DataManage.pyc #Decompile pyc -> pylspci -vnn | grep VGA #Check system modeldf -h #Check hard drive capacitychomd -R 700 dir # Make the path accessible only to the user themselves
curl 'http://202.204.48.66' --data "DDDDD=41824276&upass=08173039&0MKKey="unset http_proxyunset https_proxyx-www-browser http://some-url.org
sudo /usr/local/sunlogin/bin/sunloginclient
#Delete within one daysudo find /tmp -type f -atime +1 -delete# Delete pip cached packagespip cache purge
#Check hard drive statusdf -h#Find top 50 largest files under a pathsudo du -hd 1 /home/user/ | sort -hr | head -50
#Server transfer commandsudo scp -r -P 10091 /data/cc/TOF_private/resample/label+/ cyq@frp.visual3d.cn:/external_disk/cc_data/
# Clean up GPU zombie processes, this command will kill all processesfuser -v /dev/nvidia2 | awk '{print $0}' | xargs kill -9Where nvidia2 represents killing the nvidia card with index 2 (generally the order is card 0, card 1, card 2....)
# Install missing packages for a programpip install pipreqspipreqs ./ # Will generate a requirements txt
# Make a file readable, writable, and executablechmod 777 xxx.file4 (read) 2 (write) 1 (execute)
# Change file ownerchown cc:cc cyq.txt# Find frp process and run frp in backgroundps -aux|grep frp| grep -v grep
# Clash for Windows usagePath ./config/clash4linux# Run./clash_linux# Set terminal to use proxyexport http_proxy="http://127.0.0.1:10809"export https_proxy="http://127.0.0.1:10808"# Git proxygit config --global http.proxy 'http://127.0.0.1:10809'git config --global https.proxy 'http://127.0.0.1:10808'
# Cancel proxyunset http_proxyunset https_proxy
# Git cancel proxygit config --global --unset http.proxygit config --global --unset https.proxy
To delete none images, you must first delete the containers in the images. To delete containers in images, you must stop the containers first.docker images$ docker stop $(docker ps -a | grep "Exited" | awk '{print $1 }') //Stop containers$ docker rm $(docker ps -a | grep "Exited" | awk '{print $1 }') //Delete containers$ docker rmi $(docker images | grep "none" | awk '{print $3}') //Delete images
#Specify visible GPUs for programCUDA_VISIBLE_DEVICES=0,1,2,3 python xxx.py
Ubuntu Common Commands
https://yunqing.org/en/posts/ubuntu-common-commands/