I do my research work on Acer aspire 4530 laptop with opensuse 11.3, 64 bit version. In this post I will keep on compiling various tips and tricks which I have gathered during the course of my work.
Convert video from flv to avi format
ffmpeg -i [<filename>].flv [<filename>].avi
Copy files over SSH
scp <local file> username@host:[<filename>]
Convert LaTeX to MS-Word
First move all LaTeX files to a separate folder and issue following command.
htlatex <filename.tex> 'html,word,pic-m' 'symbol^!'
It will genereate filename.html. Open this file using MS-word, embed the pictures into file, break the links to pictures. Do touch up work and finally, save with version control on.
To generate optimised code (after debugging), remove -ggdb and insert -O3.
Some useful gdb commands:
r = run the program from beginning
b <function name> |<line number> = create breakpoint
delete <n> = delete nth breakpoint, if n not given delete all breakpoints
c = continue (after breakpoint)
n = continue to next line (will not enter inside subroutines)
s = continue and step inside subroutines
p <varname> = print value of <varname>
How to split and merge large files
Use the split command to do this:
split --bytes=1024m bigfile.iso small_file_
That command will split bigfile.iso into files that are 1024 MB in size (1GB) and name the various parts small_file_aa, small_file_ab, etc. You can specify b for bytes, k for Kilobytes and m for Megabytes to specify sizes.
To join the files back together on Linux:
cat small_file_* > joined_file.iso
Similarly to join the split files on a Windows machine, use the copy command:
copy /b small_file_* joined_file.iso
Ref: http://linuxpoison.blogspot.com/2008/09/split-and-merge-large-files.html
note: scale= creates to image size of x:y pixels; -frames converts first n frames
qtiplot = Create various types of graphs
geany = Programmer's editor with syntax highlighting, etc.
kile = LaTex editor
engauge = digitizer to convert graph image into (x,y) file
octave = mathematics program, similar to matlab
inkscape = illustrations in vector format
Get <vendor:product> code for usb device using "lsusb" command.
In qemu session press ctrl+alt+2 to get console panel and type usb_add host:vendor:product. Press ctrl+alt+1 to return back to qemu session.
Convert video from flv to avi format
ffmpeg -i [<filename>].flv [<filename>].avi
Copy files over SSH
scp <local file> username@host:[<filename>]
Convert LaTeX to MS-Word
First move all LaTeX files to a separate folder and issue following command.
htlatex <filename.tex> 'html,word,pic-m' 'symbol^!'
It will genereate filename.html. Open this file using MS-word, embed the pictures into file, break the links to pictures. Do touch up work and finally, save with version control on.
Compiling and debugging FORTRAN programs
gfortran -fdefault-real-8 -fdefault-integer-8 -fno-automatic -ff2c -fbounds-check -fimplicit-none -ggdb programfile.f -o programfile.oTo generate optimised code (after debugging), remove -ggdb and insert -O3.
Some useful gdb commands:
r = run the program from beginning
b <function name> |<line number> = create breakpoint
delete <n> = delete nth breakpoint, if n not given delete all breakpoints
c = continue (after breakpoint)
n = continue to next line (will not enter inside subroutines)
s = continue and step inside subroutines
p <varname> = print value of <varname>
How to join multiple avi files created by ABAQUS
mencoder -oac copy -ovc copy p1.avi p2.avi ... -o big.avi [-forceidx]
How to split and merge large files
Use the split command to do this:
split --bytes=1024m bigfile.iso small_file_
That command will split bigfile.iso into files that are 1024 MB in size (1GB) and name the various parts small_file_aa, small_file_ab, etc. You can specify b for bytes, k for Kilobytes and m for Megabytes to specify sizes.
To join the files back together on Linux:
cat small_file_* > joined_file.iso
Similarly to join the split files on a Windows machine, use the copy command:
copy /b small_file_* joined_file.iso
Ref: http://linuxpoison.blogspot.com/2008/09/split-and-merge-large-files.html
How to convert avi file to animated gif file
mplayer <inputfile.avi> -vo gif89a -vf scale=<x:y> -frames <n>note: scale= creates to image size of x:y pixels; -frames converts first n frames
How to copy files from multiple directories to a single directory
find <search path> -iname 'search pattern' -exec cp {} <dest path> \;
How to extract pages from pdf
pdftk <input file> cat n1-n2 output <output fie>
where n1-n2 is page range
Some useful opensource scientific programs
jabref = bibliography management in bibtex formatqtiplot = Create various types of graphs
geany = Programmer's editor with syntax highlighting, etc.
kile = LaTex editor
engauge = digitizer to convert graph image into (x,y) file
octave = mathematics program, similar to matlab
inkscape = illustrations in vector format
QEMU
/usr/bin/qemu-kvm -monitor stdio -m 1024 -localtime -cdrom /dev/cdrom -hda /datastorage/virtualbox/hdd1 -hdb /datastorage/virtualbox/hdd2 -boot c -net nic,vlan=0 -net user,vlan=0,hostname=xp-qemu -name "winxp" -smb /home/raykar/qemu
USB support in qemuGet <vendor:product> code for usb device using "lsusb" command.
In qemu session press ctrl+alt+2 to get console panel and type usb_add host:vendor:product. Press ctrl+alt+1 to return back to qemu session.
How to monitor content of a continuously updated file (such as .sta file during ABAQUS run)
tail -f <filename>