soledad penadés
repeat 4[fd 100 rt 90]

Archive for January, 2008

20080131 DIY: Replacing my powerbook's hard drive

It is a natural-born traveller: I had owned it for less than one month and was already travelling to Barcelona with it; next came several more visits to different cities, in Spain (Madrid, Valencia, Seville) or in Europe indistinctly (Frankfurt, Helsinki). It even was my commuting companion during the month that I was working in Wokingham (although we could never play with T-mobile's train wi-fi service) and also came with me to Sundown and barcamplondon2! And I'm not even detailing minor, local moves…

But some weeks ago it was playing a plain AVI and it suddenly got absolutely frozen. I began to blame Leopard, since everything has been kind of awkward since I upgraded to it. I restarted it, played the video again and luckily it finished playing without freezing. I left it there and went for some coffee; when I came back it was frozen again! No response whatsoever to mouse moves or key presses. Something was really wrong there and I kept believing it was Leopard's fault.

I immediately began to look for info about Ubuntu on powerpc mac's. It's not a very positive experience; powerpc macs are not very mainstream nowadays (or so that seems) and so they are not part of the main ubuntu distribution. The powerpc port is maintained by volunteers and not officially endorsed or supported by Canonical. Not that it makes it unusable but it's somehow less shiny. There are other distributions which do support powerpc, but I am not too keen on changing: I like Ubuntu.

Anyway, while I decided about ubuntu or not, I thought about having a look at the powerbook's system logs. Ahhh the horrible sight I found!

14:23 disk0s3: I/O error

(… lots more stuff…)

16:48 disk0s3: I/O error

Or what is the same: each time the computer had got frozen, there had been an I/O error. Not nice…

All the searches pointed to one and only solution:

Back up your data and replace the hard disk as soon as possible!

Since I don't really like to give my computers to strangers for them to be fixed, I decided I was going to replace the hard drive myself, just as I did with my mac mini.

What you'll need

First thing was to look for info on how to do that. This is the main page I used: ifixit. It is very clearly explained, including the required tools one would need. I only had to buy a Torx 06 screwdriver for the two hexagonal-like screws on the keyboard side, since I already had Philips screwdrivers.

The guide is very complete and the only thing it's missing is some geek-porn details of the powerbook interiors, so I'll just complete it with that and some remarks:

Apart from the hard disk (a SATA disk, not a SATA2 disk) and the screwdrivers, there's something else which you will need and no one speaks about: STRENGTH!!!

I was lucky mr.doob was there when I needed to remove the screws which hold the hard drive to the chassis. They are extremely tight and I wouldn't have been able to finish the replacement without his help. All the other screws are quite tight and hard to remove, having a dismaying tendency to tear up when trying to unscrew them, specially the ones which need the Torx driver (in the keyboard area). They almost ruined the screwdriver!

These are the evil screwdriver eaters!

I would say replacing the hard drive in a powerbook is way more tedious and scary than replacing the mini's hard drive. Things are very tight and tiny, and you have the general feeling that you're going to break it, so I don't recommend it if you're not a patient person.

Hands on!

First thing I did was putting a nice kitchen towel on the table, to avoid scratching the cover of the laptop. You can use whichever type of towel or soft surface you like of course!

Put the powerbook over a smooth surface, like this towel

Then the guide recommends removing the battery using a coin, but if you have a wood clothes peg handy, do use it! That way you'll avoid leaving marks in the metal. Example:

Once you remove the battery begins the monumental task of removing the incredible amount of screws that this little machine has. For not losing a single one, I placed them in a big notebook like this:

Notebook: the screws keeper

It's interesting and perhaps the reason for them to be so terribly tight that there's some kind of blue mass at the end of some screws, like if it was glue or something. If you know what it is, please let me know. I'm intrigued.

Powerbook screw with blue something at the end

After a thousand screws, you'll be able to access the compact and tight interior. Be very careful when removing the keyboard, take as much time as you need and don't use too much of your strength for that, or you may tear the connection to the motherboard quite easily (I almost did - and it was a truly terrifying moment!).

Inside the powerbook

The hard drive is right underneath the touchpad, surrounded by the battery and the optical drive on left and right respectively:

Powerbook's hard drive

And as I said you might need help for these screws if your hands are not extraordinarily strong. Once you remove them you still need to carefully remove that orange tape which keeps the hard drive connected to the motherboard. Here's a close up just for the sake of it:

Orange tape

There's still another piece of orange tape to remove on the left of the hard drive. See my thumb here for having a sense of the scale of this operation:

Orange tape 2

When you finish with these details you can remove the hard drive from its place but there's still some work to be done.

And guess what… there are more screws to remove!

The hard drive it's surrounded by a piece of plastic, which is fixed to the hard drive with those extra screws. I'm guessing it is for insulating it from static electricity or something like that; otherwise it doesn't make much sense.

Remove the other cushioned piece on the bottom of the disk but do not throw it away, the new hard drive still needs it:

You still need to disconnect the little piece of circuit board on top of the hard drive, which in fact connects to the motherboard. Be very careful when disconnecting this piece or you may destroy a pin or two (and say bye to your laptop!).

Then you just connect the new hard drive to the little circuit board thing, wrap the disk with the awkward piece of plastic, put the screws back, put the hard drive back to its place:

Putting the new hard drive in its place

Do not forget about the motherboard connection … and the orange tape ;-)

Putting the new hard drive in its place

Fnally the little cushioned piece on the right:

Putting the new hard drive in its place

And back to screwing on!

After all the screws are in their place comes the scary moment - will it still work? As I had used this disk for cloning my mac mini's hard drive, it had an intel boot image, which the powerbook's powerpc chip didn't like very much. So it gave me a big kernel panic as you can see:

Kernel Panic!

But nothing that a good install of Mac OS couldn't fix!

I have had the computer running for a couple of weeks already and I must say it's working perfectly. So if your powerbook's disk fails and you feel brave enough, do replace it yourself! :-)

20080129 You and me in Babel

Imagine an English-speaking website, where everything is written in English. The author might or not speak another language, as well as the visitors, but all of them normally write in English when replying in that website, enabling them to communicate.

Then there comes the odd visitor which decides to write in his/her own language — not English. And … ta-da! Conversation ends up there. The other readers usually don't know what's in the message so they don't write anything else, just in case they go off-topic. So that's it. Discussion ruined in just one go, 90% of the times.

Occasionally it might be a different case, the non-English comment is absolutely ignored, then its author feels ignored and never writes again.

What should we do?

In this website, I have tried several approaches. First there wasn't any warning message, and people posted in whatever they liked. Usually if I posted in Spanish, they posted in Spanish too. If I posted in English, some of them posted in English and the rest of Spanish-speaking people replied in Spanish.

Then I added messages right before the comments form, but it didn't work: apparently no one reads the text before the comments form; they go straight to fill the Your name, Your email, Your url and Your comment fields. I could be insulting them and they would write comments anyway.

I also thought of sending the contents of the message to one of those nifty web services which detect in which language is a text written, to be able to ask them (again) to write in English, but it would not work either; they would just click OK and continue sending the message in Spanish anyway, as every user does when a pop up opens.

I even translated some comments from Spanish to English and let the authors know about that, asking them to write in English next time (which didn't happen), because even if I understand the comments, there might be more people which don't, and I didn't want them to feel excluded from the conversation.

The real truth

Some excuses were in the lines of saying it's too much of an effort to write in English, or I can't express my thoughts in English.

But since I never discuss metaphysical topics here and it's more about technical and programming stuff, I really doubt there's a lack of vocabulary or concepts which can be expressed in Spanish but not in English. In fact, it's usually the opposite; I find very complicated to write about some tech stuff in Spanish because I wouldn't know how to translate certain terms.

Let me guess… Is it laziness? Are Spanish speakers lazier than anybody else? No, it can't be that. If they were truly lazy, they would even avoid commenting - that would be an effort! Not only articulating a thought but also pressing the keys in the right sequence in order to write it down… yikes! And I have seen also Italians, French, German, Brazilian and a loooooooong etc doing this. So it ought to be a different reason.

And I have the feeling that it's something more profound which has something to do with the shame that makes them apologise for their bad English whenever they feel brave enough to write in English. There's some kind of inferiority complex, and as such, it acts as a barrier when interacting with the rest of us.

Listen up, there's nothing to be afraid of. No one was born instantly knowing any language and it's better to half communicate than not to communicate at all. So stop writing in Spanish when a page is in English and join the club of the people which can communicate across the globe no matter where they are from :-)

20080128 xplsv.tv embedding!

There's a very interesting new feature here at xplsv.tv: video embedding!

If you love a movie and want to demonstrate publicly, just grab the embed code in the movie page and paste it in your homepage :-)

For example, here are two demos I love:

Isn't it cool? :)

20080122 Truly irritating: "Your Wireless network has been compromised"

Believe it or not, here's yet another stupid feature of Leopard! Whenever it decides it's a good moment to stop your workflow, a little window will pop up and tell you that because your wireless network has been compromised, it will be disabled for a minute.

What it doesn't tell is that it won't connect by itself automatically when that ghostly compromising menace disappears, even if the network password is stored in the keychain. So if you were doing something which depended on the wireless connection, it will never finish unless you're there and make sure you manually connect again to the network.

There are lots of speculative solutions such as changing the encryption method in the router from WPA to WPA2 and whatever… but why should I change anything only because Leopard's wifi support is defective and can't distinguish between failure and attack?

So far, these are Leopard's good points:

  • better VNC support
  • tabbed terminal
  • some tools are preinstalled (svn, ruby… although it's nothing one couldn't get done dedicating a few hours)
  • nicer XCode

And these are its annoyances/weaknesses/useless features, plus some more that I can't remember right now or have been fixed in system updates (such as file uploading in the flash plug-in, which was broken from day 0):

  • "Your wireless network has been compromised" - and it has just happened again while I wrote this! OH YEAH!
  • continuous errors with firewire disks such as my ipod mini
  • intrusively inquiring about what do I want to do with what I download
  • absurd behaviour after returning from stand-by: on my mac mini left click acts as a right click until I do a control+tab and switch to a different application, on my powerbook the trackpad works like at a 0.00001% of the normal speed and accelerates progressively until it reaches normal speed - even after a completely clean reinstall
  • horrible wireless performance. How come the signal strength is only 20% when another computer, side by side, has 100%?
  • no more decent mp3 preview - if you switch to a different application while previewing it will stop. It sometimes does not work at all, instead. And there's no way of going back to the previous interface.
  • amazingly it still hasn't a decent image viewer which can operate fullscreen
  • super ugly folder icons

I wonder if this can be considered a defective product… by all standards it looks like that: these errors are recurrent and I'm experiencing them every single day.

I'm tempted of going back to Tiger but I'm just not willing to spend a single minute of my life re-installing software for the n-th time.

Instead, I hereby demand an immediate fix for these bugs!! I wonder if there's an open case in petitiononline for this…

20080112 My first opengl program in Linux!

SDL and OpenGL playing nicely under linux

I had my first look at SDL some years ago, when Wing Extrem from Wildbits told me about a library which could work either in Windows or Linux and was very nice for making games. I remember that I managed to compile the .lib for visual studio but didn't manage to go much further.

Since then, I have been finding lots of projects which use SDL as their base, which makes them really portable across platforms, and I decided to have a more in-depth look at it this time, since there's no point in fighting the masses :-)

So I was toying with some tutorials, specially Sol's Graphics for beginners tutorials and the Me and Mark Publishing SDL and OpenGL tutorial and wondered if it would be possible to get the same main.cpp compiled and working on our ubuntu computer…

I had absolutely no idea of how to get something compiled with SDL and OpenGL in linux; the last time I tried to compile a demo for linux it ended up being a frustrating experience which almost caused me a trauma, so I was slightly scared of trying it again. But I decided to go ahead since it was just a plain .cpp file!

Googled a bit and found an straightforward way of compiling:

gcc main.cpp -o main.o `sdl-config –cflags –libs` -lGL -lGLU

If that's not ridiculously simple you tell me what it is. In Mac, for being able to get a [Cocoa] window, you need to prepare a tedious series of files and Objective C wrappers, just for being able to open a window and having decent event processing. Thanks god the nice people from SDL provide some XCode templates for getting started!

Immediate conclusion: apparently it's easier to develop OpenGL stuff in Linux than in Mac, unless there's some hidden automagic going on without my knowledge.

Of course there are a couple of minor details; because this is a computer which acts primarily as a file server, we have never bothered to make OpenGL work and all that, and as a consequence, it doesn't have hardware acceleration. This forced me to comment out the multisampling part, or I would get a Couldn't find matching GLX visual error message each time I tried to execute the program. It's also reporting that polygon stipple is being done by software rendering, but at least it does it.

This has left me wondering why there's not more people making demos for linux. I still need to find out how it would work with more complicated code bases and things like cmake, but it looks as truly doable now that I managed to get my first program working. Hmmm…

Sources

Should you want to fully experience the 0xFF00FF background plus a randomly noise-texturized rotating triangle, simply compile this little file and let yourself carried away :-)