Introduction
In a way this is just a notebook. I am storing here the useful tricks that I am not using often enough to remember.
Nevertheless, it would be nice if it helped anybody.
Linux
How to find some details about CPU and memory quickly:
cat /proc/cpuinfo
cat /proc/meminfo
How to convert png, jpg ... to eps:
convert fig.jpg eps2:fig.eps
How to convert all png (or whatever) to jpg (or whatever):
for i in *.png ; do convert "$i" "${i%.*}.jpg" ; done
How to convert eps to pdf:
ps2pdf14 -dEPSCrop -dPDFSETTINGS=/prepress fig.eps fig.pdf
How to merge pdf files:
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=spolu.pdf subor1.pdf subor2.pdf
How to merge gif images into gif animation:
gifsicle --delay=18 --loop fig*.gif > animation.gif
pdf word count:
ps2ascii paper_gPHT.pdf | wc -w
last reboot:
last reboot | head -1
setting the number of threads for OpenMP:
set OMP_NUM_THREADS=n
export OMP_NUM_THREADS=n
Gnuplot
How to use more points in a function plot:
set sample 1000
How to reduce eps file for p3md plots in term ps:
set pm3d map
plot "data.dat" u 1:2:3 with image
How to reduce eps file for p3md plots in term ps:
set pm3d map
plot "data.dat" u 1:2:3 with image
Julia
How to run routine from a fortran module (gfortran example):
gfortran -shared modulename.f90 -o libname.so -fPIC
ccall( (:__modulename_MOD_routinename_libname, "$PATH_TO_LIB/libname"), Int32, ())
Condor
How to obtain the list of all running jobs if their names are too long:
condor_q -global -format "%d." ClusterId -format "%d" ProcId -format "%s\n " CMD -run
Why is my job in still the queue and not running
condor_q -name servername -analyze jobID
How to use condor_compile for job check-point outside the condor environment:
First of all we need a proper linking:
condor_compile -condor_standalone gfortran -o test.e test.f90
To run the job:
setarch x86_64 -R -L ./test.e -_condor_D_ALL
To restart the job from the check-point file:
setarch x86_64 -R -L ./test.e -_condor_restart ./test.e.ckpt