torch.cuda.is_available()check cudatensorboard --logdir=/home/jing/python_code/DeepRT/torch/runsuse tensorboard web graph
conda --versioncheck versionconda env listexsisted environmentsconda install python==3.6install specific pythonconda create -n name python=3.9create a conda envconda create -n newenv --clone oldenvcopy a conda envconda remove -n envname --alldelete a conda envconda activate envnameactivate a conda envconda deactivateclose a conda env- export to another machone
conda env export > envname.yamlconda env create -f envname.yaml
print(sys.version)print python versionprint(glob.glob("path/*.mhd"))print files namesfiles = os.listdir(path); files.sort()sort the files namesfor x, y in zip(directory_image, directory_label):double loopprint(f'text {variable:.3f}')print in specific format
hostname -Iip addresspsortopshow running programssudo vi /etc/hostnamechange hostname, remember to rebootps -ef | grep sshcheck sshpython --versioncheck python versionnvidia-smicheck GPU infonvidia-smi -Lcheck available GPUhtopcheck memorytouch test.pycreate a new filevi test.pyedit a filecd ~come to homebash xxx.shrun .sh filesudo vim /home/jing/.bashrcmodigy environment variablesexport PATH=path1:path2: ...... :$PATHadd multiple variablessource ~/.bashrcmake it into effectunset PYTORCH_CUDA_ALLOC_CONFcancel the previous commandsudo apt-get updateupdate softwarepip install opengate -Uupdate libsudo apt-get remove --auto-remove qtcreatoruninstall softwarescp -r /datapath/* username@ip address:/savepath/upload data to clusterscp -r username@ip address:'/remotepath/file_{367..497}.root' savepathbatch download files to localscp -r phantom*_atn_1.bin username@ip address:remotepath/upload specific type filesls -l . | egrep -c '^-'check file numbersls -lh path/file_namecheck file sizechmod 777 folder/change access permision to read/write/executeffmpeg -i input.mp3 -ss 00:01:00 -to 00:05:23.27 -c copy output.mp3edit audio lengthsu root, change to root usersu jing, change to other usersudo passwd root, change password of rootpasswd, change passwordwatch -n 10 squeue -u jzhang, watch slurm jobs every 10 secondsdf -h /, check disk spacedu -sh /home2/jzhang/, check total data used of certain pathdu /home2/jzhang/, check detail data used of certain pathtree -L 1, show tree structure in 1 leveltree -d, show directory onlytree -L 2 > structure.txtexport tree structure to filetree /Ain Windows, show tree structure with directory onlytreein Windows, similar as abovetree /Fin Windows, show all information
- A good subsitute for vmware virtual machine.
- version
wsl -l -v sudo apt-get install x11-appsto support visualization,xeyesfor testing.- in CMD,
ubuntu config --default-user jing or root, change user or root user. - in CMD,
wsl --shutdown, shutdown the wsl system. - in CMD,
wsl -l, print info of OS.
- Essence: python calls dynamic link libraries compiled by C/C++. e.g. convert the data types in python to those in c/c++, pass them to the compiled functions, and then convert returned parameters to the data types in python.
- C/C++ --> dynamic link library (Pybind11) <-- Python
adjust blank:
\setlength{\abovedisplayskip}{3pt}
\setlength{\belowdisplayskip}{3pt}
adjust the space between title and fig
\setlength{\abovecaptionskip}{-0.2cm}
adjust the distance between title and the below context
\setlength{\belowcaptionskip}{-1cm}
\begin{equation}
\setlength{\abovedisplayskip}{3pt}
\setlength{\belowdisplayskip}{3pt}
y(t)=a(t)-b(t).
\end{equation}
table:
tabular* can automatically adjust the width to fit the text.
{\textwidth} width of column{@{\extracolsep{\fill}} ll} column setting
\begin{table}[htbp]
\caption{Dataset}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} ll}
\toprule
data 1 & data 2 \\
\midrule
1 & 2 \\
3 & 4 \\
\bottomrule
\end{tabular*}
\end{table}
split a cell into two rows
\begin{tabular}[c]{@{}c@{}} part A \\ part B \end{tabular}