How to reduce the size of a PDF file

Using ghostscript:

 gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

To reduce it even more change -dPDFSETTINGS=/ebook to -dPDFSETTINGS=/screen.


Recover GRUB bootloader

If GRUB gets wiped by other operating system or is installed in the wrong disk, do this:

-> Boot from a live Debian USB

-> Start a console/terminal.

-> Find the disk where you want to install GRUB (sdX):

# lsblk -f

-> Create a mountpoint (/ospart) where you are going to mount your system partitition (sdXY)

# mkdir /ospart
# mount /dev/sdXY /ospart

-> Change root to the system partition (/ospart)

# for i in /sys /proc /dev; do mount --bind $i /target$i; done
# chroot /ospart /bin/bash

-> (Re)Install GRUB on your desired disk (sdX)
# grub-install /dev/sdX
# update-grub

> Reboot!

Colored prompts in bash

To get colored prompts in bash shells, all we have to do is to change the PS1 line in each user’s .basrc file:
nano ~$USER/.bashrc

If necessary uncomment the line:

I have a green prompt for the main user:
PS1='${debian_chroot:+($debian_chroot)}\[33[01;32m\]\u@\h\[33[00m\]:\[33[01;34m\]\w\[33[00m\]\$ '
which is the default if you enable color prompts.

a red one for root:
PS1='${debian_chroot:+($debian_chroot)}\[33[01;31m\]\u@\h\[33[00m\]:\[33[01;34m\]\w\[33[00m\]\$ '

and a purple one for my NAS:
PS1='\[33[01;35m\]\h\[33[00m\]:\w\$ '


Dyndns ddclient (Readynas addon) configuration file

replace emailaddress, username, password, servername1, servername2, servername3 accordingly.

#do not activate ssl
mail-failure=emailaddress # Mail failed updates to user
use=web,, web-skip=’IP Address’
#uncomment the line bellow
#enlever le # sur les lignes suivantes :

Use an SOCKS5 proxy through an SSH tunnel


ssh and direct connect (SOCKS5) :

The following line will start the ssh client and connect to

Port 8080 on localhost ( will listen for requests and send them to the remote machine.

The remote machine will then send the packets out as if they originated from itself.
ssh -C2qTnN -D 8080
Leave it running. And just configure the SOCKS5 proxy in the browser (localhost:8080)