quinta-feira, 30 de agosto de 2018

Handling pdf files in linux, using command line


Some times I need to merge or split files in pdf, and a great tool for this is PDFtk. I, generally, prefer use the command line, it's just my preference, so, follow the tips:

Installing


$ sudo apt-get install pdftk


Merging separate files in one


$ pdftk file1.pdf file2.pdf output final_file.pdf


Splitting files


$ pdftk A=fileA.pdf cat A1 output page1.pdf

or, if you want the pages 1 to 3 and the 5:

$ pdftk A=fileA.pdf cat A1-3 A5 output final_file.pdf

or yet, the pages you want are in different files, see:

$ pdftk A=fileA.pdf B=fileB.pdf cat A1-3 A5 B4-5 B7 output final_file.pdf
 I took the pages 1, 2, 3 and 5 of fileA, and pages 4, 5 and 7 of fileB.


Graphical Interface



Now, if you dont't like command line, and want using a graphical tool, you need to know the PDF Chain.

Installing


$ sudo apt-get install pdfchain


That's all, folks!

Some commands of pip - python package manager

In case you have the two python version installed in your system, using pip when you using python2.x and pip3 when using python3.


Installing

Using python 2.x:
$ sudo apt-get install python-pip

or, if you want to use python3:
$ sudo apt-get install python3-pip

Updating

pip
$ sudo pip install --upgrade pip

pip3
$ sudo pip3 install --upgrade pip

You can also use the above command to upgrade the pip packages, see:
$ pip install --upgrade package_name

Installing packages

pip
$ sudo pip install package_name

pip3
$ sudo pip3 install package_name


If you want install an especific package version, use the command like this example:
$ sudo pip install googlemaps==3.0.2

In case you already have this package installed, just upgrade it:
$ sudo pip install --upgrade googlemaps

Listing all of installed packages

pip:
$ sudo pip freeze

pip3
$ sudo pip3 freeze

Checking the pip version

pip
$ sudo pip --version

pip3
$ sudo pip3 --version


That's all folks!

terça-feira, 21 de agosto de 2018

DPKG RETURNED AN ERROR CODE (1)


Recentemente tive problemas com warsaw quando que não obitve sucesso na instalação do pacote de segurança da Caixa Econômica Federal, em meu Linux Mint.
Contudo, a instalação do .deb bloqueou apt, retornando sempre o mesmo erro, de que teve problemas com o warsaw e o dpkg retornava erro. Nada adiantava, quando que após algumas pesquisas resolvi o problema.

Remova os pacotes com o nome warsaw do /var/lib/dpkg/info/

$ sudo rm  /var/lib/dpkg/info/warsaw.*

Pronto, agora:

$ sudo apt-get clean
$ sudo apt-get autoremove







quinta-feira, 2 de agosto de 2018

"Failed to fetch http://dl.google.com/linux/earth/deb/dists/stable/Release"


I have received this warning every time I upgrade my Linux Mint Debian Editian 2 (LMDE 2). Today I decided to solve this problem. After some research I found a possible solution. I'm still testing, but I'll share it this way to fix the problem:

First step, execute this command:
$ sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-earth-pro.list"

So, execute this one:
$ sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/cron.daily/google-earth-pro"

And then:
$ sudo apt-get update ; sudo apt-get check

As I commented, I'm still testing if this configuration will be reset, but with this I can upgrade the sources. In case I have news I will tell you.

Tks!