Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Content

Table of Contents
 

Submit job in batch

Code Block
bsub -o mylog0 -q psanaq ls -l
bsub -o mylog1 -q psanaq 'ls -l'
bsub -o mylog2 -q psanaq "ls -l"

bsub -o mylog -q psanaq curl -s "https://pswww-dev.slac.stanford.edu/calib_ws/"
[dubrovin@summitdev-login1:~]$ bsub -o mylog -q batch -W 1:00  -P CHM137 curl -s "https://pswww-dev.slac.stanford.edu/calib_ws/"

Useful system files

Code Block
~/.ssh/known_hosts

...

bqueues                     - Summary status of entire batch system organized by queues.
bqueues -l long - Detailed summary status of the 'long' queue.
lshosts         - Very long listing of all batch machines along with their resources.
bmod                            - Change the queue for a submitted job.
bhist                          - Get history information for completed jobs.
lsinfo                       - List all 'resources' defined in batch system.
busers                       - Summary of my batch activity.

qstat

 

Host specs

CPU

Code Block
cat /proc/cpuinfo

Memory

Code Block
free
cat /proc/meminfo

HDD

Code Block
df -h
sudo fdisk -l
sudo hdparm -i /dev/<device> (where <device> for example sda1, hda3...)
sudo hdparm -i /dev/sda1
sudo dmidecode

 

Re-direct output in file

All POSIX operating systems have 3 streams: stdin, stdout, and stderr.

...

Code Block
command >   file.txt
command >>  file.txt  # to append
command >&  file.txt # re-direct stdout and stderr
command 1>& file.txt # 1-stdout
command 2>& file.txt # 2-stderr
command &>> file.txt # append file with both streams (2-stderr to 1-stdout)
command 2> /dev/null # silence error
command 2>&1         # re-direct 2-stderr to 1-stdout
command 2>&1 >> file.txt # re-direct 2-stderr to 1-stdout and append file with both streams

 

Re-direct ls in file

USE BACKSLASH to get rid of formatting symbols in the output file

Code Block
\ls -1 /reg/d/psdm/MEC > file.txt

Or similar with adding some content:

Code Block
\ls -1 /reg/d/psdm/MEC | awk '{print "cdb convert -e " $1}' > test_convert_mec.sh

Save / re-direct text from command line in file

Code Block
echo "abcd1234" > t.t

 

 

 

Make movie from images

Code Block
convert _tmp*.png _tmp.gif

#or in python
os.system("convert _tmp*.png _tmp.gif")

...