Skip to main content

Posts

Showing posts from January, 2012

Enlaces a mensajes de correo

Gruber, de Daring Fireball, escribió hace tiempo sobre la posibilidad de crear URLs que enlazan a mensajes en tu buzón de Mail.app . Y es algo tremendamente útil y que no veo publicado en español, así que aquí pongo un pequeño resumen. Primero: de qué se trata exactamente? Pues que es un enlace que, cuando clicas en él, se abre Mail.app y te muestra el mensaje concreto que sea, en medio de tu buzón. Muy útil si por ejemplo dentro de 2 semanas tendrás que usar un mensaje que acabas de recibir: puedes usar el enlace al mensaje en iCal, de forma que la alarma que te saltará dentro de 2 semanas tiene un link que al clicarlo abre el mensaje correspondiente. La cosa es que Mail.app entiende esas URLs, y se crean automáticamente si por ejemplo arrastras un mensaje desde Mail.app a iCal. Tienen este aspecto: message:// , donde MESSAGE-ID está contenido en las cabeceras de cualquier mensaje. Y sí, es muy útil, pero Mail.app no tiene una forma directa de crear tales links. Una forma es dra

Safari's Reading List protocol: CalDAV + XBELs

Safari on desktop and iOS has a feature called "Reading List". It is a way to store URLs in iCloud, synchronize them between Safaris, and mark them as read or not. Somewhat like Instapaper maybe. I was a bit surprised that there is no Chrome or Firefox extensions for tapping into Safari's Reading List. So I wanted to try poking a bit into the protocol, maybe something interesting would appear or someone could get some headstart from this. Safari always seem to start contacting p05-bookmarks.icloud.com, which resolves to the Akamai CDN, some p05-bookmarks.icloud.com.akadns.net. Luckily the IP always was the same, and there is no client certificate check, so I could mount a little Man In The Middle via /etc/hosts. Then, a couple of socats: one to pose as the original SSL server and resend the plaintext; and the second to receive the plaintext and send it to the original IP. The first socat shows everything that goes out of it (in plaintext) thanks to the -vx option.

Huawei E220 3G modem drivers on OS X Lion: only 32 bits

I recently installed Mac OS X 10.7 Lion, and found that it already had drivers for the Huawei E220 3G modem. But the drivers are 32 bit, so they won't work for machines which use a 64 bit kernel. And there seem to be no 64 bits drivers, so the only solution for now is booting in 32 bit kernel mode (pressing 3 and 2 when booting). I seriously doubt that Huawei are going to publish updated drivers; they were already rather unsupporting even when the modems were new. Eventually, I plan to try to make my own driver, but that won't be short-term...

Tcpflow and connections between local interfaces

Looks like tcpflow doesn't see connections between local interfaces. After a bit of digging, looks like such connections are "routed internally by the kernel", at least in Linux. And there are patches for Linux to force those packets out of one interface and in from another, but even that is only useful if you have an external network connecting both interfaces (looks like a simple crossover cable should be enough). http://www.ssi.bg/~ja/send-to-self.txt There is another option: using iptables to first make the packets leave the machine towards some external IP, and then using arpd to make a router send back those packets. http://serverfault.com/questions/127636/force-local-ip-traffic-to-an-external-interface And I see people reporting that tcpflow -i lo does work for them, capturing flows having local addresses even though different than 127.0.0.1. http://fixunix.com/tcp-ip/327123-capturing-tcpdump-local-traffic.html The interesting thing is that people seem

FileMon-like functionality on OS X as a one-liner dtrace script

I first thought about this as a lsof substitute, but no, it's more like a primitive / simple FileMon/fs_usage. It shows the executable and the file it opened. Could be improved, of course. Dtrace is amazing. sudo dtrace -qn 'syscall::open*:entry{ printf("%s %s\n",execname,copyinstr(arg0)); }' fs_usage shows much more information... but is not a one-liner ;P

mplayer vs. polish subtitles

Typically, when I start seeing a film, I only have enough time to quickly get some subtitles, try to make them more-or-less work with the film at hand and ... that's it. So, lots of repetitive, rushed fixes but no long-term solutions. But this time I got sick of it and tried to get to understand the problem. Which is: Polish subtitles don't work with mplayer, or at least not with the mplayer built with MacPorts' mplayer-devel port, which uses mplayer's SVN HEAD. The option -subcp cp1250 does select the codepage (cp1250 is variously called Windows Latin 2 or Windows Central European encoding, which seems to be the typical encoding used by polish subtitles on the net) The option -subcp enca should auto-detect the encoding, but the port disables enca at configure time, and provides no way to enable it. I'll try to send a patch for that. In the meantime, enca -L pl -i file by itself works nicely (enca is provided by a port). For difficult cases when enca fails

Toshiba G450 en Mac OS X Lion

Los drivers que Toshiba publicó para el G450 en el 2008 son sólo 32 bits. Si tu Mac OS X Lion corre el kernel a 32 bits, posiblemente funcionarán. Pero si ordenador corre el kernel a 64 bits, lo cual creo que ya será la mayoría de macs, esos drivers no funcionarán. Y Toshiba no tiene pinta de  que vaya a publicar nuevos drivers, porque ya eran lentos con cosas de soporte cuando el móvil era nuevo, y ahora encima parece que la división de móviles de Toshiba se ... arrejuntó con Fujitsu en el 2010. Así que la solución a corto plazo es arrancar en modo 32 bits, lo cual se hace pulsando las teclas 3 y 2 mientras arrancas. Sólo el kernel pasa a modo 32 bits, y se supone que la diferencia no será demasiado grande en rendimiento - pero no sé de cifras concretas. Los programas seguirán funcionando a 64 bits. Curiosamente, OS X Lion lleva de serie drivers de Huawei para el modem E220 y algún otro. Pero son también drivers de 32 bits, así que estamos en las mismas. Y tampoco veo que Huawei

Toshiba G450 drivers for OS X Lion - only 32 bits

I recently changed computers and got a MacBook Pro which boots the kernel in 64 bit mode. The problem is, the only drivers Toshiba published for the G450 modem are 32 bit only (published on 2008). So the only solution for now is booting in 32 bit kernel mode (pressing 3 and 2 when booting). I seriously doubt that Toshiba are going to publish updated drivers; they were already rather unsupporting even when the modems were new. And Toshiba seems to have merged its mobile division with Fujitsu's... and even Windows 7 users seem to have problems. So... maybe this means that I should try to go back to the program-your-own-driver thing.

Building socat in OS X 10.7 Lion

socat (1.7.2.0 as of this writing) doesn't compile with the clang, the standard compiler in Mac OS X 10.7 Lion (10.7.2 as of this writing). It does compile if instead of clang one uses for example llvm-gcc-4.2.2. The developer reports that this is a bug; only gcc is supported in socat, but there are compatibility fallbacks for other compilers. Only, the fallback was missing on the file that fails to compile, xioexit.c. The fix is easy: @@ -5,6 +5,7 @@ /* this file contains the source for the extended exit function */ #include "xiosysincludes.h" +#include "compat.h" #include "xio.h" (if someone is trying to build something like socat, I guess he doesn't need help about patchfiles) This problem was also present in MacPorts' port for socat. I have already reported it and provided a new working portfile, so I guess it won't be long until it is published.