These are software packages that make my life easier. I use the GNU/Linux operating system, but most or all of these are available for other operating systems too.
Here's a command to add a comment to an Ogg Vorbis audio file:
vorbiscomment -a Ciaran_O\'Riordan_-_End_Software_Patents_-_LibrePlanet_2009.ogg -t "comment=Transcript: http://groups.fsf.org/index.php/Ciaran_O'Riordan_(LP09)"
Convert track 1 of a CD to ogg via pipe:
cdparanoia 1-1 - | oggenc -q 3 -o track-01.ogg - ; done
And to do that for a CD of 20 tracks:
for i in `seq -w 1 20`; do cdparanoia ${i}-${i} - | oggenc -q 3 -o track-${i}.ogg - ; done
gs -sPAPERSIZE=a4 -sDEVICE=pnmraw -r300 -dNOPAUSE -dBATCH
-sOutputFile=- -q input.pdf | ocrad > output.text
There's an article about a more thorough method here: How To Extract All Text From PDFs (Including Text In Images).
Here's a command which operates on all .pdf files in the current directory. It replaces any spaces in the filenames with underscores.
find . -maxdepth 1 -iname '*.pdf' | while read n; do mv
"$n" `echo "$n" | sed 's/ /_/g'`; done
I have two files with lists of words, each has one word per line, and I want to run a command based on all combinasions of those two lists. For a practical example, there's a website that posts videos each day, but they don't provide a convenient way to download them. The file names are different each day, but many use a recurring set of words used to form the file names, so if I try all those combinations, I'll get a few videos each day.
cat prefixes | while read p; do cat suffixes | while read s; do wget -c http://videos.gmanews.tv/2010a/03/${p}_030710_${s}.flv; done ; done
In this example, I'll also have to change the date (mmddyy).
To play a file at 1.5 times normal speed with mplayer:
mplayer -af scaletempo=scale=1.5 the_file.ogg
This increases the playback speed without increasing the pitch.
If you want to run, say, GIMP in Spanish, you can lauch it with this command from a shell command line:
LANGUAGE=es_ES gimp
For some commands such as "date", you use "LANG" instead
and you can only use the languages of "locales" that are installed
on your system. To see the list of locales, type:locale
-a
LANG=nl_BE.utf8 date
Here's the command I used to get the audio from a .flv video:
mplayer rozemarijn.flv -dumpaudio -dumpfile rozemarijn.mp3
When mplayer is given the dumpaudio command, it dumps an exact
copy of the audio data that's in the original file. No conversion is done
and no data is lost, so you can do this infinitely without degrading the
audio. This also means that you don't choose the format of the resulting
audio file. In this case, I knew the audio in the .flv file was in the MP3
format, so I gave the output file a name ending in ".mp3". I
could have called the output file "rozemarijn.wav" or
"rozemarijn.ogg", but that wouldn't change anything. The audio
would still be in MP3 format.
The following are suggestions for how to see what URLs your computer is accessing. This can be useful, for example, if you can see a video in your browser and you want to download it directly. I haven't gotten to try these commands out yet. They were suggested in a discussion thread on LWN.net (Thanks!).
Hmm, I don't remember exactly what this does:
ffmpeg -i filename -ab 56 -ar 44100 -b 500 -s 320x240 filename.mpg
It might have something to do with Rockbox's instructions for shrinking videos.
(Go: homepage of Ciarán O'Riordan)
© Copyright 2010 Ciarán O'Riordan. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. Distribution of modified versions of all or part of this article are permitted, provided that such works carry three things: (1) this copyright notice, (2) prominent notices stating the that it has been changed, and (3) information for how to obtain the original (such as a URL).