In this post I am going to try to write a series of tricks that it makes me easier day to day with the operating system GNU/Linux.
Record VCD from console
Explanation: the majority of DVD players don’t reproduce movies in divx format, but only they do it in DVD and in VCD. If we haven’t DVD record and we want to see a movie in the TV, we can create a VCD easily.
Necessary: cdrdao, vcdtools, video in mpg format.
Example:
$ mkvcdfs video.mpg
$ cdrdao blank –device /dev/hdc (if it’s a rewritable CD)
$ cdrdao write –device /dev/hdc –eject vcd.toc
What package does belong this file?
(Is it said this way in English?)
Explanation: often we want to know to that package belongs a file. Sometimes it can be something very trivial, but other times, in which the file has a less specific name, it can be a great problem and remove enough of our valued time, there is a way easy to obtain this.
Necessary: which, dpkg, (¿debian?)
Example:
$ which touch
$ dpkg -S /usr/bin/touch
An opened port? What program has opened this port?
Explanation: When we have an opened port and we don’t know that port is this, it can be a port that we don’t need that it’s opened, or a port that uses a program that we are using and we wish continue with it opened.
Necessary: netstat (in any distribution)
Example:
# netstat -tnap
¿Where is pkgconfig?
Explanation: At some time there has happened to me that try to compile a program, it was asking me for the directory pkgconfig and it wasn’t finding though this directory existed. We must say where it’s. In general it’s in /usr/lib/pkgconfig but it can be in /usr/local/lib/pkgconfig, depending the distribution, the way of installing the modules that it contains, etc.
Compile with gcc y gtk
Explanation: When gtk we want compile a small program in c with the gtk graphical libraries, without needing to write neither Makefile, or anything, it’s necessary pass a small parameter to gcc in order that it compiles with gtk.
Necessary: gcc, gtk libraries
Example:
$ gcc appgtk.c -o appgtk `pkg-config –cflags –libs gtk+-2.0`
Rename multiple files
Explanation: When we have a great quantity of files in the same directory and we need rename them rapidly, there is a way easy to do it from the console. It’s possible use rename for deleting a common part of the name of files, as for example, spaces.
Necessary: rename
Example:
$ rename ’s/portion_to_delete//’ *.ext
Add suffix or prefix to multiple files
Explanation: There are times that we need to add a suffix or a prefix to multiple files, and we find to do it in a easy way from console. With the language python this is very easy.
Necessary: python (in all distros)
Example:
execute python in a console and inside of python interpreter:
import os
for archives in os.listdir(’/directory_of_files/’):
*for suffix:
…os.rename(archives, archives + ’suffix’)
*for prefix:
…os.rename(archives, ‘prefix’ + archives)
How to reproduce a video that it doesn’t synchronize
Explanation: There are times that I have visualized some video in my computer (an old computer), it sees me to pulls, or the sound and the video don’t synchronize well. It’s possible to see it correctly, though losing something of the image quality, but something is something.
Necessary: mplayer, video codecs
Example:
$ mplayer -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all video.avi
If it’s seen bad change lowres:1 to lowres:0.1 (this can be changed).
How to encode a video to 3gp
Explanation: mobile multimedia they are in the habit of reproducing videos in 3gp format, if we want encode some video to this format for have it in the mobile, it’s possible to do easily with mplayer, mencoder and ffmpeg, in way text.
Necessary: mplayer, ffmpeg, mencoder, video codecs
Example:
Audio:
$ mplayer -vo null -ao pcm -af resample=8000,volume=+4db:sc ‘input.avi’
Video:
$ mencoder ‘input.avi’ -nosound -ovc lavc -lavcopts vcodec=mpeg4 -vop expand=176:144,scale=176:-2 -o output.avi -ofps 12
Join video and audio:
$ ffmpeg -i input.avi -i audiodump.wav -b 48 -ac 1 -ab 12 -map 0.0 -map 1.0 output.3gp
Sure that there are thousand ways of doing these tasks, but this way it’s as more easy for me, and already I am accustomed to them.











Related Articles
No user responded in this post
Leave A Reply
Please Note: Comment moderation maybe active so there is no need to resubmit your comments