Merge PDFs / Arrange pdf pages

merge in order

pdfunite file1.pdf file2.pdf <...> output.pdf

(last filename should not exist. If you fail to provide it, the last pdf will be overwritten):

 

arrange pages:

sudo apt-get install libreoffice-pdfimport
libreoffice <file.pdf>

File menu -> export to PDF

(disadvantage: the resulting file is pretty big)

 

convert color pdf to greyscale:

gs \
 -sOutputFile=output.pdf \
 -sDEVICE=pdfwrite \
 -sColorConversionStrategy=Gray \
 -dProcessColorModel=/DeviceGray \
 -dCompatibilityLevel=1.4 \
 -dAutoRotatePages=/None\
 -dNOPAUSE \
 -dBATCH \
 input.pdf

sources:

 

manipulating pdf files: pdftk (pdf toolkit):

more: https://wiki.ubuntuusers.de/PDF (german)

 

Great tools to use in ubuntu / linux

A few applications that help me a lot daily

Application Purpose install command
zim note taking sudo apt-get install zim
RedNotebook agenda sudo apt-get install rednotebook
Alarm Clock Alarm/ Timer sudo apt-get install alarm-clock-applet
Geany text editor sudo apt-get install geany
Kdiff3 file/ folder comparator sudo apt-get install kdiff3*- note, it will install a lot of kde stuff
Midnight Commander file manager (console) sudo apt-get install mc
vim tesxt editor (console) sudo apt-get install vim
pinta image editor sudo apt-get install pinta
Image magick image editor (console) sudo apt-get install imagemagick imagemagick-doc
bleachbit system cleanup sudo apt-get install bleachbit
k4dirstat disk usage sudo apt install k4dirstat
htop system monitoring (console) sudo apt install htop
iotop file monitor (console) sudo apt install iotop

Canon Lide 220 in ubuntu 14.04

To fix it (source: http://gsusmonzon.blogspot.de/2015/06/canon-lide-220-in-ubuntu-1404.html)

  • ensure it’s identified with lsusb
  • add alternative ppa + install xsane
    • sudo add-apt-repository ppa:rolfbensch/sane-git
    • sudo apt-get update && sudo apt-get install gocr libsane-extras xsane-common xsane
    • sudo apt-get update && sudo apt-get install gocr libusb-dev libsane-dev libsane-extras xsane-common xsane
  • add user to scanner group
    • usermod -a -G scanner [user]

 

Convert jpg to pdf in linux (and vice-versa)

  1. install imageMagick
    sudo apt-get install imagemagick
  2. in the command line:
    1. To convert JPG -> PDF:
      convert input.jpg output.pdf
    2. To merge 2 image files in one pdf:
      convert input_1.jpg input_2.jpg output.pdf
    3. to decrease the quality (and therefore the file size):
      convert input_1.jpg -quality 90 output.pdf
    4. to resize the file:
      convert input_1.jpg -resize 50% output.pdf
    5. to convert PDF -> image (it generates one image per PDF page)
      convert input.pdf output.png

+ info/ source:

JAVA_HOME is not defined correctly (set it correctly)

If you get this while running java based sw (for ex: maven)

$ mvn
Error: JAVA_HOME is not defined correctly.
We cannot execute /usr/bin/java/bin/java

 

add the java home and java path (in my case, oracle java 8) to the enviroment variables (ex, with text editor vim)

sudo vim /etc/profile
#add these 2 lines at the end of the file:
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
export PATH=JAVA_HOME/bin:$PATH

save and reload vars executing:

$ source /etc/profile

all done. Now trying one more time:

$mvn -version
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_66, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre

android phone – unlock “Too may pattern atempts”

My sister locked my phone playing with unlock pattern attempts.

Looked  in the net. Found and answer 🙂

* run in adb shell:

adb -d shell
sqlite3 data/data/com.android.providers.settings/databases/settings.db
sqlite> update secure set value=0 where name='lock_pattern_autolock';
sqlite> update secure set value=2726148 where name='lockscreen.lockoutattemptdeadline';
sqlite> delete from secure where name='lockscreen.lockedoutpermanently';
sqlite> .exit
# exit

source: http://forum.xda-developers.com/showthread.php?t=977398