Blog del sito MyDigitalia - Usare il Pc seriamente.
Non disdegnate di sbirciare anche la pagina di Facebook

domenica 13 ottobre 2019

avoid b/w photos in librebase

You must set read-only the field of linked pictures, as in the image below:

problems with "locale"

In case of problems with locale (i.g. autokey not starting, or a file with non-latin characters not opening) you can try these commands
  • export LC_ALL="en_US.UTF-8"
  • export LC_CTYPE="en_US.UTF-8
  • sudo dpkg-reconfigure locales

sabato 12 ottobre 2019

calculate age from year of birth

There are two ways:

via php

## 2. in php
You can also use php code, as in the following way
(inspired from this page (https://stackoverflow.com/questions/3776682/php-calculate-age), and _slighty modified_: 

    $dob ="$row[anno_nascita]";
    $age = date_diff(date_create($dob), date_create('now'))->y;
    echo "age: $age years
";

via mysql in phpmyadmin

1.do this sql query:
     select *,year(CURDATE())-year(anno_nascita) age from studenti__classi; 
2. save the result as view
3. and so you will have, in the view, the age (of your students, i.g.) that can work in LibreBase (to connect with that view).

giovedì 10 ottobre 2019

insert a text as field from an odt to another odt

0. Avoid to copy more than one paragraph: in that case the whole original file will be insert in the destination file.
1. copy an area in original file
2, paste special in destination file (as DDE link)

martedì 8 ottobre 2019

convert big (text) pdf files to word

This website has converted a big (5mb) text pdf file to word in a very good way.

venerdì 4 ottobre 2019

symlinks on fat32 devices

You can use posixovl:
  • install posixovl (i.g. via synaptic);
  • rename /sbin/mount-posixovl -> mount-posixovl.orig;
  • create a new mount-posixovl in sbin:

#!/bin/bash
# wrapper for mount.posixovl to conform with common mount syntax
# with this wrapper posixovl can be used in fstab

# location of the original mount.posixovl
origposixovl="/sbin/mount.posixovl.orig"

# gather inputs
while [ $# -gt 0 ]; do
        if [[ "$1" == -* ]]; then
                # var is an input switch
                # we can only use the -o or -F switches
                if [[ "$1" == *F* ]]; then
                        optsF="-F"
                else
                        optsF=""
                fi
                if [[ "$1" == *o* ]]; then
                        shift
                        optsfuse="-- -o $1"
                else
                        optsfuse=""
                fi
                shift
        else
                # var is a main argument
                sourcedir="$1"
                shift
                if [[ "$1" != -* ]]; then
                        targetdir="$1"
                        shift
                else
                        targetdir="$sourcedir"
                fi
        fi
done

# verify inputs
if [ "$sourcedir" == "" ]; then
        echo "no source specified"
        exit 1
fi
if [ "$targetdir" == "" ]; then
        echo "no target specified"
        exit 1
fi

# build mount.posixovl command
"$origposixovl" $optsF -S "$sourcedir" "$targetdir" $optsfuse

  • add to /etc/fstab something like this (depending on the name of your device):

LABEL=Basic\0402 /media/duns/basic2 vfat user,rw,noauto,uid=1000,gid=1000,iocharset=iso8859-1,shortname=mixed,showexec,utf8 1 2
/media/duns/basic2 /mnt/e-reader posixovl noauto 0 0


  • create a script, like this:

#!/bin/bash
wmctrl -c mount.posixovl.orig
mount /media/duns/basic2
mount.posixovl -F /media/duns/basic2 /mnt/e-reader
krusader --left /mnt/e-reader/ebooks --right /mnt/zippati/eBooks

done!

view djvu files with okular

Add "okular-extra-backends" in Synaptic.

Translate

Archivio blog