Thursday, April 24, 2014

Merge pdf files into one pdf file using GhostScript on Linux

Command:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf

Explanation:
  • gs starts the Ghostscript program. 
  • -dBATCH once Ghostscript processes the PDF files, it should exit. If you don't include this option, Ghostscript will just keep running. 
  • -dNOPAUSE forces Ghostscript to process each page without pausing for user interaction. 
  • -q stops Ghostscript from displaying messages while it works 
  • -sDEVICE=pdfwrite tells Ghostscript to use its built-in PDF writer to process the files. 
  • -sOutputFile=finished.pdf tells Ghostscript to save the combined PDF file with the specified name.

Monday, April 21, 2014

Crop a video file using ffmpeg

If you want to crop the file beyond 1 min then use the -t flag and as follows. It will generates the output.avi video with the first 60 seconds of the input.avi

ffmpeg -t 60 -i input.avi -an -vcodec copy output.avi

Sunday, April 13, 2014

CSS clearfix

.group:before,
.group:after {
  content: "";
  display: table;
}

.group:after {
  clear: both;
}

.group {
  zoom: 1 /* IE6&7 */
}

Make Odin flashable tar.md5 on Linux

Steps:

  1. tar -H ustar -c image_1 image_2 > your_odin_package.tar
  2. md5sum -t your_odin_package.tar >> your_odin_package.tar
  3. mv your_odin_package.tar your_odin_package.tar.md5
You are done!!!
Enjoy!