Monday, May 31, 2010

Joining Multiple avi files in ubuntu

cat first.avi second.avi third.avi > temp.avi
mencoder temp.avi -o final.avi -forceidx -ovc copy -oac copy
rm temp.avi

and the joined will be in final.avi

Tuesday, March 2, 2010

if integer weights
./mkidx <> outputFile

if double weights
./mkidx -s (weightMultiplier) <> outputFile

Saturday, February 27, 2010

Metis fix

Error message

In file included from ./metis.h:36,
from coarsen.c:13:
./proto.h:462: error: conflicting types for ‘__log2’
/usr/include/bits/mathcalls.h:145: note: previous declaration of ‘__log2’ was here
make[1]: *** [coarsen.o] Error 1
make[1]: Leaving directory `/home/km/Downloads/metis/metis-4.0/Lib'
make: *** [default] Error 2

can be fixed by

I know about a fix : change log2 by ilog2 in metis source files :

kmetis.c kvmetis.c mkmetis.c util.c
proto.h rename.h

(taken from forum post here: http://www.code-aster.org/forum2/viewtopic.php?id=13444 )

Wednesday, February 17, 2010

Remove Every 2nd (or 3rd, etc) line in Unix

awk 'NR%2 != 0' filename1 > filename2

Friday, January 22, 2010

Unix Sort on multiple columns

To sort, first make sure you're using the correct locale

setenv LC_ALL C

or

export LC_ALL=C

sort -k1,1 -k3,3nr new_test.txt

or (sort -k1,1 -k3nr,3 new_test.txt) not sure which

To sort on first column, and then numerically in reverse order on the third.