20 Marzo 2009
En estos tiempos de crisis, a nadie nos gusta perder tiempo. Por eso últimamente estoy tan pesado con hacer cosas de una forma eficiente. No, tranquilos, no voy a explicar como leer Google Reader desde Vim XD
Hace ya mucho tiempo que cambié del hoy casi extinto Bloglines al que entonces era el rejuvenecido Google Reader (Me he dado cuenta releyendo ese post, que estaba metido o algo: Normal, estaba en exámenes :P). Hace casi dos años que lo uso todos los días sin excepción, antes solo en el ordenador, y ahora con el iPhone, gano tiempo leyendo mis feeds en el bus de camino a la Escuela.
Optimizando mi uso de Google Reader, he ganado tiempo y he hecho mi experiencia con Google Reader mucho mas acogedora, gracias a ciertos atajos de teclado que integra de serie. Aquí van los que yo más uso:
- ga: Abre "All Items", así lo leemos todo.
- u: Oculta la barra lateral haciendo mas grande la zona de lectura.
- n / p: Para ir bajando/ subiendo entre los posts, para elegir cual queremos leer.
- space / shift-space: Para bajar / subir la página y continuar leyendo (así no recurrimos a las flechitas. :D
- o: Abrir / Cerrar un post.
- m: Marcar como leído / no leído.
- s: Marcar / desmarcar con una estrella.
- shift-s: Compartir / descompartir.
- gl: abrir una etiqueta.
- r: Refrescar.
Hay unos cuantos más, que podéis encontrar aquí.
Estos atajos pueden parecer raros, pero si lo pensáis, tiene mucho sentido: "n y p", son "next" y "previous", "gl" es "go to label", "s" es "star", "o" es "open"...
servido por eckelon
3 comentarios
compártelo
19 Marzo 2009
This week I was selected for a new mission: help somebody with his Windows administration. The first I thought was using a VNC server and connect to it from my comfortable home.
1st Round
Well, using VNC with spanish Internet connections is an utopia: It was so slow that I couldn't do anything.
2nd Round
The next I thought was using Microsoft's remote admin tool. It worked! And it was really simple in a few steps:
- Activate Remote Admin from your Windows Settings. In my case: My Computer propierties, in the advanced tab.
- Create an administrator account, protected by password (unless you protect it with a password, you couldn't do anything).
- Download Microsoft Remote Desktop Connection (for Windows or Mac), and install it on the client machine.
- The only thing you'll need to access to the server machine, is the username credentials and the public IP.
Personnally I prefered to set up a DynDNS account, because I didn´t want to look for the public IP each time ;)
What I want to do now is to admin a Windows or Mac machine from GNU/Linux and vice versa :D
servido por eckelon
sin comentarios
compártelo
18 Marzo 2009
This evening I've learned to use regular expressions in sql code, and I'm loving it. Talking with GoLo about this, he showed me how to use regular expressions on the Vim´s search and replace tool (Instead he doesn't like Vim :P). E.g. If you want to comment some lines of code, you may want to use:
[sourcecode language='css']
:4,9 s/^/\/\/ /g
[/sourcecode]
Where 4 and 9 are the lines between which you want to comment on the code, ^ is what you must use to go to the begin of the lines and \ allow us to insert the /. This would be more efficient if you record it into a macro.
This is a very extensive topic, and this is only a minimal part of it. If you want to learn more about it, you can read this tutorial.
servido por eckelon
2 comentarios
compártelo
17 Marzo 2009
Sometimes, when a ntfs partition is open, or partially corrupted, or it had been bad closed, if you try to mount it, you'll find an error message telling you that it's impossible to mount.
Today, I have to help a friend with her computer, wich was infected by a virus or a trojan... and she can't access her windows partition.
The first I've done is using an Ubuntu Live CD (it's always on my bag :P) to mount her Windows partition and moving her files to another hard drive. But always got that error message. Finally I've typed this command on the Terminal, et voilà:
[sourcecode language='css']
$sudo mkdir /media/HDD
$sudo mount -t ntfs-3g /dev/sda1 /media/HDD -o force
[/sourcecode]
This only forces the ntfs partition mounting by using the ntfs-3g driver, and it had worked great.
servido por eckelon
5 comentarios
compártelo
16 Marzo 2009
It had to exist. For a few years I've have been using both Vim and Eclipse to edit code. Actually, I only use Eclipse for Java, because it's really a powerful tool. Vim, on the other hand makes me much more efficient when typing, but it isn't an IDE, so, I'm forced to use Eclipse too (or another IDE, obviously). My attemps to become Vim into an IDE had failed, so, I abandoned, and I only use Vim to type, but not to compile, or stuff like that. That's why I use Vim with PHP or Python, but not with Java.
The problem using two editors is easy: you have to learn two different ways of editing text, and that isn't cool, e.g. I have an error on my Java app, and when I look the mistaken line, I found ":wq".
So I started searching a solution for integrating Vim into Eclipse. All the plugins I found, perfectly integrate Vim into the Eclipse editor, but, all the Eclipse features broke. And I don't want to program without the code assist. But finally I found Vrapper, witch is a plugin that emulate some Vim commands in Eclipse, and, despite it´s not a totally Vim experience, it makes me much more efficient.
Vrapper turns Eclipse into a modal editor, with the 3 Vim modes: normal, insert and visual. Today the visual mode only allows to select a few lines, and operate with y, d and c, but the author is working hard on it.
Some things I can do now with Eclipse are:
- browse the code using h,j,k,l
- search with / and * (the Vim find and replace tool will be soon add :D)
- use :noremap in my configuration file to make my own mappings
I´m using it since a couple of hours, so, I don't have a complete opinion yet, but for now It's really comfortable :D
How I install it in my Eclipse?
It´s really simple: add a new location on your "find and install" menu, and paste this url: http://vrapper.sourceforge.net/eclipse-update-site
servido por eckelon
1 comentario
compártelo
10 Marzo 2009
Pese a que en mi paso a Mac, intenté darle una oportunidad a Textmate, no he podido. Y es que tras unas cuantas semanas me he dado cuenta de que mis líneas de código tenían lindezas como :wq y cosas así. Tuve que volver a Vim. Por varios motivos:
- Me he hecho a él
- Aún no conozco sus límites
- Lo puedo ejecutar en cualquier máquina: hoy he tenido que picar código en un Windows, y Vim y el vimrc que llevo siempre conmigo, me han salvado la vida.
El caso es que GoLo pese a que suele usar Vim para modificar cosas del sistema, a la hora de la verdad abre el Eclipse, y para según que cosas es normal (yo soy el primero que lo hace) pero para programar en Python, Perl o Php, me parece una burrada. Desde que empecé a usar Vim de verdad, suelo llevar encima una pequeña Moleskine donde voy apuntando truquillos que me van haciendo más y más rápido a la hora de picar código. De este cuadernito he hecho una selección que le vendrá a GoLo que ni pintada :D Si no eres GoLo, también puedes usarla :D ¡Y hasta comentar!
Inserciones (en modo normal)
- i : empiezas a escribir a la izquierda de la letra sobre la que tienes el cursor
- I : empiezas a escribir al principio de la línea en la que estás
- a : empiezas a escribir a la derecha de la letra donde tienes el cursor
- A : empiezas a escribir al final de la línea en la que estás
- o : empiezas a escribir en la linea de abajo. Importantísimo.
- O: empiezas a escribir en la línea de arriba
Moverse por el texto (en modo normal)
- e : pone el cursor al final de la línea
- b: pone el cursor al principio de la línea
- yy : copia la línea actual
- dd : corta la línea actual
- y3y o d3d: copia o corta 3 líneas, hacia abajo desde la que está el cursor. Esto es genial para mover grandes bloques de texto de un lugar a otro. (Si GoLo, si, como me dijiste que hace el Eclipse :P)
Otros, pero no menos importantes
- :1,$ s/hola/mundo/g : reemplaza de la línea 1 hasta el final todas las palabras "hola" por "mundo". Si cambiamos $ por un 5, lo hará en las 5 primeras líneas, y si cambiamos el 1 por un 5 lo hará de la línea 5 hasta el final. Si solo lo queremos para un pequeño bloque de texto, pues, tan sencillo como poner las dos líneas entre las que quieres acotar. En que le coges el tranquillo, lo echas de menos en todas las
- :set nu : activa la numeración
- :tabnew : abre nueva pestaña
- gt : para moverse entre las pestañas. Comodísimo.
- :tab sba : abre todos los buffers activos en pestañas. Utilísimo.
Me dejo muchos en el tintero, pero estos son imprescindibles :D Seguiré añadiendo más poco a poco para la sección de Vím :D GoLo, espero haberte convencido :P
servido por eckelon
7 comentarios
compártelo
5 Marzo 2009
sudo apt-get install openarena
servido por eckelon
3 comentarios
compártelo
27 Febrero 2009
Dados los comentarios sobre la beta de la nueva versión de Safari, decidí a instalármelo. Funcionaba todo perfectamente expecto un pequeño detalle, que no funcionaba Gmail. Desinstalé, instalé, reinstalé, y todo lo que acaba en alé, pero nada funcionaba. Desesperado, intenté que algún lector del blog me ayudara publicando este post. Y, como siempre Ramón vino al rescate con el consejo de que desinstalara Gears. Efectivamente, se soluciónó
Pero, ¿cómo desinstalo Gears?
Abre una terminal y pega esto (comillas incluidas)
'/Library/Internet Plug-Ins/Gears.plugin/Contents/Resources/uninstall.command'
Al dar a enter, te pide la contraseña y listo. Cierra y abre Safari, y todo debería ir sobre ruedas.
servido por eckelon
5 comentarios
compártelo