Archive for the ‘English’ Category.
2011-11-29, 21:42
El siguiente script hace que cada línea nueva que aparezca en un archivo remoto, salte en mi pantalla como notificación.
Con pocas modificaciones se puede hacer lo mismo para un archivo local.
Se puede colocar el comando en el arranque de sesión, pero se va a bloquear para pedir la contraseña. Se recomienda tener acceso al servidor remoto por medio de claves públicas para que el agente de SSH automáticamente pida la contrafrase en pantalla.
Puesto que tail -f nunca debería salirse, tal vez sería conveniente agregar una línea después del SSH que mande una alerta de que concluyó el tail -f o de que falló la conexión con el servidor. Tal vez se pueda hacer revisando el código de retorno, pero hay que ver qué ruido le provoca el tubo.
Se puede modificar para que también el icono y la severidad de la notificación sean distintas, pero en mi caso no es necesario.
El comando podría fallar si la cadena a mostrar contiene comillas.
#!/bin/bash
# stail-notify.bash
# Escrito por Octavio Alvarez.
# Licencia: WTFPL
[ $# -lt 3 ] && {
echo "usage: "`basename $0`" <user@host> <file-to-tail> <alert-title>"
exit
}
ssh $1 "tail -n 0 -f "$2 | while read M D T ELSE; do notify-send -t 5000 -i dialog-warning -u critical "$3" "$ELSE"; done
Para usarlo, lo ejecutan así:
stail-notify.bash alvarezp@192.168.2.100 /var/log/messages "Alerta de Syslog"
2011-07-14, 19:09
There seems to be a common misconception around some user forums. Maybe you recall this phrase:
RAM is there to be used.
This phrase is true within a particular context. It is used to let the operating system cache as much disk as possible into RAM, as RAM is significantly faster than hard disks.
However, within the context of a user-space application it is actually a fallacy. Some users (and even some developers) don’t know much about the inner workings of their computers, and use this phrase outside of its proper context. What is worse, sometimes they don’t even care much about RAM consumption. They don’t care about memory leaks, or think that if memory leaking occurs only once, it’s fine. Or they think garbage-collected frameworks or languages will take care of everything by magic. Without knowing, they end up using the aforementioned phrase as the equivalent of:
RAM is there to be wasted.
Continue reading ‘The “RAM is there to be used” fallacy’ »
2011-03-28, 18:30
This is how Superkb used to look back then in the 0.10 version. It used direct calls to the Xlib library which doesn’t support antialiasing. Back then, text was also rendered using Xlib. The icons were loaded and painted using Imlib2. Version 0.10 was released on September, 2006. I didn’t include an even older screenshot because I considered it to be “still too experimental”.
Continue reading ‘Superkb: then and now’ »
2011-03-18, 16:50
Superkb 0.22 has been released! This is a minor release. Do you want to know what’s new? Take a look at the 0.22 page on the Superkb Wiki.
Superkb is a shortcut-based launcher with on-screen graphical hints. It is written in C using Xlib, with the help of Cairo graphics, Pango, Imlib2, Xinerama, etc. and the source code is managed using Git.
Continue reading ‘Superkb 0.22 released’ »
2010-10-11, 14:21
$ ls -l /sys/class/net/*/device/driver
lrwxrwxrwx 1 root root 0 Oct 11 14:03 /sys/class/net/eth1/device/driver -> ../../../../bus/pci/drivers/skge
lrwxrwxrwx 1 root root 0 Oct 11 14:03 /sys/class/net/eth3/device/driver -> ../../../../bus/pci/drivers/8139too
Thanks to bldewolf. / Gracias a bldewolf.
2010-09-28, 7:42
It was not long ago that I started biking to make at least a little more exercise than I usually did (zero).
At the same time, Alfredo started too. So him and I took the 50-mile challenge that is biking from Rosarito to Ensenada, Baja California.
I knew it was difficult, but not that much. The Sun was really tough. I heard other cyclists talking about how hot the day was. Uphill most people were walking. “Casual riders complete the trip in 4 hours” says the website. I did 7:15, and there were still people behind me.
It was a real challenge, but actually fun. I found out what I am capable of doing.
Lessons learned:
- I need to train.
- I need to learn to administer my water and food supplies better during the ride.
- I need to lighten in my backpack (and my frontpack too)
- I need to find the optimal way to use my energy on level ground and better hill management.
- I probably need to find a more optimal way to use my bike: gears, posture and technique.
- I might need to tune up the bike or have a better one.
- I need to train.
- Not to forget to empty the GNOME trash before placing the flash memory back in the camera. Sorry for the lack of pictures.
- … and I’m sure I’m missing something else.

2010-08-13, 12:50
This is a quick note, documenting a quick successful test on Reverse VNC connections.
Unlike regular VNC connections, in which you connect to the controllable PC, in a Reverse VNC connection the controllable PC will connect to you. The control is in the same direction, but the connection is reversed.
What’s the benefit? Not having to worry about the network status and addresses of the remote PC. It is usually easier to initiate connections than to receive. This lets the guy with better network understanding to be the listener and the poor soul to be the initiator. This will put the network worries near to the tech support guy, where it should be for this particular scenario. Also, as with the current state of IPv4, full of the evil but necessary NAT, you will not have to worry about router NAT / port forwarding configuration in the remote router.
Test setup
The test setup consisted on my desktop workstation running Ubuntu and my laptop running Windows, both on the same Ethernet broadcast domain. No gateway was involved in the test.
The desktop workstation had the following characteristics:
- Operating System: Ubuntu Lucid Lynx (10.04).
- VNC package: xvnc4viewer 4.1.1+xorg4.3.0-37ubuntu2.
- Role: Controlling computer (VNC client). In real life here is where I would sit and control other computers.
- IP address: 192.0.2.10 (this is a fake, RFC 5735 documentation address).
The laptop had the following characteristics:
- Operating System: Microsoft Windows XP SP3.
- VNC package: TightVNC 1.3.10, installed from the OpenDisc software collection.
- Role: Controlled computer (VNC server). In real life this would be the PC receiving remote tech support from me.
- IP address: 192.0.2.20 (this is a fake, RFC 5735 documentation address).
Steps performed to establish the connection
On the desktop workstation (the VNC client, controlling computer):
- Opened a terminal
- Ran
vncviewer -listen
- You should get a message like “main: Listening on port 5500″
On the laptop (the VNC server, controlled computer):
- Went to Start » All Programs » TightVNC and ran Launch TightVNC Server
- If the Properties window pops up, disable “Accept socket connections” and click OK (just for security reasons).
- Right click on the system tray TightVNC Server icon and choose Add New Client…
- Enter the IP address of the desktop workstation, in this example,
192.0.2.10 and click OK or hit Enter.
Sidenotes
- The test was done with the Windows Firewall enabled. You might get a message like To help protect your computer, Windows Firewall blocked some of this program features. | The computer administrator may unblock this program for: TightVNC Win32 Server when running the Tight VNC Server. You may safely click “OK” because you will initiate connections and not listen for a connection. This message gets inhibited by disabling Accept socket connections in the Properties window.
- The test was repeated using a restricted Windows account, with a successful result. This gives you a lot of flexibility. You might even try making a portable TightVNC server by following the Step 2 from the instructions on this VNC document from the TinyApps.Org blog
- Depending on the available bandwidth and latency, it might be necessary to tweak the server on the Properties window.
- I noticed a somewhat long delay on the first connection attempt, in one case even leading to a connection failing. On the second try it worked fine. I would guess this has to do with DNS resolving delays and caching, but it’s just speculation.
Comments welcome. If you have instructions for the same scenario on different platforms, post it on your blog and link it from a comment, or write it directly on a comment.