This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
quickhowtos [2012/02/25 10:05] mantis [Rip a media stream] |
quickhowtos [2012/02/25 10:05] (current) mantis [Change encoding of a file] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | Find nifty Ubuntu Linux-based recipes here. | ||
+ | |||
+ | ======= Python setup.py to DEB package ======= | ||
+ | |||
+ | [[http://www.smallbulb.net/2011/194-python-setup-py-to-deb-package | Found]] it here. | ||
+ | |||
+ | Often Python packages come with setup.py utility but you'd rather have a .deb file. | ||
+ | |||
+ | <code bash> | ||
+ | sudo aptitude install python-stdeb | ||
+ | python setup.py --command-packages=stdeb.command bdist_deb | ||
+ | </code> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ======= Change encoding of a file ======= | ||
+ | <code bash> | ||
+ | iconv -l # lists available encodings | ||
+ | |||
+ | iconv -f <present encoding> -t <desired encoding> <file> | ||
+ | </code> | ||
+ | |||
+ | ======= Convert images to AVI file ======= | ||
+ | |||
+ | File names must contain sequence numbers (frame001.png, frame002.png etc.) | ||
+ | <code bash> | ||
+ | mencoder "mf://*.PNG" -mf fps=10 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4 | ||
+ | </code> | ||
+ | |||
+ | ======= Rip a media stream ======= | ||
+ | <code bash> | ||
+ | mplayer -dumpstream -dumpfile orgel.asf mms://apasf.apa.at/oe1_live_worldwide | ||
+ | mplayer -vc null -vo null -ao pcm:file=orgel.wav orgel.asf | ||
+ | oggenc -Q orgel.wav | ||
+ | ogg123 orgel.ogg | ||
+ | </code> | ||
+ | |||
+ | ======= Count occurences of pattern in multiple files ======= | ||
+ | <code bash> | ||
+ | egrep -hc "ECO>101<" *xml | awk '{total+=$0}END{print total}'}}} | ||
+ | </code> |