Saturday, November 26, 2016

Rotate a PDF under Linux with pdftk

sudo apt-get install pdftk

To rotate page 1 by 90 degrees clockwise:
pdftk in.pdf cat 1east output out.pdf 

To rotate all pages clockwise:
pdftk in.pdf cat 1-endeast output out.pdf 

From the "man" page
The page rotation setting can cause pdftk to rotate pages and documents. Each option sets the page rotation as follows (in degrees): north: 0, east: 90, south: 180, west: 270, left: -90, right: +90, down: +180. left, right, and down make relative adjustments to a page's rotation.

Adding a Swap Partition After System Installation

Updating partitions.
We need to edit /etc/fstab and add the new swap partition.

sudo nano /etc/fstab

We need to add a line that looks like

UUID=735b3be3-779c-4d21-a944-b033225f3ab4 none   swap    sw      0       0

The UUID can be got using the command

sudo blkid /dev/sdaX

---------///
We can format this partition with:

sudo mkswap /dev/sdX
replacing the X with your partition number. Mount this partition as swap with

sudo swapon -U UUID

If you want to use your swap for hibernating then you need to update the UUID in
/etc/initramfs-tools/conf.d/resume
with this content RESUME=UUID=xxx.
Don't forget to
sudo update-initramfs -u

-----///