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

-----///

Sunday, October 16, 2016

Embedding a PDF in Blogger

The following HTML code is to embed a PDF in Blogger (Blogspot). We only need to change the "srcid" value (the 0B6bwihHnzzPHbHdsQUpFYVQ3Mm8 part for the new corresponding PDF value)


The code can be downloaded from here.
Or copied from here:

<iframe height="480px" src="https://docs.google.com/viewer?srcid=0B6bwihHnzzPHbHdsQUpFYVQ3Mm8&amp;pid=explorer&amp;efh=false&amp;a=v&amp;chrome=false&amp;embedded=true" width="720px"></iframe>

Saturday, October 01, 2016

Mounting the Android Phone in Ubuntu 16.04

I was getting the following pop up message 'Unable to mount Android Device' every time that I plugged my Android smartphone in my Linux Ubuntu 16.04 machine.

I found the solution taking as a reference the following thread.

First I used the following command:

lsusb

That gives me:
Bus 001 Device 004: ID 04e8:6860 Samsung Electronics Co., Ltd Galaxy (MTP)

Then I included this info:
# Samsung LTD Galaxy
ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

in the following file:
sudo vim /lib/udev/rules.d/69-libmtp.rules

And the following line:
ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0666"

In the following file:

sudo vim /lib/udev/rules.d/61-persistent-storage-android.rules

And that's all. After a reboot my Linux PC can mount without problems my Android phone.

-----///

Wednesday, June 29, 2016

Updating the Youtube-DL


sudo apt install python3-pip

sudo pip3 install --upgrade youtube-dl

-----------
The following is deprecated:

sudo apt install python-pip

sudo pip install youtube-dl

If you want to upgrade youtube-dl

sudo pip install --upgrade youtube-dl

or, if necessary

sudo pip install --upgrade pip


The following method of installation is deprecated:

sudo apt-get install python-setuptools

sudo easy_install pip



Friday, February 12, 2016

Segmentation fault (core dumped)

If after a segmentation fault you are not getting the core dumped file, you might need to edit the limits.conf (this is in Ubuntu 14.04)

sudo vim /etc/security/limits.conf

and add a line like:
username      soft    core            50000

The previous line is for a core dumped file up to 50000 KB for that user. The user would have to relogin for the changes to take effect. A "small" core dump file is around 10 MB.

-----///