Archive for the 'tech' Category

Cuidado con Sony Vaio!

Escribo este pequeño post, a nota de advertencia a aquellos consumidores de productos Sony.

Hace ya más de un año, el grupo de investigación con el que estoy trabajando adquirió unos portátiles Sony VAIO VGN-CR42, al mismo tiempo una companyera de trabajo también se compró el mismo portátil. De estos VAIOS, yo utilizo uno dentro de mi carrera como investigador.

La historia es muy sencilla, en Junio de 2009 la tarjeta de red del susodicho portátil dejó de funcionar por completo, se murió de un día para el otro. Perdí mucho tiempo haciendo varias pruebas, el windows que llevan preinstalado estos bichos no era capaz de establecer ningún tipo de conexión, y tanto el Linux como las livecd's que probé tampoco eran capaces de recibir, ni enviar ningún tipo de paquete en la red. Utilizando Wireshark sobre la interfaz no se veía absolutamente la entrada de ningún paquete entrante, solo las solicitudes dhcp, las cuales tampoco llegaban al servidor dhcp.

Bien, el portátil acabó en el servicio técnico de Sony, se lo quedaron como algo más de un mes. Le cambiaron la placa base, el disco duro, actualizaron la bios, y cambiaron alguna cosa mas. Me lo devolvieron con un trapito de regalo.

Este pasado sábado, por la noche ha vuelto a pasar. Mi Linux se desconectó por completo de la red. Ejecuto dhclient eth0 para ver si se vuelve a conectar, y vualá, veo que no recibe respuesta del servidor DHCP otra vez. Miro la falta completa de trafico con wireshark, arranco windows, compruebo el cable, pruebo una livecd, intento arrancar por red (cosa que obviamente fracasa). Es como simplemente el cable no estuviera conectado, pero la luz del switch si se enciende y ethtool dice que hay link. Pero no pasan paquetes. Zero paquetes. En cambio, para comprobar que realmente el cable funciona bien y que el servidor DHCP responde, conecto mi Acer Aspire One, y veo como este se conecta sin ningún problema.

Ya estoy cansado de este portátil, tengo un Toshiba Satellite Pro 4600 con una vieja Debian y siempre me funcionó de maravilla, lo retiré pq a 700 Mhz y 128MB hoy en día no se pueden hacer muchas cosas. Luego adquirí un Toshiba Satellite M30, lleva una debian squeeze (testing) y desde que lo compré hasta ahora, todavía funciona a la perfección. Los únicos problemas es que es un poco lento, tengo el disco duro a tope, y el pobre ventilador del procesador hace más ruido que un array de reactores de varios jets.

Pensaba que con el Sony VAIO VGN-CR42 podria jubilar al Toshiba, pero no, todavia lo tengo por aquí, funciona perfectamente y miraré haber cuanto tiempo aguanto hasta que me compro un portatil nuevo, que sea de mi propiedad, ya que por suerte o por desgracia los Sonys son de la Universidad.

A mi companyera de trabajo les paso exactamente lo mismo hace un par de meses, y perdió como varias mañanas haciendo estupidos tests inservibles a solicitud de los inútiles del soporte técnico de Sony, para acabar haciendo una inútil restauración. El portatil lo acabó enviando al soporte técnico, el qual todavia esta allí.

Y para acabar, para mi, Sony y mierda, son palabras sinónimas, como también lo son VAIO y basura.

Linux booting optimizations

This is a smal guide that I use myself in new or current Debian GNU/Linux installations, to reduce a bit (about some seconds), the overall booting time.

To start, we need a way to measure the time that our system needs to boot up.

  • Bootchart: It measures time required to boot the system, and displays it in a graphical way.
    • $sudo apt-get install bootchart
    • Edit /etc/grub/menu.lst, and add "init=/sbin/bootchartd" to the kopt line.
    • $sudo update-grub
    • Edit /etc/bootchartd.conf and set "AUTO_STOP_LOGGER" to "yes"

Now some basic "safe" optimizations. Optimizations that you can do without breaking the system.

  • ReadAhead: It preloads all files required to boot at the begining of the boot process. (Note: If you have preload installed it must be dissables when the first run is done.)
    • $sudo apt-get install readahead
    • If preload is installed, temporally dissable it by adding "exit 0" at the beggining to /etc/init.d/preload
    • Enable profile on first run: $sudo touch /etc/readahead/profile-once
    • reboot system (yes you need to reboot, sorry, is one of these exceptions when you need to reboot Linux.)
  • preload: It learns with system libraries are most used, and preloads them on demand.
    • $sudo apt-get install preload
  • dash: By default the OS ships with bash that is extremely slow, thus all init shell scripts run very slow. Dash is a faster shell implementation. I saw an increase of 6 seconds in my experiments.
    • $sudo apt-get install dash
    • Install dash as default sh interpreter: $sudo dpkg-reconfigure dash
  • You need an e-amail server?: By default the OS will ship with a full e-mail server, because some desktop applications an other stuff depend on it. Debian comes with Exim, the light version by default. This means that you will have an extra useless process consuming resources at boot time, and during execution. You can't remove it because it's needed, but you can replace it with a null mailer implementation. So there are two possible packages avaliable depending on your e-mail needs. Of course if you really need a full e-mail server in you computer, then you may continue with wathever you have.
    So, we have ssmtp and esmtp-run

    • ssmtp: This mailer will deliver all mail to a remote e-mail server, it does not do local mail delivery it's only usefull when you already have an e-mail server in your network.
      • $sudo apt-get install ssmtp
      • Configure your remote e-mail server. $sudo dpkg-reconfigure ssmtp
    • esmtp: Same as ssmtp, but does local mail delibery. If you don't have a remote mail server to use, just use localhost as a mail server, it will try to deliver mail to it, but since there is no service running it will fail, thus it will only do local delibery. This is perfect for a laptop where I'm only interesting on recieving locally system generated mails, I don't want my laptop to send e-mails outside. (In fact most Linux distros ship by default with an e-mail server that will do remote delivery by default, altough it's only listenning on localhost, I see that as a possible security threat that any user could exploit, altough nowadays most e-mail servers will reject those e-mails.).
      • $sudo apt-get install esmtp-run
  • quiet saves time also. The "quiet" kernel parameter it's usually enabled on most distros, but if it is not enabled in your distro, it's poosible to save some time. Just check that "quiet" is present in "defoptions" of your /boot/grub/menu.lst configuration file.
  • remove some useless garbage: Some completely useless services, that only waste ram, and time. (Always check when you remove something from your system, that you are not deinstalling your entire operating system due to dependencies. I at least know a case of someone that wanted to unistall mysql but unistalled the entire os, because the os had dependencies over mysql?? (This only happens on Ubuntu, Debian does not have this problem ;-P )
    • Who needs "inetd", I don't use anything that it provides. $sudo apt-get --purge remove openbsd-inetd
    • WTF is avahi? More useless garbage. I remove it as soon as I install a new system. $sudo apt-get --purge remove avahi-daemon avahi-autoipd
    • localepurge: Why do you need your os avaliable in 560 and more languages? Them waste disk space.
      • $sudo apt-get install localepurge
      • Configure it to the locales that you want to keep $sudo dpkg-reconfigure localepurge
      • And free about 1Gigabyte or more of space. $sudo localepurge
    • orphaner: Remove unused orphaned system libraries.
      • $sudo apt-get install deborphan
      • Remove all unused garbage: $sudo orphaner
    • autoremove unused stuff: Remove all those packages that were installed but are currently not used and we don't want them in our system.
      • $sudo apt-get --purge autoremove
    • remove unused config files: Unistalled packages will drop a lot of garbage in the /etc directory, so remove it.
      • $sudo dpkg --purge `dpkg --get-selections | grep deinstall | cut -f1`

Some dangerous optimizations. These optimizations may break your system into an unboatable status, and also require lot of user intervention to configure.

  • insserv: Reorders the init scripts. May break some thing that need to be manually fixed.
  • runit: Another init system, requires a lot of time to configure and get a boatable, system. NOT recomended for currently installed systems. Should be implemented on new systems, with lot of patience. I personally do not have enough patience and/or time to configure runit.

That's all for today.