martedì 30 novembre 2010

Correzione ".muttrc.gmail"

Mi sono accorto solamente ora di un'errore nel file.
Succede che rispondendo ad una mail, il messaggio di risposta viene memorizzato due volte nella posta inviata, ma sembra che al destinatario ne arrivi (per fortuna) solamente una.

Questo e` il nuovo ".muttrc.gmail"
# Gmail muttrc configuration

#set ssl_starttls=yes
#set ssl_force_tls=yes
set imap_user="USERNAME@gmail.com"
set imap_login="USERNAME@gmail.com"
set imap_pass="PASSWORD"
mailboxes imaps://imap.gmail.com
set folder="imaps://imap.gmail.com/"
set spoolfile="+INBOX"
#set record="+[Gmail]/Posta\ inviata"
set postponed="+[Gmail]/Bozze"
set trash="+[Gmail]/Trash"
#set imap_idle
#unset imap_passive

set smtp_url="smtp://USERNAME@smtp.gmail.com:587/"
set smtp_pass="PASSWORD"

set from="USERNAME@gmail.com"
#set use_domain="no"
#%set use_from="no"
#%set use_domain
set hostname=gmail.com
set realname="NOME COGNOME"
set sort=threads
set editor=vim
#set charset="ISO-8859-15"

set header_cache =~/.mutt/cache/gmail/headers
set message_cachedir =~/.mutt/cache/gmail/bodies
set certificate_file =~/.mutt/gmail/certificates

# Maybe we shouldn't set index_format here, but this is a recommended
# one for maildir-style folders.

set index_format="%4C %Z %{%b %d} %-16.16L  %s"

######################################################################
#
# mySystem configuration file for Mutt
#
color hdrdefault cyan black
color quoted magenta black
color signature brightred black
color indicator brightyellow red
color error brightred black
color status brightyellow blue
color tree brightmagenta black  # the thread tree in the index menu
color tilde brightmagenta black
color message brightcyan black
color normal white black
color attachment brightmagenta black
color search black green        # how to hilite search patterns in the pager
color header brightyellow black ^(From|Subject):
color body brightyellow black "(ftp|http)://[^ ]+"      # point out URLs
color body brightcyan black [-a-z_0-9.]+@[-a-z_0-9.]+   # e-mail addresses
color underline brightgreen black


# Lista degli header da togliere quando visualizzo la mail
ignore *
unignore  Date To From: Subject X-Mailer Organization User-Agent
hdr_order Date From To Subject X-Mailer User-Agent Organization

# lbdb database
#%set query_command="lbdbq %s"

# abook
set query_command="abook --mutt-query '%s'"
macro pager A "abook --add-email"

Ho commentato la riga:
set record="+[Gmail]/Posta\ inviata"

Debian - Abilitare SSL in Apache

Non sto` inventando niente, e` solo un promemoria, perche` non ricordo MAI dove andare a leggere :P

Un'estratto dal file "/usr/share/doc/apache2.2-common/README.Debian.gz":

Enabling SSL
------------

To enable SSL, type (as user root):

  a2ensite default-ssl
  a2enmod ssl

If you want to use self-signed certificates, you should install the ssl-cert
package (see below). Otherwise, just adjust the SSLCertificateFile and
SSLCertificateKeyFile directives in /etc/apache2/sites-available/default-ssl to
point to your SSL certificate. Then restart apache:

  /etc/init.d/apache2 restart


Creating self-signed certificates
---------------------------------

If you install the ssl-cert package, a self-signed certificate will be
automatically created using the hostname currently configured on your computer.
You can recreate that certificate (e.g. after you have changed /etc/hosts or
DNS to give the correct hostname) as user root with:

  make-ssl-cert generate-default-snakeoil --force-overwrite

To create more certificates with different host names, you can use

  make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /path/to/cert-file.crt

This will ask you for the hostname and place both SSL key and certificate in
the file /path/to/cert-file.crt . Use this file with the SSLCertificateFile
directive in the apache config (you don't need the SSLCertificateKeyFile in
this case).

E questi sono i comandi digitati in console, completi delle informazioni restituite:
PC:~# a2ensite default-ssl
Enabling site default-ssl.
Run '/etc/init.d/apache2 reload' to activate new configuration!
PC:~# a2enmod ssl
Enabling module ssl.
See /usr/share/doc/apache2.2-common/README.Debian.gz on how to configure SSL and create self-signed certificates.
Run '/etc/init.d/apache2 restart' to activate new configuration!
PC:~# make-ssl-cert generate-default-snakeoil --force-overwrite
PC:~# /etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting .

mercoledì 17 novembre 2010

Bridging on Bonding per macchine virtuali

Non sono riuscito a fare quello che volevo, configurare sul server di virtualizzazione le due schede rete in modo che avessero sia "fault tolerance" che "load balancing".
Il perche` e` dato dal fatto che utilizzando macchine virtuali con indirizzo ip dinamico (client dhcp), non riescono a scambiare correttamente i pacchetti.
Ho trovato questo in rete https://bugzilla.kernel.org/show_bug.cgi?id=14586, partito probabilmente da questo thread http://www.spinics.net/lists/kvm/msg25153.html (o viceversa),dove indicano anche la soluzione, ma ovviamente a me non funziona.

Non posso provare all'infinito, per ora ho lasciato la configurazione di backup, che tradotto significa: se la prima scheda di rete dovesse rompersi o scollegarsi, il traffico viene rediretto sulla seconda.
OS: GNU/Debian (Lenny)
Virtualizzazione: KVM


Ho modificato il file "/etc/network/interfaces":
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
#allow-hotplug eth1
#iface eth1 inet dhcp

auto bond0
iface bond0 inet manual
    bond_mode 1
    bond_miimon 100
#    bond_downdelay 200
#    bond_updelay 200
    slaves eth0 eth1

auto br0
iface br0 inet dhcp
#    address 192.168.0.2
#    broadcast 192.168.0.255
#    network 192.168.0.0
#    gateway 192.168.0.1
#    netmask 255.255.255.0
    bridge_ports   bond0
    bridge_stp     off
    bridge_maxwait 0

Seguito da un:
/etc/init.d/network restart

Funziona, nel senso che sia la macchina "server" di virtualizzazione che le proprie virtualizzate usano e correttamente prendono l'indirizzo dal dhcp server (che e` un'altra macchina all'interno della rete).

Vedo cosa riesco a trovare in rete, per essere pronto a fare ulteriori prove al prossimo "fermo macchina".

Riferimenti:
http://guide.debianizzati.org/index.php/Configurare_un_Ethernet_Bonding_per_garantire_ridondanza_alla_rete
http://www.linux-kvm.org/page/Networking
http://www.slacky.eu/wikislack/index.php?title=Linux_Bonding_Mini-Howto
http://www.linux-kvm.org/page/HOWTO_BONDING
http://wiki.centos.org/HowTos/KVM
http://compsoc.dur.ac.uk/~djw/qemu.html
http://www.spinics.net/lists/kvm/msg25153.html

domenica 14 novembre 2010

Mutt, IMAP e gmail

Quest'oggi ho pensato di aggiungere un'ulteriore ".muttrc" per gestire la posta elettronica "gmail".

Creazione delle directory per la "cache" (caricare piu` di 10000 mail ogni volta potrebbe essere estenuante):
mkdir -p .mutt/gmail/
mkdir -p .mutt/cache/gmail

Il file di configurazione, che ho chiamato ".muttrc.gmail":
# Gmail muttrc configuration

#set ssl_starttls=yes
#set ssl_force_tls=yes
set imap_user="USERNAME@gmail.com"
set imap_login="USERNAME@gmail.com"
set imap_pass="PASSWORD"
mailboxes imaps://imap.gmail.com
set folder="imaps://imap.gmail.com/"
set spoolfile="+INBOX"
set record="+[Gmail]/Posta\ inviata"
set postponed="+[Gmail]/Bozze"
set trash="+[Gmail]/Trash"
#set imap_idle
#unset imap_passive

set smtp_url="smtp://USERNAME@smtp.gmail.com:587/"
set smtp_pass="PASSWORD"

set from="USERNAME@gmail.com"
#set use_domain="no"
#%set use_from="no"
#%set use_domain
set hostname=gmail.com
set realname="NOME COGNOME"
set sort=threads
set editor=vim
#set charset="ISO-8859-15"

set header_cache =~/.mutt/cache/gmail/headers
set message_cachedir =~/.mutt/cache/gmail/bodies
set certificate_file =~/.mutt/gmail/certificates

# Maybe we shouldn't set index_format here, but this is a recommended
# one for maildir-style folders.

set index_format="%4C %Z %{%b %d} %-16.16L  %s"

######################################################################
#
# mySystem configuration file for Mutt
#
color hdrdefault cyan black
color quoted magenta black
color signature brightred black
color indicator brightyellow red
color error brightred black
color status brightyellow blue
color tree brightmagenta black  # the thread tree in the index menu
color tilde brightmagenta black
color message brightcyan black
color normal white black
color attachment brightmagenta black
color search black green        # how to hilite search patterns in the pager
color header brightyellow black ^(From|Subject):
color body brightyellow black "(ftp|http)://[^ ]+"      # point out URLs
color body brightcyan black [-a-z_0-9.]+@[-a-z_0-9.]+   # e-mail addresses
color underline brightgreen black


# Lista degli header da togliere quando visualizzo la mail
ignore *
unignore  Date To From: Subject X-Mailer Organization User-Agent
hdr_order Date From To Subject X-Mailer User-Agent Organization

# lbdb database
#%set query_command="lbdbq %s"

# abook
set query_command="abook --mutt-query '%s'"
macro pager A "abook --add-email"

Per utilizzare questa configurazione il comando e`:
mutt -F .muttrc.gmail

Riferimenti:
http://davide4.blogspot.com/2010/10/debian-riconfigurazione-di-mutt-per.html
http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=mutt+imap+gmail
http://crunchbanglinux.org/wiki/howto/howto_setup_mutt_with_gmail_imap

venerdì 5 novembre 2010

Installazione Zentyal su Ubuntu in KVM con Debian

Che titolo eh ? Ma non sapevo cosa mettere :P
Sto` andando a memoria, alcune cose potrebbero non essere proprio come le ho scritte

Dopo aver constatato alcuni problemi nell'avvio dell'installazione di Zentyal su macchina virtualizzata in Debian con KVM, ed altri riguardanti la risoluzione video al termine dell'installazione (non era possibile collegarsi tramite "vnc" a causa dell'errata o incompatibile visualizzazione) .. ho pensato di adottare un'altro metodo.

Installazione di Ubuntu 10.04 Server amd64 in una macchina virtualizzata KVM su Debian lenny
Ho utilizzato l'immagine "ubuntu-10.04.1-server-amd64.iso" per l'installazione del sistema operativo.
All'avvio, quando si presenta la selezione, ho premuto il tasto F6 per le impostazioni avanzate, correggendo la linea di comando, aggiungendo "fb=false" ed eliminando "--quiet --".
Ho installato solamente i pacchetti base, deselezionando qualsiasi "gruppo" di programmi server venisse proposto durante l'installazione.

Installazione Zentyal 2.0
Terminata l'installazione Ubuntu, ho seguito le direttive per l'installazione tramite "apt-get" indicate sul sito http://trac.zentyal.org/wiki/Document/Documentation/InstallationGuide.

Riferimenti:
http://www.zentyal.org/