Archive

¿Google de pago?

Durante toda la mañana de ayer estuve (practicamente) sin poder usar Google. Al abrir Google me salia la pagina de siempre, pero cualquier busqueda que hacia me llevaba a una pagina que decia “We’re sorry…”, explicando que Google estaba recibidendo muchas consultas que se parecian a consultas emitidas por un virus o un spyware. Tras introducir el captcha (lo cierto es que a veces ni podia entenderlo de lo dificil que lo ponian), me daba las respuestas a mis consultas. Lo que pasa es que no siempre me permitia meter el captcha. A veces solo lo sentia, diciendome que buscara si tenia virus/spyware, o alguien de mi red.

Aqui tenemos mas informacion:

The CAPTCHA page you’re referring to is served by Google when we experience a quick spike in traffic on Google.com. A CAPTCHA image helps us determine whether traffic is coming from automated robot software or individual users. Please be aware that your network is receiving this page because our system is detecting automated querying coming from your network’s IP address.

Lo cierto es que estar sin google toda la mañana fue una experiencia dura. Cambie el buscador por defecto de mi Firefox a Yahoo!, pero tenia la impresion de no encontrar nada de lo que buscaba.

A raiz de esto se me occurrio una idea: Google podria cobrar por el uso corporativo/masivo de su buscador. Por ejemplo:

  • por encima de 500 consultas al dia (digo 500 por definir un umbral razonable), que sea de pago: x€ por consulta, bonos de consultas, tarifa plana por volumen de consultas,…),
  • por debajo del umbral, gratias (para familias). Supongo que la gente de Google ya lo habran pensado y que por alguna razon no lo querran hacer (¿todavia?).

apt-get error: public key not available

Este fin de semana me paso el siguiente error tras añadir una linea en el /etc/apt/sources.list:

# apt-get update
[...]
Reading package lists... Done
W: GPG error: http://www.virtualbox.org etch Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 390EC3FF927CCC73
W: You may want to run apt-get update to correct these problems

Tras buscar un poco por google, encontre como solucionar el error, importando la clave publica que faltaba, de la siguiente manera:

# gpg --keyserver hkp://subkeys.pgp.net --recv-keys 390EC3FF927CCC73
gpg: directory `/root/.gnupg' created
gpg: can't open `/gnupg/options.skel': No such file or directory
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: requesting key 927CCC73 from hkp server subkeys.pgp.net
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 927CCC73: public key "innotek GmbH (archive signing key) " imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
# gpg --export --armor 390EC3FF927CCC73 | apt-key add -
OK

Podemos verificar que la clave se ha importado con:

# apt-key list
/etc/apt/trusted.gpg
--------------------
[...]
pub   1024D/927CCC73 2007-06-04
uid                  innotek GmbH (archive signing key) 
sub   2048g/F0C31E29 2007-06-04

Mirror de un lvol en LVM de Linux

Para quien venga de HP-UX, resulta facil mirrorear un lvol bajo LVM: con un lvextend -m. En Linux, el lvextend -m simplemente no funciona…

De hecho el comando lvcreate si tiene una opcion -m, y esa si que funciona (lo he probado)! Pero con el lvextend no la coje.

Me he bajado las fuentes de lvm2. En commands.h he descubierto el comando lvconvert que no conocia:

alegrome# lvconvert
  Exactly one of --mirrors or --snapshot arguments required.
  lvconvert: Change logical volume layout

lvconvert [-m|--mirrors Mirrors [--corelog]]
        [--alloc AllocationPolicy]
        [-d|--debug]
        [-h|-?|--help]
        [-v|--verbose]
        [--version]
        LogicalVolume[Path] [PhysicalVolume[Path]...]

lvconvert [-s|--snapshot]
        [-c|--chunksize]
        [-d|--debug]
        [-h|-?|--help]
        [-v|--verbose]
        [-Z|--zero {y|n}]
        [--version]
        OriginalLogicalVolume[Path] SnapshotLogicalVolume[Path]

Este comando si que parece funcionar. Probemos a mirrorear un lvol:

# lvconvert -m 1 /dev/vg02/lvweb
  Logical volume lvweb converted.

Miremos con un lvdisplay lo que nos ha hecho el comando:

alegrome# lvdisplay -m lvweb
  --- Logical volume ---
  LV Name                /dev/vg02/lvweb
  VG Name                vg02
  LV UUID                9I4wK7-2hn7-j4dI-o5yT-ngYx-8Wtd-m3no6q
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                200.00 MB
  Current LE             50
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:6

  --- Segments ---
  Logical extent 0 to 49:
    Type                mirror
    Mirrors             2
    Mirror size         50
    Mirror log volume   lvweb_mlog
    Mirror region size  512.00 KB
    Mirror original:
      Logical volume    lvweb_mimage_0
      Logical extents   0 to 49
    Mirror destinations:
      Logical volume    lvweb_mimage_1
      Logical extents   0 to 49

A notar ahi: Type = mirror.

Como se puede ver, el lvweb ahora si esta en mirror. La verdad es que no he visto esto documentado en ningun sitio (¿alguien ha visto mas sobre esto?).

Para quitar el mirror (reducir), se haria asi:

# lvconvert -m 0 /dev/vg02/lvweb
  Logical volume lvweb converted.

# lvdisplay -m lvweb
  --- Logical volume ---
  LV Name                /dev/vg02/lvweb
  VG Name                vg02
  LV UUID                9I4wK7-2hn7-j4dI-o5yT-ngYx-8Wtd-m3no6q
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                200.00 MB
  Current LE             50
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:6

  --- Segments ---
  Logical extent 0 to 49:
    Type                linear
    Physical volume     /dev/hdh4
    Physical extents    18370 to 18419

Con lvs vemos el estado del mirrorring

alegrome# lvs lvweb
  LV     VG   Attr   LSize Origin Snap%  Move Log         Copy%
  lvweb  vg02 mwi-ao 200M                    lvweb_mlog   12.22

En Attr, la “m” es de mirror.

Este post viene originado por un comentario de Rubik a un post de Ivan sobre “Crear un raid 1 a partir de un disco con datos sin formatear“.. Gracias a ambos.

sleep en la shell de Windows (cmd.exe)

Estaba buscando como hacer un sleep de 1 minutos en un .bat de Windows (CMD.EXE). Encontre esta forma, es original :-) :

@  ping -n 60 127.0.0.1 > NUL 2>&1

RHEL5, yum + proxy = Error

En un RedHat EL 5, al hacer un yum con proxy recibo el siguente mensaje: “Error: Cannot open/read repomd.xml file for repository: rhel-i386-server-5″

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)

# export http_proxy="http://localhost:8888"
# yum update
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
Error: Cannot open/read repomd.xml file for repository: rhel-i386-server-5

En el proxy recibimos lo siguiente:

[Fiddler] Request Header parsing failed. Request was:
43 4F 4E 4E 45 43 54 20 78 6D 6C 72 70 63 2E 72 68 6E 2E 72 65 64 68 61  CONNECT xmlrpc.rhn.redha
74 2E 63 6F 6D 3A 34 34 33 20 48 54 54 50 2F 31 2E 31 0D 0A 0D 0A        t.com:443 HTTP/1.1....

Encontre la solucion googleando un poco (solo una pagina hablaba de ello), pero probe la solucion y funciono:

It’s a bug in the crypto lib of python. It doesn’t add the HOST in the
headers of the HTTP/1.1.

Hay que editar el fichero /usr/lib/python2.4/site-packages/M2Crypto/httpslib.py en la maquina y añadir la linea siguiente entre las lineas 165 y 166:

msg = msg + "Host: %s:%d\\r\\n" % (self._real_host, self._real_port)

Quedando asi:

    def _get_connect_msg(self):
        """ Return an HTTP CONNECT request to send to the proxy. """
        msg = "CONNECT %s:%d HTTP/1.1\\r\\n" % (self._real_host, self._real_port)
        msg = msg + "Host: %s:%d\\r\\n" % (self._real_host, self._real_port)
        if self._proxy_auth:
            msg = msg + "%s: %s\\r\\n" % (self._AUTH_HEADER, self._proxy_auth)
        msg = msg + "\\r\\n"
        return msg

Una vez hecho esto, ya funciona bien:

# yum check-update
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
Setting up repositories
rpmforge                  100% |=========================| 1.1 kB    00:00
rhel-i386-server-5        100% |=========================| 1.4 kB    00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 1.5 MB    00:00
################################################## 6175/6175
primary.xml.gz            100% |=========================| 1.1 MB    00:05
################################################## 3219/3219



Close
Powered by ShareThis