Skip to content

Instantly share code, notes, and snippets.

View anshultiwari1's full-sized avatar

Anshul Tiwari anshultiwari1

View GitHub Profile
@anshultiwari1
anshultiwari1 / getAllJobs.sh
Last active May 30, 2016 13:02
to get all jobs from tractor database ...
# to get all jobs from tractor database
tq_bin='/home/anshul/dev/python/Tractor-2.0/bin/tq'
export TRACTOR_ENGINE=fox:1503
$tq_bin jobs "done and stoptime > -7d " -c title,owner,jid,numdone,stoptime,esttotalsecs --nh | sort
@anshultiwari1
anshultiwari1 / getAllTasks.sh
Last active May 30, 2016 13:02
to get all tasks for a particular job id from tractor database ...
# to get all tasks for a particular job id from tractor database
tq_bin='/home/anshul/dev/python/Tractor-2.0/bin/tq'
export TRACTOR_ENGINE=fox:1503
$tq_bin tasks "jid=877" -c tid,wtime,current --nh
@anshultiwari1
anshultiwari1 / getJobTime.sh
Last active August 29, 2015 14:24
to get time for all tasks of a particular job id from tractor database
# to get time for all tasks of a particular job id from tractor database
tq_bin='/home/anshul/dev/python/Tractor-2.0/bin/tq'
export TRACTOR_ENGINE=fox:1503
$tq_bin tasks "jid=877" -c wtime --nh | tail -n+2 | awk '{print $1}'

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@anshultiwari1
anshultiwari1 / local_spool.sh
Last active August 29, 2015 14:27
tool to transfer jobs from one (away) tractor farm to other (local) tractor farm
## tool to transfer jobs from one (away) tractor farm to other (local) tractor farm
## either directly using .alf file or by user and .alf file
#!/usr/bin/env sh
export TRACTOR_ENGINE=lic:1503;
#/opt/pixar/Tractor-2.1/bin/tractor-spool "$@"
/opt/pixar/Tractor-2.1/bin/tractor-spool --user="$1" "$2"
@anshultiwari1
anshultiwari1 / spoolLocal.py
Last active August 29, 2015 14:27
python script to use local_spol.sh, so to direct transfer jobs between tractor farms, using local_spool.sh
# python script to use local_spol.sh, so to direct transfer jobs between tractor farms
#!/usr/bin/env python
import sys
import pexpect
def spoolLocal(args):
user, alf = args[0], args[1]
p_cmd = pexpect.spawn('/root/local_spool.sh '+ user + ' ' + alf)
@anshultiwari1
anshultiwari1 / tasks_stat_fox.sh
Created August 24, 2015 23:56
getting tractor tasks list with selected fields and saving them in datewise logs
#!/bin/bash
for jid in `./tq jobs "done and stoptime > -1d " -c jid,stoptime --nh | sort | awk '{print $1}'`; do echo ">>>>>>>>>>>$jid<<<<<<<<<<"; ./tq invocations "jid=$jid" -c jid,tid,wtime,current | grep -i true; echo ">>>>>>>>>>$jid<<<<<<<<<<<<<"; done | tee -a /tmp/task_stat_`date +%F`.log
@anshultiwari1
anshultiwari1 / cacheExport.py
Created August 25, 2015 00:09
yeti cache export script for maya
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
import sys, pprint
from pysideuic import compileUi
pyfile = open("/nas/projects/development/pipeline/bs_pipeline/cacheExportUI.py", 'w')
compileUi("/nas/projects/development/pipeline/bs_pipeline/ui/cacheExport.ui", pyfile, False, 4, False)
pyfile.close()
'''
@anshultiwari1
anshultiwari1 / sceneDepsSize.py
Created August 26, 2015 13:12
getting the approx size of all dependencies for a maya scene file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# getting the approx size of all dependencies for a maya scene file
import os
import sys
def size_format(size):
units = ['B', 'KB', 'MB', 'GB']
for u in units:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# getting the total size of all dependencies for a maya scene file
import os
import sys
import glob
def size_format(size):
units = ['B', 'KB', 'MB', 'GB']