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

Archive for the ‘mac’ Category

20080226 Xcode3 oddities

It's been a couple of interesting days already, got ideas for something fun and I'm using XCode quite furiously. Everything began since I got SDL working with OpenGl (what derived into a Linux version of the famously rotating triangle with pink background), then a couple of weeks later I made some additions which I'm further developing now.

But… what's going on with XCode3? It's just me the only one which has to close it and reopen it again every X debugging attempts? or maybe that's what the X in XCode stands for…

The symptoms are: you Build and Go (Compile and debug in ye olde jargon) and then one would expect the debugger to pop up. But nothing happens because a) it didn't rebuild at all or b) it couldn't attach the debugger to the process. So it runs as normal.

There's another weird thing, sometimes I add a new method in a class header (I'm working with C++) and when I write the method body in the .cpp file and try to compile, I get a message saying that there aren't matches with the definitions of the class, blabla. I solved this one cleaning all targets and rebuilding again, but if you know a better way of fixing it, I'm all ears.

Maybe there are hidden options which can be configured with

defaults write com.apple.Xcode AppleAnnoyances off

or something like that!

Event though, I must say that I like XCode2 way more than the previous version. If I had to choose a single reason it would be the removal of ZeroLink, then I would say the new finder, code folding, etc. (I never use its SCM features or design features so I can't tell)

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! :-)

20080101 "Fix" for Leopard "bug" when mounting an iPod via Firewire

I was using the firewire hub which the Apple Cinema Display provides for connecting my ipod mini. This worked perfectly with Tiger: iTunes opened each time I connected the iPod to the cable, and it also charged it as expected. But once I upgraded to Leopard this wasn't working anymore; the iPod was charged but iTunes didn't show up for synchronizing, basically because the iPod didn't mount at all.

It did synchronize if I used the USB cable, but that is very inconvenient for me since all the USB ports are in use already and I don't like to be plugging and unplugging cables constantly.

But today I found the solution (or more exactly work-around): to connect the ipod, using the Firewire cable, directly to the computer, instead of using the Display's hub.

I don't know what is the reason for this change/bug, unless they definitely want to eradicate Firewire iPod interfaces from the market or something. Luckily I don't have any other Firewire device, or I'd be screwed!

20071101 DIY: Replace your intel mac mini's hard disk drive

Although there are lots of tutorials and guides out there in the internets which try to guide you through the process, I found most of them are outdated (their contents applying only for PowerPC minis only, whose layout is different from intel minis) or confusing (dark pictures, etc). So after I managed to replace my mini's hard disk yesterday, and not breaking anything (in fact, I'm writing with it now!) I feel with authority enough for writing a how-to.

If you're willing to replace your mini's hard disk, I recommend you read this completely first so that you get an idea of what is needed and then decide if you're adventurous enough for doing so. Although I would say, it wasn't as difficult as I was expecting.

Tools you will need

Scratching knife, putty knife or however you call it.

You'll find them in your favourite real hardware store, in the painting area. If you don't look over 18 years they will ask you for an ID, just in case you're trying to commit crime with it or something (!!!).

Scratching knife

Philips screwdrivers

I just needed these two sizes. There's no need for any other exotic format. This is how philips screwdrivers look; they are just the usual plus sign-shaped screwdrivers (+):

Philips screwdrivers

An external hard drive for backing up your data

I have read of people using their ipods in disk mode, but mine is just too small for holding even my songs (it's a 4gb mac mini) so I used an external USB disk with plenty of space.

A new hard drive

You'll need a Serial ATA 2.5" 5400rpm drive. Normal ATA drives won't work, basically because the connectors are absolutely incompatible. I chose a 160 GB disk.

Before opening the case

We need to duplicate the current contents in the hard disk, so that we can restore all into the new disk later. I used SuperDuper! because I heard it was faster, but I think you can also use MacOSX's Disk Utility. (I haven't tried the latter for duplicating).

The ideal would be to have some external enclosure into which you could place your new SATA drive temporarily, duplicate everything into it and then you wouldn't need to reinstall anything once it is in place of the old hard disk. In reality I hadn't a SATA enclosure so I just backed everything up to that external hard disk. It takes a while, like 2 hours, to back up the whole disk (it was a 60GB disk). So you could play Metroid 3 in your wii meanwhile.

Apart from that I also copied my stuff (i.e. non System folders or Applications, just my data) to a different computer just to be safe :-)

Opening the case

Now comes the dirty stuff! This may hurt, mainly your psyche, since it looks like you're going to break your little precious mini. But if you're careful nothing wrong should happen.

Common sense advice: disconnect everything. Pretty obvious but there's always crazy people around there.

There's nothing you can do on the top side…

Mac mini top

But maybe you could do something in the bottom…

Mac mini bottom

Pick up your scratching knife and even if it hurts your heart (it hurt mine) begin inserting it between the case and the white plastic area, and use it then for kindly inviting the plastic area to go out by levering it. This is what I mean:

(Note: I don't know where do those crazy distortions at the end of the video come from but they are amazing! I have never programmed an effect like that. I might copy it…)

It took me a bit of trying but if you place the knife in the right spots it will go out in just a minute. I guess if I did it everyday it could be out in 30 seconds. And that's the most difficult part of this process :-)

So here it is:

Mac mini without its case

Unlike normal computers, here it's very difficult to spot components at first sight. Everything is so tightly packed that I didn't touch anything until I examined it carefully. And while you're on it, touch the metallic inside of the case so that you discharge all possible static electricity you could be carrying around. I have never heard of anything broken because of this but I do it just in case.

Unscrewing the right screws

Where's the mac mini's hard disk?

Here's where most of the tutorials fail. I was looking at three different tutorials in my powerbook but at the end I was so confused as to which screws did they refer to that I just decided to ignore them and began unscrewing things until I could reach the hard disk. It is underneath the dvd drive, and it is enclosed in that black chassis you can see. So we need to be able to loose the black chassis and then we'll be able to access the hard disk from the bottom.

Main screws

There are four screws we need to remove. There's one on each corner of the base, roughly saying (see pic). They are black and the one on front right is bigger:

Screw 1 is easy to get out.

Screw 2 was a little bit stuck on my case. I had to unscrew it very slowly or the screwdriver began to slip and didn't do any useful movement. It can be possible that the antenna (the Bluetooth one) is a little bit closer than it should be, but as it has a spring it is somehow flexible so don't worry too much if you touch it while unscrewing that one.

Screw 3 is easy as well, although quite deep (it's also the largest one).

Screw 4 is relatively tricky. It is underneath that antenna (which is the Airport antenna, by the way) and it seems to be impossible to unscrew it without breaking the antenna! But the antenna can be removed by pressing the two tabs below it at the same time and it will pop out and leave way for you to unscrew the last one:

Battery wire

Wire battery

You need to disconnect a little jumper next to the battery before continuing. It is on the front side, right to the big button battery. If your thumb's fingernail is long enough you can use it for quickly and harmlessly disconnecting that little jumper. Just pull up with the nail and it will disconnect, without having to grab it from the wires:

Inside the mini (at last!)

Once you've completed those steps it's a question of pulling apart the chassis from the base and carefully turn it so that you can see the inside. Be careful with the antenna you removed from its base while unscrewing the screw below it, it may get in the way (and you don't want to break it!).

Inside the mini

Here it is. If you want to upgrade your RAM it is now the right moment. Or the processor. I didn't want to do either so I just went for continuing with the hard disk stuff which is here:

Inside the mini - hard disk

Removing the hard disk

The disk is attached to the chassis with four screws. These are silvered and a little bit fatter than the ones we unscrewed. There are two screws on top of the disk and two more on the chassis side. They are easy to spot - no hidden secrets here.

Hard disk screws

Once the screws are removed you need to pull backwards the disk to disconnect it from the chassis.

Now put there your new big hard disk. It may take a bit to connect it to the chassis but just be patient and you'll get it. No brute force required…!

Putting things back where they were

Once the new hard disk is in place the rest is way quicker. It just consists in undoing what you did, but just for the sake of completion:

Put the hard disk screws back

Hard disk screws

Carefully flip the chassis again and make sure the connection to the motherboard is fully done

It just needs a bit of pushing and you'll feel how it's connected. In any case there's not any other way of assembling this together and being able to close the case again, so you'll notice anyway :-)

Put the chassis screws back

Put the Bluetooth antenna back in its tabs

Connect the little battery wire we disconnected before

You could use your fingernail again for pushing it down and making sure it connects.

Testing it before closing the case

What I did for being safe - since it had the case opened and I didn't want to risk electrocution - was to disconnect the power adapter. Then I connected the screen, keyboard, mouse and power wires, the external USB disk with the clone of the old disk, and finally connected the power adapter to the mains again. Without touching any component from inside, I switched the computer on.

Booting from USB

Because I had done a full clone of the hard disk, the computer could boot from the USB disk. Once it's booted, everything looks as if it was your normal disk: screen settings, applications, data - only it's not!

We need to restore the data from the external into the internal disk, but the internal is not showing because it hasn't been formatted. So go to the usual Applications - Utilities - Disk Utility and make sure the new internal disk is on the list of devices on left:

New device

See how there's a Samsung disk with no partition (partitions are nested in the devices). I selected the new disk, clicked on the Erase tab and said I wanted a new partition, Macintosh Journaled type. Because it was way bigger than the old Macintosh HD partition, I called it MegaHD.

Then I selected MegaHD in the list of partitions and clicked on the Restore tab, dragged the external disk partition (externito) to the Source field and the MegaHD partition to the Destination field. And clicked Restore!

Restoring with disk utility

That will take quite a bit of time since it needs to read everything from the USB disk. You can have a walk or something while it completes. It took almost two hours here.

Once it's done, shut down the computer, disconnect the USB disk and try to boot up as normal (only with the case still open). It is normal for a folder with a question mark to appear the first time, it disappears after it finds the boot volume. Test your system, make sure everything keeps working, etc…

As it worked for me, I shut it down, put the case back and congratulated myself :-)

20060528 Testing Quicksilver

As I have been using a mac for more than one year, I considered that it was the time to start using superadvanced tools for savvy users, as for example Quicksilver. It's 10 minutes since I installed it and I must say this:

  1. The installation process is so full of nice transitions that it deserves to be installed just to see them
  2. It's quick! It does not work exactly as Spotlight (I doubt it indexes file contents as Spotlight), but it feels fast, and launchs applications faster than Spotlight (which is the main use I give to Spotlight)
  3. I absolutely love the configuration options, where it refers to the effects as "Superfluous visual effects". This kind of honesty has not been seen for a long time. Funnier enough, although they may be superfluous, they really look cool and don't annoy you as the usual effects you see in other applications.
    Quicksilver

There is more info for beginners in blogs like TUAW: Getting Started with Quicksilver: understanding the basics, just in case you feel curious.