torch.cuda.is_available()
check cudatensorboard --logdir=/home/jing/python_code/DeepRT/torch/runs
use tensorboard web graph
conda --version
check versionconda env list
exsisted environmentsconda install python==3.6
install specific pythonconda create -n name python=3.9
create a conda envconda create -n newenv --clone oldenv
copy a conda envconda remove -n envname --all
delete a conda envconda activate envname
activate a conda envconda deactivate
close a conda env- export to another machone
conda env export > envname.yaml
conda 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 -I
ip addressps
ortop
show running programssudo vi /etc/hostname
change hostname, remember to rebootps -ef | grep ssh
check sshpython --version
check python versionnvidia-smi
check GPU infonvidia-smi -L
check available GPUhtop
check memorytouch test.py
create a new filevi test.py
edit a filecd ~
come to homebash xxx.sh
run .sh filesudo vim /home/jing/.bashrc
modigy environment variablesexport PATH=path1:path2: ...... :$PATH
add multiple variablessource ~/.bashrc
make it into effectunset PYTORCH_CUDA_ALLOC_CONF
cancel the previous commandsudo apt-get update
update softwarepip install opengate -U
update libsudo apt-get remove --auto-remove qtcreator
uninstall softwarescp -r /datapath/* username@ip address:/savepath/
upload data to clusterscp -r username@ip address:'/remotepath/file_{367..497}.root' savepath
batch 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_name
check file sizeffmpeg -i input.mp3 -ss 00:01:00 -to 00:05:23.27 -c copy output.mp3
edit 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.txt
export tree structure to filetree /A
in Windows, show tree structure with directory onlytree
in Windows, similar as abovetree /F
in Windows, show all information
- A good subsitute for vmware virtual machine.
- version
wsl -l -v
sudo apt-get install x11-apps
to support visualization,xeyes
for 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}