working on it ...

Filters

Explore Public Snippets

Sort by

Found 24 snippets

    public by lbottaro  14555  56  8  0

    How to list files changed in clearcase ucm stream activities

    This script lists the files changed in all the activities delivered on a specific stream, with no duplicates. The stream is the one currently set on the clearcase view.
    #!/usr/bin/tcsh -f
    # This script lists the activities of a stream and saves on the following file the changed files without duplicates.
    
    set tmpoutput = "$HOME/.tmp_AllChangedFilesInStream.txt"
    set output = "$HOME/AllChangedFilesInStream.txt"
    rm -rf $tmpoutput
    touch $tmpoutput
    rm -rf $output
    touch $output
    
    foreach act ( `cleartool lsact -s | grep -v rebase` )	
        set changeset = `cleartool lsact -fmt "%[versions]p" $act`
        echo $changeset | tr ' ' '\n' >> $tmpoutput
    end
    
    foreach line ( "`cat $tmpoutput`" )	
        set file=`echo $line | sed -e "s|\(.*\)@@.*|\1|"`
        
        set isPresent = `grep "$file" "$output"`
        if ("$isPresent" == "") then
          echo $file >> $output
        endif  
    end
    
    rm -rf $tmpoutput
    
    exit 0

    public by lbottaro  7230  31  8  0

    Custom diff tool for clearcase object

    This simple tcsh script allows to run a custom diff tool to view differences between file versions. The diff tool to be used can be easily configured. In this example I use kdiff3. The script will detect if one or two file paths are passed on the command line. In case of two files, the diff will be done on them. In case of one file, th
    #!/bin/tcsh -e
    set _CLEARCASE_VIEW = `cleartool pwv -short -setview`
    echo Set view: "$_CLEARCASE_VIEW"
    set my_firstversion = ""
    set my_secondversion = ""
    set my_difftool = kdiff3
    
    # check clearcase view
    if ( "$_CLEARCASE_VIEW" == "** NONE **" ) then
      echo "Error: ClearCase view not set, aborted."
      exit -1
    endif
    
    if ( "$1" == "" ) then
      echo "Error: missing 1st file argument!"
      echo "Eg: `basename $0` file1.txt -> This will diff file1.txt with its previous version"
      echo "Eg: `basename $0` file1.txt file2.txt -> This will diff file1.txt and file2.txt"
      exit -1
    endif  
    
    set my_firstversion = "$1"
    echo "my_firstversion=$my_firstversion"
    
    if ( "$2" == "" ) then
      echo "No 2nd file passed, calculating previous version of $my_firstversion"
      set my_secondversion = $my_firstversion@@`cleartool descr -pred -short $my_firstversion`
    else
      echo "Setting 2nd file to $2"
      set my_secondversion = "$2"
    endif
    echo "my_secondversion=$my_secondversion"
    
    ${my_difftool} ${my_firstversion} ${my_secondversion} &

    external by Peter Caldwell  0  0  1  0

    Run script demonstrating that ending EXEROOT with a slash causes MCT build to fail.

    Run script demonstrating that ending EXEROOT with a slash causes MCT build to fail.: run_acme.minimal.csh
    #!/bin/csh                                                                                                               
    #Minimal code reproducing mct build failure on Anvil.                                                                    
    #Note that problem seems to be ending slash in specification of EXEROOT                                                
     
    set case_name=master.mintest1.ne4np4_oQU240
     
    cd ~/ACME_code/master/cime/scripts/
    ./create_newcase --case /lcrc/group/acme/${USER}/ACME_simulations/${case_name}/case_scripts --compset A_WCYCL1850 --res n\
    e4np4_oQU240 --pecount M --handle-preexisting-dirs u --output-root /lcrc/group/acme/${USER}/ACME_simulations/
     
    cd /lcrc/group/acme/${USER}/ACME_simulations/${case_name}/case_scripts
     
    #Adding a '/' on the end of build in the line below causes the build to fail.
    #try deleting the ending slash and re-running to see that this really is the problem.
    ./xmlchange EXEROOT=/lcrc/group/acme/${USER}/ACME_simulations/${case_name}/build/
     
    ./xmlchange RUNDIR=/lcrc/group/acme/${USER}/ACME_simulations/${case_name}/run
    ./case.setup --reset
    ./case.build
    
    
    

    external by jeffrl  2  0  1  0

    git command aliases

    git command aliases: git.tcsh
    a gs		    'git status -uno .'
    a gsu			  'git status .'
    a gsm		    'git status --porcelain -uno . | grep -v "^?"'
    a gsn		    'git status --porcelain . | grep    "^?"'
    a gstash	  'git stash'
    a gpop		  'git stash pop'
    a glog 		  'git log -10 \!*'
    a gshow 		'git show \!*'
    a gd 		    'git difftool \!*'
    a gdn 		  'git diff --name-status \!*'
    a guc 		  'git reset HEAD \!*'
    a gdc 		  'git difftool --cached \!*'
    a gdif-master 		'git difftool origin/master \!*'
    a grmt  		'git remote -v'
    a ggui  		'git gui &'
    a gguib 	  'git gui browser . &'
    a gitk 	    'gitk \!* &'
    a gnew      'git diff origin/master --name-only'
    a gfetch    'git fetch'
    a gpull     'git pull --rebase'
    a gtag      'git tag \!*'
    a gco       'git checkout \!*'
    a gstash    'git stash'
    a gpop      'git stash pop'
    a gskip     'git update-index --skip-worktree \!*'
    a gunskip   'git update-index --no-skip-worktree \!*'
    a gskipped  'git ls-files -v . | grep ^S'
    a gpush     'git push'
    a gclone    'git clone githsip@git-irv-09.irv.broadcom.com:\!1 \!2; cd \!:2; git remote add hsipdvgithsip@git-irv-09.irv.broadcom.com:hsipdv; cd ..'
    
    

    external by ayoburgess  5  0  1  0

    TCSH Prompt

    TCSH Prompt: .tcshrc
    set prompt="\n%d %D-%w-%Y %P\n[%n@%m | %~]\n(tcsh) > "
    
    

    external by nocd5  1  0  1  0

    chdir with cho

    chdir with cho: chocd.csh
    #!/bin/csh
    
    if ("$1" == "") then
      pushd ~
    else if ("$1" =~ */ | "$1" == "..") then
      pushd $1
    else
      set pattern = `basename $1`
      set parent = `dirname $1`
      set directories = `find "${parent}" -maxdepth 1 -iname "${pattern}*" ! -name "." ! -name ".." -type d`
      if (${#directories} == 0) then
        echo "${pattern}: No such file or directory." > /dev/stderr
      else if (${#directories} == 1) then
        pushd ${directories}
      else
        set candidates = ""
        foreach d (${directories})
          set candidates = ${candidates}"\n"`echo ${d} | sed "s/^.\///"`"/"
        end
        set tartget = `echo ${candidates} | cho -lb yellow`
        if (${#tartget} != 0) then
          pushd ${tartget}
        endif
      endif
    endif
    
    

    external by koteitan  7  0  1  0

    enumdate

    enumdate: enumdate.csh
    #!/bin/csh
    set a=0
    while($a<$2)
            date --date "$1 $a day" +%Y%m%d
            @ a ++
    end
    
    # usage ---------------------------
    # enumdate.csh [start] [days]
    # enumrates the serial dates from the date [start] for [days] days.
    # example -------------------------
    # $ ./serialdate.csh 19831025 10
    # 19831025
    # 19831026
    # 19831027
    # 19831028
    # 19831029
    # 19831030
    # 19831031
    # 19831101
    # 19831102
    # 19831103
    
    
    

    external by zaxebo1  6  0  1  0

    Get Emacs workspace for each GNU screen

    Get Emacs workspace for each GNU screen: create_dedicated_emacs_server_for_each_screen.csh
    setenv DEFAULT_WORKSPACE "default"
    if ( $?WORKSPACE == 0 ) then
        setenv WORKSPACE $DEFAULT_WORKSPACE
    endif
    
    # Define alias 'et' to connect to the proper Emacs server identified by EMACS_SEVER_NAME
    setenv EDITOR "emacsclient -s $WORKSPACE -t -a ''"
    alias et "$EDITOR"
     
    # Create alias 'kill-emacs' to kill proper Emacs server.
    alias kill-emacs "$EDITOR --eval '(kill-emacs)'"
    alias start-emacs-server "emacs --daemon=$WORKSPACE"
    
    # $WINDOW is set by GNU screen to indicate current window number.
    if ( $?WINDOW ) then
        # Create aliase to start dvtm session for each window in a workspace
        alias dvtm "dtach -A /tmp/dvtm-session-${WORKSPACE}-${WINDOW} dvtm"
    else
        # Create convenient aliases for creating workspaces only 
        # when not inside GNU screen to avoid accidentally starting GNU screen inside GNU screen.
        foreach p ( study bozaalarm bug $DEFAULT_WORKSPACE )
            alias ws-$p "setenv WORKSPACE $p; screen -mS $p -DR"
        end
    
        foreach s ( 1 2 3 4 5 6 7 8 9 )
            alias dvtm$s "dtach -A /tmp/dvtm-session-${WORKSPACE}-$s dvtm"
        end
        alias dvtm "dtach -A /tmp/dvtm-session dvtm"
    endif
    
    

    external by joshuacurtiss  3  0  1  0

    Script to get the public IP from DynDNS's checkip service.

    Script to get the public IP from DynDNS's checkip service.: publicip.csh
    #!/bin/csh
    curl -s http://checkip.dyndns.org | awk '{print $6}' | awk ' BEGIN { FS = "<" } { print $1 } '
    
    
    

    external by Ryan Galloway  311  0  3  0

    Alembic OSX Build

    Alembic OSX Build: abcbuild.csh
    # tool chain
    xcode-select --install
    
    # install homebrew
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
    # required libs
    brew doctor
    brew install boost --with-python
    brew install boost-python
    brew install autoconf
    brew install automake
    brew install libtool
    
    # IlmBase / PyIlmBase
    git clone https://github.com/openexr/openexr
    cd openexr/IlmBase
    ./bootsrap
    ./configure
    make; make install
    cd ../PyIlmBase
    ./bootsrap
    ./configure
    make; make install
    
    # Alembic
    git clone https://github.com/alembic/alembic
    cd alembic; mkdir build; cd build
    cmake ../ -DUSE_PYTHON=ON
    make
    make install
    
    # AbcView
    git clone https://github.com/alembic/abcview
    cd abcview; mkdir build; cd build
    cmake ../ -DUSE_PYTHON=ON
    make
    make install
    
    
    
    • Public Snippets
    • Channels Snippets