Report inadequate content

Ubuntu in Harecoded

Conectar por SSH sin password (autenticación de clave pública)

 TAGS:

Esta es una de aquellas cosas que uno hace una y otra vez y al final pierde 10 minutos intentando recordar los comandos o buscando la información.

Para conectar a un servidor remoto por SSH sin usuario ni contraseña todo lo que hace falta es compartir una clave entre cliente y servidor. Los pasos son "mu" sencillos:

  1. Asegurarse que la carpeta .ssh existe en el servidor al que nos queremos conectar
  2. Crear una clave RSA pública en la máquina cliente (la que se conecta):
    ssh-keygen -t rsa
    Cuando se te pida por un password, dale al enter sin poner ninguno (este es el propósito del artículo, sin passwords)
  3. Copiar la clave pública en el servidor:
    scp ~/.ssh/id_rsa.pub usuario@servidor.com:.ssh/authorized_keys2

    Puedes omitir la parte usuario@ si te conectas con el mismo usuario.

Y esto es todo amigos. En la siguiente conexión por SSH ya no se pedirá de nuevo el password.

Importante:

A partir de este momento, si alguien robara la clave pública que has guardado en ~/.ssh/id_rsa tendría acceso completo a tu servidor. Más vale que la protejas bien :)

Si dejas un password en la autenticación RSA puede ser una buena idea desactivar en el servidor el acceso SSH vía login/password y dejar sólo autenticación por clave.

Cómo cambiar la extensión a múltiples ficheros desde terminal (unix shell)

Para renombrar la extensión de muchos ficheros a la vez en la terminal, se puede hacer con la siguiente línea:

for file in *.phtml ; do mv $file `echo $file | sed 's/\(.*\.\)phtml/\1tpl/'` ; done

Esto cambiaría todas las extensiones phtml por tpl del directorio en que lo lanzéis. Cambiando la parte en negrita por vuestra extensión favorita ya funcionaría.

Lo que hace la línea es buscar todos los archivos que cumplen la condición *.phtml e iterarlos en un bucle. Para cada uno de ellos hace un mv del orígen al destino. El destino es una expresión regular que substitye el patrón .phtml por el .tpl (gracias al comando sed)

Restore broken hard disk creating an image with Ubuntu

If your boot partition has been damaged and you cannot boot Ubuntu you still might be able to recover your hard disk and save your data by making an image. All you need is the Ubuntu LiveCD and Partimage, an excellent tool for making backups, or the SystemRescueCD.

Here you'll find a detailed explanation on how to use partimage as well:
http://www.psychocats.net/ubuntu/partimage

TortoiseSVN for Ubuntu Linux: The real alternative

RabbitVCS logoI have posted several articles regarding subversion in this blog. If you ask me one thing I like in Windows, then I only have one answer: Tortoise SVN client. This small application is the only thing I love in Windows, for anything else, I'd rather user Mac or Linux.

But now, there is a Linux alternative to Tortoise SVN called RabbitVCS. I've tried it and it works pretty well. This project, formerly NautilusSVN, looks really well and is inspired in the windows tool. By now, it offers a good support for SVN but the aim is to cover other Version Control Systems (VCS), like Git.

RabbitVCS is integrated smartly in the Nautilus context menu, like Tortoise does, and contains all the options you might need. Logs, updates, merge, commit, full checkout... anything... plus you can play in the terminal and create your own scripts!

If you are a developer and you work in a Linux environment, then you need this tool.

 

Rabbit VCS Log viewer

There is still a long way to walk for RabbitVCS but I am sure that in short will be a perfect replacement. We don't have to forget that TortoiseSVN offers many many advanced features (not just the common commands), but if you are a regular developer who works with a small group of developers and you don't have a lot of branches that need to merge, reintegrate and so on, this is definetelly a perfect option.

Cómo reproducir ficheros .RMVB en Ubuntu

Los ficheros .rmvb no se pueden reproducir por defecto en Ubuntu, esta extensión es para los de tipo RealMedia Variable Bitrate, pero instalando los códecs de Mplayer los podrás abrir sin problemas.

Lo primero que debes instalar, aunque no sea intuitivo es la librería libstdc++5, para hacerlo o bien abre Synaptic ( Sistema -> Administración -> Gestor de Paquetes )  y haz doble click sobre libstdc++5 o ejecuta en la terminal:

sudo apt-get install libstdc++5

Si ya tienes Mplayer instalado con los códecs prueba ya a ver si se pueden reproducir los ficheros. Si no, lo siguiente será instalar Mplayer,  a través otra vez de Synaptic o de la terminal

sudo apt-get install mplayer

Luego para instalar los códecs, bájatelos de la página Mplayer Binary Codec Packages (si no sabes cuál elegir lo más probable es que necesites el que se llama Linux x86). Descomprime la carpeta que te has bajado en el escritorio y abre la Terminal, ejecuta los siguientes comandos:

cd Escritorio  ( en función del idioma de tu Ubuntu puede cambiar)
cd essential-20071007
sudo mkdir -p /usr/lib/codecs
sudo cp * /usr/lib/codecs

A partir de este punto ya sólo te queda configurar Mplayer, para ello entra en las Preferencias y en la pestaña Codecs & Demuxer selecciona de los deplegables:

  • Video codec: RealVideo decoder
  • Audio codec: FFmpeg

y ya deberías poder reproducir los ficheros .rmvb en Ubuntu. Si te suceden cosas extrañas, como ver la imagen pequeña, no oír el Audio, o ver la imagen que da saltos, tendrás que hacer modificaciones en la configuración de Mplayer, como por ejemplo desactivar opciones tipo "Enable double buffering", "direct rendering", etc...

Mplayer CodecsMplayer prefs video

GnomeDo: Quicksilver/Launchy para Gnome (Linux)

GnomeDoSi hace ya mucho tiempo hablamos de Katapult, un lanzador para KDE, ahora damos el turno a Gnome, con el GnomeDo

Al igual que en Quicksilver, se pueden descargar varios plugins interesantes que amplían las funcionalidades básicas del programa, que no son simplemente limitarse a abrir documentos y programas tecleando parte de su nombre.

Lo que más me gusta de estos programas (sin duda el mejor, la versión original de Mac, Quicksilver) es como uno se olvida de navegar por los menús y los sistemas de ficheros. Uno puede tener el sistema de ficheros hecho un desastre y sin embargo, tecleando cuatro letras se puede encontrar aquel documento que no sabíamos dónde estaba.

Pero como decía, y volviendo específicamente a gnomeDo, instalando 4 plugins puede conseguir cosas útiles como:

  • Sincronizar los contactos de Gmail
  • Tomar notas con TomBoy rápidamente
  • Abrir ventanas de chat directamente tecleando el nombre del contacto de MSN/Jabber/Yahoo/loquesea
  • Reproducir una canción tecleando un título
  • Buscar en el diccionario... y un largo etcétera.

En Ubuntu lo podéis instalar usando el comando: 

sudo aptitude update && sudo aptitude install gnome-do

Si no está disponible, agregad las siguientes líneas a /etc/apt/sources.list (a mi no me ha hecho falta):

deb http://ppa.launchpad.net/do-core/ubuntu hardy main
deb-src http://ppa.launchpad.net/do-core/ubuntu hardy main

Si necesitáis instalarlo en otras versiones linux, también es muy sencillo.

Para cambiar la combinación de teclas por defecto, siempre podéis editarlo "a pelo" con el gconf-editor, tan solo editando la clave /apps/gnome-do/preferences/key_binding y cambiándolo por el valor deseado.

Programas similares:

How to watch and record TV with a PC Ubuntu linux

Catalan speakers see: "Com veure la TV amb Ubuntu"

There are many alternatives when we speak of media centers, but I can't figure out anything other than a computer. It offers all the functionallity you could want in a well-known interface. That's why I have a PC in the living room, I browse the Internet using my TV (using an HDMI cable) and now I record stuff when I am not at home. This is how I did it

If you want to have a complete media center solution with Ubuntu, you should take a deep look at MythTV. A true PVR with a lot of features, but it's not easy to have it up and running. You need to spend a little bit of time with the configuration, so if you want to watch digital television (DVB) in a few minutes I propose installing Me TV. At least to see if your TV card is working ;)

Me TV it's available via apt-get if you add the launchpad repository. To do so:

  • Execute (ALT+F2):sudo gedit /etc/apt/sources.list
  • Then add this two lines and save:
    deb http://ppa.launchpad.net/michael-lamothe/ubuntu gutsy main
    deb-src http://ppa.launchpad.net/michael-lamothe/ubuntu gutsy main

After that, you only need to update the sources and install the program:

  • sudo apt-get update
  • sudo apt-get install me-tv

Now, you have Me TV under the menu Applications -> Image and Sound -> Me TV

99682-83155.jpg

Requirements:

  • If you want your tv card working on a Linux box, ensure you are using the latest kernel. Ubuntu 8 is a good choice, or you can try also Linux MCE.
  • Not all the hardware is supported. Check yours. I bought a Pinnacle PC DVB-T that I had to refund back because didn't work. Now I have a Hauppauge WinTV NOVA-T that works like a charm
  • Install lirc (sudo apt-get install lirc) for remote control support

Automatix for Ubuntu 8 is dead

Today I read on the GetAutomatix Forum that Getautomatix for Ubuntu has been discontinued. That's sad news since we were all pretty used to it. Everything outside-the-box was installed with a single click and was a great improvement for the end-user experience. Now I can only hope that someone will resume the development with a new project. These guys are now working only for the distro Pioneer Warrior. The original message by the authors is:

Well the day has finally come, development of Automatix has been discontinued. We are doing this, NOT because we think Automatix is no longer necessary on Ubuntu and Debian, but because all of the Automatix developers have become wrapped up in more pressing commitments.
I, Jared, have been asked by Technalign Inc. to assist in the development of the next version of their GNU/Linux distribution, Pioneer Warrior. I will use what I have learned as an Automatix developer to make Pioneer Warrior the best GNU/Linux distribution for the average user. Arnie, and the other Automatix Team members, currently are too involved in their personal lives to do justice to the Automatix project as well. We thank our loyal users for the years of support they have given us, and we wish them well on their journey in the world of free software.
Edit: I do want to clarify something, Automatix isn't entirely dead yet. Only development of Automatix2 for Ubuntu has ended. We may still decide to develop Automatix3, which will be a whole new app, however if we do, it will be exclusive to Pioneer Warrior. The reasons for the exclusiveness are, 1. because Technalign has paid for our server and hosting for the past year and 2. because we can easily work with Technalign's developers.

Installing Firefox 3 beta on Ubuntu Gutsy, with Firebug!

If you want to test the Firefox 3 new features on your Ubuntu Gutsy installation, but don't want to loose all the Firebug niceties for developing web apps, here are some quick and dirty steps:

  • $ sudo apt-get install Firefox-3.0 (upgrades/downgrades to kernel 2.6.20... weird!)
  •  Go to the Fireclipse site and download Firebug-1.1.0b10.xpi. This is a modified version from the firebug original, compatible with Firefox 3. 
  • Open Firefox 3, install the xpi by drag & drop to the firefox window. 

Voila! There you are...

96361-83164.jpg

Firefox 3 is in its early stages and it shows: there are some cosmeting issues here and there, the enter key doesn't work in the url field, etc. Anyhow, you can test whether the browser's memory consumption has gone to less crazy numbers, and how quick is the rendering of its new Gecko 1.9 engine. You won't screw Firefox 2 with this installation, so there is nothing to loose. If your are brave people (like us) and put to test this Firefox 3 beta, please tell us your impressions!

Linux web development. Test web sites in Internet Explorer inside Linux

IE: We hate it, but our customers don't know anything else... So, we must test how Internet Explorer renders our websites. It's a bit unpractical to boot from another partition, or change your machine for testing. There are a couple of useful practices:

  1. Install a Virtual Machine for Linux, such as Virtualbox with a windows XP in it
  2. Install IE5, IE5.5 or IE6 as a linux standalone application with IEs4Linux

I have a Windows XP with 128MB RAM for Internet Explorer 7 testing inside my VirtualBox for linux. So, when i want to see how IE7 treats my valid XHTML and CSS i boot the virtual machine and I test it. But, when older IEs come into play, I directly load an internet explorer thanks to IEs4Linux, as if it were another Linux application. This is not something really new, since it is a shortcut to wine, but it's really fast to install and you get all the versions working with a single command. Give it a chance.