Report inadequate content

Linux, Mac in Harecoded

Expand

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.

Expand

How to backup your full Flickr account (script)

Why you would like to copy all your images stored at Flickr to your computer? Well, maybe you want to browse them later offline, maybe you want to stop paying your PRO account, or to keep them just in case...

In any case, Flickrtouchr is a simple command-line script to backup Flickr. You don't need to know python or programming at all. A couple of lines in the Terminal and that's it.

After downloading and uncompressing the .py script all you need is to:

Create a directory, e.g: A folder called "Flickr" in your Home dir:

mkdir ~/Flickr

And then call the script:

python flickrtouchr.py ~/Flickr

After this a browser will be opened and Flickr will ask you to authorize Flickrtouchr, and that's it!

Now maybe you want to add this line to your crontab so you can run it periodically. The script will check if the files exists to prevent continuous download.

Expand

How to create a patch and apply it with subversion

If you want to create a patch with svn you only have to type in the terminal something like:

svn diff yourproject > yourproject.patch

Where yourproject is the folder containing the modified source code.

Then, to restore the patch (apply the changes stored in patch in a new working copy), copy the patch file yourproject.patch in the machine where you want apply the patch and "cd "to the parent folder containing the yourproject folder (not inside yourproject). Then type:

patch -p0 -i /path/to/yourproject.patch

If you do not respect the same hierarchy when creating and applying the patch then you'll have to play around with the "p0" parameter (gives the entire file name unmodified). Of course the patch command is not related to SVN and you can use it in many other environments.

Expand

A free good cross-platform CSS editor

There are many applications where you can edit your Cascading Style Sheets (CSS) in Linux, Windows or Mac, but specifically in my Ubuntu I haven't found an application like CSSED (GTK). It supports auto-completion, really useful wizards, color pickers, preview and a long etcetera. You can go directly to the download page and see specific instructions for Gentoo, BSD, Mac OS X (via Fink), Windows ... or if you are an ubuntu or debian user just type in a terminal (or through the synaptic manager):

  • sudo apt-get install cssed