Friday, February 19, 2016

Screenshot shortcuts on a new Linux Mint OS

Linux Mint 17.3 did not have the keyboard shortcuts for screenshots of selected areas working.
I want the behavior to be:

  • Shift-PrintScr = save selected area screenshot (to /home/<username>/Pictures/)
  • Ctrl-Shift-PrintScr = copy selected area screenshot to clipboard
The following steps proved sufficient:
  • Copy scripts from https://gist.github.com/dineshj1/d2c671a3ad82f89879c2
    • Navigate to keyboard>shortcuts>custom shortcuts
    • Add shortcut commands: 
      • bash /home/dineshj/screenshot_area.sh, with keyboard bindings: Shift+Print 
      • bash /home/dineshj/screenshot_area_to_clipboard.sh, with keyboard bindings: Ctrl+Shift+Print 

    Compiling and submitting matlab scripts to condor on the UTCS cluster



    1. Write the script in condor-compatible way: (see https://gist.github.com/dineshj1/935a703f93c12a3efc19#file-sample_condorized_function-m, and read tips and details)
    2. Compile code after adding all necessary paths to Matlab path: (see https://gist.github.com/dineshj1/935a703f93c12a3efc19#file-compilecodes-m-example)
    3. Create submit script: (see https://gist.github.com/dineshj1/935a703f93c12a3efc19#file-sample_submit_file)
    4. Some edits to PATH, LD_LIBRARY_PATH etc. may be necessary (see full .profile at https://gist.github.com/dineshj1/935a703f93c12a3efc19#file-profile-when-working): 
      1. export PATH=$PATH:/lusr/share/software/matlab-r2015b/bin/glnxa64/:/lusr/share/software/matlab-r2015b/toolbox/compiler/deploy/;
      2. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/v/filer4b/software/matlab-r2015b/bin/glnxa64/:/v/filer4b/software/matlab-r2015b/runtime/glnxa64/;
      3. export MCR_CACHE_ROOT=/scratch/vision/dineshj/mcrCache/ # where executables will extract ctf archives
      4. export KMP_DUPLICATE_LIB_OK=true;

    Wednesday, February 17, 2016

    Python jobs on condor

    Condor submit file could look like:

    +Group="GRAD"
    +Project="AI_ROBOTICS"
    +ProjectDescription=""
    Universe = vanilla
    Getenv = True
    Log    = ../SUN_download_condor.log
    Output = ../SUN_download_condor.out
    Error  = ../SUN_download_condor.err
    Executable = ./download_SUN_large_panos.py
    Queue 100

    And the python script itself could look like:

    #!/usr/bin/env python

    import os
    import urllib
    import sys

    def touch(fname, times=None):
      with open(fname, 'a'):
        os.utime(fname, times)

    target_root='./dataset/9104x4552/';
    if not os.path.exists(target_root):
      os.mkdir(target_root);


    Note the header at the top (shown in bold). This is important for condor to know how to execute the script.

    Also, obviously, the python script would have to have executable permissions.

    Friday, February 5, 2016

    Caffe installation on Maverick, from scratch, without CMake

    Scripts at: https://gist.github.com/dineshj1/69cc2d2aae149bed519d
    (very basic bashrc, dependency installation script and Makefile.config)

    1) Run dependency installation script to install all deps to a  common install/ folder (and anaconda separately).
    2) Makefile.config and bashrc are configured to point to these folders.
    3) Compile!

    • make all -j; 
    • make pycaffe -j; 
    • make matcaffe -j; 
    • make runtest -j; 
    • make pytest -j;
    • make mattest -j; 
    Everything works!