Monday, August 25, 2008

Merging PDFs on Windows

First you need Ghostscript.
Then, you can just issue the command:
> gswin32 -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=merged_file.pdf -dBATCH file_1.pdf file_2.pdf file_3.pdf

What I noticed is that the text in the merged file is a little bigger than the original one at the same magnification although nothing is missing.
Maybe you/we need to tweak a bit with the parameters...

Sunday, August 24, 2008

Dual-boot With Grub After Installing Windows XP on a Linux Machine

Your situation: Windoz will boot but Linux is now invisible.
What you want is to have Grub installed on the Master Boot Record (MBR) of the first disk to pilot the boot sequence.
You need a Linux distribution CD/DVD with the rescue mode as an option. Any distribution is fine even if different from the one you have installed.
  1. Boot in rescue mode
  2. Once you have a shell type:
  3. > fdisk -l
  4. > grub
  5. grub> root (hd0, n)
  6. grub> setup (hd0)
  7. grub> quit
Notes
3. With fdisk -l you can check which partition holds the linux root partition (in case you forgot).
5. If your partition is, for example, /dev/sda2, then your value for n is 1 (Grub starts from 0)

Now you can exit the rescue shell and reboot. If you had a Grub configuration file configured to boot Linux and Windoz, you are done. You will be in the same exact position as before Winsoz zeroed Grub on the MBR.

If you didn't have Windoz before, you need to add to the Grub configuration file the Windoz entry:

title Windoz
root (hd0,m)
makeactive
chainloader +1

where m is the Windoz partition (Grub's way of course, see note above).