Tag Archives: mac

MySQL on Mac OSX Yosemite

If you use XAMPP for dev work on your Mac at home, and updated your OS to Yosemite, you may be temporarily distressed when you find that your MySQLd doesn’t start up. The fix is fairly simple.

Edit /Applications/XAMPP/xamppfiles/xampp. (You may have to use sudo to do this.)

Look for:

$XAMPP_ROOT/bin/mysql.server start > /dev/null &

And add unset DYLD_LIBRARY_PATH on top of it. It should look like:

unset DYLD_LIBRARY_PATH
$XAMPP_ROOT/bin/mysql.server start > /dev/null &

Restart MySQLd and you it should work.

Missing Events and Photos in iPhoto?

Let me guess – you got your new iMac. You had a recent Time Machine backup on your Time Capsule. Setting up the new iMac was ridiculously easy — just point to the backup. A few hours later, your new iMac is just like your old Mac, right down to the wall paper and browser history. You shake your head in disbelief and say to yourself, “Man, this thing just works! This is the way it is supposed to be!”

A couple of days later, you fire up your iPhoto. It says it needs to update the database or whatever. No sweat. Just a couple of minutes — the new iMac is ridiculously fast. Hullo — what is wrong with the last four events? How come they have no photos in them? Well, actually, they do have something, you can see the thumbnails for a second, and then they disappear. The events seem to have the right number of photos. They even list the camera model and exposure data.

You scratch your head and say to yourself, “Well, may be the Time Machine backup didn’t unpack properly or whatever. May be the version upgrade messed up some data. No sweat. I can use the Time Machine and find the right iPhoto Library.” You fire up the Time Machine — probably for the first time for real. You restore the last good backup of the iPhoto Library to your desktop, and launch iPhoto again. Database update again. Anxious wait. Hey, the damned events are still missing.

Panic begins to set in. Mad Google for answers. Ok, hold down the Option and Command keys, and launch iPhoto. Regenerate thumbnails. Repair the library. Rebuild the Database. Still, the ****** events refuse to come back.

How do I know all this? Because this is exactly what I did. I was lucky though. I managed to recover the events. It dawned on me that the problem was not with the restore process, nor the version update of iPhoto. It was the Time Machine backup process — the backup was incomplete. I had the old Mac and the old iPhoto library intact. So I copied the old library over to the new iMac (directly, over the network; not from the Time Machine backup). I then started iPhoto on the new machine. After the necessary database update, all the events and photos showed up. Phew!

So what exactly went wrong? It appears that Time Machine doesn’t backup the iPhoto Library properly if iPhoto is open (according to Apple). More precisely, the recently imported photos and events may not get backed up. This bug (or “feature”) was reported earlier and discussed in detail.

I thought I would share my experience here because it was important piece of information and might save somebody some time, and possibly some valuable photos. And I feel it is disingenuous of Apple to tout the Time Machine as the mother of all backup solutions with this glaring bug. After all, your photos are among the most precious of your data. If they are not backed up and migrated properly, why bother with Time Machine at all?

To recap:

  1. If you find your photo collection incomplete after migrating to your shiny new iMac (using a Time Machine backup), don’t panic if you still have your old Mac.
  2. Exit gracefully from iPhoto on both the machines.
  3. Copy your old iPhoto Library from the old Mac over to the new one, after properly exiting from iPhoto on both machines.
  4. Restart iPhoto on the new Mac and enjoy.

How to prevent this from happening

Before the final Time Machine backup from your old Mac, ensure that iPhoto is not running. In fact, it may be worth exiting from all applications before taking the final snapshot.

If you want to be doubly sure, consider another automated backup solution just for your iPhoto Library. I use Carbon Copy Cloner.

Photo by Victor Svensson

Slow Time Machine with Time Capsule – SOLVED!

Let me guess — you bought a new Time Capsule, set up your Time Machine to back up half a terabyte of family photos and home videos, and expected it to be “hands-free” from then on? Then you got this progress bar saying that it will take 563 days (or some such ridiculous number) to sync?

Your next step was to trawl Google, which would have shown you that you are not alone. You would have tried disk utility to repair your Time Capsule disk, disabled Spotlight indexing, connected your Mac directly to TC etc. Nothing has helped so far? Fear not, here is what you need to do.

First of all, launch your software update pane from your system preferences on your Mac.

Mac Software Update
Ensure that you have this update, which specifically addresses this problem.
Mac Software Update

Here is what Apple says about this update:

About OS X Lion 10.7.5 Supplemental Update
The OS X v10.7.5 Supplemental Update is recommended for all users running OS X Lion v10.7.5 and includes the following fixes:

  • Resolves an issue that may cause Time Machine backups to take a very long time to complete
  • Addresses an issue that prevents certain applications signed with a Developer ID from launching

If it is not installed, click on the “Scheduled Check” tab, and install it. Note that it may be installed as bundled with other updates. So, as long as your Mac is up-to-date, you don’t have to worry too much about missing this particular update.

In all likelihood, this update is all that you will need to fix your slow Time Machine on Time Capsule To verify, restart your machine and launch Time Machine. Give it a few minutes and see if the speed is acceptable (about 10-20 MB a second on your wired Gigabit network).

If it is not, or if you have other reasons for not installing the update, there are a few other these tips you can try.

  • QuickSilver and Dropbox iconsQuit applications that may be indexing the file system. Dropbox, QuickSilver etc.  Find them on your menu bar. Right click on the icons and select Quit.
  • Finder optionEnsure that Finder is not set to show all size. Open a Finder window, hit Cmd-J to bring up these options, and ensure that the Calculate All Sizes is not ticked (despite the fact that it is shown ticked in the screenshot here).

    Note that it is not under the usual Finder preferences, which you would bring up using Cmd-I.

  • Kill FinderThe last thing to try is to kill and relaunch Finder. Click on the Apple logo on any menu bar, select “Force Quit…” to bring up the window show, select Finder and hit the Relaunch button

The last step (of killing and relaunching Finder) has been touted as something that definitely works. So do give it a try if nothing else helps. Another way of killing and relaunching Finder is to issue the command killall Finder from a terminal window.

If these tips didn’t work, you are pretty much out of luck. There are still one more thing you could try, which probably will not work. It certainly didn’t, for me, but gave me a sense that I was “fixing” the problem.

Connect your Time Capsule (TC) directly to your Mac. In order to do this, follow these steps.

  • First, connect your TC to your network, and set it up using the Airport Utility.
  • Disconnect it from your network. (Disconnect the ethernet cable.)
  • Disconnect the ethernet cable from your Mac, and connect TC (one of the three output ports) to your Mac.

Cloud Computing

I first heard of “Cloud Computing” when my friend in Trivandrum started talking about it, organizing seminars and conferences on the topic. I was familiar with Grid Computing, so I thought it was something similar and left it at that. But a recent need of mine illustrated to me what cloud computing really is, and why one would want it. I thought I would share my insight with the uninitiated.

Before we go any further, I should confess that I write this post with a bit of an ulterior motive. What that motive is is something I will divulge towards the end of this post.

Let me start by saying that I am no noob when it comes to computers. I started my long love affair with computing and programming in 1983. Those late night bicycle rides to CLT and stacks of Fortran cards – those were fun-filled adventures. We would submit the stack to the IBM 370 operators early in the morning and get the output in the evening. So the turn around time for each bug fix would be a day, which I think made us fairly careful programmers. I remember writing a program for printing out a calendar, one page per month, spaced and aligned properly. Useless really, because the printout would be on A3 size feed rolls with holes on the sides, and the font was a dirty Courier type of point size 12 in light blue-black, barely legible at normal reading distance. But it was fun. Unfortunately I made a mistake in the loop nesting and the calendar came out all messed up. Worse, the operator, who was stingy about the paper usage, interrupted the output on the fourth month and advised me to stop doing it. I knew that he could not interrupt it if I used only one Fortran PRINT statement and rewrote the program to do it that way. I got the output, but on the January page, there was this hand-written missive, “Try it once more and I will cancel your account.” At that point I ceased and desisted.

I started using email in the late eighties on a cluster of Vaxstations that belonged to the high-energy physics group at Syracuse University. At first, we could send email only to users on the same cluster, with DecNet addresses like VAX05::MONETI. And a year later, when I could send a mail to my friend in the next building with an address like IN%”naresh@ee.syr.edu” or something (the “IN” signifying Internet), I was mighty impressed with the pace at which technology was progressing. Little did I know that a few short years later, there would be usenet, Mosaic and e-commerce. And that I would be writing books on financial computing and WordPress plugins in PHP.

Despite keeping pace with computing technology most of my life, I have begun to feel that technology is slowly breaking free and drifting away from me. I still don’t have a twitter account, and I visit my Facebook only once a month or so. More to the point of this post, I am embarrassed to admit that I had no clue what this cloud computing was all about. Until I got my MacBook Air, thanks to my dear wife who likes to play sugar mama once in a while. I always had this problem of synchronizing my documents among the four or five PCs and Macs I regularly work with. With a USB drive and extreme care, I could manage it, but the MBA was the proverbial straw that broke my camel of a back. (By the way, did you know this Iranian proverb – “Every time the came shits, it’s not dates”?) I figured that there had to be better way. I had played with Google Apps for a while now, although I didn’t realize that it was cloud computing.

What I wanted to do was a bit more involved than office applications. I wanted to work on my hobby PHP projects from different computers. This means something like XAMPP or MAMPP along with NetBeans on all the computers I work with. But how do I keep the source code sync’ed? Thmbdrives and backup/sync programs? Not elegant, and hardly seamless. Then I hit upon the perfect solution – Dropbox! This way, you store the source files on the network (using Amazon S3, apparently, but that is beside the point), and see a directory (folder for those who haven’t obeyed Steve Jobbs and gone back to the Mac) that looks like suspiciously local. In fact, it is a local directory – just that there is a program running on the background syncing it with your folder on the cloud.

Dropbox! gives you 2GB of network storage free, which I find quite adequate for any normal user. (That sounds like the famous last words by Bill Gates, doesn’t it? “64KB of memory should be enough for anyone!”) And, you can get 250MB extra for every successful referral you make. That brings me to my ulterior motive – all the links to Dropbox! on this post are actually referral links. When you sign up and start using it by clicking on one of them, I get 250MB extra. Don’t worry, you get 250MB extra as well. So I can grow my online storage up to 8GB, which should keep me happy for a long time, unless I want to store my photos and video there, in which case I will upgrade my Dropbox! account to a paid service.

Apart from giving me extra space, there are many reasons you should really check out Dropbox!. I will write more on those reasons later, but let me list them here.
1. Sync your (Mac) address book among your Macs.
2. Multiple synced backups of your precious data.
3. Transparent use for IDEs such as Netbeans.
Some of these reasons are addressed only by following some tips and tricks, which I will write about.

By the way, we Indian writers like to use expressions like ulterior motives and vested interests. Do you think it is because we always have some?