Thursday, November 22, 2012

Converting jpeg to pdf with lower quality

Convert jpeg into PDF with 50% quality:

$ convert -quality 50 file1.jpg file.pdf


Combine multiple file into PDf

$ pdftk *.pdf cat output merged.pdf
or
$ pdftk file1.pdf file2.pdf cat output merged.pdf

You need to have imagemagick and pdftk installed on your system.

If you have multiple files to convert, use the following command on bash:


$ for i in *.jpg; do convert -quality 50 -resize 60% "$i" "${i%.jpg}.eps"; done


Changing resolutions in DPI

$ convert -units PixelsPerInch pic1.png -density 300 pic1.jpg
$ identify -verbose pic1.jpg | grep Resolution
Resolution: 300x300


Converting from PDF to eps 

$ pdftops -eps input.pdf output.eps

Wednesday, November 21, 2012

File Synchronization over Network using Unison

Unison is great tool for synchronizing files over network. Earlier I used rsync for file-synchronization. Unison at least provides one level of comfort over rsync which requires quite a bit of customization. If you want to use Unison to synchronize files between two systems over a network, then please refer to the following links:

http://www.howtoforge.com/setting-up-unison-file-synchronization-between-two-servers-on-ubuntu-11.10

This worked for me on Ubuntu 12.04 LTS 64-bit version and I managed to do everything mentioned on this page. One more thing, you don't need to use the root login for executing the steps.

If you need to delete the several profiles already created on Unison, you should go to ~/.unison folder and delete the corresponding .prf files. It is not possible to delete profiles using GUI.