Archive for giugno, 2008
Correttore ortografico in Openoffice
Se vorresti aggiungere altri dizionari in open-office (Kubuntu Feisty, Ubuntu…) e clicchi su File > Procedure guidate > Installa dizioniari e ti va in crash, si chiude, ripristina, cerca di abilitare un macro, va in crash in un loop senza fine: sappi che tu puoi fare:
sudo apt-get update
sudo apt-get install openoffice.org
e ti installa un 4mb di pacchetti mancanti e poi va, basta insistere a cliccare su”continua” nel wizard. “sudo oowriter” per installare i dizionari per tutti gli utenti.
grazie launchpad.
Post (forse) correlati:
Netbooks con Ubuntu in arrivo
Secondo Mark Shuttleworth il mondo vedrà tra breve arrivare netbooks (piccoli portatili economici pensati sopratutto per navigare) equipaggiati con Ubuntu:
The Canonical OEM team has been approached by a number of OEM’s who want to sell netbooks (small, low-cost laptops with an emphasis on the web) based on Ubuntu. Almost universally, they’ve asked for standard Ubuntu packages and updates, with an app launcher that’s more suited to new users and has the feeling of a “device” more than a PC.
Post (forse) correlati:
Il backup totale, integrale e completo
Premessa: Almeno la /home dovrebbe essere su partizione separata, perché in caso di guasti irrimediabili basta reinstallare il sistema senza dover toccare i dati e impostazioni. Si può creare con gparted da un CD live (Ubuntu, Knoppix o direttamente gparted live) e spostarci il contenuto (cartelle “nomeutente/i), modificando /etc/fstab. Cercando in rete si trovano molte guide, una è qui.
1) Questo file – salvato con nome “backup” in /home/utente/bin e reso eseguibile in “proprietà” – crea una copia sincronizzata della /home/utente su un disco USB (ma anche su una cartella di rete, su un altro disco ecc)
#–exclude=espressione da escludere
rsync -auv –exclude=.local – -exclude=.thumbnails v – -delete – -stats /home/UTENTE/ /media/NOME_DISCO/backup_UTENTE
NOTA: si vede male ma per le opzioni estese ci vogliono due trattini – -
Altre opzioni:
man rsync
Da ora in poi basta scrivere “backup” nel terminale per aggiornare il backup: verranno copiati solo i file nuovi, quelli modificati e cancellati anche nel backup quelli non più esistenti.
2) In K/X/Ubuntu in un momento di perfetto funzionamento dare
dpkg –get-selections > ~/pacchetti_installati.txt
Se dovrebbe essere necessario una reinstallazione (anche su PC diverso) basta il comando
sudo bash
dpkg –set-selections < ./pacchetti_installati.txt && apt-get dselect-upgrade
per reinstallare tutti i programmi.
3) Se si sono fatte modifiche in /etc (xorg.conf, alsa-base) vanno copiati anche questi file modificati nel backup
4) Infine si può fare un immagine della partizione del sistema: Avviare da CD live, e dare
dd if=/dev/sdaX of=/media/NOME_DISCO/immagine-sdaX
con X il numero della partizione (sudo fisk -l per vedere tutti)
Il ripristino si fa con
dd if=/media/NOME_DISCO/immagine-sdaX of=/dev/sdaX
La medaglia d’oro però va a rsnapshot. Elimina un grosso difetto della soluzione con rsync: cancellando un file o cartella per sbaglio e facendo di seguito un backup con rsync si cancellano anche sul backup, a meno di non usare l’opzione –delete, sconsigliato.
Praticamente abbiamo più versioni della nostra home sul backup mentre i file identici esistono solo una volta grazie ai hardlink di ext3, quindi un enorme risparmio di spazio, nel esempio sotto tutto il backup ammonta a 88gb mentre una cartella monthly* o weekly* a 44gb, cioè la dimensione della mia home:
La configurazione è un po’ ostile e va fatto nel file /etc/rsnapshot.conf, riporto le cose essenziali:
#################################################
# rsnapshot.conf – rsnapshot configuration file #
#################################################
#
# OSSERVARE QUESTE REGOLE:
#
# Questo file richiede TAB per spaziare tra gli elementi
#
# Percorsi devono finire con /:
# corretto: /home/
# sbagliato: /home
#
###########################
# SNAPSHOT ROOT DIRECTORY #
############################ Tutti backup verranno salvati in questo percorso
# Dare una etichetta con gparted a un eventuale disco USB
# per assicurarsi che viene sempre montato nello stesso percorso in /media
# Esempio:
snapshot_root /media/nome_etichetta/backup/# If no_create_root is enabled, rsnapshot will not automatically create the
# snapshot_root directory. This is particularly useful if you are backing
# up to removable media, such as a FireWire or USB drive.
#
no_create_root 1#################################
# DIPENDENZE DA PROGRAMMI ESTERNI #
#################################cmd_cp /bin/cp
cmd_rm /bin/rm
cmd_rsync /usr/bin/rsync
# Scommenta per attivare remote ssh backup.
#
#cmd_ssh /usr/bin/ssh# Commenta per disabilitare log.
#
cmd_logger /usr/bin/loggercmd_du /bin/du
#########################################
# INTERVALLI DEL BACKUP
# Univoci e in ordine ascendente
# i.e. hourly, daily, weekly, etc.
# Esempio: 5 versione backup da tenere del weekly, 3 dal monthly
##########################################interval hourly 6
#interval daily 3
interval weekly 5
interval monthly 3############################################
# GLOBAL OPTIONS #
# All are optional, with sensible defaults #
############################################# Verbose level, 1 through 5.
# 1 Quiet Print fatal errors only
#2 Default Print errors and warnings only
#3 Verbose Show equivalent shell commands being executed
# 4 Extra Verbose Show extra verbose information
# 5 Debug mode Everything
#
verbose 3# Same as “verbose” above, but controls the amount of data sent to the
# logfile, if one is being used. The default is 3.
#
loglevel 3# If you enable this, data will be written to the file you specify. The
# amount of data written is controlled by the “loglevel” parameter.
#
logfile /var/log/rsnapshot# Il file di lock, per non avere due volte rsnapshot in esecuzione.
# Per evitare errori di permessi scegliere la home
lockfile /home/arch/rsnapshot.pid# Argomenti corti e lunghi passati a rsync. Per dettagli: rsync –help
rsync_short_args -auvp
rsync_long_args –stats# ssh has no args passed by default, but you can specify some here.
#ssh_args -p 22
# Default arguments for the “du” program (for disk space reporting).
# The GNU version of “du” is preferred. See the man page for more details.
# If your version of “du” doesn’t support the -h flag, try -k flag instead.
#
du_args -csh# If this is enabled, rsync won’t span filesystem partitions within a
# backup point. This essentially passes the -x option to rsync.
# The default is 0 (off).
#
#one_fs 0# I parmetri include e exclude [pattern] passati a rsync.
#Multipli argomenti su righe singole
# Dettagli nella rsync man page
#Esempi: nessun backup del cestino e dei dischi di virtualbox
#include XXXX
exclude .local
exclude .vdi# The include_file and exclude_file parameters, if enabled, simply get
# passed directly to rsync. Please look up the –include-from and
# –exclude-from options in the rsync man page for more details.
#
#include_file /path/to/include/file
#exclude_file /percorso/al/file# If your version of rsync supports –link-dest, consider enable this.
# This is the best way to support special files (FIFOs, etc) cross-platform.
# The default is 0 (off).
#
link_dest 1# The default is 0 (off).
#
#sync_first 0#The default is 0 (off).
#
#use_lazy_deletes 0# Number of rsync re-tries. If you experience any network problems or
# network card issues that tend to cause ssh to crap-out with
# “Corrupted MAC on input” errors, for example, set this to a non-zero
# value to have the rsync operation re-tried
#
#rsync_numtries 0###############################
### BACKUP / SCRIPTS ###
################################ LOCALHOST
#backup /home/arch/.mozilla mozilla/
backup /etc/ etc/
backup /home/nome_utente/ nome_utente/
#backup /usr/local/ localhost/
#backup /var/log/rsnapshot localhost/
#backup /etc/passwd localhost/
#backup /home/foo/My Documents/ localhost/
#backup /foo/bar/ localhost/ one_fs=1, rsync_short_args=-urltvpog
#backup_script /usr/local/bin/backup_pgsql.sh localhost/postgres/# EXAMPLE.COM
#backup_script /bin/date “+ backup of example.com started at %c” unused1
#backup root@example.com:/home/ example.com/ +rsync_long_args=–bwlimit=16,exclude=core
#backup root@example.com:/etc/ example.com/ exclude=mtab,exclude=core
#backup_script ssh root@example.com “mysqldump -A > /var/db/dump/mysql.sql” unused2
#backup root@example.com:/var/db/dump/ example.com/
#backup_script /bin/date “+ backup of example.com ended at %c” unused9# CVS.SOURCEFORGE.NET
#backup_script /usr/local/bin/backup_rsnapshot_cvsroot.sh rsnapshot.cvs.sourceforge.net/# RSYNC.SAMBA.ORG
#backup rsync://rsync.samba.org/rsyncftp/ rsync.samba.org/rsyncftp/
Una volta create le cartelle e messo a posto il file possiamo lanciare rsnapshot con gli argomenti che abbiamo specificato:
rsnapshot weekly
o
rsnapshot monthly
Se usiamo un disco usb conviene di lanciarlo manualmente in quanto non sarà sempre montato. Se invece facciamo un backup in rete o su un secondo disco fisso possiamo inserire i comandi in /etc/cron.daily salvando in questa directory un semplice script eseguibile:
!#/bin/bash
rsnapshot daily
Stesso procedimento per cron.weekly e eventualmente cron.monthly con script analogici, cioè rsnapshot weekly
rsnapshot monthly
Adesso basta installare anacron se la macchina non è sempre accesa per far sì che vengono sempre eseguiti.
Post (forse) correlati:

