Samstag, 7. August 2010

screen rotation script with wacom tablet rotation and font rendering adjustment

( Update: now available on github: https://github.com/fdietze/rotate )

  1. Put this script in ~/bin:
    https://raw.github.com/fdietze/rotate/master/rotate
  2. Make it executable.
    chmod +x ~/bin/rotate
  3. Log out. Log in.
  4. Use it in the Terminal.
    rotate inverted
  5. Create a Shortcut for easy usage.

Freitag, 6. August 2010

Merge PDFs with the command line

  1. Install Ghostscript and pdftk.
    sudo aptitude install ghostscript pdftk -y
  2. Put this script in ~/bin.
    http://einrad.eu/stuff/pdfmerge
  3. Make it executable.
    chmod +x ~/bin/pdfmerge
  4. Log out. Log in.
  5. Use it.
    pdfmerge output.pdf a.pdf b.pdf c.pdf

Create a GRUB2 bootable external harddrive with Ubuntu and Windows 7 setup

  1. Create a NTFS boot partition in the beginning of the drive and set the hidden flag.
  2. Mount the boot partition.
    sudo mount /dev/sdX1 /mnt
  3. Install GRUB2 on the external drive with the root-directory on the NTFS boot partition (needs to be under the 1024 cylinder boundary).
    sudo grub-install --root-directory=/mnt --no-floppy /dev/sdX
  4. Edit the grub configuration file.
    gedit /mnt/boot/grub/grub.cfg
    And insert the following Contents:
    menuentry "Ubuntu Live 10.04 32bit"
    {
        loopback loop /ubuntu-10.04-desktop-i386.iso
        linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-10.04-desktop-i386.iso noeject noprompt  quiet splash -- debian-installer/language=de console-setup/layoutcode?=de
        initrd (loop)/casper/initrd.lz
    }

    menuentry "Windows 7 x86 Deutsch Setup"
    {
        insmod chain
        chainloader +1
    }
  5. Copy the Ubuntu ISO.
    cp [...]/ubuntu-10.04-desktop-i386.iso /mnt
  6. Mount the Windows 7 ISO (make sure, there is no cd in the drive).
    sudo mount [...]/de_windows_7_professional_x86_dvd_x15-65812.iso /media/cdrom -o loop
  7. Copy the Windows 7 ISO contents.
    cp -r /media/cdrom/* /mnt
  8. Umount the ISO and boot partition.
    sudo umount /media/cdrom
    sudo umount /mnt
  9. Finished. You can now boot from the external drive or test it with QEMU.
    sudo qemu -m 256 -hda /dev/sdX