dos/windows to unix text files: cat [file.name].txt | tr -d '\r' > new.[file.name].txt mv new.[file.name].txt [file.name].txt or sed 's/\r//g' -i [file.name].txt empty lines deletion: sed '/^$/d' -i [file.name].txt multiple spaces and tab's deletion: sed 's/[ \t]\{1,\}/ /g' [file.name].txt spaces and tab's on the line begin deletion: sed 's/^[ \t]//g' [file.name].txt txt from webpages in text mode: links http://[addres]/[filename].html (then

\ "[filename].txt") or elinks http://[addres]/[filename].html (then

\ "[filename].txt") or links -dump [filename].html > [filename].txt or elinks -dump -no-numbering -no-references [filename].html > \ [filename].txt (elinks hendles with pages encodings better - not replaces "not ascii" chars witch ascii ones, elinks with only -dump option, produces numbered list of detected links on the end of document) pdf form webpages in text mode: if no virtual pdf printer in system, install it and set papersize on A3 with landscape orientation for that printer (this hack help handle with very long lines, or very wide webpages, without line wrapping) save page in html format: wget http://[addres]/[filename].html or links http://[addres]/[filename].html (then

) or elinks http://[addres]/[filename].html (then

) then print with virtual printer: links -dump [filename].html | lpr -P [virtual pdf printer] or elinks -dump -no-numbering -no-references [filename].html | \ lpr -P [virtual pdf printer] or just "print from web" (with "to text" inflight conversion): links -dump http://[addres]/[filename].html | lpr -P [virtual \ pdf printer] or elinks -dump -no-numbering -no-references [filename].html | \ lpr -P [virtual pdf printer] then rescale to A4 format with: pdfnup --scale 0.90 --nup 1x1 --orient landscape --outfile \ [filename].printable.pdf /var/spool/[virtual pdf printer \ driver]/[user name]/_stdin_.pdf or pdfnup --nup 1x1 --orient landscape --outfile /tmp/temp.pdf \ /var/spool/[virtual pdf printer driver]/[user name]/_stdin_.pdf and pdfnup --nup 1x2 --scale 0.90 --outfile \ [filename].printable.pdf /tmp/temporary.pdf second way gives "two pages on one" converting pdf to graphic files: pdftoppm -r 600 -aa yes -freetype yes -aaVector yes -gray \ [filename].pdf [filename] after conversion each page will be in file [filename]-pagenumber.pgm and then: convert [filename]-pagenumber.pgm \ [filename]-pagenumber.[final file format extension] this way conversion gives better results than using convert direct on pdf file. easy joining multiple pdf files in one pdfjoin --turn false [filename1].pdf [filename2].pdf --outfile \ joined.pdf or (if rotation is needed) pdfjoin [filename1].pdf [filename2].pdf --outfile joined.pdf easy one file with all sorces listing: ls [dir with sources]/[some wildcards i.e. *.h *.c *.*] > list then ./listing_generator.sh listing generator script body: #!/bin/sh sed 's/^/cat /g' list >part1 sed 's/^/echo -e "/g' list|sed 's/$/\\n"/g'> part2 echo '#!/bin/sh' > script paste part2 part1 |sed 's/^/echo -e "\*\*\*\*\*\*\*\*\\n" /g' \ | sed 's/\t/echo -e "\*\*\*\*\*\*\*\*\\n" /g'|sed 's/echo/\necho/g' \ | sed 's/cat/\ncat/g' >> script chmod u+x script rm part1 part2 ./script > listing.print.txt rm script joining video an audio streams in one file: mencoder video_stream.avi -audiofile audio_stream.mp3 -ovc \ copy -oac copy -o joined.avi or ffmpeg -i video_stream.avi -i audio_stream.mp3 -vcodec copy \ -acodec copy joined.avi converting windows media audio file to mpeg-1 audio layer 3 file: ffmpeg -i [file_name].wma -aq 0 [file_name].mp3 printing growing log on stdout: tail -f log_file.log