See differences between PDF files

A very convenient tool to visually display differences between two PDF files is diffpdf.

Advertisements

Multiple domains sharing one Nextcloud installation

You may easily have access to your Nextcloud via multiple domain names, e.g. cloud.myname.com and cloud.myname.org.

Set up virtual servers as you normally would and either configure them both to use the same WWW document root directory or create symbolic links to the initial directory as needed.

Do not forget to add all these domains to the trusted_domains section of config/config.php file in the Nextcloud directory, like:

‘trusted_domains’ =>
array (
0 => ‘cloud.myname.com’,
1 => ‘cloud.myname.org’,
),

 


Forgot password for Nextcloud

If you have forgotten your admin (or any other for that matter) password for Nextcloud, one way to fix it is like this.

Go to the root directory of your Nextcloud installation and type:

  • sudo -u www-data php ./occ user:resetpassword <username>

Substitute <username> with the username of the user you want to reset the password for.

NB! The actual username may be different from the display name, for the admin account too.

If you do not remember the actual username, you can look it up in the MySQL database. Using any suitable tool look into the oc_users table of the Nextcloud’s database. The field uid contains the actual username which you shall then use with the occ script to reset the password.


Fast image viewer for Linux

Meet feh – a fast and minimalist image viewer, suitable for quickly scrolling though your collection of resized photos without annoying jerks and delays.

It can be installed from your package repository.

One way to use it is to open the terminal window in the folder where your images are stored and run command:

  • feh -ZF

Here “Z” stands for zoom, and “F” stands for full screen. So it goes full screen and any images smaller than the screen size will be zoomed up. You can also add “r” parameter to recursively scan all subdirectories.

You can also set delay between slides. Read more about it all:

  • man feh

Client IP in SSH session

If you are writing a bash script and you want to know the remote public IP address of the client logged into the session via SSH, a simple way to do this is:

  • my_ip=`echo $SSH_CLIENT | awk '{ print $1}'`; echo $my_ip

Opening WebP with Gimp

If your version of Gimp does not yet have support for images in Google’s WebP format, you probably still can open them using gimp-webp plugin. Just check it out from Github and follow the instructions.


Connecting to MySQL without a password

There may be situations when you need to log into MySQL without providing a password. Well, not exactly without providing it at all, but without doing it in an interactive way or writing it in the command line in plain text. A real life example is doing database dump for backup purposes.

Luckily MySQL provides a mechanism to do just that. What you do is you create a file accessible only to you and MySQL and save your password within.

The procedure is very simple:

  • Go to your home directory
  • Create a hidden file named .my.cnf
  • Open it in a text editor
  • Create a section called “[client]” and provide your MySQL password, like this:
[client]
password=mypassword
  • Update access rights for better security:
chmod 600 .my.cnf