Scrolledge on touchpad

Time ago I was wrote an entry (in spanish) about how to activate scrolledge vertical and horizontal on your touchpad/mouse. I did it with synclient but I’ve another simple recipe to do it if you don’t use Gnome or KDE.
On /etc/X11/xorg.conf.d/10-synaptics.conf I added that options:

Option «VertEdgeScroll» «1»
Option «HorizEdgeScroll» «1»

and if you want to add more options, list all with

synclient -l

Made it with charm and jed from a rxvt-unicode terminal.

Compile-n-run in jed

In jed’s maling-list someone asked about how to compile and run from it without leave it. (Most of GUI IDEs do it.)
And you can automaticed it with a function that gets information about the buffer in which you are, runs the command and displays it on new buffer:

define compile_and_run ()
{
% declare variables
variable FORMAT = «cd %s && gcc -o %s %s && ./%s»;
variable filename, exe, dir, cmd, buffer;

% get file info and create command string
(filename, dir, , ) = getbuf_info ();
exe = path_basename_sans_extname (filename);
buffer = exe + «_output»;
cmd = sprintf (FORMAT, dir, exe, filename, exe);

% set output buffer, run command and move to that buffer
setbuf (buffer);
run_shell_cmd (cmd);
pop2buf (buffer);
}

Made it with charm and jed from a rxvt-unicode terminal.

My default Charm’s template

This’ my default Charm’s template I use with jed to post in my wordpress.
(I actived «no_mode» in jed because wordpress pick up return lines as new paragraph.)

<p style=»text-align:justify;»>
Write here :)
</p>
<p style=»text-align:right;font-size:xx-small;»>Made it with <em>charm</em> and <em>jed</em> from a <em>rxvt-unicode</em> terminal.</p>

Enjoy your console experince!

Made it with charm and jed from a rxvt-unicode terminal.

Ocultar archivos en una imagen

Desde el blog de Tony Baldwin[0] encontré un excelente truco para enviar imágenes y dentro de ellas ocultar archivos.

Comprime en un .zip los archivos que quieras ocultar

zip shhh.zip secreto1 secreto2

Después, eligiendo una imagen cualquiera, por ejemplo, vacaciones2010.png, anidarlas y crear un nuevo archivo de imagen:

cat vacaciones2010.png shhh.zip > foto.png

Si usamos una aplicación para ver la imagen foto.png veremos que la podemos ver, si usamos «file foto.png» nos dirá que es exáctamente una imagen. Ahora, si vemos el tamaño de la misma respecto a la original («vacaciones2010.png») veremos que tiene un tamaño un poquito mayor dependiendo del archivo que le anidemos.
Ahora hay que desencriptar,

mv foto.png foto.zip
unzip foto.zip

y aquí tienes los archivos ocultos.

Práctico y elegante ;)

El post (en inglés): http://baldwinsoftware.com/blog/?p=1209

0. http://baldwinsoftware.com

Made it with charm and jed from a rxvt-unicode terminal.

Bloqueo de pantalla con X lanzada desde la consola


Donde trabajo los empleados, cuando salen a almorzar o están en una reunión, siempre bloquean sus equipos. Yo utilizaba slock[0] que cumplia con esa función: poner la pantalla en negro y esperar se ingrese nuestra contraeña.
Estaba muy contento con esa herramienta hasta que un amigo me contó de un «bug» que tenemos aquellos que lanzamos el entorno gráfico desde la consola: basta con volver a la TTY donde lanzamos la X, presionar Ctrl+Z y el startx o xinit se manda a segundo plano dejándonos una bonita tty esperando que se ingresen comandos. Él paso una solución[1] que, si bien es efectiva, no me gustaba que me devuelva la tty cuando mato el startx y ese método no me reconocía las tildes ni «ñ» de mi teclado. Y para colmo, slock solo funciona en la X.
Buscando encontré a vlock[2] que cumple con todo lo que espero. Me gusto el que muestre un lindo texto informando que la pantalla esta bloqueada (ver screenshots en el sitio) y registre los logins fallidos. Pero además tiene la funcionalidad de bloquear todas las sesiones e impedir nos desplacemos entre TTYs.
Para lanzarlo hay que estar en una TTY (no sirven las virtuales como las de X o screen) pero aquí es donde lo uso con ese supuesto «bug»: Voy a la TTY donde lancé el startx, con Ctrl+Z mando a segundo plano el startx y tipeo «vlock -a» impidiendo así que cualquiera pueda hacer uso de mi equipo. Luego salgo a almorzar, vuelvo, ingreso mi constraseña y con «fg» reclamo de nuevo el proceso que dejé en segundo plano.

0. http://tools.suckless.org/slock
1. https://gbe.ring0.de/crap/display_managers
2. http://cthulhu.c3d2.de/~toidinamai/vlock/vlock.html

Made it with charm and jed from a rxvt-unicode terminal.

The Definitive Guide to Bash Command Line History

Last week I published a tricks to reverse search (and execute) commandas in Bash.
Now, I found a nice guide that you should read:
"The definitive guide to Bash command line history" from Peteris Krumins’ blog.

Warning: remote host identification has changed!

If you’re using ssh at home with IP instead of hostnames, probably you’ll get problems with SSH and RSA fingerprints.
And on nixCraft I found the solution for this error/problem.