The blogger and the (cookie) jar

For a while now, I’ve been unable to post comments at * blogs. Even anonymous comments, in blogs that allow them. Alas, when writing a comment and clicking the ‘Submit’ button, the page was just reloaded, and no trace of my comment was left behind. Weird is an understatement. Puzzled as I was, now I have discovered the reason: unlike * blogs, to post a comment, any kind of comment, at blogger, you have to allow third party cookies! Yep, to comment you must open yourself to the possibility of “anonymous” surveillance (even more than what you are already exposed for just using the internet). Luckily, there’s an easy fix (if you’re a Firefox user, that is): install the Cookie Monster addon. Then disable third party cookies globally (Edit -> Preferences -> Privacy), and go submit a comment. It’ll reload the page, but the addon icon in FF’s bottom bar will tell you that the page tried to set a third party cookie. Allow it to do this always. This way, you disable third party cookies by default, while still allowing it for those sites that require it, viz. blogger. And presto, problem solved!

Addendum: I think this only happens when the comment form shows up after the “original” post, like so, and not when the comments are written in a separate page, like so. Blogger is weird…

Test post from Blogilo

I’m using the KDE blogging client Blogilo, let’s see how this works! Heck it even supports real browser-like preview inside the remote client! How awesome is that?!

My only catch so far is that the image handling (resize et al.) could be a little better. But still, it’s pretty awesome! Linux + KDE + Arch, you rock!


Via the twitter feed of Wikileaks, came this interview of Assange, and in it, these insightful words:

When reading mathematics you must take your mind through each intellectual step. In this case, the steps of Heisenberg or Bohr. Because good proofs are very creative, it takes the full energies of your mind to reach through one step to another. Your whole mind must be engaged in a particular state of thought, and you realize that this mental arrangement is the same as the author’s at the moment of writing, so the feeling of mental similarity and rapport becomes strong. Quantum mechanics and its modern evolution left me with a theory of change and how to properly understand how one thing causes another.

Maybe that’s why all of the mathematicians I can think of are, well, thin! :D

PS: now I mentioned Assange, I must also mention that, in an adversarial spirit, I started reading Inside Wikileaks, written by a WL former full time employee. So far, it has been surprisingly addictive (but now I must sleep).

Comentários desligados Publicado em geek, math

Internet Explorer

Is one crappy piece of software. But one which stirred a rather lively discussion yesterday, at the end of another day’s work. The main point of contention was not that IE sucks (everyone agreed to that: some versions more than others, but overall, they all suck). Rather, it was about whether Microsoft should be able to commercialize a browser that does not respect web standards. At first glance, this seems to be the case. I mean, why shouldn’t they be allowed to do so? Furthermore, as one colleague pointed out, back in the day of 56kbps connections, downloading a ~1Mb browser, was a royal pain: it would usually take more than two hours. So when Microsoft developed Internet Explorer, and shipped it pre-installed with the Windows CD, as the adoption of the latter soared, the former rode along.

To be clear: so far none of the behaviours described above are (or ought to be, IMHO) illegal. Of course, Microsoft’s demeanour went well beyond what I’ve described above. Its strategy “embrace, extend and extinguish” was particularly notorious (and nefarious):

  1. Embrace: Development of software substantially compatible with a competing product, or implementing a public standard.
  2. Extend: Addition and promotion of features not supported by the competing product or part of the standard, creating interoperability problems for customers who try to use the ‘simple’ standard.
  3. Extinguish: When extensions become a de facto standard because of their dominant market share, they marginalize competitors that do not or cannot support the new extensions.

It’s bullet point number 3 above, that is illegal. Microsoft could only do it after both Windows and IE achieved widespread adoption, i.e., after they achieved a monopoly, of both operating system and browser. The question now becomes why should #3 be illegal? After all, both monopolies were achieved by Microsoft’s merits.

The short answer to why should #3 be illegal, is that it stifles innovation. For the purpose of markets is to foster innovation through competition. This doesn’t automatically make monopolies illegal, but it does put them under a much tighter grip, for the potential for abuse is enormous. And that was indeed what happened: IE evolved in such a way as to create what in practice was a de facto custom standard, which made it very hard for competitors to implement browsers compatible with IE. It is of little comfort to claim that this isn’t Microsoft’s fault, but rather that of the web designers’, for using extensions that are not a part of the standard. After all, it’s not the designers that have a monopoly, nor should it be theirs the responsibility of ensuring a competitive market. The net result was that as Microsoft’s custom changes to HTML rendering were adopted for the majority of sites, because the majority of sites was designed to display properly in the most used browser (IE at the time), anyone trying to design an alternative browser was stuck fighting an uphill battle to keep things compatible with IE. In other words, this creates a much higher barrier of entry in the browser market, thus ensuring the IE continued to rule unchallenged, not because it was the best product, but because its monopoly hindered the entry of competing products. This killed innovation, and subverted market forces, and was what prompted legal action against Microsoft in the past. And this is why IE (or any other browser that enjoys a monopoly) should not be allowed to add proprietary extensions: because these will easily become a de facto standard, which will distort market forces in order to perpetuate its monopoly.

I’ll will end pointing that the different versions IE no longer have a browser monopoly, and that was possible because increasing versions of IE increasingly support web standards, which made it possible for other browsers to compete with IE on product merit alone. And that is the one feature that all competitive markets have: competition is based on product merit, and NOT on product user share.

Comentários desligados Publicado em geek


Being a vim aficionado, I used Vimperator with Firefox, but I’ve found a fork of the former, called Pentadactyl, which looks really cool, and more flexible (although I haven’t explored this enough, yet). In the meantime, at least in version 1.0b5 (FF 3.5+), that status bar text, non https pages, is white on a light background, which sucks, because it makes the text very hard to read. Here’s a simple fix. Create a .pentadactylrc file in you home directory (don’t forget the initial dot), and put this in it:

” do not hide Firefox’s main bars
set guioptions+=mTB

” change the status bar default text colour to black
highlight StatusLineNormal color:black

NOTE: only the highlight line is needed to solve the colour scheme problem, the “set…” line is to prevent the addon from hiding Firefox’s main bars (which it does by default).

EDIT: In order to be able to be able to use some usual shortcuts when editing text, insert this in ~/.pentadactylrc:

 inoremap <C-a>      <pass>
 inoremap <C-b>      <pass>
 inoremap <C-c>      <pass>
 inoremap <C-i>      <pass>
 inoremap <C-u>      <pass>
 inoremap <C-v>      <pass>
 inoremap <C-x>      <pass>
 inoremap <C-y>      <pass>
 inoremap <C-z>      <pass>
 inoremap <S-Insert> <pass>

Youtube gallore

First, here’s fractal generation, without a computer:

The trick is to wire the output of a camera to three monitors lying next to each other, and then to point the camera at those monitors. It’s awesome, but I don’t quite get how did they “bootstrapped” the process. If only I had three monitors to give it a try… But sadly, I don’t.

Via Good Math, Bad Math

Next, here’s Hitler on Portugal, SCUTS, our Socialist Party, our Prime-Minister, and so on. It’s funny, but in the end, it’s also sad…

video (embedding disabled by youtube)

Finally, if you’ve ever complained about your job, don’t:

Via Que Treta!

C self reproducing program

Inspired by the classic Ken Thompson’s “Trusting Trust” speech, I decided to try to write my own self-replicating program. I took as the basis for the (rather incomplete) sample of code shown in the above speech. I wanted to avoid approaches like having the program open it’s source file and output its contents. The result is a 387 line C file. Doing it makes you think and rethink about the true power of quoting, and how to abuse it (and made think about a Lisp, but that’s just me, I guess…). Should you decide to try to read it, have fun! (but be warned that the first ~350 lines are rather boring! ;-) )

When running it and comparing its output with its source, beware of spaces, specially if you copied the file from the web browser and pasted into the text editor. Either download the file or when doing the diff, use:

diff --ignore-all-space

And an interesting thing I found when doing this, is that vim by default always adds a newline at the end of file (you can see this for yourself by doing “tail -1 | hexdump” to some file_name written in vim. The last character will be an “0A” (hex code for “\n”). This caused some problems with the diff output (it issues a warning if one or more file do not end with a newline), and would be problematic if mixing files written in Unix and Windows, but whatever…

Anyway, talk is cheap, so here’s the code: source. To view, just remove the .pdf extension (it’s there just to fool WordPress’ allowed formats limitation…) and extract the tarball.

Firefox addons

After mentioning in a previous post three apps, I know mention two (IMHO must have) Firefox addons:

  • HTTPS Everywhere forces the use of HTTPS during all the session (as opposed to just during login) of several sites, such as WordPress and Facebook, to name just two. This is of paramount importance specially to those that browse the web using wi-fi in public places (and if you don’t believe me, just google for “firesheep”).
    EDIT: it seems this addon breaks Facebook Chat. Bummer!
  • Textarea Cache saves what you write in forms in cache, so that in the event of a browser crash or, vastly more likely, session expiration, you can still recover what you’ve written. I ought to have for a long time, but just searched for it now, after losing a rather lengthy text I meant to post in the ArchLinux forums (the session expires rather quickly…).

Open source vs. witchcraft

In my late night ramblings, I found this quote from Linus Torvalds:

I think, fundamentally, open source does tend to be more stable software. It’s the right way to do things. I compare it to science vs. witchcraft. In science, the whole system builds on people looking at other people’s results and building on top of them. In witchcraft, somebody had a small secret and guarded it — but never allowed others to really understand it and build on it.

Traditional software is like witchcraft. In history, witchcraft just died out. The same will happen in software. When problems get serious enough, you can’t have one person or one company guarding their secrets. You have to have everybody share in knowledge.

The fact that this reality is systematically ignored, is perhaps a part of the reason of why software is in the sorry state we all know. And now I’m going to sleep.

Three new apps

First, we start with Google Sharing. Its stated purpose is to diminish the amount of information Google collects about you, while at the same being completely transparent to the end user. It achieves this using a Firefox addon the redirects google searches to a special proxy, that will modify it so as to hide its origin, before sending it back to google. When used with SSL, this ensures that not even the proxy can violate the user’s privacy, because the request is encrypted from Google’s server to the end user’s computer. More information can be found on the homepage and the FAQ, which is very clearly written, even to the non-geek user.

The second app, is the smplayer. I was an avid vlc user, but this “frontend” to mplayer seems (thus far at least) to throw vlc into a distant second place. It has nice features, and one in particular, that is totally awesome: it can automatically download subtitles for you! In a matter of seconds. Awesome.

Last, but surely not least the third app: for those you who, like the author, used Windows and Winamp, and then Linux and XMMS, and thought the latter had been cast into an inescapable oblivion, here’s audacious! Not much to say, better go see for yourself. I, for one, have found my new favourite audio player!


Copyright and the IMF

Two videos on one post. The first one is a clever and very funny retort to that mantra of sorts, viz. that artistic creation springs from the artist’s mind in its entirety, implicitly stating that previous works play no role whatsoever. Well, that’s simply wrong: like science, art also borrows from the art that existed before. Here’s a witty demonstration of precisely that:

From Que Treta!

Secondly, at a time where an increasing number of voices are starting to ask whether the IMF will have to intervene in Portugal, here’s a video that exposes it’s darker face, and indeed, indirectly, the darker face of modern capitalism.

source (Portuguese)

Script that email

To my own future reference, and to whom it might prove useful, I post a little Tcl/expect script, used to (rudimentarily) automate email sending. Usage shouldn’t be too hard to figure out :-)

#! /usr/bin/expect

if { $argc < 2 } {
        puts "Usage: ./$argv0 MTA_IP_addr MTA_port \[rcpt\]"
spawn telnet [lindex $argv 0] [lindex $argv 1]
set rcpt "oscar@foo.tld"
if { $argc == 3 } {
        set rcpt [lindex $argv 2]
expect "220"
send "ehlo a\n"
expect "250 DSN"
send "mail from: <>\n"
expect "250 2.1.0 Ok"
send "rcpt to: <$rcpt>\n"
expect {
        "250 2.1.5 Ok" {
                send "data\n"
                expect "354 End data with <CR><LF>.<CR><LF>"
                set ts [exec "/bin/date" +%s]
                send "Subject: foo $ts\n"
                send "bar\n"
                send ".\n"
                expect "250 2.0.0 Ok"
        "5**" {
                puts "Rcpt addr rejected!\n"
                return -1
send "quit"

EDIT: modified the script to also receive from command line the recipient address

Windows 7

So, I have to take the computer to the store (again). But I only have Linux installed, and I don’t want to let the techies there handle it—for pretty obvious reasons. So I had an idea: let’s install Windows 7, and see what all the hype is about! And the same time, I can leave the computer at the store with a system that will be (one hopes) more familiar to the guys there than any UNIX relative. It’s supposed to be user friendly—but, as so much else in life, user friendliness is in the eye of the beholder. As long as the beholder is not any other OS living on the same machine.

But first things first. I have two hard drives, sda and sdb. ArchLinux is installed on the former, and Win 7 was to be installed on a FAT logical partition on the latter. First (not so unexpected) surprise: it can only installed on NTFS. Oh well. Format took care of it. Second (way more, completely unexpected) surprise: After formatting the drive, it warned that it may create additional partitions to help the boot process. WTF?! I was this close of trashing the CD and shutting down the entire she-bang… but I didn’t. Curiosity (plus the fact that I needed for the aforementioned reason), spoke louder, and I went through with it. Installation is pretty much like its predecessor, WinXP, just “next” it until there’s no more, but this time there is a catch: it is SLOW! Really SLOW. I have a Quad core machine, with 4Gb of RAM, and just the change between menus took minutes!

But I’m going astray. After the install, Windows 7, like all of its predecessors, wiped out the existing Master Boot Record, so GRUB had to be reinstalled. I booted the Kubuntu live CD, but before going into the GRUB part, I ran cfdisk on both drives. sdb had an NTFS partition, marked as bootable, as expected. But the really really scary and totally completely unexpected surprise, came from sda: it had an NTFS partition! Curse! Curse curse CURSE! My data!! Alas, no, after a big scare, all my Linux partitions were OK, and that new NTFS thing on sda had just a couple of Mb. Strange, but oh well, reinstall GRUB, modify (from ArchLinux) it’s menu.lst to allow Win 7 to boot and reboot, and … FAIL. Windows complains something is missing. Mess around with bootloader’s config to see if we get lucky, but no. Until, an idea comes. Instead of trying to boot the NTFS partition on sdb (which is where Win 7 was installed), just boot the one in sda. And surprise, it now works!

So, to sum it up, Windows now cannot be installed on a single partition. What is worse, you have NO CONTROL on what other partitions it might create, and just have to hope for the best, i.e., that it doesn’t wreck anything else on the process. I mean come on, even Linux can be installed on a single partition, if you ditch swap! And windows needs another partition JUST TO BOOT?! Like them guys say, EPIC FAIL!

Second post with drivel

After installing drivel, in Archlinux, my distro of choice, a funny thing happened: KDE’s device notifier stopped working. Specifically, it stopped detecting CDs and DVDs (but USB pen drives and HDD worked fine). Now after googling and searching the distro forums, I found some (old) threads which hinted that the problem could be a lib which was installed because it was a dependency of some GTk package, which in itself was a dependency of drivel (which is, obviously, GTK based). So, the first thing I did was to uninstall drivel, and all dependencies it brought along. No good. OK, so what if the problem is not with KDE, with the underlying hardware detection layer (i.e. HAL)? We monitor its activity with “lshal -m” (run as root), insert a CD, and surprise, nothing happens!! OK, to the HAL wiki page, where I, finally, found the bastard root of the problem:

I am not sure why but you may have a file under /etc/hal/fdi/information/media-check-disable-storage_model_$YOUR_DEVICE.fdi which should have a content similar to:
File: /etc/hal/fdi/information/media-check-disable-storage_model_$YOUR_DEVICE.fdi

<match key="info.udi" string="/org/freedesktop/Hal/devices/storage_model_DV$

If the key is set to false (it was in my case), all you have to do is to change the value of the key to true.

I did it, restarted HAL and DBUS, and it was finally working….

But wait, I’m not done yet! After that, I reinstalled drivel, along with all its children dependencies, and now it works! As a matter of fact, I’m writing this post from drivel… Oh well…

Comentários desligados Publicado em geek