Skip to content

Instantly share code, notes, and snippets.

View anshultiwari1's full-sized avatar

Anshul Tiwari anshultiwari1

View GitHub Profile
@anshultiwari1
anshultiwari1 / DNS-server-types
Last active June 2, 2016 13:48
DNS inner working
When a client program wants to access a server by its domain name, it must find out how to translate the domain name into an actual routable address that it can use to communicate. It needs to know this information in order to get or send information to the server.
Some applications, including most web browsers, maintain an internal cache of recent queries. This is the first place the application will check, if it has this capability, in order to find the IP address of the domain in question. If it does not find the answer to its question here, it then asks the system resolver to find out what the address of the domain name is.
A resolver in general is any component that acts as a client-side participant in a DNS query. The system resolver is the resolving library that your operating system uses to seek out the answer for DNS queries. In general, system resolvers are usually what we consider stub resolvers because they are not capable of much complexity beyond searching a few static files on the system (lik
@anshultiwari1
anshultiwari1 / compareDirs.py
Last active February 20, 2024 10:05
compares two directories, and list all difference based on contents and size ...
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys
import filecmp
holderlist=[]
def compare_dirs(dir1, dir2):
dircomp=filecmp.dircmp(dir1,dir2)
only_in_source=dircomp.left_only
@anshultiwari1
anshultiwari1 / rv_spool.sh
Last active June 27, 2016 10:55
tool to transfer jobs from one(local) tractor farm to other (away) tractor farm
## tool to transfer jobs from one (local) tractor farm to other (away) tractor farm
## either directly using .alf file, maya file and user, in that order.
#!/bin/sh
maya -batch -file "$2" -command 'python "import pymel.core as pm; import sys, os; sys.path.append(\"/nas/projects/development/productionTools\"); from py_queue.sync import find_scene_deps; bin = \"/nas/projects/development/productionTools/py_queue/bin/submit_to_queue.py\"; import uuid; uuid_num = uuid.uuid4(); scene_name = pm.sceneName(); (file_path, _) = find_scene_deps.gen2(scene_name); (f1, _) = os.path.basename(scene_name).split(\".\"); print bin, \"SYNC_RENDER\", file_path, \"'"$3"'\", \"'"$1"'\", uuid_num, \"50\", \"'"$2"'\", \"%s_%s\" % (f1, uuid_num) "'
@anshultiwari1
anshultiwari1 / sequenceInfoList.py
Last active November 25, 2015 13:09
getting all sequences and render info list for all shots and thier size on the disk, based on information fetched from tactic database.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys
import json
from operator import itemgetter
from tabulate import tabulate
import datetime
import argparse
#!/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']
@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:
@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 / 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 / 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 / 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"