Archivio del mese di Marzo 2008

Rilasciato WordPress 2.5

Annunci, Novità Nessun commento »

Il logo di WordPressDa oggi è disponibile per il download la release 2.5 di WP! Conto di effettuare l’aggiornamento di questo sito entro pochi giorni, giusto il tempo di testare l’upgrade. L’annuncio ufficiale, di cui riporto le prime righe, si trova qui.

WordPress 2.5, the culmination of six months of work by the WordPress community, people just like you. The improvements in 2.5 are numerous, and almost entirely a result of your feedback: multi-file uploading, one-click plugin upgrades, built-in galleries, customizable dashboard, salted passwords and cookie encryption, media library, a WYSIWYG that doesn’t mess with your code, concurrent post editing protection, full-screen writing, and search that covers posts and pages.

UPDATE: Ho appena effettuato l’aggiornamento di WordPress. Non c’è che dire, la community ha fatto un lavoro eccellente, specialmente per quanto riguarda la gestione dei plugin che ora è davvero idiot-proof.

Mac vs PC vs Linux (South Park Style)

YouTube Nessun commento »

CSS e commenti condizionali per Internet Explorer

HTML, Tips & tricks Nessun commento »

Una versione particolarmente ben riuscita del logo di Internet ExplorerI commenti condizionali sono particolari istruzioni interpretabili dal browser Internet Explorer di Microsoft Windows. Sono supportati già dalla versione 5.0, ma pochissimi sono in grado di sfruttarne le notevoli potenzialità, specie nella correzione di interpretazioni anomale dei CSS proprio da parte del browser di casa Microsoft.

È possibile utilizzare commenti condizionali distinguendo addirittura la versione di Internet Explorer in uso dal navigatore, ottenendo effetti (o correzioni) differenti a seconda delle caratteristiche (o delle mancanze) specifiche della versione.

I commenti condizionali seguono una sintassi molto semplice, come nell’esempio che segue:

<!--[if IE 6]>
Qui ci metto istruzioni specifiche per Internet Explorer 6
<![endif]–>

Come si vede, il commento condizionale è un comando racchiuso tra gli indicatori di commento HTML: in questo modo i browser che non supportano questa funzionalità ignoreranno completamente il commento e le istruzioni in esso racchiuse.

Attenzione! Proprio per questo motivo, i commenti condizionali non possono essere utilizzati direttamente nei fogli di stile, ma vanno inclusi giocoforza nelle normali pagine HTML.

Ecco un altro semplice ma esaustivo esempio:

<p><!--[if IE]>
Stai utilizzando Internet Explorer<br />
<![endif]–>
<!–[if IE 5]>
Stai utilizzando Internet Explorer 5<br />
<![endif]–>
<!–[if IE 5.0]>
Stai utilizzando Internet Explorer 5.0<br />
<![endif]–>
<!–[if IE 5.5]>
Stai utilizzando Internet Explorer 5.5<br />
<![endif]–>
<!–[if IE 6]>
Stai utilizzando Internet Explorer 6<br />
<![endif]–>
<!–[if IE 7]>
Stai utilizzando Internet Explorer 7<br />
<![endif]–>
<!–[if gte IE 5]>
Stai utilizzando Internet Explorer, versione 5 o superiore<br />
<![endif]–>
<!–[if lt IE 6]>
Stai utilizzando Internet Explorer, versione inferiore alla 6<br />
<![endif]–>
<!–[if lte IE 5.5]>
Stai utilizzando Internet Explorer, versione inferiore o uguale alla 5.5<br />
<![endif]–>
<!–[if gt IE 6]>
Stai utilizzando Internet Explorer, versione superiore alla 6<br />
<![endif]–>
</p>
Il risultato di questo semplice elenco di commenti condizionali è riportato nelle righe seguenti, sempre che stiate utilizzando Internet Explorer (scelta sconsigliata):












Esempi d’uso di rdiff-backup

Backup, Copincollato, Shell, Sistema, Tips & tricks Nessun commento »

Riporto qui integralmente la pagina che contiene gli esempi pubblicati sul sito ufficiale del progetto rdiff-backup. Non escludo di provvedere ad una sua progressiva traduzione, nei prossimi giorni, tempo permettendo.

rdiff-backup examples

Sections

Backing up

  • Simplest case—backup local directory foo to local directory bar. bar will end up a copy of foo, except it will contain the directory foo/rdiff-backup-data, which will allow rdiff-backup to restore previous states.
    rdiff-backup foo bar
  • Simple remote case—backup directory /some/local-dir to the directory /whatever/remote-dir on the machine hostname.net. It uses ssh to open the necessary pipe to the remote copy of rdiff-backup. Just like the above except one directory is on a remote computer.
    rdiff-backup /some/local-dir hostname.net::/whatever/remote-dir
  • This time the source directory is remote and the destination is local. Also, we have specified the username on the remote host (by default ssh will attempt to log you in with the same username you have on the local host).
    rdiff-backup user@hostname.net::/remote-dir local-dir
  • It is even possible for both the source and destination directories to be on other machines. Below we have also added the -v5 switch for greater verbosity (verbosity settings go from 0 to 9, with 3 as the default), and the –print-statistics switch so some statistics will be displayed at the end (even without this switch, the statistics will still be saved in the rdiff-backup-data directory).
    rdiff-backup -v5 --print-statistics user1@host1::/source-dir user2@host2::/dest-dir

Restoring

  • Suppose earlier we have run rdiff-backup foo bar, with both foo and bar local. We accidentally deleted foo/dir and now want to restore it from bar/dir.
    cp -a bar/dir foo/dirThat’s right, since rdiff-backup makes a mirror, we can retrieve files using standard commands like cp.
  • For the rest of the examples in the section, we will assume that the user has backed up with the command rdiff-backup local-dir host.net::/remote-dir. Of course, in all these examples it would be equally possible to have the source being remote and the backup directory local.In this case we can’t use cp to copying host.net::remote-dir/file to local-dir/file because they are on different machines. We can get rdiff-backup to restore the current version of that file using either of these::
    rdiff-backup --restore-as-of now host.net::/remote-dir/file local-dir/file
    rdiff-backup -r now host.net::/remote-dir/file local-dir/file
    The –restore-as-of (or -r for short) switch tells rdiff-backup to restore instead of back up, and the now option indicates the current time.
  • But the main advantage of rdiff-backup is that it keeps version history. This command restores host.net::/remote-dir/file as it was 10 days ago into a new location /tmp/file.
    rdiff-backup -r 10D host.net::/remote-dir/file /tmp/fileOther acceptable time strings include 5m4s (5 minutes and 4 seconds) and 2002-03-05 (March 5th, 2002). For more information, see the TIME FORMATS section of the manual page.
  • Finally, we can use rdiff-backup to restore directory from an increment file. Increment files are stored in host.net::/remote-dir/rdiff-backup-data/increments and hold the previous versions of changed files. If you specify one directly:
    rdiff-backup host.net::/remote-dir/rdiff-backup-data/increments/file.2003-03-05T12:21:41-07:00.diff.gz local-dir/filerdiff-backup will tell from the filename that it is an rdiff-backup increment file and thus enter restore mode. Above the restored version is written to local-dir/file.

Deleting older files

Although rdiff-backup tries to save space by only storing file differences, eventually space may run out in the destination directory. rdiff-backup’s –remove-older-than mode can be used to delete older increments.

This section assumes that rdiff-backup has been used in the past to back up to host.net::/remote-dir, but all commands would work locally too, if the hostname were ommitted.

  • This commands deletes all information concerning file versions which have not been current for 2 weeks:
    rdiff-backup --remove-older-than 2W host.net::/remote-dirNote that an existing file which hasn’t changed for a year will still be preserved. But a file which was deleted 15 days ago cannot be restored after this command is run.
  • As when restoring, there are a variety of ways to specify the time. The 20B below tells rdiff-backup to only preserve information from the last 20 rdiff-backup sessions. (nnB syntax is only available in versions after 0.13.1.)
    rdiff-backup --remove-older-than 20B host.net::/remote-dir

File selection with include/exclude options

Sometimes you don’t want to back up all files. The various –include and –exclude options can be used to select exactly which files to back up. See the man page for a list of all the options and their definitions.

  • In this example we exclude /mnt/backup to avoid an infinite loop.
    rdiff-backup --exclude /mnt/backup / /mnt/backup(Actually rdiff-backup can automatically detect simple loops like the one above.) This is just an example, in reality it would be important to exclude /proc as well.
  • This example is more realistic. We have excluded /proc, /tmp, and /mnt. /proc in particular should never be backed up. Also, the source directory happens to be remote.
    rdiff-backup --exclude /tmp --exclude /mnt --exclude /proc user@host.net::/ /backup/host.net
  • Multiple include and exclude options take precedence in the order they are given. The following command would back up /usr/local/bin but not /usr/bin.
    rdiff-backup --include /usr/local --exclude /usr / host.net::/backup
  • rdiff-backup uses rsync-like wildcards, where ** matches any path and * matches any path without a / in it. Thus this command:
    rdiff-backup --include /usr/local --include /var --exclude '**' / /backupbacks up only the /usr/local and /var directories. The single quotes ” are not part of rdiff-backup and are only used because many shells will expand **.
  • Here is a more complicated example:
    rdiff-backup --include '**txt' --exclude /usr/local/games --include /usr/local --exclude /usr --exclude /backup --exclude /proc / /backupThe above command will back up any file ending in txt, even /usr/local/games/pong/scores.txt because that include has highest precedence. The contents of the directory /usr/local/bin will get backed up, but not /usr/share or /usr/local/games/pong.
  • rdiff-backup can also accept a list of files to be backed up. If the file include-list contains these two lines:
    /var
    /usr/bin/gzip
    Then this command:
    rdiff-backup --include-filelist include-list --exclude '**' / /backup
    would only back up the files /var, /usr, /usr/bin, and /usr/bin/gzip, but not /var/log or /usr/bin/gunzip. Note that this differs from the –include option, since –include /var would also match /var/log.
  • The same file list can both include and exclude files. If we create a file called include-list that contains these lines:
    **txt
    - /usr/local/games
    /usr/local
    - /usr
    - /backup
    - /proc

    Then the following command will do exactly the same thing as the complicated example two above.
    rdiff-backup --include-globbing-filelist include-list / /backup
    Above we have used –include-globbing-filelist instead of –include-filelist so that the lines would be interpreted as if they were specified on the command line. Otherwise, for instance, **txt would be considered the name of a file, not a globbing string.

Getting information about the backup directory

The following examples assume that you have run rdiff-backup in-dir out-dir in the past.

  • This command finds all new or old files which contain the string frobniz.
    find out-dir -name '*frobniz*'
    rdiff-backup doesn’t obscure the names of files at all, so often using traditional tools work well.
  • Either of these equivalent commands lists the times of the available versions of the file out-dir/file. It may be useful if you need to restore an older version of in-dir/file but aren’t sure which one.
    rdiff-backup --list-increments out-dir/file
    rdiff-backup -l out-dir/file
  • The following command lists all the files under out-dir/subdir which has changed in the last 5 days.
    rdiff-backup --list-changed-since 5D out-dir/subdir
  • This command lists all the files that were present in out-dir/subdir 5 days ago. This includes files that have not changed recently as well as those that have been deleted in the last 5 days.
    rdiff-backup --list-at-time 5D out-dir/subdir
  • The first command below compares the current files in out-dir (which is on a remote computer) with the files in in-dir, displaying which ones have changed. The second command is similar but compares in-dir to out-dir as it was 2 weeks ago.
    rdiff-backup --compare in-dir user@host::out-dir
    rdiff-backup --compare-at-time 2W in-dir user@host::out-dir
  • rdiff-backup writes one statistics file per session to the out-dir/rdiff-backup-data directory. An average of the files can be displayed using the –calculate-average option and specifying the statistics files to use.
    rdiff-backup --calculate-average out-dir/rdiff-backup-data/session_statistics*

Miscellaneous other commands

  • If you are having problems connecting to a remote host, the –test-server command may be useful. This command simply verifies that there is a working rdiff-backup server on the remote side.
    rdiff-backup --test-server hostname.net::/ignored
Fonte: http://rdiff-backup.nongnu.org

Buona Pasqua in tutte (o quasi) le lingue del mondo

Diario di bordo Nessun commento »
Uovo di Pasqua dorato con fiocco rosso

Buona Pasqua!

Questa brevissima pausa dalle comuni incombenze lavorative sia per tutti occasione - oltre che di gioia - di sincera riflessione, in particolare per tutti coloro che non soffrono: il significato profondo di questa commemorazione religiosa - che si sta via via sempre più trasformando in una sorta di festa pagana della rigenerazione - vi faccia guardare con occhi diversi ogni cosa. L’uovo è fin dai tempi più antichi un simbolo vitale e positivo. Emblema di vita nuova, metafora di rinascita dei corpi e della natura. Questi significati gli sono stati attribuiti in tutti i continenti e nelle tradizioni più antiche, tanto che per celebrare l’arrivo della bella stagione (primavera) si usava mangiare uova. Leggi il resto »

Let’s (Google) dance!

Diario di bordo, Motori di ricerca Nessun commento »

Il logo di Google ItaliaDal momento che una dozzina di portali di miei clienti hanno subito pesanti conseguenze a causa di questo fenomeno, riporto qui alcune notizie trovate qua e là relativamente all’argomento. Se pensate di rientrare in una situazione simile, contattatemi!

Gli avvocati di KinderStart.com, un portale dedicato ai prodotti per l’infanzia, hanno denunciato Google e pretendono un cospicuo risarcimento danni: “La nostra pagina principale ha perso il 70% delle visite per colpa di una decisione arbitraria e poco trasparente da parte di Google”.

KinderStart sostiene infatti che il motore californiano avrebbe abbassato il page-rank del sito aziendale, utilizzato da Google come criterio per calcolare la visibilità di una pagina web. Sebbene parziale e certamente poco efficace nel descrivere la qualità di un sito web, questo “indice” viene pubblicizzato da Google in vari modi, ad esempio con la sua Toolbar. Secondo i legali del sito americano questo genera una suggestione errata sull’effettiva popolarità del sito stesso.

Punto Informatico

Google non guarda in faccia a nessuno quando si tratta di pratiche borderline per guadagnare popolarità: a Mountain View prendono molto sul serio il loro PageRank, e tutte le attività sospettate di far ricorso a subdoli trucchi finiscono presto per causare un declassamento del sito che tentano di promuovere: in gergo si dice che quel sito è stato colpito da una Google Penalty. [...]

Esistono poi tante altre situazioni che possono condurre al declassamento: una Google Bomb, materiale copiato da un altro sito, una pagina link.htm zeppa di collegamenti strategici etc. Gli esperti oggi preferiscono parlare di filtri, visto che le tecniche adottate da BigM si sono fatte sempre più raffinate e sono in grado di coprire una vasta gamma di possibili trucchetti.

Atuttonet

Interlinking Dallo Stesso Ip. Per interlinking intendiamo quando i webmaster linkano tutti i siti di loro proprietà anche se hanno contenuto non pertinente, linkare molti siti con lo stesso ip è considerato da google una cosa”cattiva” quindi questa può essere una delle ragioni per i quali molti siti sono stati declassati.

I Maledetti Contest. Credo che a google non faccia piacere che un sito usi questa strategia di marketing per ottenere una valanga di backlinks, un esepio lampante può essere Gekissimo che con il contest del nokia ha ottenuto davvero molta popolarità e backlink, e forse è stato declassato per questo. (oltre che a vendere links)

Vendere Links. Be questo è risaputo, tutti si stanno accandendo contro text links ads, ma il problema riguara tutti i network di questo genere, anche Linklift il servizio di acquisto e vendità links usato da moltissimi italiani, per ovviare a questo problema basterebbe che i proprietari dei network inserissero l’attributo nofollow ai link comprati, ma facendo questo chi comprerebbe più un link?

Treni e altro. Se leggiamo le regole di google nel webmaster guidelines cità che una pagina web non deve contenere più di 100 link, purtroppo i treni lanciati da siti importanti, superano facilmente quel numero.

Soldiweb

Registrazione conclusa per il dominio agliardi.it

Diario di bordo Nessun commento »

Logo del Registro del ccTLD.itAlle 12:16:54 di oggi la registrazione a mio nome del dominio agliardi.it si è finalmente conclusa.

Firewall Linux e stampante di rete HP LaserJet

Diario di bordo, Sistema, Tips & tricks Nessun commento »

La stampante HP Color LaserJet 2840Oggi mi si è presentato un piccolo problema: dopo avere aggiunto una stampante di rete HP Color LaserJet 2840 ad una LAN ho configurato i client perché stampassero su quella stampante mediante il protocollo di stampa CUPS. Sui tutti i client gira Debian GNU/Linux protetto da firewall iptable. Benché la stampante venisse individuata, era impossibile avviare la stampa di un documento senza prima disabilitare il firewall.

Analisi e risoluzione del problema hanno richiesto solo pochi minuti! Dopo avere avviato un `tail` su /var/log/messages ho lanciato una stampa di prova:

#tail -f /var/log/messages
Ho ottenuto immediatamente a video queste linee di log generate da iptable:

Mar 18 12:34:53 localhost kernel: DROPPED IN= OUT=eth2 src=192.168.1.112 DST=192.168.1.138 LEN=78 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=1700 DPT=161 LEN=58
Mar 18 12:34:53 localhost Officejet_6300_series?ip=192.168.1.138: INFO: open device failed; will retry in 30 seconds...

In altre parole, lo scambio di pacchetti UDP sulla porta 161 veniva impedito (in nerdese: droppato) dal firewall. È bastato aggiungere una regola al firewall perché permettesse il transito dei pacchetti UDP su quella porta per risolvere il problema.

Alterare l’orario di accesso ad un file

Shell, Sistema, Tips & tricks Nessun commento »
Konsole catturato con KsnapshotI sistemi basati su UNIX e Linux conservano le informazioni relative all’ultima modifica e all’ultimo accesso di ogni file. Per visualizzare quest’ultima informazione si ricorre al comando:
$ls -lu
L’orario di accesso ad un file può essere però alterato mediante l’utilizzo del comando `touch`. Questo comando si usa di norma per cambiare data e ora di ultima modifica e di ultimo accesso ad un file:
$touch nome_file
Se il file nome_file non esiste viene creato come file vuoto. Per modificare soltanto data e ora di ultimo accesso ad un file si utilizza il parametro -a:
$touch -a nome_fileAnalogamente è possibile modificare data e ora dell’ultima modifica senza alterare le informazioni relative all’ultimo accesso:
$touch -m nome_file
In entrambi i casi è possibile indicare un orario specifico mediante l’opzione -t:
$touch -t orario_desiderato nome_file

Per quanto riguarda la sintassi da adottare per il parametro orario_desiderato, `man` offre una spiegazione non semplicissima ma abbastanza esaustiva:

L’argomento è un numero decimale della forma [SS]AA]MMGGoomm[.ss] con l’ovvio significato. Se SS non è specificato, l’anno SSAA viene assunto nell’intervallo 1969-2068. Se ss non è specificato, viene assunto 0; può essere specificato nell’intervallo 0-61 in modo da potersi riferire a secondi saltati («leap second»). L’orario risultante viene interpretato come un orario nel fuso specificato dalla variabile ambientale TZ. Si ha un errore se l’orario ottenuto è precedente al 1 gennaio 1970

Windows (Vista) vs. Mac: la sicurezza

YouTube Nessun commento »